summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Foundation/Library
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Foundation/Library')
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Dummy.c21
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpy.asm81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep1.asm61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep4.asm70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpySSE2.asm86
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memset.asm72
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep1.asm48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep4.asm56
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetSSE2.asm74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm73
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm59
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm80
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm55
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/memcpy.c46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/memset.c45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.c122
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.h113
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.inf39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Debug.c172
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c551
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DxeDriverLib.c56
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ebc/PerformancePrimitives.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c537
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.inf101
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib_Edk2.inf93
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c444
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiGetConfigTable.c61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiLibAllocate.c233
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c371
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/GetImage.c220
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Handle.c180
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ia32/PerformancePrimitives.c47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/AsmCpuMisc.s44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/PerformancePrimitives.s61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalDs.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalErrorLevel.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalSt.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Lock.c159
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Perf.c868
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c224
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/X64/PerformancePrimitives.c47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c1038
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h1303
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOnTheFly.c979
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c615
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrVariable.c492
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c710
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c493
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.inf43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/PrintWidth.h88
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/Sprint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.c685
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.inf50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.c956
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.h37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/PrintWidth.h34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/Sprint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/PrintWidth.h88
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/Sprint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.c684
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.inf50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.c528
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.h37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/PrintWidth.h35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/Sprint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/Hob.c540
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/HobLib.inf46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Aarch64/ProcDep.h26
-rwxr-xr-xEdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/CpuFuncs.h24
-rwxr-xr-xEdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/ProcDep.h26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ebc/ProcDep.h26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCombinationLib.h294
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCommonLib.h1359
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h1282
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiHobLib.h297
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiMgmtModeRuntimeLib.h429
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiPrintLib.h327
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRegTableLib.h205
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRuntimeLib.h1743
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiScriptLib.h591
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h218
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h234
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiWinNtLib.h75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GetImage.h104
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GraphicsLib.h250
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/CpuFuncs.h260
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/ProcDep.h26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32EfiRuntimeDriverLib.h111
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h93
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h1305
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/ProcDep.h119
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h1454
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/LinkedList.h312
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/RtDevicePath.h231
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/SmmRuntimeLib.h75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/CpuFuncs.h262
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/ProcDep.h29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/PrintWidth.h88
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/SPrint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/BoxDraw.c212
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.c559
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.h37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/PrintLib.inf49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/StdErr.c284
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/PrintWidth.h35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/SPrint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/PrintWidth.h88
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/SPrint.c142
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/BoxDraw.c212
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.c154
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.h37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/PrintLib.inf50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c284
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/PrintWidth.h35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/SPrint.c144
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c763
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c1828
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h1342
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c638
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c726
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c751
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGluePeimEntryPoint.c177
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c496
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/AutoGen.h50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueBaseTypes.h90
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h118
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h95
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h162
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h885
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/DxeDepex.h34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ebc/EdkIIGlueProcessorBind.h46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h97
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h161
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h272
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h116
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h178
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ia32/EdkIIGlueProcessorBind.h46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h73
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h7206
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseMemoryLib.h391
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueCacheMaintenanceLib.h224
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h545
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDevicePathLib.h269
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h454
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeServicesTableLib.h32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeSmmDriverEntryPoint.h147
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueEdkDxeSalLib.h141
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHobLib.h371
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueIoLib.h2563
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueMemoryAllocationLib.h637
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciCf8Lib.h1055
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciExpressLib.h1023
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciLib.h1019
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffGetEntryPointLib.h93
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffLib.h221
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesLib.h365
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesTablePointerLib.h42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeimEntryPoint.h111
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePostCodeLib.h165
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePrintLib.h481
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueReportStatusCodeLib.h659
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueResourcePublicationLib.h49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueSmbusLib.h382
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueTimerLib.h106
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiBootServicesTableLib.h41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDecompressLib.h113
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverEntryPoint.h162
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h706
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiRuntimeServicesTableLib.h36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcd.h42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdBaseLib.h52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdDebugLib.h50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdIoLib.h42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPciExpressLib.h40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPostCodeLib.h40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdReportStatusCodeLib.h40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdTimerLib.h40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/PeimDepex.h34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/X64/EdkIIGlueProcessorBind.h47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/EbcCache.c241
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/IpfCache.c245
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/X86Cache.c262
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/BaseDebugLibNull.inf79
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/DebugLib.c110
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf89
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoHighLevel.c2280
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLib.c74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibGcc.c382
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIcc.c404
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIpf.c490
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibMsc.c436
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ARShiftU64.c49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLib.inf658
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLibInternals.h876
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BitField.c873
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CheckSum.c336
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ChkStkGcc.c20
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Cpu.c75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CpuDeadLoop.c42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivS64x64Remainder.c54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32Remainder.c54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x64Remainder.c53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/CpuBreakpoint.c167
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SetJumpLongJump.c86
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SwitchStack.c71
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/Synchronization.c106
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo32.c48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet32.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet64.c60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.c35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.c40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuFlushTlb.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.S65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.asm66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.c51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S69
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.asm57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.c48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivS64x64Remainder.c60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.c35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.S48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.c40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.S91
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.asm92
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.c68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.asm57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.c48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.S65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.asm66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.S49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.asm47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.c33
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InternalSwitchStack.c73
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.S48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.asm49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.c46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.c43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.c37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.S42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.c41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.S42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.c40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.asm47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Non-existing.c66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.S48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.asm49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.c38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.c43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.c26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.asm47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.asm47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.S41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.c40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.c46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S203
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm251
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.asm48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.asm48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.c28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.c35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.asm44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.c31
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessDbr.s117
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessEicr.s511
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s263
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGp.s85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessKr.s399
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPmr.s123
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPsr.s110
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AsmPalCall.s158
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpoint.c118
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpointMsc.c118
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuFlushTlb.s59
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuPause.s26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ExecFc.s66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/FlushCacheRange.s95
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/GetInterruptState.s27
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange32.s29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange64.s28
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InternalSwitchStack.c68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/PalCallStatic.s48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ReadCpuid.s39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/SwitchStack.s51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Synchronization.c83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Unaligned.c249
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/asm.h33
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ia_64gen.h211
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/longjmp.s122
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/setjmp.s109
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU32.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU64.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LShiftU64.c49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LinkedList.c471
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LongJump.c51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet32.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet64.c54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Math64.c377
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ModU64x32.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultS64x64.c49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x32.c51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x64.c51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU32.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU64.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RShiftU64.c49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SetJump.c46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/String.c2088
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes16.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes32.c50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes64.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwitchStack.c73
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Synchronization.c364
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationGcc.c403
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationMsc.c375
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Unaligned.c228
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.S26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuFlushTlb.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.S62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.asm60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.S63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.asm62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.S34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.S34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.asm63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.S61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.asm62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.c38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.c38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.asm56
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.S40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.S38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Non-existing.c116
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.asm40
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.asm38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.c33
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.asm38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.asm38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.asm64
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.S44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S324
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm296
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.asm41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.S36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.asm36
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.S35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.S39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.asm39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.c35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging32.c71
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging64.c68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging32.c74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging64.c70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86GetInterruptState.c47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86MemoryFence.c39
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Msr.c657
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadGdtr.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadIdtr.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Thunk.c250
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteGdtr.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteIdtr.c44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLib.inf154
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLibInternal.h227
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CopyMemWrapper.c58
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/CopyMem.c65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/MemLibGeneric.c261
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/SetMem.c55
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.asm54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.asm63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.asm53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.asm53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S59
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.asm62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.asm53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.asm49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.asm50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/CopyMem.c65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/MemLibGeneric.c261
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/SetMem.c55
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/MemLibGuid.c135
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem16Wrapper.c63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem32Wrapper.c63
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem64Wrapper.c62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem8Wrapper.c57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem16Wrapper.c61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem32Wrapper.c61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem64Wrapper.c62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMemWrapper.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.asm52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.asm61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.asm51
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.asm44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.asm44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.asm44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.asm47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ZeroMemWrapper.c47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/BasePciCf8Lib.inf84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/PciLib.c1468
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/BasePciExpressLib.inf83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/PciLib.c1373
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/BasePciLibCf8.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/PciLib.c1076
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/PciLib.c1076
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/PeCoffGetEntryPoint.c222
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoff.c1357
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLib.inf83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLibInternals.h131
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ebc/PeCoffLoaderEx.c98
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ia32/PeCoffLoaderEx.c98
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c430
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/X64/PeCoffLoaderEx.c99
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/PostCode.c131
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c131
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/BasePrintLib.inf82
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c1108
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.c215
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.h209
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/BaseTimerLibLocalApic.inf85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ebc/EbcTimerLib.c135
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ia32/X86LocalApicTimerInitialize.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ipf/IpfTimerLib.c178
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X64/X86LocalApicTimerInitialize.asm43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X86TimerLib.c277
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c837
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLibInternals.h222
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/DxeHobLib.inf84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/HobLib.c503
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h115
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf80
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoHighLevel.c2271
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoLib.c600
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c1079
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/DxePerformanceLib.inf85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/PerformanceLib.c886
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf97
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c612
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.inf79
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.c107
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.inf82
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLibInternal.h67
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/SmbusLib.c475
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c181
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c471
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.inf96
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c243
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c557
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/EdkDxeSalLib.inf83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/AsmEsalServiceLib.s149
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/EsalServiceLib.c251
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.c75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.inf79
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c213
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf89
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c160
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/HobLib.c614
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/PeiHobLib.inf83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c1075
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf87
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PeiPerformanceLib.inf93
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PerformanceLib.c241
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf108
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c532
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.c470
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.inf87
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf79
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/ReadKr1.s44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/WriteKr1.s45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointer.c74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibInternals.h52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibKr1.inf74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointerLibMm7.inf78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.c104
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.inf86
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLibInternal.h84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/SmbusLib.c475
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c562
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h128
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeReportStatusCodeLib.inf96
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeSupport.c350
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf77
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.c533
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.inf85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c425
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.inf67
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/Console.c288
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c911
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.inf89
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c366
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf108
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf128
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareGuid.c59
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareMem.c76
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCopyMem.c69
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiSetMem.c65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiZeroMem.c57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.S91
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm87
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.c75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S202
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm200
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c185
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm86
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.c73
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep4.c79
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c169
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.S158
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.asm152
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.c139
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep1.c56
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.c64
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemSSE2.c141
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.S139
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.asm135
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.c122
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep1.c52
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.c59
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemSSE2.c111
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.S68
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm67
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.c62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.S82
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.asm80
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.c74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.S78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.asm81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.c74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.S71
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.asm70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.c64
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S84
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm83
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c72
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.S80
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.asm78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.c71
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/LinkedList.c354
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c231
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c382
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/PostCode.c62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ReportStatusCode.c344
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/String.c806
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ValueToString.c214
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMem.asm74
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.S66
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.asm58
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep4.asm65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep8.asm65
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemSSE2.asm80
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMem.asm60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep1.asm46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.S54
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.asm53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep8.asm58
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemSSE2.asm67
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMem.asm53
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep1.asm42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.S46
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep8.asm45
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemSSE2.asm60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.c722
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.inf49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiHobLib.h400
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h1433
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Aarch64/PerformancePrimitives.c48
-rwxr-xr-xEdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Arm/PerformancePrimitives.c48
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Debug.c131
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Decompress.c1142
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/FindFv.c180
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Hob/Hob.c521
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/EfiJump.h34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.c93
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.h85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeiServicePointer.c152
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PerformancePrimitives.c47
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/Processor.c140
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.Asm223
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S207
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S69
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.asm60
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S71
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm69
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S50
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.asm49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Asm.h35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/AsmCpuMisc.s44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/EfiJump.h112
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/HwAccess.s77
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Ia_64Gen.h214
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Math.c139
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.c268
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.h87
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeiServicePointer.c108
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PerformancePrimitives.s61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PioFlush.s106
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Processor.c118
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SetJmp.s325
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SwitchStack.s122
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c1484
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c714
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.inf110
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib_Edk2.inf121
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Perf.c234
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c771
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.h38
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h42
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/IdtDumb.c41
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Math.c116
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.c87
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.h85
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeiServicePointer.c98
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PerformancePrimitives.c34
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c146
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm186
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S161
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S78
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.asm76
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Debug.c154
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ebc/RuntimeLib.c316
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib.inf81
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib_Edk2.inf90
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Event.c351
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/GetImage.c221
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.S61
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.asm62
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.c55
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Fvb.c615
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/IoLib.c130
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Lock.c177
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/PlatformIoLib.c407
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c956
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Io.c346
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/AsmCpuMisc.s44
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/EsalLib.s149
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Fvb.c332
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/IpfCpuCache.s88
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Lock.c170
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/RuntimeLib.c1321
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/LibGlobals.c37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c649
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Fvb.c618
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/IoLib.c130
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Lock.c177
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/PlatformIoLib.c409
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c956
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.S37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.asm37
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h472
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmS3SaveState.h169
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.c498
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.h119
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.inf43
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S76
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm75
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S189
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm209
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h355
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.inf49
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib_Edk2.inf57
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm70
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S244
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm228
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c395
1104 files changed, 0 insertions, 166775 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
deleted file mode 100644
index afc72f1679..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# CompilerStubLib.inf
-#
-# Abstract:
-#
-# Component description file for the CompilerStub.
-#
-#--*/
-
-[defines]
-BASE_NAME = CompilerStub
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ia32]
- Ia32/memcpyRep1.asm | MSFT
- Ia32/memcpyRep1.asm | INTEL
- Ia32/memsetRep4.asm | MSFT
- Ia32/memsetRep4.asm | INTEL
- memcpy.c | GCC
- memset.c | GCC
-
-[sources.x64]
- x64/memcpyRep4.asm | MSFT
- x64/memcpyRep4.asm | INTEL
- x64/memsetRep4.asm | MSFT
- x64/memsetRep4.asm | INTEL
- memcpy.c | GCC
- memset.c | GCC
-
-[sources.Ipf]
- memcpy.c
- memset.c
-
-[sources.ARM]
- Dummy.c
-
-[sources.AARCH64]
- Dummy.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Framework/Ppi/CpuIo
- $(EDK_SOURCE)/Foundation/Framework
-
-[libraries.common]
-
-[libraries.ARM]
- CompilerIntrinsicsLib
-
-[libraries.AArch64]
- CompilerIntrinsicsLib
-
-[nmake.common]
-
-[nmake.ia32,nmake.x64]
- C_FLAGS= $(C_FLAGS) /GL-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
deleted file mode 100644
index bbe3f33d5d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
+++ /dev/null
@@ -1,74 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# CompilerStubLib.inf
-#
-# Abstract:
-#
-# Component description file for the CompilerStub.
-#
-#--*/
-
-[defines]
-BASE_NAME = CompilerStub
-COMPONENT_TYPE = LIBRARY
-
-[sources.ia32]
- memcpy.c | GCC
-
- Ia32/memcpyRep1.asm
- Ia32/memsetRep4.asm
-# Ia32/memcpy.asm
-# Ia32/memset.asm
-
-[sources.x64]
- memcpy.c | GCC
-
- x64/memcpyRep4.asm
- x64/memsetRep4.asm
-# x64/memcpy.asm
-# x64/memset.asm
-
-[sources.Ipf]
- memcpy.c | MSFT
- memset.c | MSFT
- memcpy.c | INTEL
- memset.c | INTEL
- memcpy.c | GCC
-
-[sources.ebc]
- memcpy.c
- memset.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Framework/Ppi/CpuIo
- $(EDK_SOURCE)/Foundation/Framework
-
-[libraries.common]
-
-[nmake.common]
-
-[nmake.ia32,nmake.x64]
- C_FLAGS= $(C_FLAGS) /GL-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Dummy.c b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Dummy.c
deleted file mode 100644
index 239daf1128..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Dummy.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*++
-
-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.
-
-Module Name:
- memcpy.c
-
-Abstract:
-
- This file is purely empty as a work around for CompilerStubLib to pass GCC build.
-
---*/
-
-extern int __make_me_compile_correctly;
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpy.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpy.asm
deleted file mode 100644
index 39657bf87a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpy.asm
+++ /dev/null
@@ -1,81 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES esi edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- je @CopyMemDone
- cmp edx, 0
- je @CopyMemDone
- cmp esi, edi
- jae @F
- cmp eax, edi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov ecx, edx
- and edx, 7
- shr ecx, 3 ; ecx <- # of Qwords to copy
- jz @CopyBytes
- push eax
- push eax
- movq [esp], mm0 ; save mm0
-@@:
- movq mm0, [esi]
- movq [edi], mm0
- add esi, 8
- add edi, 8
- loop @B
- movq mm0, [esp] ; restore mm0
- pop ecx ; stack cleanup
- pop ecx ; stack cleanup
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- Last byte in Source
- lea edi, [edi + edx - 1] ; edi <- Last byte in Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb
- cld
-@CopyMemDone:
- mov eax, [esp + 12]
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep1.asm
deleted file mode 100644
index e519fbe19d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep1.asm
+++ /dev/null
@@ -1,61 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES esi edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- cmp esi, edi
- je @CopyDone
- cmp edx, 0
- je @CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae @F
- cmp eax, edi
- jb @F ; Copy backward if overlapped
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-@@:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-@CopyDone:
- mov eax, [esp + 12]
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep4.asm
deleted file mode 100644
index f88163cb00..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpyRep4.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES esi edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- cmp esi, edi
- je @CopyDone
- cmp edx, 0
- je @CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae @F
- cmp eax, edi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov ecx, edx
- and edx, 3
- shr ecx, 2
- rep movsd ; Copy as many Dwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-@CopyDone:
- mov eax, [esp + 12]
- ret
-
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpySSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpySSE2.asm
deleted file mode 100644
index d65b270c5a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memcpySSE2.asm
+++ /dev/null
@@ -1,86 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES esi edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- je @CopyMemDone
- cmp edx, 0
- je @CopyMemDone
- cmp esi, edi
- jae @F
- cmp eax, edi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- xor ecx, ecx
- sub ecx, edi
- and ecx, 15 ; ecx + edi aligns on 16-byte boundary
- jz @F
- cmp ecx, edx
- cmova ecx, edx
- sub edx, ecx ; edx <- remaining bytes to copy
- rep movsb
-@@:
- mov ecx, edx
- and edx, 15
- shr ecx, 4 ; ecx <- # of DQwords to copy
- jz @CopyBytes
- add esp, -16
-@@:
- movdqu xmm0, [esi] ; esi may not be 16-bytes aligned
- movdqa [edi], xmm0 ; edi should be 16-bytes aligned
- add esi, 16
- add edi, 16
- loop @B
- add esp, 16 ; stack cleanup
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- Last byte in Source
- lea edi, [edi + edx - 1] ; edi <- Last byte in Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb
- cld
-@CopyMemDone:
- mov eax, [esp + 12]
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memset.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memset.asm
deleted file mode 100644
index 6a52a6653c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memset.asm
+++ /dev/null
@@ -1,72 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-memset PROC USES edi
- mov al, [esp + 12]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov ecx, [esp + 16] ; ecx <- Count
- cmp ecx, 0 ; if Count == 0, do nothing
- je @SetDone
- mov edi, [esp + 8] ; edi <- Buffer
- mov edx, ecx
- and edx, 7
- shr ecx, 3 ; # of Qwords to set
- jz @SetBytes
- add esp, -10h
- movq [esp], mm0 ; save mm0
- movq [esp + 8], mm1 ; save mm1
- movd mm0, eax
- movd mm1, eax
- psllq mm0, 32
- por mm0, mm1 ; fill mm0 with 8 Value's
-@@:
- movq [edi], mm0
- add edi, 8
- loop @B
- movq mm0, [esp] ; restore mm0
- movq mm1, [esp + 8] ; restore mm1
- add esp, 10h ; stack cleanup
-@SetBytes:
- mov ecx, edx
- rep stosb
-@SetDone:
- mov eax, [esp + 8] ; eax <- Buffer as return value
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep1.asm
deleted file mode 100644
index dd9ed12acb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep1.asm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-memset PROC USES edi
- mov ecx, [esp + 16]
- test ecx, ecx
- je @F
- mov al, [esp + 12]
- mov edi, [esp + 8]
- rep stosb
-@@:
- mov eax, [esp + 8]
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep4.asm
deleted file mode 100644
index 1e8f0577e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetRep4.asm
+++ /dev/null
@@ -1,56 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-memset PROC USES edi
- mov ecx, [esp + 16]
- test ecx, ecx
- je @F
- mov al, [esp + 12]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, ecx
- mov edi, [esp + 8]
- shr ecx, 2
- rep stosd
- mov ecx, edx
- and ecx, 3
- rep stosb
-@@:
- mov eax, [esp + 8]
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetSSE2.asm
deleted file mode 100644
index db488c1f2e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/Ia32/memsetSSE2.asm
+++ /dev/null
@@ -1,74 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-memset PROC USES edi
- mov edx, [esp + 16] ; edx <- Count
- cmp edx, 0 ; if Count == 0, do nothing
- je @SetDone
- mov edi, [esp + 8] ; edi <- Buffer
- mov al, [esp + 12] ; al <- Value
- xor ecx, ecx
- sub ecx, edi
- and ecx, 15 ; ecx + edi aligns on 16-byte boundary
- jz @F
- cmp ecx, edx
- cmova ecx, edx
- sub edx, ecx
- rep stosb
-@@:
- mov ecx, edx
- and edx, 15
- shr ecx, 4 ; ecx <- # of DQwords to set
- jz @SetBytes
- mov ah, al ; ax <- Value | (Value << 8)
- add esp, -16
- movd xmm0, eax
- pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times
- movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times
-@@:
- movdqa [edi], xmm0 ; edi should be 16-byte aligned
- add edi, 16
- loop @B
- add esp, 16 ; stack cleanup
-@SetBytes:
- mov ecx, edx
- rep stosb
-@SetDone:
- mov eax, [esp + 8] ; eax <- Buffer as return value
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm
deleted file mode 100644
index 7c53bc113e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpy.asm
+++ /dev/null
@@ -1,73 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; OUT VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES rsi rdi
- mov rax, rcx ; rax <- Destination as return value
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 7
- shr rcx, 3 ; rcx <- # of Qwords to copy
- jz @CopyBytes
- DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10)
-@@:
- DB 0fh, 6fh, 06h ; movd mm0, [rsi]
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0
- add rsi, 8
- add rdi, 8
- loop @B
- DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0)
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm
deleted file mode 100644
index d17cec942b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep1.asm
+++ /dev/null
@@ -1,59 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; memcpyRep1.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; memcpy (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES rsi rdi
- mov rax, rcx
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jb @F ; Copy backward if overlapped
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@@:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-memcpy ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm
deleted file mode 100644
index f9ab12c16e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep4.asm
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; memcpyRep8.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; memcpy (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES rsi rdi
- mov rax, rcx
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 3
- shr rcx, 2
- rep movsd ; Copy as many Dwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm
deleted file mode 100644
index e01419bab7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpyRep8.asm
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; memcpyRep8.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; memcpy (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES rsi rdi
- mov rax, rcx
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 7
- shr rcx, 3
- rep movsq ; Copy as many Qwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-memcpy ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm
deleted file mode 100644
index 5d294ae614..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memcpySSE2.asm
+++ /dev/null
@@ -1,80 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; memcpy function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memcpy (
-; OUT VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-memcpy PROC USES rsi rdi
- mov rax, rcx ; rax <- Destination as return value
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- Last byte of Source
- cmp rsi, rdi
- jae @F ; Copy forward if Source > Destination
- cmp r9, rdi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- xor rcx, rcx
- sub rcx, rdi ; rcx <- -rdi
- and rcx, 15 ; rcx + rsi should be 16 bytes aligned
- jz @F ; skip if rcx == 0
- cmp rcx, r8
- cmova rcx, r8
- sub r8, rcx
- rep movsb
-@@:
- mov rcx, r8
- and r8, 15
- shr rcx, 4 ; rcx <- # of DQwords to copy
- jz @CopyBytes
-@@:
- movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned
- add rsi, 16
- add rdi, 16
- loop @B
- jmp @CopyBytes ; copy remaining bytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- Last byte of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination
- std
-@CopyBytes:
- mov rcx, r8
- rep movsb
- cld
-@CopyMemDone:
- ret
-memcpy ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm
deleted file mode 100644
index cae04e03f5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memset.asm
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer, --> rcx
-; IN UINT8 Value, --> rdx
-; IN UINTN Length --> r8
-; );
-;------------------------------------------------------------------------------
-memset PROC USES rdi
- mov rax, rcx
- cmp r8, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rax, rdx ; rdx <-> r8
- mov rdx, r8 ; rdx <- Length
- mov r8, rax ; r8 <- Value
- mov ah, al
- DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax
- mov r8, rcx
- mov rdi, r8 ; rdi <- Buffer
- mov rcx, rdx
- and edx, 7
- shr rcx, 3
- jz @SetBytes
- DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h
-@@:
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0
- add rdi, 8
- loop @B
-@SetBytes:
- mov ecx, edx
- rep stosb
- mov rax, r8
-@SetDone:
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm
deleted file mode 100644
index c5e08e1ba9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep1.asm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; memsetRep1.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-memset PROC USES rdi
- cmp rdx, 0 ; if Size == 0, do nothing
- mov r9, rcx
- je @SetDone
- mov rax, r8
- mov rdi, rcx
- mov rcx, rdx
- rep stosb
-@SetDone:
- mov rax, r9
- ret
-memset ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm
deleted file mode 100644
index 0ce0beda93..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep4.asm
+++ /dev/null
@@ -1,55 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-memset PROC USES rdi
- cmp r8, 0 ; if Size == 0, do nothing
- mov r9, rcx
- je @SetDone
- mov al, dl
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov rdi, rcx
- mov rcx, r8
- shr rcx, 2
- rep stosd
- mov rcx, r8
- and rcx, 3
- rep stosb
-@SetDone:
- mov rax, r9
- ret
-memset ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm
deleted file mode 100644
index 0c52034203..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetRep8.asm
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; memsetRep8.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; memset (
-; OUT VOID *Buffer,
-; IN UINT8 Value,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-memset PROC USES rdi rbx
- cmp r8, 0 ; if Size == 0, do nothing
- mov r9, rcx
- je @SetDone
- mov rax, rdx
- mov bl, al
- mov bh, bl
- mov ax, bx
- shl rax, 10h
- mov ax, bx
- mov ebx, eax
- shl rax, 20h
- mov eax, ebx
- mov rdi, rcx
- mov rcx, r8
- shr rcx, 3
- rep stosq
- mov rcx, rdx
- and rcx, 7
- rep stosb
-@SetDone:
- mov rax, r9
- ret
-memset ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm
deleted file mode 100644
index 0ba72d6dab..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/X64/memsetSSE2.asm
+++ /dev/null
@@ -1,74 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; memset function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; memset (
-; OUT VOID *Buffer, --> rcx
-; IN UINT8 Value, --> rdx
-; IN UINTN Length --> r8
-; );
-;------------------------------------------------------------------------------
-memset PROC USES rdi
- mov rax, rcx
- cmp r8, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rax, rdx ; rdx <-> r8
- mov rdx, r8 ; rdx <- Length
- mov r8, rax ; r8 <- Value
-
- mov rdi, rcx ; rdi <- Buffer
- mov al, r8b ; al <- Value
- mov r9, rdi ; r9 <- Buffer as return value
- xor rcx, rcx
- sub rcx, rdi
- and rcx, 15 ; rcx + rdi aligns on 16-byte boundary
- jz @F
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosb
-@@:
- mov rcx, rdx
- and rdx, 15
- shr rcx, 4
- jz @SetBytes
- mov ah, al ; ax <- Value repeats twice
- movd xmm0, eax ; xmm0[0..16] <- Value repeats twice
- pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times
- movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times
-@@:
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned
- add rdi, 16
- loop @B
-@SetBytes:
- mov ecx, edx ; high 32 bits of rcx are always zero
- rep stosb
- mov rax, r9 ; rax <- Return value
-@SetDone:
- ret
-memset ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memcpy.c b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memcpy.c
deleted file mode 100644
index 1ae4079db3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memcpy.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*++
-
-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.
-
-Module Name:
- memcpy.c
-
-Abstract:
-
- The Microsoft compiler inlines memcpy and we can not stop it.
- These routines allow the code to link!
-
- There is no *.h definition of these modules as they are well known by the
- compiler. See Microsoft documentation for more details!
-
- volatile is used to prevent the compiler from trying to implement these
- C functions as inline functions.
-
---*/
-
-#include "Tiano.h"
-
-VOID *
-memcpy (
- OUT VOID *Dest,
- IN const VOID *Src,
- IN UINTN Count
- )
-{
- volatile UINT8 *Ptr;
- const UINT8 *Source;
-
- for (Ptr = Dest, Source = Src; Count > 0; Count--, Source++, Ptr++) {
- *Ptr = *Source;
- }
-
- return Dest;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memset.c b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memset.c
deleted file mode 100644
index 55603dc70f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/memset.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*++
-
-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.
-
-Module Name:
- memset.c
-
-Abstract:
-
- The Microsoft compiler inlines memset and we can not stop it.
- These routines allow the code to link!
-
- There is no *.h definition of these modules as they are well known by the
- compiler. See Microsoft documentation for more details!
-
- volatile is used to prevent the compiler from trying to implement these
- C functions as inline functions.
-
---*/
-
-#include "Tiano.h"
-
-VOID *
-memset (
- OUT VOID *Dest,
- IN int Char,
- IN UINTN Count
- )
-{
- volatile UINT8 *Ptr;
-
- for (Ptr = Dest; Count > 0; Count--, Ptr++) {
- *Ptr = (UINT8) Char;
- }
-
- return Dest;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.c b/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.c
deleted file mode 100644
index 03032b9804..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- CustomizedDecompress.c
-
-Abstract:
-
- Implementation file for Customized decompression routine
-
---*/
-#include "TianoCommon.h"
-#include "CustomizedDecompress.h"
-
-EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL mCustomizedDecompress = {
- CustomizedGetInfo,
- CustomizedDecompress
-};
-
-EFI_STATUS
-InstallCustomizedDecompress (
- EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install customeized decompress protocol.
-
-Arguments:
-
- This - The protocol that needs to be installed.
-
-Returns:
-
- EFI_SUCCESS - Always success
-
---*/
-{
- *This = &mCustomizedDecompress;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-CustomizedGetInfo (
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Customized GetInfo().
-
-Arguments:
- This - The EFI customized decompress protocol
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
- EFI_UNSUPPORTED - Not supported
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-CustomizedDecompress (
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Customized Decompress().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
- EFI_UNSUPPORTED - Not supported
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.h b/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.h
deleted file mode 100644
index 701831b1dd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- CustomizedDecompress.h
-
-Abstract:
-
- Header file for Customized decompression routine
-
---*/
-#ifndef _CUSTOMIZED_DECOMPRESS_LIB_H_
-#define _CUSTOMIZED_DECOMPRESS_LIB_H_
-
-#include EFI_PROTOCOL_DEFINITION (CustomizedDecompress)
-
-EFI_STATUS
-EFIAPI
-CustomizedGetInfo (
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Customized GetInfo().
-
-Arguments:
- This - The EFI customized decompress protocol
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
- EFI_UNSUPPORTED - Not supported
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-CustomizedDecompress (
- IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of Customized Decompress().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
- EFI_UNSUPPORTED - Not supported
-
---*/
-;
-
-EFI_STATUS
-InstallCustomizedDecompress (
- EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install customeized decompress protocol.
-
-Arguments:
-
- This - The protocol that needs to be installed.
-
-Returns:
-
- EFI_SUCCESS - Always success
-
---*/
-;
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.inf b/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.inf
deleted file mode 100644
index eff72a685b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/CustomizedDecompress/CustomizedDecompress.inf
+++ /dev/null
@@ -1,39 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# CustomizedDecompress.inf
-#
-# Abstract:
-#
-# Component description file for the Customized Decompress library.
-#
-#--*/
-
-[defines]
-BASE_NAME = CustomizedDecompress
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- CustomizedDecompress.c
- CustomizedDecompress.h
-
-[includes.common]
- .
- $(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
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Debug.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Debug.c
deleted file mode 100644
index 3c43451d09..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Debug.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Debug.c
-
-Abstract:
-
- Support for Debug primatives.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "EfiPrintLib.h"
-#include "EfiStatusCode.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-#include EFI_PROTOCOL_DEFINITION (DebugMask)
-
-//
-// You would think you should divid by sizeof (UINT64), but EBC does not like
-// that!
-//
-#define EFI_STATUS_CODE_DATA_MAX_SIZE64 (EFI_STATUS_CODE_DATA_MAX_SIZE / 8)
-
-VOID
-EfiDebugAssert (
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded BREAKPOINT().
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- FileName - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT().
-
- Description - Descritption, usally the assertion,
-
-Returns:
-
- None
-
---*/
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
-
- EfiDebugAssertWorker (FileName, LineNumber, Description, sizeof (Buffer), Buffer);
-
- EfiLibReportStatusCode (
- (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
- (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),
- 0,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
- //
- // Put dead loop in module that contained the error.
- //
- EFI_DEADLOOP ();
-}
-
-VOID
-EfiDebugVPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- Marker - VarArgs
-
-Returns:
-
- None
-
---*/
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
- UINTN ImageDebugMask;
-
- //
- // Check driver debug mask value and global mask
- //
- if (gDebugMaskInterface != NULL) {
- gDebugMaskInterface->GetDebugMask (gDebugMaskInterface, &ImageDebugMask);
- if (!(ErrorLevel & ImageDebugMask)) {
- return ;
- }
- } else if (!(gErrorLevel & ErrorLevel)) {
- return ;
- }
-
- EfiDebugVPrintWorker (ErrorLevel, Format, Marker, sizeof (Buffer), Buffer);
-
- EfiLibReportStatusCode (
- EFI_DEBUG_CODE,
- (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),
- (UINT32) ErrorLevel,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
- return ;
-}
-
-VOID
-EfiDebugPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Wrapper for EfiDebugVPrint ()
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- ... - Print arguments.
-
-
-Returns:
-
- None
-
---*/
-{
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- EfiDebugVPrint (ErrorLevel, Format, Marker);
- VA_END (Marker);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
deleted file mode 100644
index daa01a29a7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
+++ /dev/null
@@ -1,551 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- DevicePath.c
-
-Abstract:
-
- Device Path services. The thing to remember is device paths are built out of
- nodes. The device path is terminated by an end node that is length
- sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
- all over this file.
-
- The only place where multi-instance device paths are supported is in
- environment varibles. Multi-instance device paths should never be placed
- on a Handle.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include EFI_PROTOCOL_DEFINITION (DevicePath)
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Function retrieves the next device path instance from a device path data structure.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
- Size - A pointer to the size of a device path instance in bytes.
-
-Returns:
-
- This function returns a pointer to the current device path instance.
- In addition, it returns the size in bytes of the current device path instance in Size,
- and a pointer to the next device path instance in DevicePath.
- If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *ReturnValue;
- UINT8 Temp;
-
- if (*DevicePath == NULL) {
- if (Size != NULL) {
- *Size = 0;
- }
-
- return NULL;
- }
-
- //
- // Find the end of the device path instance
- //
- DevPath = *DevicePath;
- while (!IsDevicePathEndType (DevPath)) {
- DevPath = NextDevicePathNode (DevPath);
- }
-
- //
- // Compute the size of the device path instance
- //
- if (Size != NULL) {
- *Size = ((UINTN) DevPath - (UINTN) (*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
- }
-
- //
- // Make a copy and return the device path instance
- //
- Temp = DevPath->SubType;
- DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- ReturnValue = EfiDuplicateDevicePath (*DevicePath);
- DevPath->SubType = Temp;
-
- //
- // If DevPath is the end of an entire device path, then another instance
- // does not follow, so *DevicePath is set to NULL.
- //
- if (DevicePathSubType (DevPath) == END_ENTIRE_DEVICE_PATH_SUBTYPE) {
- *DevicePath = NULL;
- } else {
- *DevicePath = NextDevicePathNode (DevPath);
- }
-
- return ReturnValue;
-}
-
-BOOLEAN
-EfiIsDevicePathMultiInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Return TRUE is this is a multi instance device path.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
-
-Returns:
- TRUE - If DevicePath is multi instance. FALSE - If DevicePath is not multi
- instance.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Node;
-
- if (DevicePath == NULL) {
- return FALSE;
- }
-
- Node = DevicePath;
- while (!EfiIsDevicePathEnd (Node)) {
- if (EfiIsDevicePathEndInstance (Node)) {
- return TRUE;
- }
-
- Node = EfiNextDevicePathNode (Node);
- }
-
- return FALSE;
-}
-
-UINTN
-EfiDevicePathSize (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
-
- Calculate the space size of a device path.
-
-Arguments:
-
- DevicePath - A specified device path
-
-Returns:
-
- The size.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Start;
-
- if (DevicePath == NULL) {
- return 0;
- }
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Compute the size and add back in the size of the end device path structure
- //
- return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDevicePathFromHandle (
- IN EFI_HANDLE Handle
- )
-/*++
-
-Routine Description:
-
- Get the device path protocol interface installed on a specified handle.
-
-Arguments:
-
- Handle - a specified handle
-
-Returns:
-
- The device path protocol interface installed on that handle.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- DevicePath = NULL;
- gBS->HandleProtocol (
- Handle,
- &gEfiDevicePathProtocolGuid,
- (VOID *) &DevicePath
- );
- return DevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDuplicateDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
-
- Duplicate a device path structure.
-
-Arguments:
-
- DevicePath - The device path to duplicated.
-
-Returns:
-
- The duplicated device path.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN Size;
-
- if (DevicePath == NULL) {
- return NULL;
- }
-
- //
- // Compute the size
- //
- Size = EfiDevicePathSize (DevicePath);
- if (Size == 0) {
- return NULL;
- }
-
- //
- // Allocate space for duplicate device path
- //
- NewDevicePath = EfiLibAllocateCopyPool (Size, DevicePath);
-
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a Src1 and Src2 together.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
-
- A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
-
---*/
-{
- UINTN Size;
- UINTN Size1;
- UINTN Size2;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath;
-
- //
- // If there's only 1 path, just duplicate it
- //
- if (!Src1) {
- ASSERT (!IsDevicePathUnpacked (Src2));
- return EfiDuplicateDevicePath (Src2);
- }
-
- if (!Src2) {
- ASSERT (!IsDevicePathUnpacked (Src1));
- return EfiDuplicateDevicePath (Src1);
- }
-
- //
- // Allocate space for the combined device path. It only has one end node of
- // length EFI_DEVICE_PATH_PROTOCOL
- //
- Size1 = EfiDevicePathSize (Src1);
- Size2 = EfiDevicePathSize (Src2);
- Size = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL);
-
- NewDevicePath = EfiLibAllocateCopyPool (Size, Src1);
-
- if (NewDevicePath != NULL) {
-
- //
- // Over write Src1 EndNode and do the copy
- //
- SecondDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));
- EfiCopyMem (SecondDevicePath, Src2, Size2);
- }
-
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePathNode (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Node
- )
-/*++
-
-Routine Description:
- Function is used to append a device path node to the end of another device path.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Node - A pointer to a device path data structure.
-
-Returns:
- This function returns a pointer to the new device path.
- If there is not enough temporary pool memory available to complete this function,
- then NULL is returned.
-
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Temp;
- EFI_DEVICE_PATH_PROTOCOL *NextNode;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN NodeLength;
-
- //
- // Build a Node that has a terminator on it
- //
- NodeLength = DevicePathNodeLength (Node);
-
- Temp = EfiLibAllocateCopyPool (NodeLength + sizeof (EFI_DEVICE_PATH_PROTOCOL), Node);
- if (Temp == NULL) {
- return NULL;
- }
-
- //
- // Add and end device path node to convert Node to device path
- //
- NextNode = NextDevicePathNode (Temp);
- SetDevicePathEndNode (NextNode);
-
- //
- // Append device paths
- //
- NewDevicePath = EfiAppendDevicePath (Src1, Temp);
- gBS->FreePool (Temp);
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiFileDevicePath (
- IN EFI_HANDLE Device OPTIONAL,
- IN CHAR16 *FileName
- )
-/*++
-
-Routine Description:
-
- This function allocates a device path for a file and appends it to an existiong
- device path.
-
-Arguments:
- Device - A pointer to a device handle.
-
- FileName - A pointer to a Null-terminated Unicodestring.
-
-Returns:
- A device path contain the file name.
-
---*/
-{
- UINTN Size;
- FILEPATH_DEVICE_PATH *FilePath;
- EFI_DEVICE_PATH_PROTOCOL *Eop;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- for (Size = 0; FileName[Size] != 0; Size++)
- ;
- Size = (Size + 1) * 2;
-
- FilePath = EfiLibAllocateZeroPool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + sizeof (EFI_DEVICE_PATH_PROTOCOL));
-
- DevicePath = NULL;
-
- if (FilePath != NULL) {
-
- //
- // Build a file path
- //
- FilePath->Header.Type = MEDIA_DEVICE_PATH;
- FilePath->Header.SubType = MEDIA_FILEPATH_DP;
- SetDevicePathNodeLength (&FilePath->Header, Size + SIZE_OF_FILEPATH_DEVICE_PATH);
- EfiCopyMem (FilePath->PathName, FileName, Size);
- Eop = NextDevicePathNode (&FilePath->Header);
- SetDevicePathEndNode (Eop);
-
- //
- // Append file path to device's device path
- //
-
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) FilePath;
- if (Device != NULL) {
- DevicePath = EfiAppendDevicePath (
- EfiDevicePathFromHandle (Device),
- DevicePath
- );
-
- gBS->FreePool (FilePath);
- }
- }
-
- return DevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePathInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *Src,
- IN EFI_DEVICE_PATH_PROTOCOL *Instance
- )
-/*++
-
-Routine Description:
-
- Append a device path instance to another.
-
-Arguments:
-
- Src - The device path instance to be appended with.
- Instance - The device path instance appending the other.
-
-Returns:
-
- The contaction of these two.
-
---*/
-{
- UINT8 *Ptr;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- UINTN SrcSize;
- UINTN InstanceSize;
-
- if (Src == NULL) {
- return EfiDuplicateDevicePath (Instance);
- }
-
- SrcSize = EfiDevicePathSize (Src);
- InstanceSize = EfiDevicePathSize (Instance);
-
- Ptr = EfiLibAllocateCopyPool (SrcSize + InstanceSize, Src);
- if (Ptr != NULL) {
-
- DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
-
- while (!IsDevicePathEnd (DevPath)) {
- DevPath = NextDevicePathNode (DevPath);
- }
- //
- // Convert the End to an End Instance, since we are
- // appending another instacne after this one its a good
- // idea.
- //
- DevPath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE;
-
- DevPath = NextDevicePathNode (DevPath);
- EfiCopyMem (DevPath, Instance, InstanceSize);
- }
-
- return (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
-}
-
-VOID
-EFIAPI
-EfiInitializeFwVolDevicepathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN EFI_GUID *NameGuid
- )
-/*++
-
-Routine Description:
-
- Initialize a Firmware Volume (FV) Media Device Path node.
-
-Arguments:
-
- FvDevicePathNode - Pointer to a FV device path node to initialize
- NameGuid - FV file name to use in FvDevicePathNode
-
-Returns:
-
- None
-
---*/
-{
- FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
- FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
- SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
-
- EfiCopyMem (&FvDevicePathNode->NameGuid, NameGuid, sizeof(EFI_GUID));
-}
-
-EFI_GUID *
-EFIAPI
-EfiGetNameGuidFromFwVolDevicePathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- )
-/*++
-
-Routine Description:
-
- Check to see if the Firmware Volume (FV) Media Device Path is valid.
-
-Arguments:
-
- FvDevicePathNode - Pointer to FV device path to check
-
-Returns:
-
- NULL - FvDevicePathNode is not valid.
- Other - FvDevicePathNode is valid and pointer to NameGuid was returned.
-
---*/
-{
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
- return &FvDevicePathNode->NameGuid;
- }
-
- return NULL;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DxeDriverLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DxeDriverLib.c
deleted file mode 100644
index c445bf0978..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DxeDriverLib.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- DxeDriverLib.c
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_STATUS
-DxeInitializeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - Standard EFI Image entry parameter
-
- SystemTable - Standard EFI Image entry parameter
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiInitializeDriverLib (ImageHandle, SystemTable);
- if (!EFI_ERROR (Status)) {
- Status = EfiLibGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- }
-
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ebc/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ebc/PerformancePrimitives.c
deleted file mode 100644
index 899d75577a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ebc/PerformancePrimitives.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "Tiano.h" // for ASSERT macro
-#include "TianoCommon.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Set TimerValue to 0, which is not expected to be run.
-
-Arguments:
-
- TimerValue - Timer value for output
-
-Returns:
-
- EFI_SUCCESS - Should not be reached.
-
---*/
-{
- //
- // Should not be used for EBC, so assert.
- //
- *TimerValue = 0;
- ASSERT (FALSE);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
deleted file mode 100644
index ef10d41702..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiDriverLib.c
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-VOID
-EFIAPI
-OnStatusCodeInstall (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-#endif
-
-//
-// Global Interface for Debug Mask Protocol
-//
-EFI_DEBUG_MASK_PROTOCOL *gDebugMaskInterface = NULL;
-
-EFI_STATUS
-EfiInitializeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - Standard EFI Image entry parameter
-
- SystemTable - Standard EFI Image entry parameter
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- VOID *Registration;
-#endif
-
- gST = SystemTable;
-
- ASSERT (gST != NULL);
-
- gBS = gST->BootServices;
- gRT = gST->RuntimeServices;
-
- ASSERT (gBS != NULL);
- ASSERT (gRT != NULL);
-
- //
- // Get driver debug mask protocol interface
- //
-#ifdef EFI_DEBUG
- gBS->HandleProtocol (
- ImageHandle,
- &gEfiDebugMaskProtocolGuid,
- (VOID *) &gDebugMaskInterface
- );
-#endif
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // Register EFI_STATUS_CODE_PROTOCOL notify function
- //
- EfiLibCreateProtocolNotifyEvent (
- &gEfiStatusCodeRuntimeProtocolGuid,
- EFI_TPL_CALLBACK,
- OnStatusCodeInstall,
- NULL,
- &Registration
- );
-
-#endif
-
- //
- // Should be at EFI_D_INFO, but lets us know things are running
- //
- DEBUG ((EFI_D_INFO, "EfiInitializeDriverLib: Started\n"));
-
- return EFI_SUCCESS;
-}
-
-STATIC
-BOOLEAN
-IsIso639LanguageCode (
- IN CHAR8 *Languages
- )
-/*++
-
-Routine Description:
-
- Tests whether a language code has format of ISO639-2.
-
-Arguments:
-
- Languages - The language code to be tested.
-
-Returns:
-
- TRUE - Language code format is ISO 639-2.
- FALSE - Language code format is not ISO 639-2.
-
---*/
-{
- UINTN Index;
-
- //
- // Find out format of Languages
- //
- for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';' && Languages[Index] != '-'; Index++);
- if (Languages[Index] != 0) {
- //
- // RFC4646 language code
- //
- return FALSE;
- }
-
- //
- // No ';' and '-', it's either ISO639-2 code (list) or single RFC4646 code
- //
- if (Index == 2) {
- //
- // Single RFC4646 language code without country code, e.g. "en"
- //
- return FALSE;
- }
-
- //
- // Languages in format of ISO639-2
- //
- return TRUE;
-}
-
-BOOLEAN
-EfiLibCompareLanguage (
- IN CHAR8 *Language1,
- IN CHAR8 *Language2
- )
-/*++
-
-Routine Description:
-
- Compare the first language instance of two language codes, either could be a
- single language code or a language code list. This function assume Language1
- and Language2 has the same language code format, i.e. either ISO639-2 or RFC4646.
-
-Arguments:
-
- Language1 - The first language code to be tested.
- Language2 - The second language code to be tested.
-
-Returns:
-
- TRUE - Language code match.
- FALSE - Language code mismatch.
-
---*/
-{
- UINTN Index;
-
- //
- // Compare first two bytes of language tag
- //
- if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {
- return FALSE;
- }
-
- if (IsIso639LanguageCode (Language1)) {
- //
- // ISO639-2 language code, compare the third byte of language tag
- //
- return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);
- }
-
- //
- // RFC4646 language code
- //
- for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++);
- if ((EfiAsciiStrnCmp (Language1, Language2, Index) == 0) && (Language2[Index] == 0 || Language2[Index] == ';')) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-STATIC
-CHAR8 *
-NextSupportedLanguage (
- IN CHAR8 *Languages
- )
-/*++
-
-Routine Description:
-
- Step to next language code of a language code list.
-
-Arguments:
-
- Languages - The language code list to traverse.
-
-Returns:
-
- Pointer to next language code or NULL terminator if it's the last one.
-
---*/
-{
- UINTN Index;
-
- if (IsIso639LanguageCode (Languages)) {
- //
- // ISO639-2 language code
- //
- return (Languages + 3);
- }
-
- //
- // Search in RFC4646 language code list
- //
- for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);
- if (Languages[Index] == ';') {
- Index++;
- }
- return (Languages + Index);
-}
-
-EFI_STATUS
-EfiLibLookupUnicodeString (
- IN CHAR8 *Language,
- IN CHAR8 *SupportedLanguages,
- IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- OUT CHAR16 **UnicodeString
- )
-/*++
-
-Routine Description:
-
- Translate a unicode string to a specified language if supported.
-
-Arguments:
-
- Language - The name of language to translate to
- SupportedLanguages - Supported languages set
- UnicodeStringTable - Pointer of one item in translation dictionary
- UnicodeString - The translated string
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
- EFI_UNSUPPORTED - System not supported this language or this string translation
- EFI_SUCCESS - String successfully translated
-
---*/
-{
- //
- // Make sure the parameters are valid
- //
- if (Language == NULL || UnicodeString == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // If there are no supported languages, or the Unicode String Table is empty, then the
- // Unicode String specified by Language is not supported by this Unicode String Table
- //
- if (SupportedLanguages == NULL || UnicodeStringTable == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Make sure Language is in the set of Supported Languages
- //
- while (*SupportedLanguages != 0) {
- if (EfiLibCompareLanguage (Language, SupportedLanguages)) {
-
- //
- // Search the Unicode String Table for the matching Language specifier
- //
- while (UnicodeStringTable->Language != NULL) {
- if (EfiLibCompareLanguage (Language, UnicodeStringTable->Language)) {
-
- //
- // A matching string was found, so return it
- //
- *UnicodeString = UnicodeStringTable->UnicodeString;
- return EFI_SUCCESS;
- }
-
- UnicodeStringTable++;
- }
-
- return EFI_UNSUPPORTED;
- }
-
- SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
- }
-
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EfiLibAddUnicodeString (
- IN CHAR8 *Language,
- IN CHAR8 *SupportedLanguages,
- IN OUT EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- IN CHAR16 *UnicodeString
- )
-/*++
-
-Routine Description:
-
- Add an translation to the dictionary if this language if supported.
-
-Arguments:
-
- Language - The name of language to translate to
- SupportedLanguages - Supported languages set
- UnicodeStringTable - Translation dictionary
- UnicodeString - The corresponding string for the language to be translated to
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
- EFI_UNSUPPORTED - System not supported this language
- EFI_ALREADY_STARTED - Already has a translation item of this language
- EFI_OUT_OF_RESOURCES - No enough buffer to be allocated
- EFI_SUCCESS - String successfully translated
-
---*/
-{
- UINTN NumberOfEntries;
- EFI_UNICODE_STRING_TABLE *OldUnicodeStringTable;
- EFI_UNICODE_STRING_TABLE *NewUnicodeStringTable;
- UINTN UnicodeStringLength;
-
- //
- // Make sure the parameter are valid
- //
- if (Language == NULL || UnicodeString == NULL || UnicodeStringTable == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // If there are no supported languages, then a Unicode String can not be added
- //
- if (SupportedLanguages == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // If the Unicode String is empty, then a Unicode String can not be added
- //
- if (UnicodeString[0] == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Make sure Language is a member of SupportedLanguages
- //
- while (*SupportedLanguages != 0) {
- if (EfiLibCompareLanguage (Language, SupportedLanguages)) {
-
- //
- // Determine the size of the Unicode String Table by looking for a NULL Language entry
- //
- NumberOfEntries = 0;
- if (*UnicodeStringTable != NULL) {
- OldUnicodeStringTable = *UnicodeStringTable;
- while (OldUnicodeStringTable->Language != NULL) {
- if (EfiLibCompareLanguage (Language, OldUnicodeStringTable->Language)) {
- return EFI_ALREADY_STARTED;
- }
-
- OldUnicodeStringTable++;
- NumberOfEntries++;
- }
- }
-
- //
- // Allocate space for a new Unicode String Table. It must hold the current number of
- // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table
- // marker
- //
- NewUnicodeStringTable = EfiLibAllocatePool ((NumberOfEntries + 2) * sizeof (EFI_UNICODE_STRING_TABLE));
- if (NewUnicodeStringTable == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // If the current Unicode String Table contains any entries, then copy them to the
- // newly allocated Unicode String Table.
- //
- if (*UnicodeStringTable != NULL) {
- EfiCopyMem (
- NewUnicodeStringTable,
- *UnicodeStringTable,
- NumberOfEntries * sizeof (EFI_UNICODE_STRING_TABLE)
- );
- }
-
- //
- // Allocate space for a copy of the Language specifier
- //
- NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrSize (Language), Language);
- if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
- gBS->FreePool (NewUnicodeStringTable);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Compute the length of the Unicode String
- //
- for (UnicodeStringLength = 0; UnicodeString[UnicodeStringLength] != 0; UnicodeStringLength++)
- ;
-
- //
- // Allocate space for a copy of the Unicode String
- //
- NewUnicodeStringTable[NumberOfEntries].UnicodeString = EfiLibAllocateCopyPool (
- (UnicodeStringLength + 1) * sizeof (CHAR16),
- UnicodeString
- );
- if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) {
- gBS->FreePool (NewUnicodeStringTable[NumberOfEntries].Language);
- gBS->FreePool (NewUnicodeStringTable);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Mark the end of the Unicode String Table
- //
- NewUnicodeStringTable[NumberOfEntries + 1].Language = NULL;
- NewUnicodeStringTable[NumberOfEntries + 1].UnicodeString = NULL;
-
- //
- // Free the old Unicode String Table
- //
- if (*UnicodeStringTable != NULL) {
- gBS->FreePool (*UnicodeStringTable);
- }
-
- //
- // Point UnicodeStringTable at the newly allocated Unicode String Table
- //
- *UnicodeStringTable = NewUnicodeStringTable;
-
- return EFI_SUCCESS;
- }
-
- SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
- }
-
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EfiLibFreeUnicodeStringTable (
- IN OUT EFI_UNICODE_STRING_TABLE *UnicodeStringTable
- )
-/*++
-
-Routine Description:
-
- Free a string table.
-
-Arguments:
-
- UnicodeStringTable - The string table to be freed.
-
-Returns:
-
- EFI_SUCCESS - The table successfully freed.
-
---*/
-{
- UINTN Index;
-
- //
- // If the Unicode String Table is NULL, then it is already freed
- //
- if (UnicodeStringTable == NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // Loop through the Unicode String Table until we reach the end of table marker
- //
- for (Index = 0; UnicodeStringTable[Index].Language != NULL; Index++) {
-
- //
- // Free the Language string from the Unicode String Table
- //
- gBS->FreePool (UnicodeStringTable[Index].Language);
-
- //
- // Free the Unicode String from the Unicode String Table
- //
- if (UnicodeStringTable[Index].UnicodeString != NULL) {
- gBS->FreePool (UnicodeStringTable[Index].UnicodeString);
- }
- }
-
- //
- // Free the Unicode String Table itself
- //
- gBS->FreePool (UnicodeStringTable);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.inf
deleted file mode 100644
index 885e52cb20..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.inf
+++ /dev/null
@@ -1,101 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiDriverLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI driver library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiDriverLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Debug.c
- DevicePath.c
- EfiDriverLib.c
- DxeDriverLib.c
- EfiGetConfigTable.c
- EfiDriverModelLib.c
- Event.c
- Handle.c
- LibGlobalSt.c
- LibGlobalDs.c
- LibGlobalErrorLevel.c
- Lock.c
- EfiLibAllocate.c
- Perf.c
- ReportStatusCode.c
- GetImage.c
-
- ../Hob/Hob.c
-
-[sources.ia32]
- Ia32/PerformancePrimitives.c
-
-[sources.x64]
- X64/PerformancePrimitives.c
-
-[sources.ipf]
- Ipf/PerformancePrimitives.s
-
-[sources.ebc]
- Ebc/PerformancePrimitives.c
-
-[sources.ARM]
- Ebc/PerformancePrimitives.c
-
-[sources.AArch64]
- Ebc/PerformancePrimitives.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkGuidLib
- EdkProtocolLib
- EdkFrameworkProtocolLib
- EfiGuidLib
- EfiProtocolLib
- ArchProtocolLib
- EfiCommonLib
-
-[libraries.ia32]
- CpuIA32Lib
-
-[libraries.x64]
- CpuIA32Lib
-
-[libraries.ipf]
- CpuIA64Lib
-
-[libraries.ARM]
- CompilerIntrinsicsLib
-
-[libraries.AArch64]
- CompilerIntrinsicsLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib_Edk2.inf
deleted file mode 100644
index c6520a5f46..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib_Edk2.inf
+++ /dev/null
@@ -1,93 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiDriverLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI driver library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiDriverLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Debug.c
- DevicePath.c
- EfiDriverLib.c
- DxeDriverLib.c
- EfiGetConfigTable.c
- EfiDriverModelLib.c
- Event.c
- Handle.c
- LibGlobalSt.c
- LibGlobalDs.c
- LibGlobalErrorLevel.c
- Lock.c
- EfiLibAllocate.c
- Perf.c
- ReportStatusCode.c
- GetImage.c
-
- ../Hob/Hob.c
-
-[sources.ia32]
- Ia32/PerformancePrimitives.c
-
-[sources.x64]
- X64/PerformancePrimitives.c
-
-[sources.ipf]
- Ipf/PerformancePrimitives.s
- #
- # Only for CYGWINGCC IPF tool chain, EFI_BREAKPOINT and MEMORY_FENCE
- # is defined as two functions EcpEfiBreakPoint and EcpMemoryFence.
- #
- Ipf/AsmCpuMisc.s | GCC
-
-[sources.ebc]
- Ebc/PerformancePrimitives.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkGuidLib
- EdkProtocolLib
- EdkFrameworkProtocolLib
- EfiGuidLib
- EfiProtocolLib
- ArchProtocolLib
- EfiCommonLib
-
-[libraries.ia32]
- CpuIA32Lib
-
-[libraries.x64]
- CpuIA32Lib
-
-[libraries.ipf]
- CpuIA64Lib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c
deleted file mode 100644
index 5a07185098..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverModelLib.c
+++ /dev/null
@@ -1,444 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiDriverModelLib.c
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_STATUS
-EfiLibInstallDriverBinding (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
-Returns:
-
- EFI_SUCCESS is DriverBinding is installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-{
- EfiInitializeDriverLib (ImageHandle, SystemTable);
-
- DriverBinding->ImageHandle = ImageHandle;
-
- DriverBinding->DriverBindingHandle = DriverBindingHandle;
-
- return gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid,
- EFI_NATIVE_INTERFACE,
- DriverBinding
- );
-}
-
-EFI_STATUS
-InstallAllDriverProtocolsWorker (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_COMPONENT_NAME_PROTOCOL * ComponentName, OPTIONAL
- IN EFI_COMPONENT_NAME2_PROTOCOL * ComponentName2, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL * DriverConfiguration, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION2_PROTOCOL * DriverConfiguration2, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * DriverDiagnostics, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL * DriverDiagnostics2 OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
- ComponentName - A Component Name Protocol instance that this driver is producing
-
- ComponentName2 - A Component Name2 Protocol instance that this driver is producing
-
- DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
-
- DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
-
- DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
-
- DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
-
-Returns:
-
- EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiLibInstallDriverBinding (ImageHandle, SystemTable, DriverBinding, DriverBindingHandle);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (ComponentName != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiComponentNameProtocolGuid,
- EFI_NATIVE_INTERFACE,
- ComponentName
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- if (ComponentName2 != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiComponentName2ProtocolGuid,
- EFI_NATIVE_INTERFACE,
- ComponentName2
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- if (DriverConfiguration != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverConfigurationProtocolGuid,
- EFI_NATIVE_INTERFACE,
- DriverConfiguration
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- if (DriverConfiguration2 != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverConfiguration2ProtocolGuid,
- EFI_NATIVE_INTERFACE,
- DriverConfiguration2
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- if (DriverDiagnostics != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverDiagnosticsProtocolGuid,
- EFI_NATIVE_INTERFACE,
- DriverDiagnostics
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- if (DriverDiagnostics2 != NULL) {
- Status = gBS->InstallProtocolInterface (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverDiagnostics2ProtocolGuid,
- EFI_NATIVE_INTERFACE,
- DriverDiagnostics2
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiLibInstallAllDriverProtocols (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_COMPONENT_NAME_PROTOCOL * ComponentName, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL * DriverConfiguration, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL * DriverDiagnostics OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
- ComponentName - A Component Name Protocol instance that this driver is producing
-
- DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
-
- DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
-
-Returns:
-
- EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-{
- return InstallAllDriverProtocolsWorker (
- ImageHandle,
- SystemTable,
- DriverBinding,
- DriverBindingHandle,
- ComponentName,
- NULL,
- DriverConfiguration,
- NULL,
- DriverDiagnostics,
- NULL
- );
-}
-
-EFI_STATUS
-EfiLibInstallAllDriverProtocols2 (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL * DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_COMPONENT_NAME2_PROTOCOL * ComponentName2, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION2_PROTOCOL * DriverConfiguration2, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL * DriverDiagnostics2 OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
- ComponentName2 - A Component Name2 Protocol instance that this driver is producing
-
- DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
-
- DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
-
-Returns:
-
- EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-{
- return InstallAllDriverProtocolsWorker (
- ImageHandle,
- SystemTable,
- DriverBinding,
- DriverBindingHandle,
- NULL,
- ComponentName2,
- NULL,
- DriverConfiguration2,
- NULL,
- DriverDiagnostics2
- );
-}
-
-EFI_STATUS
-EfiLibTestManagedDevice (
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_GUID *ManagedProtocolGuid
- )
-/*++
-
-Routine Description:
-
- Test to see if the controller is managed by a specific driver.
-
-Arguments:
-
- ControllerHandle - Handle for controller to test
-
- DriverBindingHandle - Driver binding handle for controller
-
- ManagedProtocolGuid - The protocol guid the driver opens on controller
-
-Returns:
-
- EFI_SUCCESS - The controller is managed by the driver
-
- EFI_UNSUPPORTED - The controller is not managed by the driver
-
---*/
-{
- EFI_STATUS Status;
- VOID *ManagedInterface;
-
- Status = gBS->OpenProtocol (
- ControllerHandle,
- ManagedProtocolGuid,
- &ManagedInterface,
- DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- ManagedProtocolGuid,
- DriverBindingHandle,
- ControllerHandle
- );
- return EFI_UNSUPPORTED;
- }
-
- if (Status != EFI_ALREADY_STARTED) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiLibTestChildHandle (
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle,
- IN EFI_GUID *ConsumedGuid
- )
-/*++
-
-Routine Description:
-
- Test to see if the child handle is the child of the controller
-
-Arguments:
-
- ControllerHandle - Handle for controller (parent)
-
- ChildHandle - Child handle to test
-
- ConsumsedGuid - Protocol guid consumed by child from controller
-
-Returns:
-
- EFI_SUCCESS - The child handle is the child of the controller
-
- EFI_UNSUPPORTED - The child handle is not the child of the controller
-
---*/
-{
- EFI_STATUS Status;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
- UINTN EntryCount;
- UINTN Index;
-
- //
- // Retrieve the list of agents that are consuming one of the protocols
- // on ControllerHandle that the children consume
- //
- Status = gBS->OpenProtocolInformation (
- ControllerHandle,
- ConsumedGuid,
- &OpenInfoBuffer,
- &EntryCount
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // See if one of the agents is ChildHandle
- //
- Status = EFI_UNSUPPORTED;
- for (Index = 0; Index < EntryCount; Index++) {
- if (OpenInfoBuffer[Index].ControllerHandle == ChildHandle &&
- OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) {
- Status = EFI_SUCCESS;
- }
- }
- gBS->FreePool (OpenInfoBuffer);
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiGetConfigTable.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiGetConfigTable.c
deleted file mode 100644
index 21cac71ee2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiGetConfigTable.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiGetConfigTable.c
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Get table from configuration table by name
-
-Arguments:
-
- TableGuid - Table name to search
-
- Table - Pointer to the table caller wants
-
-Returns:
-
- EFI_NOT_FOUND - Not found the table
-
- EFI_SUCCESS - Found the table
-
---*/
-{
- UINTN Index;
-
- *Table = NULL;
- for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
- if (EfiCompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
- *Table = gST->ConfigurationTable[Index].VendorTable;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiLibAllocate.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiLibAllocate.c
deleted file mode 100644
index 29352e9d4e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiLibAllocate.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiLibAllocate.c
-
-Abstract:
-
- Support routines for memory allocation routines for use with drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-VOID *
-EfiLibAllocatePool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiBootServicesData, AllocationSize, &Memory);
- return Memory;
-}
-
-VOID *
-EfiLibAllocateRuntimePool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate RuntimeServicesData pool.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiRuntimeServicesData, AllocationSize, &Memory);
- return Memory;
-}
-
-VOID *
-EfiLibAllocateZeroPool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool and zero it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = EfiLibAllocatePool (AllocationSize);
- if (Memory != NULL) {
- gBS->SetMem (Memory, AllocationSize, 0);
- }
-
- return Memory;
-}
-
-VOID *
-EfiLibAllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate RuntimeServicesData pool and zero it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = EfiLibAllocateRuntimePool (AllocationSize);
- if (Memory != NULL) {
- gBS->SetMem (Memory, AllocationSize, 0);
- }
-
- return Memory;
-}
-
-VOID *
-EfiLibAllocateCopyPool (
- IN UINTN AllocationSize,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool and use a buffer provided by
- caller to fill it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
- Buffer - Buffer that will be filled into the buffer allocated
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiBootServicesData, AllocationSize, &Memory);
- if (Memory != NULL) {
- gBS->CopyMem (Memory, Buffer, AllocationSize);
- }
-
- return Memory;
-}
-
-VOID *
-EfiLibAllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate RuntimeServicesData pool and use a buffer provided by
- caller to fill it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
- Buffer - Buffer that will be filled into the buffer allocated
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiRuntimeServicesData, AllocationSize, &Memory);
- if (Memory != NULL) {
- gBS->CopyMem (Memory, Buffer, AllocationSize);
- }
-
- return Memory;
-}
-
-
-VOID
-EfiLibSafeFreePool (
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Free pool safely (without setting back Buffer to NULL).
-
-Arguments:
-
- Buffer - The allocated pool entry to free
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- if (Buffer != NULL) {
- gBS->FreePool (Buffer);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c
deleted file mode 100644
index 643ba7152c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Event.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- Event.c
-
-Abstract:
-
- Support for Event lib fucntions.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_EVENT
-EfiLibCreateProtocolNotifyEvent (
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT VOID **Registration
- )
-/*++
-
-Routine Description:
-
- Create a protocol notification event and return it.
-
-Arguments:
-
- ProtocolGuid - Protocol to register notification event on.
-
- NotifyTpl - Maximum TPL to single the NotifyFunction.
-
- NotifyFunction - EFI notification routine.
-
- NotifyContext - Context passed into Event when it is created.
-
- Registration - Registration key returned from RegisterProtocolNotify().
-
-Returns:
-
- The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
- is added to the system.
-
---*/
-{
- EFI_STATUS Status;
- EFI_EVENT Event;
-
- //
- // Create the event
- //
-
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &Event
- );
- ASSERT (!EFI_ERROR (Status));
-
- //
- // Register for protocol notifactions on this event
- //
-
- Status = gBS->RegisterProtocolNotify (
- ProtocolGuid,
- Event,
- Registration
- );
-
- ASSERT (!EFI_ERROR (Status));
-
- //
- // Kick the event so we will perform an initial pass of
- // current installed drivers
- //
-
- gBS->SignalEvent (Event);
- return Event;
-}
-
-EFI_STATUS
-EfiLibNamedEventListen (
- IN EFI_GUID * Name,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext
- )
-/*++
-
-Routine Description:
- Listenes to signals on the name.
- EfiLibNamedEventSignal() signals the event.
-
- NOTE: For now, the named listening/signalling is implemented
- on a protocol interface being installed and uninstalled.
- In the future, this maybe implemented based on a dedicated mechanism.
-
-Arguments:
- Name - Name to register the listener on.
- NotifyTpl - Maximum TPL to singnal the NotifyFunction.
- NotifyFunction - The listener routine.
- NotifyContext - Context passed into the listener routine.
-
-Returns:
- EFI_SUCCESS if successful.
-
---*/
-{
- EFI_STATUS Status;
- EFI_EVENT Event;
- VOID *RegistrationLocal;
-
- //
- // Create event
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &Event
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->RegisterProtocolNotify (
- Name,
- Event,
- &RegistrationLocal
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiLibNamedEventSignal (
- IN EFI_GUID *Name
- )
-/*++
-
-Routine Description:
- Signals a named event. All registered listeners will run.
- The listeners should register using EfiLibNamedEventListen() function.
-
- NOTE: For now, the named listening/signalling is implemented
- on a protocol interface being installed and uninstalled.
- In the future, this maybe implemented based on a dedicated mechanism.
-
-Arguments:
- Name - Name to perform the signaling on. The name is a GUID.
-
-Returns:
- EFI_SUCCESS if successfull.
-
---*/
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- Handle = NULL;
- Status = gBS->InstallProtocolInterface (
- &Handle,
- Name,
- EFI_NATIVE_INTERFACE,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->UninstallProtocolInterface (
- Handle,
- Name,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-static
-VOID
-EFIAPI
-EventNotifySignalAllNullEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- //
- // This null event is a size efficent way to enusre that
- // EFI_EVENT_NOTIFY_SIGNAL_ALL is error checked correctly.
- // EFI_EVENT_NOTIFY_SIGNAL_ALL is now mapped into
- // CreateEventEx() and this function is used to make the
- // old error checking in CreateEvent() for Tiano extensions
- // function.
- //
- return;
-}
-
-#endif
-
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *LegacyBootEvent
- )
-/*++
-
-Routine Description:
- Create a Legacy Boot Event.
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to
- work both ways.
-
-Arguments:
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Returns:
- EFI_SUCCESS Event was created.
- Other Event was not created.
-
---*/
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- LegacyBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventLegacyBootGuid,
- LegacyBootEvent
- );
-#endif
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *ReadyToBootEvent
- )
-/*++
-
-Routine Description:
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to
- work both ways.
-
-Arguments:
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Return:
- EFI_SUCCESS - Event was created.
- Other - Event was not created.
-
---*/
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- ReadyToBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventReadyToBootGuid,
- ReadyToBootEvent
- );
-#endif
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/GetImage.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/GetImage.c
deleted file mode 100644
index df866f254d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/GetImage.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 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.
-
-Module Name:
-
- GetImage.c
-
-Abstract:
-
- Image data extraction support for common use.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "EfiImageFormat.h"
-
-#include EFI_PROTOCOL_CONSUMER (LoadedImage)
-
-EFI_STATUS
-GetImageFromFv (
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- IN EFI_FIRMWARE_VOLUME_PROTOCOL *Fv,
-#else
- IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv,
-#endif
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size
- )
-{
- EFI_STATUS Status;
- EFI_FV_FILETYPE FileType;
- EFI_FV_FILE_ATTRIBUTES Attributes;
- UINT32 AuthenticationStatus;
-
- //
- // Read desired section content in NameGuid file
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadSection (
- Fv,
- NameGuid,
- SectionType,
- 0,
- Buffer,
- Size,
- &AuthenticationStatus
- );
-
- if (EFI_ERROR (Status) && (SectionType == EFI_SECTION_TE)) {
- //
- // Try reading PE32 section, since the TE section does not exist
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadSection (
- Fv,
- NameGuid,
- EFI_SECTION_PE32,
- 0,
- Buffer,
- Size,
- &AuthenticationStatus
- );
- }
-
- if (EFI_ERROR (Status) &&
- ((SectionType == EFI_SECTION_TE) || (SectionType == EFI_SECTION_PE32))) {
- //
- // Try reading raw file, since the desired section does not exist
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadFile (
- Fv,
- NameGuid,
- Buffer,
- Size,
- &FileType,
- &Attributes,
- &AuthenticationStatus
- );
- }
-
- return Status;
-}
-
-EFI_STATUS
-GetImage (
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size
- )
-{
- return GetImageEx (NULL, NameGuid, SectionType, Buffer, Size, FALSE);
-}
-
-EFI_STATUS
-GetImageEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size,
- BOOLEAN WithinImageFv
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleCount;
- UINTN Index;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- EFI_FIRMWARE_VOLUME_PROTOCOL *ImageFv;
- EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
-#else
- EFI_FIRMWARE_VOLUME2_PROTOCOL *ImageFv;
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
-#endif
-
- if (ImageHandle == NULL && WithinImageFv) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = EFI_NOT_FOUND;
- ImageFv = NULL;
- if (ImageHandle != NULL) {
- Status = gBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- Status = gBS->HandleProtocol (
- LoadedImage->DeviceHandle,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- (VOID **) &ImageFv
- );
- if (!EFI_ERROR (Status)) {
- Status = GetImageFromFv (ImageFv, NameGuid, SectionType, Buffer, Size);
- }
- }
-
- if (Status == EFI_SUCCESS || WithinImageFv) {
- return Status;
- }
-
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Find desired image in all Fvs
- //
- for (Index = 0; Index < HandleCount; ++Index) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- (VOID**)&Fv
- );
-
- if (EFI_ERROR (Status)) {
- gBS->FreePool(HandleBuffer);
- return Status;
- }
-
- if (ImageFv != NULL && Fv == ImageFv) {
- continue;
- }
-
- Status = GetImageFromFv (Fv, NameGuid, SectionType, Buffer, Size);
-
- if (!EFI_ERROR (Status)) {
- break;
- }
- }
- gBS->FreePool(HandleBuffer);
-
- //
- // Not found image
- //
- if (Index == HandleCount) {
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Handle.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Handle.c
deleted file mode 100644
index b6484731e9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Handle.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Handle.c
-
-Abstract:
-
- Support for Handle lib fucntions.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_STATUS
-EfiLibLocateHandleProtocolByProtocols (
- IN OUT EFI_HANDLE * Handle, OPTIONAL
- OUT VOID **Interface, OPTIONAL
- ...
- )
-/*++
-Routine Description:
-
- Function locates Protocol and/or Handle on which all Protocols specified
- as a variable list are installed.
- It supports continued search. The caller must assure that no handles are added
- or removed while performing continued search, by e.g., rising the TPL and not
- calling any handle routines. Otherwise the behavior is undefined.
-
-Arguments:
-
- Handle - The address of handle to receive the handle on which protocols
- indicated by the variable list are installed.
- If points to NULL, all handles are searched. If pointing to a
- handle returned from previous call, searches starting from next handle.
- If NULL, the parameter is ignored.
-
- Interface - The address of a pointer to a protocol interface that will receive
- the interface indicated by first variable argument.
- If NULL, the parameter is ignored.
-
- ... - A variable argument list containing protocol GUIDs. Must end with NULL.
-
-Returns:
-
- EFI_SUCCESS - All the protocols where found on same handle.
- EFI_NOT_FOUND - A Handle with all the protocols installed was not found.
- Other values as may be returned from LocateHandleBuffer() or HandleProtocol().
-
---*/
-{
- VA_LIST args;
- EFI_STATUS Status;
- EFI_GUID *Protocol;
- EFI_GUID *ProtocolFirst;
- EFI_HANDLE *HandleBuffer;
- UINTN NumberOfHandles;
- UINTN Idx;
- VOID *AnInterface;
-
- AnInterface = NULL;
- VA_START (args, Interface);
- ProtocolFirst = VA_ARG (args, EFI_GUID *);
- VA_END (args);
-
- //
- // Get list of all handles that support the first protocol.
- //
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- ProtocolFirst,
- NULL,
- &NumberOfHandles,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Check if this is a countinuation of handle searching.
- //
- Idx = 0;
- if ((Handle != NULL) && (*Handle != NULL)) {
- //
- // Leave the Idx just beyond the matching handle.
- //
- for (; Idx < NumberOfHandles;) {
- if (*Handle == HandleBuffer[Idx++]) {
- break;
- }
- }
- }
-
- //
- // Iterate handles testing for presence of remaining protocols.
- //
- for (; Idx < NumberOfHandles; Idx++) {
-
- //
- // Start with the second protocol, the first one is sure on this handle.
- //
- VA_START (args, Interface);
- Protocol = VA_ARG (args, EFI_GUID *);
-
- //
- // Iterate protocols from the variable list.
- //
- while (TRUE) {
-
- Protocol = VA_ARG (args, EFI_GUID *);
-
- if (Protocol == NULL) {
-
- //
- // If here, the list was iterated successfully
- // finding each protocol on a single handle.
- //
-
- Status = EFI_SUCCESS;
-
- //
- // OPTIONAL parameter returning the Handle.
- //
- if (Handle != NULL) {
- *Handle = HandleBuffer[Idx];
- }
-
- //
- // OPTIONAL parameter returning the first rotocol's Interface.
- //
- if (Interface != NULL) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Idx],
- ProtocolFirst,
- Interface
- );
- }
-
- VA_END (args);
-
- goto lbl_out;
- }
-
- Status = gBS->HandleProtocol (
- HandleBuffer[Idx],
- Protocol,
- &AnInterface
- );
- if (EFI_ERROR (Status)) {
-
- //
- // This handle does not have the iterated protocol.
- //
- break;
- }
- }
-
- VA_END (args);
- }
-
- //
- // If here, no handle that bears all the protocols was found.
- //
- Status = EFI_NOT_FOUND;
-
-lbl_out:
- gBS->FreePool (HandleBuffer);
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ia32/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ia32/PerformancePrimitives.c
deleted file mode 100644
index 91bb750ee1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ia32/PerformancePrimitives.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-#include "CpuIA32.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Set TimerValue with current tick.
-
-Arguments:
-
- TimerValue - Timer value to be set
-
-Returns:
-
- EFI_SUCCESS - TimerValue is set.
-
---*/
-{
- *TimerValue = EfiReadTsc ();
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/AsmCpuMisc.s b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/AsmCpuMisc.s
deleted file mode 100644
index 81837472bf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/AsmCpuMisc.s
+++ /dev/null
@@ -1,44 +0,0 @@
-/// @file
-/// Contains an implementation of EcpEfiBreakPoint and EcpMemoryFence on Itanium-based
-/// architecture.
-///
-/// 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.
-///
-/// Module Name: AsmCpuMisc.s
-///
-///
-
-
-.text
-.proc EcpEfiBreakPoint
-.type EcpEfiBreakPoint, @function
-
-EcpEfiBreakPoint::
- break.i 0;;
- br.ret.dpnt b0;;
-
-.endp EcpEfiBreakPoint
-
-.proc EcpMemoryFence
-.type EcpMemoryFence, @function
-
-EcpMemoryFence::
- mf;; // memory access ordering
-
- // do we need the mf.a also here?
- mf.a // wait for any IO to complete?
-
- // not sure if we need serialization here, just put it, in case...
-
- srlz.d;;
- srlz.i;;
-
- br.ret.dpnt b0;;
-.endp EcpMemoryFence \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/PerformancePrimitives.s b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/PerformancePrimitives.s
deleted file mode 100644
index d5b0a1af02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Ipf/PerformancePrimitives.s
+++ /dev/null
@@ -1,61 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// PerformancePrimitives.s
-//
-// Abstract:
-//
-//
-// Revision History:
-//
-//--
-
-.file "PerformancePrimitives.s"
-
-#include "IpfMacro.i"
-
-//-----------------------------------------------------------------------------
-//++
-// GetTimerValue
-//
-// Implementation of CPU-based time service
-//
-// On Entry :
-// EFI_STATUS
-// GetTimerValue (
-// OUT UINT64 *TimerValue
-// )
-//
-// Return Value:
-// r8 = Status
-// r9 = 0
-// r10 = 0
-// r11 = 0
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (GetTimerValue)
-
- NESTED_SETUP (1,8,0,0)
- mov r8 = ar.itc;;
- st8 [r32]= r8
- mov r8 = r0
- mov r9 = r0
- mov r10 = r0
- mov r11 = r0
- NESTED_RETURN
-
-PROCEDURE_EXIT (GetTimerValue)
-//---------------------------------------------------------------------------
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalDs.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalDs.c
deleted file mode 100644
index 44f9015bc5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalDs.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LibGlobalDs.c
-
-Abstract:
-
- Globals used in EFI Driver Lib. They are initialized in EfiDriverLib.c.
- Each seperatly linked module has it's own copy of these globals.
-
- gBS - Boot Services table pointer
- gRT - Runt Time services table pointer
- gST - System Table pointer
-
- gErrorLevel - Debug error level.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_DXE_SERVICES *gDS = NULL;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalErrorLevel.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalErrorLevel.c
deleted file mode 100644
index d598329610..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalErrorLevel.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LibGlobalErrorLevel.c
-
-Abstract:
-
- Globals used in EFI Driver Lib. They are initialized in EfiDriverLib.c.
- Each seperatly linked module has it's own copy of these globals.
-
- gBS - Boot Services table pointer
- gRT - Runt Time services table pointer
- gST - System Table pointer
-
- gErrorLevel - Debug error level.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-UINTN gErrorLevel = EFI_DBUG_MASK | EFI_D_LOAD;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalSt.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalSt.c
deleted file mode 100644
index 562a30a26f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/LibGlobalSt.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LibGlobalSt.c
-
-Abstract:
-
- Globals used in EFI Driver Lib. They are initialized in EfiDriverLib.c.
- Each seperatly linked module has it's own copy of these globals.
-
- gBS - Boot Services table pointer
- gRT - Runt Time services table pointer
- gST - System Table pointer
-
- gErrorLevel - Debug error level.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-EFI_SYSTEM_TABLE *gST = NULL;
-EFI_BOOT_SERVICES *gBS = NULL;
-EFI_RUNTIME_SERVICES *gRT = NULL;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Lock.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Lock.c
deleted file mode 100644
index d11c5984bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Lock.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Lock.c
-
-Abstract:
-
- Support for locking lib services.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
- Note on a check build ASSERT()s are used to ensure proper
- lock usage.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - The task priority level of the lock
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-{
- Lock->Tpl = Priority;
- Lock->OwnerTpl = 0;
- Lock->Lock = 0;
-}
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-{
- if (Lock->Lock != 0) {
- //
- // Lock is already owned, so bail out
- //
- return EFI_ACCESS_DENIED;
- }
-
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
-
- Lock->Lock += 1;
- return EFI_SUCCESS;
-}
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Raising to the task priority level of the mutual exclusion
- lock, and then acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- Lock owned
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiAcquireLockOrFail (Lock);
-
- //
- // Lock was already locked.
- //
- ASSERT_EFI_ERROR (Status);
-}
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock, and
- restores the previous task priority level.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- Lock unowned
-
---*/
-{
- EFI_TPL Tpl;
-
- Tpl = Lock->OwnerTpl;
-
- ASSERT (Lock->Lock == 1);
- Lock->Lock -= 1;
-
- gBS->RestoreTPL (Tpl);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Perf.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Perf.c
deleted file mode 100644
index b5f9a4ae5d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/Perf.c
+++ /dev/null
@@ -1,868 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Perf.c
-
-Abstract:
-
- Support for Performance primatives.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include EFI_PROTOCOL_DEFINITION (Performance)
-#include EFI_PROTOCOL_DEFINITION (LoadedImage)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_GUID_DEFINITION (PeiPerformanceHob)
-#include "LinkedList.h"
-#include "EfiHobLib.h"
-#include "EfiImage.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- );
-
-EFI_STATUS
-GetPeiPerformance (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINT64 Ticker
- );
-
-#define EFI_PERFORMANCE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'E', 'D', 'A')
-
-typedef struct {
- UINT32 Signature;
- EFI_LIST_ENTRY Link;
- EFI_GAUGE_DATA GaugeData;
-} EFI_PERF_DATA_LIST;
-
-#define GAUGE_DATA_FROM_LINK(_link) \
- CR(_link, EFI_PERF_DATA_LIST, Link, EFI_PERFORMANCE_DATA_SIGNATURE)
-
-#define GAUGE_DATA_FROM_GAUGE(_GaugeData) \
- CR(_GaugeData, EFI_PERF_DATA_LIST, GaugeData, EFI_PERFORMANCE_DATA_SIGNATURE)
-
-#define EFI_PERFORMANCE_SIGNATURE EFI_SIGNATURE_32 ('P', 'E', 'R', 'F')
-
-//
-// Performance protocol instance data structure
-//
-typedef struct {
- UINTN Signature;
- EFI_HANDLE Handle;
- EFI_PERFORMANCE_PROTOCOL Perf;
- UINT8 Phase;
-} EFI_PERFORMANCE_INSTANCE;
-
-//
-// Performace protocol instance containing record macro
-//
-
-#define EFI_PERFORMANCE_FROM_THIS(a) \
- CR(a, EFI_PERFORMANCE_INSTANCE, Perf, EFI_PERFORMANCE_SIGNATURE)
-
-EFI_LIST_ENTRY mPerfDataHead = INITIALIZE_LIST_HEAD_VARIABLE(mPerfDataHead);
-
-STATIC
-VOID
-GetShortPdbFileName (
- CHAR8 *PdbFileName,
- CHAR8 *GaugeString
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
---*/
-{
- UINTN Index;
- UINTN Index1;
- UINTN StartIndex;
- UINTN EndIndex;
-
- if (PdbFileName == NULL) {
- EfiAsciiStrCpy (GaugeString, (CHAR8 *)" ");
- } else {
- StartIndex = 0;
- for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)
- ;
-
- for (Index = 0; PdbFileName[Index] != 0; Index++) {
- if (PdbFileName[Index] == '\\') {
- StartIndex = Index + 1;
- }
-
- if (PdbFileName[Index] == '.') {
- EndIndex = Index;
- }
- }
-
- Index1 = 0;
- for (Index = StartIndex; Index < EndIndex; Index++) {
- GaugeString[Index1] = PdbFileName[Index];
- Index1++;
- if (Index1 == EFI_PERF_PDBFILENAME_LENGTH - 1) {
- break;
- }
- }
-
- GaugeString[Index1] = 0;
- }
-
- return ;
-}
-
-STATIC
-CHAR8 *
-GetPdbPath (
- VOID *ImageBase
- )
-/*++
-
-Routine Description:
-
- Located PDB path name in PE image
-
-Arguments:
-
- ImageBase - base of PE to search
-
-Returns:
-
- Pointer into image at offset of PDB file name if PDB file name is found,
- Otherwise a pointer to an empty string.
-
---*/
-{
- CHAR8 *PdbPath;
- UINT32 DirCount;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_NT_HEADERS *NtHdr;
- UINT16 Magic;
- EFI_IMAGE_OPTIONAL_HEADER32 *OptionalHdr32;
- EFI_IMAGE_OPTIONAL_HEADER64 *OptionalHdr64;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- VOID *CodeViewEntryPointer;
-
- CodeViewEntryPointer = NULL;
- PdbPath = NULL;
- DosHdr = ImageBase;
- if (DosHdr && DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- NtHdr = (EFI_IMAGE_NT_HEADERS *) ((UINT8 *) DosHdr + DosHdr->e_lfanew);
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = NtHdr->OptionalHeader.Magic;
- }
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- OptionalHdr32 = (VOID *) &NtHdr->OptionalHeader;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- } else {
- OptionalHdr64 = (VOID *) &NtHdr->OptionalHeader;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- }
-
- if (DirectoryEntry->VirtualAddress != 0) {
- for (DirCount = 0;
- (DirCount < DirectoryEntry->Size / sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) && CodeViewEntryPointer == NULL;
- DirCount++
- ) {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (DirectoryEntry->VirtualAddress + (UINTN) ImageBase + DirCount * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageBase);
- switch (*(UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- PdbPath = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- PdbPath = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- default:
- break;
- }
- }
- }
- }
- }
-
- return PdbPath;
-}
-
-STATIC
-VOID
-GetNameFromHandle (
- IN EFI_HANDLE Handle,
- OUT CHAR8 *GaugeString
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *Image;
- CHAR8 *PdbFileName;
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
-
- EfiAsciiStrCpy (GaugeString, (CHAR8 *)" ");
-
- //
- // Get handle name from image protocol
- //
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&Image
- );
-
- if (EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiDriverBindingProtocolGuid,
- (VOID **) &DriverBinding,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return ;
- }
- //
- // Get handle name from image protocol
- //
- Status = gBS->HandleProtocol (
- DriverBinding->ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&Image
- );
- }
-
- PdbFileName = GetPdbPath (Image->ImageBase);
-
- if (PdbFileName != NULL) {
- GetShortPdbFileName (PdbFileName, GaugeString);
- }
-
- return ;
-}
-
-EFI_PERF_DATA_LIST *
-CreateDataNode (
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host
- )
-/*++
-
-Routine Description:
-
- Create a EFI_PERF_DATA_LIST data node.
-
-Arguments:
-
- Handle - Handle of gauge data
- Token - Token of gauge data
- Host - Host of gauge data
-
-Returns:
-
- Pointer to a data node created.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
-
- //
- // Al\ a new image structure
- //
- Node = EfiLibAllocateZeroPool (sizeof (EFI_PERF_DATA_LIST));
- if (Node != NULL) {
-
- Node->Signature = EFI_PERFORMANCE_DATA_SIGNATURE;
-
- Node->GaugeData.Handle = Handle;
-
- if (Token != NULL) {
- EfiStrCpy ((Node->GaugeData).Token, Token);
- }
-
- if (Host != NULL) {
- EfiStrCpy ((Node->GaugeData).Host, Host);
- }
-
- if (Handle != NULL) {
- GetNameFromHandle (Handle, Node->GaugeData.PdbFileName);
- }
- }
-
- return Node;
-}
-
-
-EFI_PERF_DATA_LIST *
-GetDataNode (
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN EFI_GUID *GuidName,
- IN EFI_GAUGE_DATA *PrevGauge
- )
-/*++
-
-Routine Description:
-
- Search gauge node list to find one node with matched handle, token, host and Guid name.
-
-Arguments:
-
- Handle - Handle to match
- Token - Token to match
- Host - Host to match
- GuidName - Guid name to match
- PrevGauge - Start node, start from list head if NULL
-
-Returns:
-
- Return pointer to the node found, NULL if not found.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
- EFI_PERF_DATA_LIST *Temp;
- EFI_PERF_DATA_LIST *Temp2;
- EFI_LIST_ENTRY *CurrentLink;
- EFI_GUID NullGuid = EFI_NULL_GUID;
-
- Node = NULL;
- Temp = NULL;
- Temp2 = NULL;
-
- if (PrevGauge == NULL) {
- CurrentLink = mPerfDataHead.ForwardLink;
- } else {
- Temp2 = GAUGE_DATA_FROM_GAUGE (PrevGauge);
- CurrentLink = (Temp2->Link).ForwardLink;
- }
-
- while (CurrentLink && CurrentLink != &mPerfDataHead) {
- Node = GAUGE_DATA_FROM_LINK (CurrentLink);
-
- if (Handle == 0 && Token == NULL && Host == NULL && GuidName == NULL) {
- return Node;
- }
-
- if (Handle != (Node->GaugeData).Handle) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (GuidName == NULL && !EfiCompareGuid (&((Node->GaugeData).GuidName), &NullGuid)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (GuidName && !EfiCompareGuid (&((Node->GaugeData).GuidName), GuidName)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Token == NULL && EfiStrCmp (Node->GaugeData.Token, L"")) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Token && EfiStrCmp (Node->GaugeData.Token, Token)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Host == NULL && EfiStrCmp (Node->GaugeData.Host, L"")) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Host && EfiStrCmp (Node->GaugeData.Host, Host)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- Temp = Node;
- break;
- }
-
- return Temp;
-}
-
-
-EFI_STATUS
-EFIAPI
-StartGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Create a guage data node and initialized it.
-
-Arguments:
-
- This - Calling context
- Handle - Handle of gauge data
- Token - Token of gauge data
- Host - Host of gauge data
- Ticker - Set gauge data's StartTick. If 0, StartTick is current timer.
-
-Returns:
-
- EFI_SUCCESS - Successfully create and initialized a guage data node.
- EFI_OUT_OF_RESOURCES - No enough resource to create a guage data node.
-
---*/
-{
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- TimerValue = 0;
- PerfInstance = EFI_PERFORMANCE_FROM_THIS (This);
-
- Node = CreateDataNode (Handle, Token, Host);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- GetTimerValue (&TimerValue);
- }
-
- Node->GaugeData.StartTick = TimerValue;
-
- if (!EfiStrCmp (Token, DXE_TOK)) {
- PerfInstance->Phase = DXE_PHASE;
- }
-
- if (!EfiStrCmp (Token, SHELL_TOK)) {
- PerfInstance->Phase = SHELL_PHASE;
- }
-
- Node->GaugeData.Phase = PerfInstance->Phase;
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-EndGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- End all unfinished gauge data node that match specified handle, token and host.
-
-Arguments:
-
- This - Calling context
- Handle - Handle to stop
- Token - Token to stop
- Host - Host to stop
- Ticker - End tick, if 0 then get current timer
-
-Returns:
-
- EFI_NOT_FOUND - Node not found
- EFI_SUCCESS - Gauge data node successfully ended.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- TimerValue = 0;
-
- Node = GetDataNode (Handle, Token, Host, NULL, NULL);
- if (!Node) {
- return EFI_NOT_FOUND;
- }
-
- while (Node->GaugeData.EndTick != 0) {
- Node = GetDataNode (Handle, Token, Host, NULL, &(Node->GaugeData));
- if (!Node) {
- return EFI_NOT_FOUND;
- }
- }
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- GetTimerValue (&TimerValue);
- }
-
- Node->GaugeData.EndTick = TimerValue;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_GAUGE_DATA *
-EFIAPI
-GetGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN EFI_GAUGE_DATA *PrevGauge
- )
-/*++
-
-Routine Description:
- Get gauge.
-
-Arguments:
- This - A pointer to the EFI_PERFORMANCE_PROTOCOL.
- Handle - A pointer of a efi handle.
- Token - A pointer to the token.
- Host - A pointer to the host.
- PrevGauge - A pointer to the EFI_GAUGE_DATA structure.
-
-
-Returns:
- Status code.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
-
- Node = GetDataNode (Handle, Token, Host, NULL, PrevGauge);
- if (Node != NULL) {
- return &(Node->GaugeData);
- } else {
- return NULL;
- }
-}
-
-//
-// Driver entry point
-//
-EFI_STATUS
-EFIAPI
-InitializePerformanceInfrastructure (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Install gEfiPerformanceProtocolGuid protocol and transfer PEI performance to gauge data nodes.
-
-Arguments:
-
- ImageHandle - Standard driver entry point parameter
- SystemTable - Standard driver entry point parameter
- Ticker - End tick for PEI performance
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
- EFI_SUCCESS - Protocol installed.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
-
- //
- // Allocate a new image structure
- //
- PerfInstance = EfiLibAllocateZeroPool (sizeof (EFI_PERFORMANCE_INSTANCE));
- if (PerfInstance == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- PerfInstance->Signature = EFI_PERFORMANCE_SIGNATURE;
- PerfInstance->Perf.StartGauge = StartGauge;
- PerfInstance->Perf.EndGauge = EndGauge;
- PerfInstance->Perf.GetGauge = GetGauge;
-
- //
- // Install the protocol interfaces
- //
- Status = gBS->InstallProtocolInterface (
- &PerfInstance->Handle,
- &gEfiPerformanceProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &PerfInstance->Perf
- );
-
- if (!EFI_ERROR (Status)) {
- GetPeiPerformance (ImageHandle, SystemTable, Ticker);
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-StartMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Start to gauge on a specified handle, token and host, with Ticker as start tick.
-
-Arguments:
-
- Handle - Handle to measure
- Token - Token to measure
- Host - Host to measure
- Ticker - Ticker as start tick
-
-Returns:
-
- Status code.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return Perf->StartGauge (Perf, Handle, Token, Host, Ticker);
-
-}
-
-
-EFI_STATUS
-EFIAPI
-EndMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- End gauging on a specified handle, token and host, with Ticker as end tick.
-
-Arguments:
-
- Handle - Handle to stop
- Token - Token to stop
- Host - Host to stop
- Ticker - Ticker as end tick
-
-Returns:
-
- Status code.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (Status != EFI_SUCCESS) {
- return Status;
- }
-
- return (Perf->EndGauge( Perf, Handle, Token, Host, Ticker)) ;
-}
-
-
-EFI_STATUS
-EFIAPI
-UpdateMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- EFI_HANDLE HandleNew,
- IN UINT16 *TokenNew,
- IN UINT16 *HostNew
- )
-/*++
-
-Routine Description:
- Update measure.
-
-Arguments:
- Handle - A pointer of an efi handle.
- Token - A pointer to the token.
- Host - A pointer to the host.
- HandleNew - A pointer of an new efi handle.
- TokenNew - A pointer to the new token.
- HostNew - A pointer to the new host.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - The speicified gauge data node not found.
-
- EFI_SUCCESS - Update successfully.
-
---*/
-{
- EFI_STATUS Status;
- EFI_GAUGE_DATA *GaugeData;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- GaugeData = Perf->GetGauge (Perf, Handle, Token, Host, NULL);
- if (!GaugeData) {
- return EFI_NOT_FOUND;
- }
-
- GaugeData->Handle = HandleNew;
- if (HostNew != NULL) {
- EfiStrCpy (GaugeData->Host, HostNew);
- } else {
- EfiStrCpy (GaugeData->Host, L"");
- }
-
- if (TokenNew != NULL) {
- EfiStrCpy (GaugeData->Token, TokenNew);
- } else {
- EfiStrCpy (GaugeData->Token, L"");
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-GetPeiPerformance (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Transfer PEI performance data to gauge data node.
-
-Arguments:
-
- ImageHandle - Standard entry point parameter
- SystemTable - Standard entry point parameter
- Ticker - Start tick
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough resource to create data node.
- EFI_SUCCESS - Transfer done successfully.
-
---*/
-{
- EFI_STATUS Status;
- VOID *HobList;
- EFI_HOB_GUID_DATA_PERFORMANCE_LOG *LogHob;
- PEI_PERFORMANCE_MEASURE_LOG_ENTRY *LogEntry;
- UINT32 Index;
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- Node = CreateDataNode (0, PEI_TOK, NULL);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Initialize 'LogHob' to NULL before usage.
- //
- LogHob = NULL;
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- GetTimerValue (&TimerValue);
- }
- (Node->GaugeData).EndTick = TimerValue;
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, &HobList);
- do {
- Status = GetNextGuidHob (&HobList, &gEfiPeiPerformanceHobGuid, (VOID **) &LogHob, NULL);
- if (EFI_ERROR (Status) || (LogHob == NULL)) {
- //
- // Failed to get HOB for ProtocolGuid.
- //
- break;
- }
-
- for (Index = 0; Index < LogHob->NumberOfEntries; Index++) {
- LogEntry = &(LogHob->Log[Index]);
- Node = CreateDataNode (0, LogEntry->DescriptionString, NULL);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
- (Node->GaugeData).StartTick = LogEntry->StartTimeCount;
-
- EfiCopyMem (&(Node->GaugeData.GuidName), &LogEntry->Name, sizeof (EFI_GUID));
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- (Node->GaugeData).EndTick = LogEntry->StopTimeCount;
- }
- } while (!EFI_ERROR (Status));
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
deleted file mode 100644
index 6f62a17834..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
+++ /dev/null
@@ -1,224 +0,0 @@
-/*++
-
-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
-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:
-
- ReportStatusCode.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "PeiHob.h"
-#include EFI_PROTOCOL_DEFINITION (DevicePath)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_REPORT_STATUS_CODE gReportStatusCode = NULL;
-
-VOID
-EFIAPI
-OnStatusCodeInstall (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- EFI_STATUS_CODE_PROTOCOL *StatusCode;
-
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **) &StatusCode);
- if (!EFI_ERROR (Status)) {
- gReportStatusCode = StatusCode->ReportStatusCode;
- }
-}
-
-EFI_STATUS
-GetPeiProtocol (
- IN EFI_GUID *ProtocolGuid,
- IN VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Searches for a Protocol Interface passed from PEI through a HOB
-
-Arguments:
-
- ProtocolGuid - The Protocol GUID to search for in the HOB List
- Interface - A pointer to the interface for the Protocol GUID
-
-Returns:
-
- EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
- EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- //
- // Get Hob list
- //
- Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **) &GuidHob.Raw);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
- if (END_OF_HOB_LIST (GuidHob)) {
- Status = EFI_NOT_FOUND;
- break;
- }
-
- if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {
- if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {
- Status = EFI_SUCCESS;
- *Interface = (VOID *) *(UINTN *) (GuidHob.Guid + 1);
- }
- }
-
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
-
-#endif
-
-EFI_STATUS
-EfiLibReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Report device path through status code.
-
-Arguments:
-
- Type - Code type
- Value - Code value
- Instance - Instance number
- CallerId - Caller name
- DevicePath - Device path that to be reported
-
-Returns:
-
- Status code.
-
- EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
-
---*/
-{
- EFI_STATUS Status;
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gReportStatusCode == NULL) {
- //
- // Because we've installed the protocol notification on EfiStatusCodeRuntimeProtocol,
- // running here indicates that the StatusCode driver has not started yet.
- //
- if (gBS == NULL) {
- //
- // Running here only when StatusCode driver never starts.
- //
- return EFI_UNSUPPORTED;
- }
-
- //
- // Try to get the PEI version of ReportStatusCode.
- //
- Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
- if (EFI_ERROR (Status) || (gReportStatusCode == NULL)) {
- return EFI_UNSUPPORTED;
- }
- }
- Status = gReportStatusCode (Type, Value, Instance, CallerId, Data);
-#else
- if (gRT == NULL) {
- return EFI_UNSUPPORTED;
- }
- //
- // Check whether EFI_RUNTIME_SERVICES has Tiano Extension
- //
- Status = EFI_UNSUPPORTED;
- if (gRT->Hdr.Revision == EFI_SPECIFICATION_VERSION &&
- gRT->Hdr.HeaderSize == sizeof (EFI_RUNTIME_SERVICES) &&
- gRT->ReportStatusCode != NULL) {
- Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);
- }
-#endif
- return Status;
-}
-
-EFI_STATUS
-ReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId OPTIONAL,
- IN EFI_DEVICE_PATH_PROTOCOL * DevicePath
- )
-/*++
-
-Routine Description:
-
- Report device path through status code.
-
-Arguments:
-
- Type - Code type
- Value - Code value
- Instance - Instance number
- CallerId - Caller name
- DevicePath - Device path that to be reported
-
-Returns:
-
- Status code.
-
- EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
-
---*/
-{
- UINT16 Size;
- UINT16 DevicePathSize;
- EFI_STATUS_CODE_DATA *ExtendedData;
- EFI_DEVICE_PATH_PROTOCOL *ExtendedDevicePath;
- EFI_STATUS Status;
-
- DevicePathSize = (UINT16) EfiDevicePathSize (DevicePath);
- Size = (UINT16) (DevicePathSize + sizeof (EFI_STATUS_CODE_DATA));
- ExtendedData = (EFI_STATUS_CODE_DATA *) EfiLibAllocatePool (Size);
- if (ExtendedData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- ExtendedDevicePath = EfiConstructStatusCodeData (Size, &gEfiStatusCodeSpecificDataGuid, ExtendedData);
- EfiCopyMem (ExtendedDevicePath, DevicePath, DevicePathSize);
-
- Status = EfiLibReportStatusCode (Type, Value, Instance, CallerId, (EFI_STATUS_CODE_DATA *) ExtendedData);
-
- gBS->FreePool (ExtendedData);
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/X64/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/X64/PerformancePrimitives.c
deleted file mode 100644
index 9f56d0a449..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/X64/PerformancePrimitives.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-#include "CpuIA32.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Set TimerValue with current tick.
-
-Arguments:
-
- TimerValue - Timer value to be set
-
-Returns:
-
- EFI_SUCCESS - TimerValue is set.
-
---*/
-{
- *TimerValue = EfiReadTsc ();
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
deleted file mode 100644
index 5cbbe02104..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiIfrSupportLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiIfrSupportLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- IfrCommon.c
- IfrOnTheFly.c
- IfrOpCodeCreation.c
- IfrLibrary.h
- IfrVariable.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
- EfiGuidLib
- EdkFrameworkProtocolLib
-
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c
deleted file mode 100644
index c0ce1b23f8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrCommon.c
+++ /dev/null
@@ -1,1038 +0,0 @@
-/*++
-Copyright (c) 2004 - 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.
-
-Module Name:
- IfrCommon.c
-
-Abstract:
-
- Common Library Routines to assist in IFR creation on-the-fly
-
---*/
-
-#include "IfrLibrary.h"
-
-EFI_STATUS
-GetCurrentLanguage (
- OUT CHAR16 *Lang
- )
-/*++
-
-Routine Description:
-
- Determine what is the current language setting
-
-Arguments:
-
- Lang - Pointer of system language
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
- UINTN Size;
- UINTN Index;
- CHAR8 Language[4];
-
- //
- // Getting the system language and placing it into our Global Data
- //
- Size = sizeof (Language);
-
- Status = gRT->GetVariable (
- L"Lang",
- &gEfiGlobalVariableGuid,
- NULL,
- &Size,
- Language
- );
-
- if (EFI_ERROR (Status)) {
- EfiAsciiStrCpy (Language, (CHAR8 *) "eng");
- }
-
- for (Index = 0; Index < 3; Index++) {
- //
- // Bitwise AND ascii value with 0xDF yields an uppercase value.
- // Sign extend into a unicode value
- //
- Lang[Index] = (CHAR16) (Language[Index] & 0xDF);
- }
-
- //
- // Null-terminate the value
- //
- Lang[3] = (CHAR16) 0;
-
- return Status;
-}
-
-
-#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API
-EFI_STATUS
-AddString (
- IN VOID *StringBuffer,
- IN CHAR16 *Language,
- IN CHAR16 *String,
- IN OUT STRING_REF *StringToken
- )
-/*++
-
-Routine Description:
-
- Add a string to the incoming buffer and return the token and offset data
-
-Arguments:
-
- StringBuffer - The incoming buffer
-
- Language - Currrent language
-
- String - The string to be added
-
- StringToken - The index where the string placed
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - String successfully added to the incoming buffer
-
---*/
-{
- EFI_HII_STRING_PACK *StringPack;
- EFI_HII_STRING_PACK *StringPackBuffer;
- VOID *NewBuffer;
- RELOFST *PackSource;
- RELOFST *PackDestination;
- UINT8 *Source;
- UINT8 *Destination;
- UINTN Index;
- BOOLEAN Finished;
- UINTN SizeofLanguage;
- UINTN SizeofString;
-
- StringPack = (EFI_HII_STRING_PACK *) StringBuffer;
- Finished = FALSE;
-
- //
- // Pre-allocate a buffer sufficient for us to work on.
- // We will use it as a destination scratch pad to build data on
- // and when complete shift the data back to the original buffer
- //
- NewBuffer = EfiLibAllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);
- if (NewBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- StringPackBuffer = (EFI_HII_STRING_PACK *) NewBuffer;
-
- //
- // StringPack is terminated with a length 0 entry
- //
- for (; StringPack->Header.Length != 0;) {
- //
- // If this stringpack's language is same as CurrentLanguage, use it
- //
- if (EfiCompareMem ((VOID *) ((CHAR8 *) (StringPack) + StringPack->LanguageNameString), Language, 3) == 0) {
- //
- // We have some data in this string pack, copy the string package up to the string data
- //
- EfiCopyMem (&StringPackBuffer->Header, &StringPack->Header, sizeof (StringPack));
-
- //
- // These are references in the structure to tokens, need to increase them by the space occupied by an additional StringPointer
- //
- StringPackBuffer->LanguageNameString = (UINT16) (StringPackBuffer->LanguageNameString + (UINT16) sizeof (RELOFST));
- StringPackBuffer->PrintableLanguageName = (UINT16) (StringPackBuffer->PrintableLanguageName + (UINT16) sizeof (RELOFST));
-
- PackSource = (RELOFST *) (StringPack + 1);
- PackDestination = (RELOFST *) (StringPackBuffer + 1);
- for (Index = 0; PackSource[Index] != 0x0000; Index++) {
- //
- // Copy the stringpointers from old to new buffer
- // remember that we are adding a string, so the string offsets will all go up by sizeof (RELOFST)
- //
- PackDestination[Index] = (UINT16) (PackDestination[Index] + sizeof (RELOFST));
- }
-
- //
- // Add a new stringpointer in the new buffer since we are adding a string. Null terminate it
- //
- PackDestination[Index] = (UINT16)(PackDestination[Index-1] +
- EfiStrSize((CHAR16 *)((CHAR8 *)(StringPack) + PackSource[Index-1])));
- PackDestination[Index + 1] = (UINT16) 0;
-
- //
- // Index is the token value for the new string
- //
- *StringToken = (UINT16) Index;
-
- //
- // Source now points to the beginning of the old buffer strings
- // Destination now points to the beginning of the new buffer strings
- //
- Source = (UINT8 *) &PackSource[Index + 1];
- Destination = (UINT8 *) &PackDestination[Index + 2];
-
- //
- // This should copy all the strings from the old buffer to the new buffer
- //
- for (; Index != 0; Index--) {
- //
- // Copy Source string to destination buffer
- //
- EfiStrCpy ((CHAR16 *) Destination, (CHAR16 *) Source);
-
- //
- // Adjust the source/destination to the next string location
- //
- Destination = Destination + EfiStrSize ((CHAR16 *) Source);
- Source = Source + EfiStrSize ((CHAR16 *) Source);
- }
-
- //
- // This copies the new string to the destination buffer
- //
- EfiStrCpy ((CHAR16 *) Destination, (CHAR16 *) String);
-
- //
- // Adjust the size of the changed string pack by adding the size of the new string
- // along with the size of the additional offset entry for the new string
- //
- StringPackBuffer->Header.Length = (UINT32) ((UINTN) StringPackBuffer->Header.Length + EfiStrSize (String) + sizeof (RELOFST));
-
- //
- // Advance the buffers to point to the next spots.
- //
- StringPackBuffer = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPackBuffer->Header.Length);
- StringPack = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);
- Finished = TRUE;
- continue;
- }
- //
- // This isn't the language of the stringpack we were asked to add a string to
- // so we need to copy it to the new buffer.
- //
- EfiCopyMem (&StringPackBuffer->Header, &StringPack->Header, StringPack->Header.Length);
-
- //
- // Advance the buffers to point to the next spots.
- //
- StringPackBuffer = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPackBuffer) + StringPack->Header.Length);
- StringPack = (EFI_HII_STRING_PACK *) ((CHAR8 *) (StringPack) + StringPack->Header.Length);
- }
-
- //
- // If we didn't copy the new data to a stringpack yet
- //
- if (!Finished) {
- PackDestination = (RELOFST *) (StringPackBuffer + 1);
- //
- // Pointing to a new string pack location
- //
- SizeofLanguage = EfiStrSize (Language);
- SizeofString = EfiStrSize (String);
- StringPackBuffer->Header.Length = (UINT32)
- (
- sizeof (EFI_HII_STRING_PACK) -
- sizeof (EFI_STRING) +
- sizeof (RELOFST) +
- sizeof (RELOFST) +
- SizeofLanguage +
- SizeofString
- );
- StringPackBuffer->Header.Type = EFI_HII_STRING;
- StringPackBuffer->LanguageNameString = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);
- StringPackBuffer->PrintableLanguageName = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);
- StringPackBuffer->Attributes = 0;
- PackDestination[0] = (UINT16) ((UINTN) &PackDestination[3] - (UINTN) StringPackBuffer);
- PackDestination[1] = (UINT16) (PackDestination[0] + EfiStrSize (Language));
- PackDestination[2] = (UINT16) 0;
-
- //
- // The first string location will be set to destination. The minimum number of strings
- // associated with a stringpack will always be token 0 stored as the languagename (e.g. ENG, SPA, etc)
- // and token 1 as the new string being added and and null entry for the stringpointers
- //
- Destination = (CHAR8 *) &PackDestination[3];
-
- //
- // Copy the language name string to the new buffer
- //
- EfiStrCpy ((CHAR16 *) Destination, Language);
-
- //
- // Advance the destination to the new empty spot
- //
- Destination = Destination + EfiStrSize (Language);
-
- //
- // Copy the string to the new buffer
- //
- EfiStrCpy ((CHAR16 *) Destination, String);
-
- //
- // Since we are starting with a new string pack - we know the new string is token 1
- //
- *StringToken = (UINT16) 1;
- }
-
- //
- // Zero out the original buffer and copy the updated data in the new buffer to the old buffer
- //
- EfiZeroMem (StringBuffer, DEFAULT_STRING_BUFFER_SIZE);
- EfiCopyMem (StringBuffer, NewBuffer, DEFAULT_STRING_BUFFER_SIZE);
-
- //
- // Free the newly created buffer since we don't need it anymore
- //
- gBS->FreePool (NewBuffer);
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-AddOpCode (
- IN VOID *FormBuffer,
- IN OUT VOID *OpCodeData
- )
-/*++
-
-Routine Description:
-
- Add op-code data to the FormBuffer
-
-Arguments:
-
- FormBuffer - Form buffer to be inserted to
-
- OpCodeData - Op-code data to be inserted
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Op-code data successfully inserted
-
---*/
-{
- EFI_HII_PACK_HEADER *NewBuffer;
- UINT8 *Source;
- UINT8 *Destination;
-
- //
- // Pre-allocate a buffer sufficient for us to work on.
- // We will use it as a destination scratch pad to build data on
- // and when complete shift the data back to the original buffer
- //
- NewBuffer = EfiLibAllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);
- if (NewBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Source = (UINT8 *) FormBuffer;
- Destination = (UINT8 *) NewBuffer;
-
- //
- // Copy the IFR Package header to the new buffer
- //
- EfiCopyMem (Destination, Source, sizeof (EFI_HII_PACK_HEADER));
-
- //
- // Advance Source and Destination to next op-code
- //
- Source = Source + sizeof (EFI_HII_PACK_HEADER);
- Destination = Destination + sizeof (EFI_HII_PACK_HEADER);
-
- //
- // Copy data to the new buffer until we run into the end_form
- //
- for (; ((EFI_IFR_OP_HEADER *) Source)->OpCode != EFI_IFR_END_FORM_OP;) {
- //
- // If the this opcode is an end_form_set we better be creating and endform
- // Nonetheless, we will add data before the end_form_set. This also provides
- // for interesting behavior in the code we will run, but has no bad side-effects
- // since we will possibly do a 0 byte copy in this particular end-case.
- //
- if (((EFI_IFR_OP_HEADER *) Source)->OpCode == EFI_IFR_END_FORM_SET_OP) {
- break;
- }
-
- //
- // Copy data to new buffer
- //
- EfiCopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
-
- //
- // Adjust Source/Destination to next op-code location
- //
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
- Source = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
- }
-
- //
- // Prior to the end_form is where we insert the new op-code data
- //
- EfiCopyMem (Destination, OpCodeData, ((EFI_IFR_OP_HEADER *) OpCodeData)->Length);
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
-
- NewBuffer->Length = (UINT32) (NewBuffer->Length + (UINT32) (((EFI_IFR_OP_HEADER *) OpCodeData)->Length));
-
- //
- // Copy end-form data to new buffer
- //
- EfiCopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
-
- //
- // Adjust Source/Destination to next op-code location
- //
- Destination = Destination + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
- Source = Source + (UINTN) ((EFI_IFR_OP_HEADER *) Source)->Length;
-
- //
- // Copy end-formset data to new buffer
- //
- EfiCopyMem (Destination, Source, ((EFI_IFR_OP_HEADER *) Source)->Length);
-
- //
- // Zero out the original buffer and copy the updated data in the new buffer to the old buffer
- //
- EfiZeroMem (FormBuffer, DEFAULT_FORM_BUFFER_SIZE);
- EfiCopyMem (FormBuffer, NewBuffer, DEFAULT_FORM_BUFFER_SIZE);
-
- //
- // Free the newly created buffer since we don't need it anymore
- //
- gBS->FreePool (NewBuffer);
- return EFI_SUCCESS;
-}
-#endif
-
-
-EFI_STATUS
-GetHiiInterface (
- OUT EFI_HII_PROTOCOL **Hii
- )
-/*++
-
-Routine Description:
-
- Get the HII protocol interface
-
-Arguments:
-
- Hii - HII protocol interface
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // There should only be one HII protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiProtocolGuid,
- NULL,
- (VOID **) Hii
- );
-
- return Status;;
-}
-
-
-EFI_STATUS
-ExtractDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
- IN OUT UINT16 *ImageLength,
- OUT UINT8 *DefaultImage,
- OUT EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
-
- Extract information pertaining to the HiiHandle
-
-Arguments:
-
- HiiHandle - Hii handle
-
- ImageLength - For input, length of DefaultImage;
- For output, length of actually required
-
- DefaultImage - Image buffer prepared by caller
-
- Guid - Guid information about the form
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength
-
- EFI_SUCCESS - Successfully extract data from Hii database.
-
-
---*/
-{
- EFI_STATUS Status;
- EFI_HII_PROTOCOL *Hii;
- UINTN DataLength;
- UINT8 *RawData;
- UINT8 *OldData;
- UINTN Index;
- UINTN Temp;
- UINTN SizeOfNvStore;
- UINTN CachedStart;
-
- DataLength = DEFAULT_FORM_BUFFER_SIZE;
- SizeOfNvStore = 0;
- CachedStart = 0;
-
- Status = GetHiiInterface (&Hii);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Allocate space for retrieval of IFR data
- //
- RawData = EfiLibAllocateZeroPool ((UINTN) DataLength);
- if (RawData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Get all the forms associated with this HiiHandle
- //
- Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);
-
- if (EFI_ERROR (Status)) {
- gBS->FreePool (RawData);
-
- //
- // Allocate space for retrieval of IFR data
- //
- RawData = EfiLibAllocateZeroPool ((UINTN) DataLength);
- if (RawData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Get all the forms associated with this HiiHandle
- //
- Status = Hii->GetForms (Hii, HiiHandle, 0, &DataLength, RawData);
- }
-
- OldData = RawData;
-
- //
- // Point RawData to the beginning of the form data
- //
- RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));
-
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- switch (RawData[Index]) {
- case EFI_IFR_FORM_SET_OP:
- //
- // Copy the GUID information from this handle
- //
- EfiCopyMem (Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
- break;
-
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_CHECKBOX_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_DATE_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_STRING_OP:
- //
- // Remember, multiple op-codes may reference the same item, so let's keep a running
- // marker of what the highest QuestionId that wasn't zero length. This will accurately
- // maintain the Size of the NvStore
- //
- if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
- Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
- if (SizeOfNvStore < Temp) {
- SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
- }
- }
- }
-
- Index = RawData[Index + 1] + Index;
- }
-
- //
- // Return an error if buffer is too small
- //
- if (SizeOfNvStore > *ImageLength || DefaultImage == NULL) {
- gBS->FreePool (OldData);
- *ImageLength = (UINT16) SizeOfNvStore;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- EfiZeroMem (DefaultImage, SizeOfNvStore);
-
- //
- // Copy the default image information to the user's buffer
- //
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- switch (RawData[Index]) {
- case EFI_IFR_ONE_OF_OP:
- CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
- break;
-
- case EFI_IFR_ONE_OF_OPTION_OP:
- if (((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Flags & EFI_IFR_FLAG_DEFAULT) {
- EfiCopyMem (&DefaultImage[CachedStart], &((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value, 2);
- }
- break;
-
- case EFI_IFR_CHECKBOX_OP:
- DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId] = ((EFI_IFR_CHECK_BOX *) &RawData[Index])->Flags;
- break;
-
- case EFI_IFR_NUMERIC_OP:
- EfiCopyMem (
- &DefaultImage[((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId],
- &((EFI_IFR_NUMERIC *) &RawData[Index])->Default,
- 2
- );
- break;
-
- }
-
- Index = RawData[Index + 1] + Index;
- }
-
- *ImageLength = (UINT16) SizeOfNvStore;
-
- //
- // Free our temporary repository of form data
- //
- gBS->FreePool (OldData);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_HII_HANDLE
-FindHiiHandle (
- IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
- IN EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
- Finds HII handle for given pack GUID previously registered with the HII.
-
-Arguments:
- HiiProtocol - pointer to pointer to HII protocol interface.
- If NULL, the interface will be found but not returned.
- If it points to NULL, the interface will be found and
- written back to the pointer that is pointed to.
- Guid - The GUID of the pack that registered with the HII.
-
-Returns:
- Handle to the HII pack previously registered by the memory driver.
-
---*/
-{
- EFI_STATUS Status;
-
- EFI_HII_HANDLE *HiiHandleBuffer;
- EFI_HII_HANDLE HiiHandle;
- UINT16 HiiHandleBufferLength;
- UINT32 NumberOfHiiHandles;
- EFI_GUID HiiGuid;
- EFI_HII_PROTOCOL *HiiProt;
- UINT32 Index;
- UINT16 Length;
-
- HiiHandle = 0;
- if ((HiiProtocol != NULL) && (*HiiProtocol != NULL)) {
- //
- // The protocol has been passed in
- //
- HiiProt = *HiiProtocol;
- } else {
- gBS->LocateProtocol (
- &gEfiHiiProtocolGuid,
- NULL,
- (VOID **) &HiiProt
- );
- if (HiiProt == NULL) {
- return HiiHandle;
- }
-
- if (HiiProtocol != NULL) {
- //
- // Return back the HII protocol for the caller as promissed
- //
- *HiiProtocol = HiiProt;
- }
- }
- //
- // Allocate buffer
- //
- HiiHandleBufferLength = 10;
- HiiHandleBuffer = EfiLibAllocatePool (HiiHandleBufferLength);
- ASSERT (HiiHandleBuffer != NULL);
-
- //
- // Get the Handles of the packages that were registered with Hii
- //
- Status = HiiProt->FindHandles (
- HiiProt,
- &HiiHandleBufferLength,
- HiiHandleBuffer
- );
-
- //
- // Get a bigger bugffer if this one is to small, and try again
- //
- if (Status == EFI_BUFFER_TOO_SMALL) {
-
- gBS->FreePool (HiiHandleBuffer);
-
- HiiHandleBuffer = EfiLibAllocatePool (HiiHandleBufferLength);
- ASSERT (HiiHandleBuffer != NULL);
-
- Status = HiiProt->FindHandles (
- HiiProt,
- &HiiHandleBufferLength,
- HiiHandleBuffer
- );
- }
-
- if (EFI_ERROR (Status)) {
- goto lbl_exit;
- }
-
- NumberOfHiiHandles = HiiHandleBufferLength / sizeof (EFI_HII_HANDLE);
-
- //
- // Iterate Hii handles and look for the one that matches our Guid
- //
- for (Index = 0; Index < NumberOfHiiHandles; Index++) {
-
- Length = 0;
- ExtractDataFromHiiHandle (HiiHandleBuffer[Index], &Length, NULL, &HiiGuid);
-
- if (EfiCompareGuid (&HiiGuid, Guid)) {
-
- HiiHandle = HiiHandleBuffer[Index];
- break;
- }
- }
-
-lbl_exit:
- gBS->FreePool (HiiHandleBuffer);
- return HiiHandle;
-}
-
-#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API
-EFI_STATUS
-ValidateDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
- OUT BOOLEAN *Results
- )
-/*++
-
-Routine Description:
-
- Validate that the data associated with the HiiHandle in NVRAM is within
- the reasonable parameters for that FormSet. Values for strings and passwords
- are not verified due to their not having the equivalent of valid range settings.
-
-Arguments:
-
- HiiHandle - Handle of the HII database entry to query
-
- Results - If return Status is EFI_SUCCESS, Results provides valid data
- TRUE = NVRAM Data is within parameters
- FALSE = NVRAM Data is NOT within parameters
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Data successfully validated
---*/
-{
- EFI_STATUS Status;
- EFI_HII_PROTOCOL *Hii;
- EFI_GUID Guid;
- UINT8 *RawData;
- UINT8 *OldData;
- UINTN RawDataLength;
- UINT8 *VariableData;
- UINTN Index;
- UINTN Temp;
- UINTN SizeOfNvStore;
- UINTN CachedStart;
- BOOLEAN GotMatch;
-
- RawDataLength = DEFAULT_FORM_BUFFER_SIZE;
- SizeOfNvStore = 0;
- CachedStart = 0;
- GotMatch = FALSE;
- *Results = TRUE;
-
- Status = GetHiiInterface (&Hii);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Allocate space for retrieval of IFR data
- //
- RawData = EfiLibAllocateZeroPool (RawDataLength);
- if (RawData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Get all the forms associated with this HiiHandle
- //
- Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);
-
- if (EFI_ERROR (Status)) {
- gBS->FreePool (RawData);
-
- //
- // Allocate space for retrieval of IFR data
- //
- RawData = EfiLibAllocateZeroPool (RawDataLength);
- if (RawData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Get all the forms associated with this HiiHandle
- //
- Status = Hii->GetForms (Hii, HiiHandle, 0, &RawDataLength, RawData);
- }
-
- OldData = RawData;
-
- //
- // Point RawData to the beginning of the form data
- //
- RawData = (UINT8 *) ((UINTN) RawData + sizeof (EFI_HII_PACK_HEADER));
-
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- if (RawData[Index] == EFI_IFR_FORM_SET_OP) {
- EfiCopyMem (&Guid, &((EFI_IFR_FORM_SET *) &RawData[Index])->Guid, sizeof (EFI_GUID));
- break;
- }
-
- Index = RawData[Index + 1] + Index;
- }
-
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- switch (RawData[Index]) {
- case EFI_IFR_FORM_SET_OP:
- break;
-
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_CHECKBOX_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_DATE_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_STRING_OP:
- //
- // Remember, multiple op-codes may reference the same item, so let's keep a running
- // marker of what the highest QuestionId that wasn't zero length. This will accurately
- // maintain the Size of the NvStore
- //
- if (((EFI_IFR_ONE_OF *) &RawData[Index])->Width != 0) {
- Temp = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
- if (SizeOfNvStore < Temp) {
- SizeOfNvStore = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId + ((EFI_IFR_ONE_OF *) &RawData[Index])->Width;
- }
- }
- }
-
- Index = RawData[Index + 1] + Index;
- }
-
- //
- // Allocate memory for our File Form Tags
- //
- VariableData = EfiLibAllocateZeroPool (SizeOfNvStore);
- if (VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = gRT->GetVariable (
- L"Setup",
- &Guid,
- NULL,
- &SizeOfNvStore,
- (VOID *) VariableData
- );
-
- if (EFI_ERROR (Status)) {
-
- //
- // If there is a variable that exists already and it is larger than what we calculated the
- // storage needs to be, we must assume the variable size from GetVariable is correct and not
- // allow the truncation of the variable. It is very possible that the user who created the IFR
- // we are cracking is not referring to a variable that was in a previous map, however we cannot
- // allow it's truncation.
- //
- if (Status == EFI_BUFFER_TOO_SMALL) {
- //
- // Free the buffer that was allocated that was too small
- //
- gBS->FreePool (VariableData);
-
- VariableData = EfiLibAllocatePool (SizeOfNvStore);
- if (VariableData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = gRT->GetVariable (
- L"Setup",
- &Guid,
- NULL,
- &SizeOfNvStore,
- (VOID *) VariableData
- );
- }
- }
-
- //
- // Walk through the form and see that the variable data it refers to is ok.
- // This allows for the possibility of stale (obsoleted) data in the variable
- // can be overlooked without causing an error
- //
- for (Index = 0; RawData[Index] != EFI_IFR_END_FORM_SET_OP;) {
- switch (RawData[Index]) {
- case EFI_IFR_ONE_OF_OP:
- //
- // A one_of has no data, its the option that does - cache the storage Id
- //
- CachedStart = ((EFI_IFR_ONE_OF *) &RawData[Index])->QuestionId;
- break;
-
- case EFI_IFR_ONE_OF_OPTION_OP:
- //
- // A one_of_option can be any value
- //
- if (VariableData[CachedStart] == ((EFI_IFR_ONE_OF_OPTION *) &RawData[Index])->Value) {
- GotMatch = TRUE;
- }
- break;
-
- case EFI_IFR_END_ONE_OF_OP:
- //
- // At this point lets make sure that the data value in the NVRAM matches one of the options
- //
- if (!GotMatch) {
- *Results = FALSE;
- return EFI_SUCCESS;
- }
- break;
-
- case EFI_IFR_CHECKBOX_OP:
- //
- // A checkbox is a boolean, so 0 and 1 are valid
- // Remember, QuestionId corresponds to the offset location of the data in the variable
- //
- if (VariableData[((EFI_IFR_CHECK_BOX *) &RawData[Index])->QuestionId] > 1) {
- *Results = FALSE;
- return EFI_SUCCESS;
- }
- break;
-
- case EFI_IFR_NUMERIC_OP:
- if ((VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] < ((EFI_IFR_NUMERIC *)&RawData[Index])->Minimum) ||
- (VariableData[((EFI_IFR_NUMERIC *)&RawData[Index])->QuestionId] > ((EFI_IFR_NUMERIC *)&RawData[Index])->Maximum)) {
- *Results = FALSE;
- return EFI_SUCCESS;
- }
- break;
-
- }
-
- Index = RawData[Index + 1] + Index;
- }
-
- //
- // Free our temporary repository of form data
- //
- gBS->FreePool (OldData);
- gBS->FreePool (VariableData);
-
- return EFI_SUCCESS;
-}
-#endif
-
-EFI_HII_PACKAGES *
-PreparePackages (
- IN UINTN NumberOfPackages,
- IN EFI_GUID *GuidId,
- ...
- )
-/*++
-
-Routine Description:
-
- Assemble EFI_HII_PACKAGES according to the passed in packages.
-
-Arguments:
-
- NumberOfPackages - Number of packages.
- GuidId - Package GUID.
-
-Returns:
-
- Pointer of EFI_HII_PACKAGES.
-
---*/
-{
- VA_LIST args;
- EFI_HII_PACKAGES *HiiPackages;
- VOID **Package;
- UINTN Index;
-
- ASSERT (NumberOfPackages > 0);
-
- HiiPackages = EfiLibAllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));
-
- HiiPackages->GuidId = GuidId;
- HiiPackages->NumberOfPackages = NumberOfPackages;
- Package = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));
-
- VA_START (args, GuidId);
-
- for (Index = 0; Index < NumberOfPackages; Index++) {
- *Package = VA_ARG (args, VOID *);
- Package++;
- }
-
- VA_END (args);
-
- return HiiPackages;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h
deleted file mode 100644
index c871f82165..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrLibrary.h
+++ /dev/null
@@ -1,1303 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2005, 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.
-
-Module Name:
-
- IfrLibrary.h
-
-Abstract:
- The file contain all library function for Ifr Operations.
-
---*/
-
-#ifndef _IFRLIBRARY_H
-#define _IFRLIBRARY_H
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-#include EFI_PROTOCOL_DEFINITION (Hii)
-#include EFI_GUID_DEFINITION (GlobalVariable)
-
-#define DEFAULT_FORM_BUFFER_SIZE 0xFFFF
-#define DEFAULT_STRING_BUFFER_SIZE 0xFFFF
-
-#pragma pack(1)
-typedef struct {
- CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation
- STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already)
- UINT16 Value;
- UINT8 Flags;
- UINT16 Key;
-} IFR_OPTION;
-#pragma pack()
-
-EFI_STATUS
-GetCurrentLanguage (
- OUT CHAR16 *Lang
- )
-/*++
-
-Routine Description:
-
- Determine what is the current language setting
-
-Arguments:
-
- Lang - Pointer of system language
-
-Returns:
-
- Status code
-
---*/
-;
-
-#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API
-EFI_STATUS
-AddString (
- IN VOID *StringBuffer,
- IN CHAR16 *Language,
- IN CHAR16 *String,
- IN OUT STRING_REF *StringToken
- )
-/*++
-
-Routine Description:
-
- Add a string to the incoming buffer and return the token and offset data
-
-Arguments:
-
- StringBuffer - The incoming buffer
-
- Language - Currrent language
-
- String - The string to be added
-
- StringToken - The index where the string placed
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - String successfully added to the incoming buffer
-
---*/
-;
-
-EFI_STATUS
-AddOpCode (
- IN VOID *FormBuffer,
- IN OUT VOID *OpCodeData
- )
-/*++
-
-Routine Description:
-
- Add op-code data to the FormBuffer
-
-Arguments:
-
- FormBuffer - Form buffer to be inserted to
-
- OpCodeData - Op-code data to be inserted
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Op-code data successfully inserted
-
---*/
-;
-
-EFI_STATUS
-CreateFormSet (
- IN CHAR16 *FormSetTitle,
- IN EFI_GUID *Guid,
- IN UINT8 Class,
- IN UINT8 SubClass,
- IN OUT VOID **FormBuffer,
- IN OUT VOID **StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a formset
-
-Arguments:
-
- FormSetTitle - Title of formset
-
- Guid - Guid of formset
-
- Class - Class of formset
-
- SubClass - Sub class of formset
-
- FormBuffer - Pointer of the formset created
-
- StringBuffer - Pointer of FormSetTitile string created
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Formset successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateForm (
- IN CHAR16 *FormTitle,
- IN UINT16 FormId,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a form
-
-Arguments:
-
- FormTitle - Title of the form
-
- FormId - Id of the form
-
- FormBuffer - Pointer of the form created
-
- StringBuffer - Pointer of FormTitil string created
-
-Returns:
-
- EFI_SUCCESS - Form successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateSubTitle (
- IN CHAR16 *SubTitle,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a SubTitle
-
-Arguments:
-
- SubTitle - Sub title to be created
-
- FormBuffer - Where this subtitle to add to
-
- StringBuffer - String buffer created for subtitle
-
-Returns:
-
- EFI_SUCCESS - Subtitle successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateText (
- IN CHAR16 *String,
- IN CHAR16 *String2,
- IN CHAR16 *String3,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a line of text
-
-Arguments:
-
- String - First string of the text
-
- String2 - Second string of the text
-
- String3 - Help string of the text
-
- Flags - Flag of the text
-
- Key - Key of the text
-
- FormBuffer - The form where this text adds to
-
- StringBuffer - String buffer created for String, String2 and String3
-
-Returns:
-
- EFI_SUCCESS - Text successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateGoto (
- IN UINT16 FormId,
- IN CHAR16 *Prompt,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a hyperlink
-
-Arguments:
-
- FormId - Form ID of the hyperlink
-
- Prompt - Prompt of the hyperlink
-
- FormBuffer - The form where this hyperlink adds to
-
- StringBuffer - String buffer created for Prompt
-
-Returns:
-
- EFI_SUCCESS - Hyperlink successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateOneOf (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of question with a set of options to choose from. The
- OptionsList is a pointer to a null-terminated list of option descriptions.
-
-Arguments:
-
- QuestionId - Question ID of the one-of box
-
- DataWidth - DataWidth of the one-of box
-
- Prompt - Prompt of the one-of box
-
- Help - Help of the one-of box
-
- OptionsList - Each string in it is an option of the one-of box
-
- OptionCount - Option string count
-
- FormBuffer - The form where this one-of box adds to
-
- StringBuffer - String buffer created for Prompt, Help and Option strings
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
- EFI_SUCCESS - One-Of box successfully created.
-
---*/
-;
-
-EFI_STATUS
-CreateOrderedList (
- IN UINT16 QuestionId,
- IN UINT8 MaxEntries,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of question with a set of options to choose from. The
- OptionsList is a pointer to a null-terminated list of option descriptions.
-
-Arguments:
-
- QuestionId - Question ID of the ordered list
-
- MaxEntries - MaxEntries of the ordered list
-
- Prompt - Prompt of the ordered list
-
- Help - Help of the ordered list
-
- OptionsList - Each string in it is an option of the ordered list
-
- OptionCount - Option string count
-
- FormBuffer - The form where this ordered list adds to
-
- StringBuffer - String buffer created for Prompt, Help and Option strings
-
-Returns:
-
- EFI_SUCCESS - Ordered list successfully created.
-
---*/
-;
-
-EFI_STATUS
-CreateCheckBox (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT8 Flags,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a checkbox
-
-Arguments:
-
- QuestionId - Question ID of the check box
-
- DataWidth - DataWidth of the check box
-
- Prompt - Prompt of the check box
-
- Help - Help of the check box
-
- Flags - Flags of the check box
-
- FormBuffer - The form where this check box adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 1
-
- EFI_SUCCESS - Check box successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateNumeric (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT16 Minimum,
- IN UINT16 Maximum,
- IN UINT16 Step,
- IN UINT16 Default,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric
-
-Arguments:
-
- QuestionId - Question ID of the numeric
-
- DataWidth - DataWidth of the numeric
-
- Prompt - Prompt of the numeric
-
- Help - Help of the numeric
-
- Minimum - Minumun boundary of the numeric
-
- Maximum - Maximum boundary of the numeric
-
- Step - Step of the numeric
-
- Default - Default value
-
- Flags - Flags of the numeric
-
- Key - Key of the numeric
-
- FormBuffer - The form where this numeric adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
- EFI_SUCCESS - Numeric is successfully created
-
---*/
-;
-
-EFI_STATUS
-CreateString (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a string
-
-Arguments:
-
- QuestionId - Question ID of the string
-
- DataWidth - DataWidth of the string
-
- Prompt - Prompt of the string
-
- Help - Help of the string
-
- MinSize - Min size boundary of the string
-
- MaxSize - Max size boundary of the string
-
- Flags - Flags of the string
-
- Key - Key of the string
-
- FormBuffer - The form where this string adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_SUCCESS - String successfully created.
-
---*/
-;
-#endif
-
-EFI_STATUS
-ExtractDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
- IN OUT UINT16 *ImageLength,
- OUT UINT8 *DefaultImage,
- OUT EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
-
- Extract information pertaining to the HiiHandle
-
-Arguments:
-
- HiiHandle - Hii handle
-
- ImageLength - For input, length of DefaultImage;
- For output, length of actually required
-
- DefaultImage - Image buffer prepared by caller
-
- Guid - Guid information about the form
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength
-
- EFI_SUCCESS - Successfully extract data from Hii database.
-
-
---*/
-;
-
-EFI_HII_HANDLE
-FindHiiHandle (
- IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
- IN EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
- Finds HII handle for given pack GUID previously registered with the HII.
-
-Arguments:
- HiiProtocol - pointer to pointer to HII protocol interface.
- If NULL, the interface will be found but not returned.
- If it points to NULL, the interface will be found and
- written back to the pointer that is pointed to.
- Guid - The GUID of the pack that registered with the HII.
-
-Returns:
- Handle to the HII pack previously registered by the memory driver.
-
---*/
-;
-
-EFI_STATUS
-CreateSubTitleOpCode (
- IN STRING_REF StringToken,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a SubTitle opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- StringToken - StringToken of the subtitle
-
- FormBuffer - Output of subtitle as a form
-
-Returns:
-
- EFI_SUCCESS - Subtitle created to be a form
-
---*/
-;
-
-EFI_STATUS
-CreateTextOpCode (
- IN STRING_REF StringToken,
- IN STRING_REF StringTokenTwo,
- IN STRING_REF StringTokenThree,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a Text opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- StringToken - First string token of the text
-
- StringTokenTwo - Second string token of the text
-
- StringTokenThree - Help string token of the text
-
- Flags - Flag of the text
-
- Key - Key of the text
-
- FormBuffer - Output of text as a form
-
-Returns:
-
- EFI_SUCCESS - Text created to be a form
-
---*/
-;
-
-EFI_STATUS
-CreateGotoOpCode (
- IN UINT16 FormId,
- IN STRING_REF StringToken,
- IN STRING_REF StringTokenTwo,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a hyperlink opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- FormId - Form ID of the hyperlink
-
- StringToken - Prompt string token of the hyperlink
-
- StringTokenTwo - Help string token of the hyperlink
-
- Flags - Flags of the hyperlink
-
- Key - Key of the hyperlink
-
- FormBuffer - Output of hyperlink as a form
-
-Returns:
-
- EFI_SUCCESS - Hyperlink created to be a form
-
---*/
-;
-
-EFI_STATUS
-CreateOneOfOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of opcode with a set of option op-codes to choose from independent of string creation.
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
- has been filled in since this routine will not generate StringToken values.
-
-Arguments:
-
- QuestionId - Question ID of the one-of box
-
- DataWidth - DataWidth of the one-of box
-
- PromptToken - Prompt string token of the one-of box
-
- HelpToken - Help string token of the one-of box
-
- OptionsList - Each string in it is an option of the one-of box
-
- OptionCount - Option string count
-
- FormBuffer - Output of One-Of box as a form
-
-Returns:
-
- EFI_SUCCESS - One-Of box created to be a form
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
---*/
-;
-
-EFI_STATUS
-CreateOrderedListOpCode (
- IN UINT16 QuestionId,
- IN UINT8 MaxEntries,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
- has been filled in since this routine will not generate StringToken values.
-
-Arguments:
-
- QuestionId - Question ID of the ordered list
-
- MaxEntries - MaxEntries of the ordered list
-
- PromptToken - Prompt string token of the ordered list
-
- HelpToken - Help string token of the ordered list
-
- OptionsList - Each string in it is an option of the ordered list
-
- OptionCount - Option string count
-
- FormBuffer - Output of ordered list as a form
-
-Returns:
-
- EFI_SUCCESS - Ordered list created to be a form
-
---*/
-;
-
-EFI_STATUS
-CreateCheckBoxOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a checkbox opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the check box
-
- DataWidth - DataWidth of the check box
-
- PromptToken - Prompt string token of the check box
-
- HelpToken - Help string token of the check box
-
- Flags - Flags of the check box
-
- Key - Key of the check box
-
- FormBuffer - Output of the check box as a form
-
-Returns:
-
- EFI_SUCCESS - Checkbox created to be a form
-
- EFI_DEVICE_ERROR - DataWidth > 1
-
---*/
-;
-
-EFI_STATUS
-CreateNumericOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT16 Minimum,
- IN UINT16 Maximum,
- IN UINT16 Step,
- IN UINT16 Default,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the numeric
-
- DataWidth - DataWidth of the numeric
-
- PromptToken - Prompt string token of the numeric
-
- HelpToken - Help string token of the numeric
-
- Minimum - Minumun boundary of the numeric
-
- Maximum - Maximum boundary of the numeric
-
- Step - Step of the numeric
-
- Default - Default value of the numeric
-
- Flags - Flags of the numeric
-
- Key - Key of the numeric
-
- FormBuffer - Output of the numeric as a form
-
-Returns:
-
- EFI_SUCCESS - The numeric created to be a form.
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
---*/
-;
-
-EFI_STATUS
-CreateStringOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the string
-
- DataWidth - DataWidth of the string
-
- PromptToken - Prompt token of the string
-
- HelpToken - Help token of the string
-
- MinSize - Min size boundary of the string
-
- MaxSize - Max size boundary of the string
-
- Flags - Flags of the string
-
- Key - Key of the string
-
- FormBuffer - Output of the string as a form
-
-Returns:
-
- EFI_SUCCESS - String created to be a form.
-
---*/
-;
-
-#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API
-EFI_STATUS
-ValidateDataFromHiiHandle (
- IN EFI_HII_HANDLE HiiHandle,
- OUT BOOLEAN *Results
- )
-/*++
-
-Routine Description:
-
- Validate that the data associated with the HiiHandle in NVRAM is within
- the reasonable parameters for that FormSet. Values for strings and passwords
- are not verified due to their not having the equivalent of valid range settings.
-
-Arguments:
-
- HiiHandle - Handle of the HII database entry to query
-
- Results - If return Status is EFI_SUCCESS, Results provides valid data
- TRUE = NVRAM Data is within parameters
- FALSE = NVRAM Data is NOT within parameters
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Data successfully validated
---*/
-;
-#endif
-
-EFI_STATUS
-CreateBannerOpCode (
- IN UINT16 Title,
- IN UINT16 LineNumber,
- IN UINT8 Alignment,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.
-
-Arguments:
-
- Title - Title of the banner
-
- LineNumber - LineNumber of the banner
-
- Alignment - Alignment of the banner
-
- FormBuffer - Output of banner as a form
-
-Returns:
-
- EFI_SUCCESS - Banner created to be a form.
-
---*/
-;
-
-EFI_HII_PACKAGES *
-PreparePackages (
- IN UINTN NumberOfPackages,
- IN EFI_GUID *GuidId,
- ...
- )
-/*++
-
-Routine Description:
-
- Assemble EFI_HII_PACKAGES according to the passed in packages.
-
-Arguments:
-
- NumberOfPackages - Number of packages.
- GuidId - Package GUID.
-
-Returns:
-
- Pointer of EFI_HII_PACKAGES.
-
---*/
-;
-
-VOID
-EfiLibHiiVariablePackGetMap (
- IN EFI_HII_VARIABLE_PACK *Pack,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT UINT16 *Id, OPTIONAL
- OUT VOID **Var, OPTIONAL
- OUT UINTN *Size OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Extracts a variable form a Pack.
-
-Arguments:
-
- Pack - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- VOID.
-
---*/
-;
-
-UINTN
-EfiLibHiiVariablePackListGetMapCnt (
- IN EFI_HII_VARIABLE_PACK_LIST *List
- )
-/*++
-
-Routine Description:
-
- Finds a count of the variables/maps in the List.
-
-Arguments:
-
- List - List of variables
-
-Returns:
-
- Number of Map in the variable pack list.
-
---*/
-;
-
-typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) (
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINT16 Id,
- IN VOID *Var,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- type definition for the callback to be
- used with EfiLibHiiVariablePackListForEachVar().
-
-Arguments:
-
- Id - Variable/Map ID
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- VOID
-
---*/
-;
-
-VOID
-EfiLibHiiVariablePackListForEachVar (
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback
- )
-/*++
-
-Routine Description:
-
- Will iterate all variable/maps as appearing
- in List and for each, it will call the Callback.
-
-Arguments:
-
- List - List of variables
- Callback - Routine to be called for each iterated variable.
-
-Returns:
-
- VOID
-
---*/
-;
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMapByIdx (
- IN UINTN Idx,
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT UINT16 *Id, OPTIONAL
- OUT VOID **Var,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- Finds a variable form List given
- the order number as appears in the List.
-
-Arguments:
-
- Idx - The index of the variable/map to retrieve
- List - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- EFI_SUCCESS - Variable is found, OUT parameters are valid
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
-
---*/
-;
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMapById (
- IN UINT16 Id,
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT VOID **Var,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- Finds a variable form List given the
- order number as appears in the List.
-
-Arguments:
-
- Id - The ID of the variable/map to retrieve
- List - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- EFI_SUCCESS - Variable is found, OUT parameters are valid
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
-
---*/
-;
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMap (
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- OUT UINT16 *Id,
- OUT VOID **Var,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.
-
-Arguments:
-
- List - List of variables
- Name - Name of the variable/map to be found
- Guid - GUID of the variable/map to be found
- Var - Pointer to the variable/map found
- Size - Size of the variable/map in bytes found
-
-Returns:
-
- EFI_SUCCESS - variable is found, OUT parameters are valid
- EFI_NOT_FOUND - variable is not found, OUT parameters are not valid
-
---*/
-;
-
-EFI_STATUS
-EfiLibHiiVariableRetrieveFromNv (
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID **Var
- )
-/*++
-
-Routine Description:
- Finds out if a variable of specific Name/Guid/Size exists in NV.
- If it does, it will retrieve it into the Var.
-
-Arguments:
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into buffer pointed by this pointer.
- If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.
-Returns:
- EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-;
-
-////
-//// Variable override support.
-////
-
-EFI_STATUS
-EfiLibHiiVariableOverrideIfSuffix (
- IN CHAR16 *Suffix,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID *Var
- )
-/*++
-
-Routine Description:
- Overrrides the variable with NV data if found.
- But it only does it if the Name ends with specified Suffix.
- For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",
- the Suffix matches the end of Name, so the variable will be loaded from NV
- provided the variable exists and the GUID and Size matches.
-
-Arguments:
- Suffix - Suffix the Name should end with.
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into this buffer.
- Caller is responsible for providing storage of exactly Size size in bytes.
-Returns:
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
- EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-;
-
-EFI_STATUS
-EfiLibHiiVariableOverrideBySuffix (
- IN CHAR16 *Suffix,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID *Var
- )
-/*++
-
-Routine Description:
- Overrrides the variable with NV data if found.
- But it only does it if the NV contains the same variable with Name is appended with Suffix.
- For example, if Suffix="MyOverride" and the Name="XyzSetup",
- the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"
- will be loaded from NV provided the variable exists and the GUID and Size matches.
-
-Arguments:
- Suffix - Suffix the variable will be appended with.
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into this buffer.
- Caller is responsible for providing storage of exactly Size size in bytes.
-
-Returns:
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOnTheFly.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOnTheFly.c
deleted file mode 100644
index 1cc84a6948..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOnTheFly.c
+++ /dev/null
@@ -1,979 +0,0 @@
-/*++
-Copyright (c) 2004, 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.
-
-Module Name:
- IfrOnTheFly.c
-
-Abstract:
-
- Library Routines to create IFR on-the-fly
-
-Revision History:
-
---*/
-
-#include "IfrLibrary.h"
-
-#ifdef SUPPORT_DEPRECATED_IFRSUPPORTLIB_API
-
-EFI_STATUS
-CreateFormSet (
- IN CHAR16 *FormSetTitle,
- IN EFI_GUID *Guid,
- IN UINT8 Class,
- IN UINT8 SubClass,
- IN OUT VOID **FormBuffer,
- IN OUT VOID **StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a formset
-
-Arguments:
-
- FormSetTitle - Title of formset
-
- Guid - Guid of formset
-
- Class - Class of formset
-
- SubClass - Sub class of formset
-
- FormBuffer - Pointer of the formset created
-
- StringBuffer - Pointer of FormSetTitile string created
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
- EFI_SUCCESS - Formset successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_HII_IFR_PACK IfrPack;
- EFI_IFR_FORM_SET FormSet;
- EFI_IFR_END_FORM_SET EndFormSet;
- UINT8 *Destination;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Pre-allocate a buffer sufficient for us to work from.
- //
- FormBuffer = EfiLibAllocateZeroPool (DEFAULT_FORM_BUFFER_SIZE);
- if (FormBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Pre-allocate a buffer sufficient for us to work from.
- //
- StringBuffer = EfiLibAllocateZeroPool (DEFAULT_STRING_BUFFER_SIZE);
- if (StringBuffer == NULL) {
- gBS->FreePool (FormBuffer);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add the FormSetTitle to the string buffer and get the StringToken
- //
- Status = AddString (*StringBuffer, CurrentLanguage, FormSetTitle, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Initialize the Ifr Package header data
- //
- IfrPack.Header.Length = sizeof (EFI_HII_PACK_HEADER) + sizeof (EFI_IFR_FORM_SET) + sizeof (EFI_IFR_END_FORM_SET);
- IfrPack.Header.Type = EFI_HII_IFR;
-
- //
- // Initialize FormSet with the appropriate information
- //
- FormSet.Header.OpCode = EFI_IFR_FORM_SET_OP;
- FormSet.Header.Length = sizeof (EFI_IFR_FORM_SET);
- FormSet.FormSetTitle = StringToken;
- FormSet.Class = Class;
- FormSet.SubClass = SubClass;
- EfiCopyMem (&FormSet.Guid, Guid, sizeof (EFI_GUID));
-
- //
- // Initialize the end formset data
- //
- EndFormSet.Header.Length = sizeof (EFI_IFR_END_FORM_SET);
- EndFormSet.Header.OpCode = EFI_IFR_END_FORM_SET_OP;
-
- Destination = (CHAR8 *) *FormBuffer;
-
- //
- // Copy the formset/endformset data to the form buffer
- //
- EfiCopyMem (Destination, &IfrPack, sizeof (EFI_HII_PACK_HEADER));
-
- Destination = Destination + sizeof (EFI_HII_PACK_HEADER);
-
- EfiCopyMem (Destination, &FormSet, sizeof (EFI_IFR_FORM_SET));
-
- Destination = Destination + sizeof (EFI_IFR_FORM_SET);
-
- EfiCopyMem (Destination, &EndFormSet, sizeof (EFI_IFR_END_FORM_SET));
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateForm (
- IN CHAR16 *FormTitle,
- IN UINT16 FormId,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a form
-
-Arguments:
-
- FormTitle - Title of the form
-
- FormId - Id of the form
-
- FormBuffer - Pointer of the form created
-
- StringBuffer - Pointer of FormTitil string created
-
-Returns:
-
- EFI_SUCCESS - Form successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_FORM Form;
- EFI_IFR_END_FORM EndForm;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- Status = AddString (StringBuffer, CurrentLanguage, FormTitle, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Form.Header.OpCode = EFI_IFR_FORM_OP;
- Form.Header.Length = sizeof (EFI_IFR_FORM);
- Form.FormId = FormId;
- Form.FormTitle = StringToken;
-
- Status = AddOpCode (FormBuffer, &Form);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- EndForm.Header.OpCode = EFI_IFR_END_FORM_OP;
- EndForm.Header.Length = sizeof (EFI_IFR_END_FORM);
-
- Status = AddOpCode (FormBuffer, &EndForm);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateSubTitle (
- IN CHAR16 *SubTitle,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a SubTitle
-
-Arguments:
-
- SubTitle - Sub title to be created
-
- FormBuffer - Where this subtitle to add to
-
- StringBuffer - String buffer created for subtitle
-
-Returns:
-
- EFI_SUCCESS - Subtitle successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_SUBTITLE Subtitle;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- Status = AddString (StringBuffer, CurrentLanguage, SubTitle, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Subtitle.Header.OpCode = EFI_IFR_SUBTITLE_OP;
- Subtitle.Header.Length = sizeof (EFI_IFR_SUBTITLE);
- Subtitle.SubTitle = StringToken;
-
- Status = AddOpCode (FormBuffer, &Subtitle);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateText (
- IN CHAR16 *String,
- IN CHAR16 *String2,
- IN CHAR16 *String3,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a line of text
-
-Arguments:
-
- String - First string of the text
-
- String2 - Second string of the text
-
- String3 - Help string of the text
-
- Flags - Flag of the text
-
- Key - Key of the text
-
- FormBuffer - The form where this text adds to
-
- StringBuffer - String buffer created for String, String2 and String3
-
-Returns:
-
- EFI_SUCCESS - Text successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_TEXT Text;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, String, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Text.Header.OpCode = EFI_IFR_TEXT_OP;
- Text.Header.Length = sizeof (EFI_IFR_TEXT);
- Text.Text = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, String2, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Text.TextTwo = StringToken;
-
- Text.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
- Text.Key = Key;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, String3, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Text.Help = StringToken;
-
- Status = AddOpCode (FormBuffer, &Text);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateGoto (
- IN UINT16 FormId,
- IN CHAR16 *Prompt,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a hyperlink
-
-Arguments:
-
- FormId - Form ID of the hyperlink
-
- Prompt - Prompt of the hyperlink
-
- FormBuffer - The form where this hyperlink adds to
-
- StringBuffer - String buffer created for Prompt
-
-Returns:
-
- EFI_SUCCESS - Hyperlink successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_REF Hyperlink;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hyperlink.Header.OpCode = EFI_IFR_REF_OP;
- Hyperlink.Header.Length = sizeof (EFI_IFR_REF);
- Hyperlink.FormId = FormId;
- Hyperlink.Prompt = StringToken;
-
- Status = AddOpCode (FormBuffer, &Hyperlink);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateOneOf (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of question with a set of options to choose from. The
- OptionsList is a pointer to a null-terminated list of option descriptions.
-
-Arguments:
-
- QuestionId - Question ID of the one-of box
-
- DataWidth - DataWidth of the one-of box
-
- Prompt - Prompt of the one-of box
-
- Help - Help of the one-of box
-
- OptionsList - Each string in it is an option of the one-of box
-
- OptionCount - Option string count
-
- FormBuffer - The form where this one-of box adds to
-
- StringBuffer - String buffer created for Prompt, Help and Option strings
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
- EFI_SUCCESS - One-Of box successfully created.
-
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- EFI_IFR_ONE_OF OneOf;
- EFI_IFR_ONE_OF_OPTION OneOfOption;
- EFI_IFR_END_ONE_OF EndOneOf;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // We do not create op-code storage widths for one-of in excess of 16 bits for now
- //
- if (DataWidth > 2) {
- return EFI_DEVICE_ERROR;
- }
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;
- OneOf.Header.Length = sizeof (EFI_IFR_ONE_OF);
- OneOf.QuestionId = QuestionId;
- OneOf.Width = DataWidth;
- OneOf.Prompt = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- OneOf.Help = StringToken;
-
- Status = AddOpCode (FormBuffer, &OneOf);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Index = 0; Index < OptionCount; Index++) {
- OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
-
- //
- // Add string and get token back
- //
- Status = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);
-
- OneOfOption.Option = StringToken;
- OneOfOption.Value = OptionsList[Index].Value;
- OneOfOption.Flags = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);
- OneOfOption.Key = OptionsList[Index].Key;
-
- Status = AddOpCode (FormBuffer, &OneOfOption);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- EndOneOf.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOneOf.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
-
- Status = AddOpCode (FormBuffer, &EndOneOf);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateOrderedList (
- IN UINT16 QuestionId,
- IN UINT8 MaxEntries,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of question with a set of options to choose from. The
- OptionsList is a pointer to a null-terminated list of option descriptions.
-
-Arguments:
-
- QuestionId - Question ID of the ordered list
-
- MaxEntries - MaxEntries of the ordered list
-
- Prompt - Prompt of the ordered list
-
- Help - Help of the ordered list
-
- OptionsList - Each string in it is an option of the ordered list
-
- OptionCount - Option string count
-
- FormBuffer - The form where this ordered list adds to
-
- StringBuffer - String buffer created for Prompt, Help and Option strings
-
-Returns:
-
- EFI_SUCCESS - Ordered list successfully created.
-
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- EFI_IFR_ORDERED_LIST OrderedList;
- EFI_IFR_ONE_OF_OPTION OrderedListOption;
- EFI_IFR_END_ONE_OF EndOrderedList;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
- OrderedList.Header.Length = sizeof (EFI_IFR_ORDERED_LIST);
- OrderedList.QuestionId = QuestionId;
- OrderedList.MaxEntries = MaxEntries;
- OrderedList.Prompt = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- OrderedList.Help = StringToken;
-
- Status = AddOpCode (FormBuffer, &OrderedList);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Index = 0; Index < OptionCount; Index++) {
- OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OrderedListOption.Header.Length = sizeof (EFI_IFR_ONE_OF_OPTION);
-
- //
- // Add string and get token back
- //
- Status = AddString (StringBuffer, CurrentLanguage, OptionsList[Index].OptionString, &StringToken);
-
- OrderedListOption.Option = StringToken;
- OrderedListOption.Value = OptionsList[Index].Value;
- OrderedListOption.Flags = (UINT8) (OptionsList[Index].Flags | EFI_IFR_FLAG_CREATED);
- OrderedListOption.Key = OptionsList[Index].Key;
-
- Status = AddOpCode (FormBuffer, &OrderedListOption);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
-
- EndOrderedList.Header.Length = sizeof (EFI_IFR_END_ONE_OF);
- EndOrderedList.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
-
- Status = AddOpCode (FormBuffer, &EndOrderedList);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateCheckBox (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT8 Flags,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a checkbox
-
-Arguments:
-
- QuestionId - Question ID of the check box
-
- DataWidth - DataWidth of the check box
-
- Prompt - Prompt of the check box
-
- Help - Help of the check box
-
- Flags - Flags of the check box
-
- FormBuffer - The form where this check box adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 1
-
- EFI_SUCCESS - Check box successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_CHECK_BOX CheckBox;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // We do not create op-code storage widths for checkbox in excess of 8 bits for now
- //
- if (DataWidth > 1) {
- return EFI_DEVICE_ERROR;
- }
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- CheckBox.Header.OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox.Header.Length = sizeof (EFI_IFR_CHECK_BOX);
- CheckBox.QuestionId = QuestionId;
- CheckBox.Width = DataWidth;
- CheckBox.Prompt = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- CheckBox.Help = StringToken;
- CheckBox.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
-
- Status = AddOpCode (FormBuffer, &CheckBox);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateNumeric (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT16 Minimum,
- IN UINT16 Maximum,
- IN UINT16 Step,
- IN UINT16 Default,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric
-
-Arguments:
-
- QuestionId - Question ID of the numeric
-
- DataWidth - DataWidth of the numeric
-
- Prompt - Prompt of the numeric
-
- Help - Help of the numeric
-
- Minimum - Minumun boundary of the numeric
-
- Maximum - Maximum boundary of the numeric
-
- Step - Step of the numeric
-
- Default - Default value
-
- Flags - Flags of the numeric
-
- Key - Key of the numeric
-
- FormBuffer - The form where this numeric adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
- EFI_SUCCESS - Numeric is successfully created
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_NUMERIC Numeric;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // We do not create op-code storage widths for numerics in excess of 16 bits for now
- //
- if (DataWidth > 2) {
- return EFI_DEVICE_ERROR;
- }
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;
- Numeric.Header.Length = sizeof (EFI_IFR_NUMERIC);
- Numeric.QuestionId = QuestionId;
- Numeric.Width = DataWidth;
- Numeric.Prompt = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Numeric.Help = StringToken;
- Numeric.Minimum = Minimum;
- Numeric.Maximum = Maximum;
- Numeric.Step = Step;
- Numeric.Default = Default;
- Numeric.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
- Numeric.Key = Key;
-
- Status = AddOpCode (FormBuffer, &Numeric);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateString (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN CHAR16 *Prompt,
- IN CHAR16 *Help,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer,
- IN OUT VOID *StringBuffer
- )
-/*++
-
-Routine Description:
-
- Create a string
-
-Arguments:
-
- QuestionId - Question ID of the string
-
- DataWidth - DataWidth of the string
-
- Prompt - Prompt of the string
-
- Help - Help of the string
-
- MinSize - Min size boundary of the string
-
- MaxSize - Max size boundary of the string
-
- Flags - Flags of the string
-
- Key - Key of the string
-
- FormBuffer - The form where this string adds to
-
- StringBuffer - String buffer created for Prompt and Help.
-
-Returns:
-
- EFI_SUCCESS - String successfully created.
-
---*/
-{
- EFI_STATUS Status;
- EFI_IFR_STRING String;
- CHAR16 CurrentLanguage[4];
- STRING_REF StringToken;
-
- //
- // Obtain current language value
- //
- GetCurrentLanguage (CurrentLanguage);
-
- //
- // Add first string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Prompt, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- String.Header.OpCode = EFI_IFR_STRING_OP;
- String.Header.Length = sizeof (EFI_IFR_STRING);
- String.QuestionId = QuestionId;
- String.Width = DataWidth;
- String.Prompt = StringToken;
-
- //
- // Add second string, get first string's token
- //
- Status = AddString (StringBuffer, CurrentLanguage, Help, &StringToken);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- String.Help = StringToken;
- String.MinSize = MinSize;
- String.MaxSize = MaxSize;
- String.Flags = (UINT8) (Flags | EFI_IFR_FLAG_CREATED);
- String.Key = Key;
-
- Status = AddOpCode (FormBuffer, &String);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c
deleted file mode 100644
index 30436d5de1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrOpCodeCreation.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*++
-Copyright (c) 2004, 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.
-
-Module Name:
- IfrOpCodeCreation.c
-
-Abstract:
-
- Library Routines to create IFR independent of string data - assume tokens already exist
- Primarily to be used for exporting op-codes at a label in pre-defined forms.
-
-Revision History:
-
---*/
-
-#include "IfrLibrary.h"
-
-EFI_STATUS
-CreateSubTitleOpCode (
- IN STRING_REF StringToken,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a SubTitle opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- StringToken - StringToken of the subtitle
-
- FormBuffer - Output of subtitle as a form
-
-Returns:
-
- EFI_SUCCESS - Subtitle created to be a form
-
---*/
-{
- EFI_IFR_SUBTITLE Subtitle;
-
- Subtitle.Header.OpCode = EFI_IFR_SUBTITLE_OP;
- Subtitle.Header.Length = (UINT8) sizeof (EFI_IFR_SUBTITLE);
- Subtitle.SubTitle = StringToken;
-
- EfiCopyMem (FormBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateTextOpCode (
- IN STRING_REF StringToken,
- IN STRING_REF StringTokenTwo,
- IN STRING_REF StringTokenThree,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a Text opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- StringToken - First string token of the text
-
- StringTokenTwo - Second string token of the text
-
- StringTokenThree - Help string token of the text
-
- Flags - Flag of the text
-
- Key - Key of the text
-
- FormBuffer - Output of text as a form
-
-Returns:
-
- EFI_SUCCESS - Text created to be a form
-
---*/
-{
- EFI_IFR_TEXT Text;
-
- Text.Header.OpCode = EFI_IFR_TEXT_OP;
- Text.Header.Length = (UINT8) sizeof (EFI_IFR_TEXT);
- Text.Text = StringToken;
-
- Text.TextTwo = StringTokenTwo;
- Text.Help = StringTokenThree;
- Text.Flags = Flags;
- Text.Key = Key;
-
- EfiCopyMem (FormBuffer, &Text, sizeof (EFI_IFR_TEXT));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateGotoOpCode (
- IN UINT16 FormId,
- IN STRING_REF StringToken,
- IN STRING_REF StringTokenTwo,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a hyperlink opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- FormId - Form ID of the hyperlink
-
- StringToken - Prompt string token of the hyperlink
-
- StringTokenTwo - Help string token of the hyperlink
-
- Flags - Flags of the hyperlink
-
- Key - Key of the hyperlink
-
- FormBuffer - Output of hyperlink as a form
-
-Returns:
-
- EFI_SUCCESS - Hyperlink created to be a form
-
---*/
-{
- EFI_IFR_REF Hyperlink;
-
- Hyperlink.Header.OpCode = EFI_IFR_REF_OP;
- Hyperlink.Header.Length = (UINT8) sizeof (EFI_IFR_REF);
- Hyperlink.FormId = FormId;
- Hyperlink.Prompt = StringToken;
- Hyperlink.Help = StringTokenTwo;
- Hyperlink.Key = Key;
- Hyperlink.Flags = Flags;
-
- EfiCopyMem (FormBuffer, &Hyperlink, sizeof (EFI_IFR_REF));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateOneOfOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a one-of opcode with a set of option op-codes to choose from independent of string creation.
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
- has been filled in since this routine will not generate StringToken values.
-
-Arguments:
-
- QuestionId - Question ID of the one-of box
-
- DataWidth - DataWidth of the one-of box
-
- PromptToken - Prompt string token of the one-of box
-
- HelpToken - Help string token of the one-of box
-
- OptionsList - Each string in it is an option of the one-of box
-
- OptionCount - Option string count
-
- FormBuffer - Output of One-Of box as a form
-
-Returns:
-
- EFI_SUCCESS - One-Of box created to be a form
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
---*/
-{
- UINTN Index;
- EFI_IFR_ONE_OF OneOf;
- EFI_IFR_ONE_OF_OPTION OneOfOption;
- EFI_IFR_END_ONE_OF EndOneOf;
- UINT8 *LocalBuffer;
-
- //
- // We do not create op-code storage widths for one-of in excess of 16 bits for now
- //
- if (DataWidth > 2) {
- return EFI_DEVICE_ERROR;
- }
-
- OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;
- OneOf.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF);
- OneOf.QuestionId = QuestionId;
- OneOf.Width = DataWidth;
- OneOf.Prompt = PromptToken;
-
- OneOf.Help = HelpToken;
-
- LocalBuffer = (UINT8 *) FormBuffer;
-
- EfiCopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF));
-
- for (Index = 0; Index < OptionCount; Index++) {
- OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF_OPTION);
-
- OneOfOption.Option = OptionsList[Index].StringToken;
- OneOfOption.Value = OptionsList[Index].Value;
- OneOfOption.Flags = OptionsList[Index].Flags;
- OneOfOption.Key = OptionsList[Index].Key;
-
- EfiCopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
- }
-
- EndOneOf.Header.Length = (UINT8) sizeof (EFI_IFR_END_ONE_OF);
- EndOneOf.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
-
- EfiCopyMem (LocalBuffer, &EndOneOf, sizeof (EFI_IFR_END_ONE_OF));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateOrderedListOpCode (
- IN UINT16 QuestionId,
- IN UINT8 MaxEntries,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a ordered list opcode with a set of option op-codes to choose from independent of string creation.
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
- OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken
- has been filled in since this routine will not generate StringToken values.
-
-Arguments:
-
- QuestionId - Question ID of the ordered list
-
- MaxEntries - MaxEntries of the ordered list
-
- PromptToken - Prompt string token of the ordered list
-
- HelpToken - Help string token of the ordered list
-
- OptionsList - Each string in it is an option of the ordered list
-
- OptionCount - Option string count
-
- FormBuffer - Output of ordered list as a form
-
-Returns:
-
- EFI_SUCCESS - Ordered list created to be a form
-
---*/
-{
- UINTN Index;
- EFI_IFR_ORDERED_LIST OrderedList;
- EFI_IFR_ONE_OF_OPTION OrderedListOption;
- EFI_IFR_END_ONE_OF EndOrderedList;
- UINT8 *LocalBuffer;
-
- OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
- OrderedList.Header.Length = (UINT8) sizeof (EFI_IFR_ORDERED_LIST);
- OrderedList.QuestionId = QuestionId;
- OrderedList.MaxEntries = MaxEntries;
- OrderedList.Prompt = PromptToken;
-
- OrderedList.Help = HelpToken;
-
- LocalBuffer = (UINT8 *) FormBuffer;
-
- EfiCopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ORDERED_LIST));
-
- for (Index = 0; Index < OptionCount; Index++) {
- OrderedListOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OrderedListOption.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF_OPTION);
-
- OrderedListOption.Option = OptionsList[Index].StringToken;
- OrderedListOption.Value = OptionsList[Index].Value;
- OrderedListOption.Flags = OptionsList[Index].Flags;
- OrderedListOption.Key = OptionsList[Index].Key;
-
- EfiCopyMem (LocalBuffer, &OrderedListOption, sizeof (EFI_IFR_ONE_OF_OPTION));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_ONE_OF_OPTION));
- }
-
- EndOrderedList.Header.Length = (UINT8) sizeof (EFI_IFR_END_ONE_OF);
- EndOrderedList.Header.OpCode = EFI_IFR_END_ONE_OF_OP;
-
- EfiCopyMem (LocalBuffer, &EndOrderedList, sizeof (EFI_IFR_END_ONE_OF));
-
- LocalBuffer = (UINT8 *) (LocalBuffer + sizeof (EFI_IFR_END_ONE_OF));
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateCheckBoxOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a checkbox opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the check box
-
- DataWidth - DataWidth of the check box
-
- PromptToken - Prompt string token of the check box
-
- HelpToken - Help string token of the check box
-
- Flags - Flags of the check box
-
- Key - Key of the check box
-
- FormBuffer - Output of the check box as a form
-
-Returns:
-
- EFI_SUCCESS - Checkbox created to be a form
-
- EFI_DEVICE_ERROR - DataWidth > 1
-
---*/
-{
- EFI_IFR_CHECK_BOX CheckBox;
-
- //
- // We do not create op-code storage widths for checkbox in excess of 8 bits for now
- //
- if (DataWidth > 1) {
- return EFI_DEVICE_ERROR;
- }
-
- CheckBox.Header.OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox.Header.Length = (UINT8) sizeof (EFI_IFR_CHECK_BOX);
- CheckBox.QuestionId = QuestionId;
- CheckBox.Width = DataWidth;
- CheckBox.Prompt = PromptToken;
-
- CheckBox.Help = HelpToken;
- CheckBox.Flags = Flags;
- CheckBox.Key = Key;
-
- EfiCopyMem (FormBuffer, &CheckBox, sizeof (EFI_IFR_CHECK_BOX));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateNumericOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT16 Minimum,
- IN UINT16 Maximum,
- IN UINT16 Step,
- IN UINT16 Default,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the numeric
-
- DataWidth - DataWidth of the numeric
-
- PromptToken - Prompt string token of the numeric
-
- HelpToken - Help string token of the numeric
-
- Minimum - Minumun boundary of the numeric
-
- Maximum - Maximum boundary of the numeric
-
- Step - Step of the numeric
-
- Default - Default value of the numeric
-
- Flags - Flags of the numeric
-
- Key - Key of the numeric
-
- FormBuffer - Output of the numeric as a form
-
-Returns:
-
- EFI_SUCCESS - The numeric created to be a form.
-
- EFI_DEVICE_ERROR - DataWidth > 2
-
---*/
-{
- EFI_IFR_NUMERIC Numeric;
-
- //
- // We do not create op-code storage widths for numerics in excess of 16 bits for now
- //
- if (DataWidth > 2) {
- return EFI_DEVICE_ERROR;
- }
-
- Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;
- Numeric.Header.Length = (UINT8) sizeof (EFI_IFR_NUMERIC);
- Numeric.QuestionId = QuestionId;
- Numeric.Width = DataWidth;
- Numeric.Prompt = PromptToken;
-
- Numeric.Help = HelpToken;
- Numeric.Minimum = Minimum;
- Numeric.Maximum = Maximum;
- Numeric.Step = Step;
- Numeric.Default = Default;
- Numeric.Flags = Flags;
- Numeric.Key = Key;
-
- EfiCopyMem (FormBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateStringOpCode (
- IN UINT16 QuestionId,
- IN UINT8 DataWidth,
- IN STRING_REF PromptToken,
- IN STRING_REF HelpToken,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN UINT8 Flags,
- IN UINT16 Key,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a numeric opcode independent of string creation
- This is used primarily by users who need to create just one particular valid op-code and the string
- data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label
- location to pre-defined forms in HII)
-
-Arguments:
-
- QuestionId - Question ID of the string
-
- DataWidth - DataWidth of the string
-
- PromptToken - Prompt token of the string
-
- HelpToken - Help token of the string
-
- MinSize - Min size boundary of the string
-
- MaxSize - Max size boundary of the string
-
- Flags - Flags of the string
-
- Key - Key of the string
-
- FormBuffer - Output of the string as a form
-
-Returns:
-
- EFI_SUCCESS - String created to be a form.
-
---*/
-{
- EFI_IFR_STRING String;
-
- String.Header.OpCode = EFI_IFR_STRING_OP;
- String.Header.Length = (UINT8) sizeof (EFI_IFR_STRING);
- String.QuestionId = QuestionId;
- String.Width = DataWidth;
- String.Prompt = PromptToken;
-
- String.Help = HelpToken;
- String.MinSize = MinSize;
- String.MaxSize = MaxSize;
- String.Flags = Flags;
- String.Key = Key;
-
- EfiCopyMem (FormBuffer, &String, sizeof (EFI_IFR_STRING));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateBannerOpCode (
- IN UINT16 Title,
- IN UINT16 LineNumber,
- IN UINT8 Alignment,
- IN OUT VOID *FormBuffer
- )
-/*++
-
-Routine Description:
-
- Create a banner opcode. This is primarily used by the FrontPage implementation from BDS.
-
-Arguments:
-
- Title - Title of the banner
-
- LineNumber - LineNumber of the banner
-
- Alignment - Alignment of the banner
-
- FormBuffer - Output of banner as a form
-
-Returns:
-
- EFI_SUCCESS - Banner created to be a form.
-
---*/
-{
- EFI_IFR_BANNER Banner;
-
- Banner.Header.OpCode = EFI_IFR_BANNER_OP;
- Banner.Header.Length = (UINT8) sizeof (EFI_IFR_BANNER);
- EfiCopyMem (&Banner.Title, &Title, sizeof (UINT16));
- EfiCopyMem (&Banner.LineNumber, &LineNumber, sizeof (UINT16));
- Banner.Alignment = Alignment;
-
- EfiCopyMem (FormBuffer, &Banner, sizeof (EFI_IFR_BANNER));
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrVariable.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrVariable.c
deleted file mode 100644
index 541a4cccf9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/IfrVariable.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
- IfrVariable.c
-
-Abstract:
- Variable/Map manipulations routines
-
---*/
-
-#include "IfrLibrary.h"
-
-VOID
-EfiLibHiiVariablePackGetMap (
- IN EFI_HII_VARIABLE_PACK *Pack,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT UINT16 *Id, OPTIONAL
- OUT VOID **Var, OPTIONAL
- OUT UINTN *Size OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Extracts a variable form a Pack.
-
-Arguments:
-
- Pack - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- VOID
-
---*/
-{
- if (NULL != Name) {
- *Name = (VOID *) (Pack + 1);
- }
-
- if (NULL != Guid) {
- *Guid = &Pack->VariableGuid;
- }
-
-
- if (NULL != Id) {
- *Id = Pack->VariableId;
- }
-
- if (NULL != Var) {
- *Var = (VOID *) ((CHAR8 *) (Pack + 1) + Pack->VariableNameLength);
- }
-
- if (NULL != Size) {
- *Size = Pack->Header.Length - sizeof (*Pack) - Pack->VariableNameLength;
- }
-}
-
-
-UINTN
-EfiLibHiiVariablePackListGetMapCnt (
- IN EFI_HII_VARIABLE_PACK_LIST *List
- )
-
-/*++
-
-Routine Description:
-
- Finds a count of the variables/maps in the List.
-
-Arguments:
-
- List - List of variables
-
-Returns:
-
- UINTN - The number of map count.
-
---*/
-
-{
- UINTN Cnt = 0;
- while (NULL != List) {
- Cnt++;
- List = List->NextVariablePack;
- }
- return Cnt;
-}
-
-
-VOID
-EfiLibHiiVariablePackListForEachVar (
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback
- )
-/*++
-
-Routine Description:
-
- Will iterate all variable/maps as appearing
- in List and for each, it will call the Callback.
-
-Arguments:
-
- List - List of variables
- Callback - Routine to be called for each iterated variable.
-
-Returns:
-
- VOID
-
---*/
-
-{
- CHAR16 *MapName;
- EFI_GUID *MapGuid;
- UINT16 MapId;
- VOID *Map;
- UINTN MapSize;
-
- while (NULL != List) {
- EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);
- //
- // call the callback
- //
- Callback (MapName, MapGuid, MapId, Map, MapSize);
- List = List->NextVariablePack;
- }
-}
-
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMapByIdx (
- IN UINTN Idx,
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT UINT16 *Id, OPTIONAL
- OUT VOID **Var,
- OUT UINTN *Size
- )
-
-/*++
-
-Routine Description:
-
- Finds a variable form List given
- the order number as appears in the List.
-
-Arguments:
-
- Idx - The index of the variable/map to retrieve
- List - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- EFI_SUCCESS - Variable is found, OUT parameters are valid
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
-
---*/
-{
- CHAR16 *MapName;
- EFI_GUID *MapGuid;
- UINT16 MapId;
- VOID *Map;
- UINTN MapSize;
-
- while (NULL != List) {
- EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);
- if (0 == Idx--) {
- *Var = Map;
- *Size = MapSize;
-
- if (NULL != Name) {
- *Name = MapName;
- }
-
- if (NULL != Guid) {
- *Guid = MapGuid;
- }
-
- if (NULL != Id) {
- *Id = MapId;
- }
-
- return EFI_SUCCESS; // Map found
- }
- List = List->NextVariablePack;
- }
- //
- // If here, the map is not found
- //
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMapById (
- IN UINT16 Id,
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- OUT CHAR16 **Name, OPTIONAL
- OUT EFI_GUID **Guid, OPTIONAL
- OUT VOID **Var,
- OUT UINTN *Size
- )
-
-/*++
-
-Routine Description:
-
- Finds a variable form List given the
- order number as appears in the List.
-
-Arguments:
-
- Id - The ID of the variable/map to retrieve
- List - List of variables
- Name - Name of the variable/map
- Guid - GUID of the variable/map
- Var - Pointer to the variable/map
- Size - Size of the variable/map in bytes
-
-Returns:
-
- EFI_SUCCESS - Variable is found, OUT parameters are valid
- EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid
-
---*/
-
-{
- CHAR16 *MapName;
- EFI_GUID *MapGuid;
- UINT16 MapId;
- VOID *Map;
- UINTN MapSize;
-
- while (NULL != List) {
- EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);
- if (MapId == Id) {
- *Var = Map;
- *Size = MapSize;
- if (NULL != Name) {
- *Name = MapName;
- }
- if (NULL != Guid) {
- *Guid = MapGuid;
- }
- //
- // Map found
- //
- return EFI_SUCCESS;
- }
- List = List->NextVariablePack;
- }
- //
- // If here, the map is not found
- //
- return EFI_NOT_FOUND;
-}
-
-
-EFI_STATUS
-EfiLibHiiVariablePackListGetMap (
- IN EFI_HII_VARIABLE_PACK_LIST *List,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- OUT UINT16 *Id,
- OUT VOID **Var,
- OUT UINTN *Size
- )
-
-/*++
-
-Routine Description:
-
- Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID.
-
-Arguments:
-
- List - List of variables
- Name - Name of the variable/map to be found
- Guid - GUID of the variable/map to be found
- Var - Pointer to the variable/map found
- Size - Size of the variable/map in bytes found
-
-Returns:
-
- EFI_SUCCESS - variable is found, OUT parameters are valid
- EFI_NOT_FOUND - variable is not found, OUT parameters are not valid
-
---*/
-
-{
- VOID *Map;
- UINTN MapSize;
- UINT16 MapId;
- CHAR16 *MapName;
- EFI_GUID *MapGuid;
-
- while (NULL != List) {
- EfiLibHiiVariablePackGetMap (List->VariablePack, &MapName, &MapGuid, &MapId, &Map, &MapSize);
- if ((0 == EfiStrCmp (Name, MapName)) && EfiCompareGuid (Guid, MapGuid)) {
- *Id = MapId;
- *Var = Map;
- *Size = MapSize;
- return EFI_SUCCESS;
- }
- List = List->NextVariablePack;
- }
- //
- // If here, the map is not found
- //
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-EfiLibHiiVariableRetrieveFromNv (
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID **Var
- )
-/*++
-
-Routine Description:
- Finds out if a variable of specific Name/Guid/Size exists in NV.
- If it does, it will retrieve it into the Var.
-
-Arguments:
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into buffer pointed by this pointer.
- If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer.
-Returns:
- EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-{
- EFI_STATUS Status;
- UINTN SizeNv;
-
- //
- // Test for existence of the variable.
- //
- SizeNv = 0;
- Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, NULL);
- if (EFI_BUFFER_TOO_SMALL != Status) {
- ASSERT (EFI_SUCCESS != Status);
- return EFI_NOT_FOUND;
- }
- if (SizeNv != Size) {
- //
- // The variable is considered corrupt, as it has different size from expected.
- //
- return EFI_LOAD_ERROR;
- }
-
- if (NULL == *Var) {
- *Var = EfiLibAllocatePool (Size);
- ASSERT (NULL != *Var);
- }
- SizeNv = Size;
- //
- // Final read into the Var
- //
- Status = gRT->GetVariable (Name, Guid, NULL, &SizeNv, *Var);
- //
- // No tolerance for random failures. Such behavior is undetermined and not validated.
- //
- ASSERT_EFI_ERROR (Status);
- ASSERT (SizeNv == Size);
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-EfiLibHiiVariableOverrideIfSuffix (
- IN CHAR16 *Suffix,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID *Var
- )
-/*++
-
-Routine Description:
- Overrrides the variable with NV data if found.
- But it only does it if the Name ends with specified Suffix.
- For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride",
- the Suffix matches the end of Name, so the variable will be loaded from NV
- provided the variable exists and the GUID and Size matches.
-
-Arguments:
- Suffix - Suffix the Name should end with.
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into this buffer.
- Caller is responsible for providing storage of exactly Size size in bytes.
-Returns:
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
- EFI_INVALID_PARAMETER - The name of the variable does not end with <Suffix>.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-{
- UINTN StrLen;
- UINTN StrLenSuffix;
-
- StrLen = EfiStrLen (Name);
- StrLenSuffix = EfiStrLen (Suffix);
- if ((StrLen <= StrLenSuffix) || (0 != EfiStrCmp (Suffix, &Name[StrLen - StrLenSuffix]))) {
- //
- // Not ending with <Suffix>.
- //
- return EFI_INVALID_PARAMETER;
- }
- return EfiLibHiiVariableRetrieveFromNv (Name, Guid, Size, &Var);
-}
-
-
-
-EFI_STATUS
-EfiLibHiiVariableOverrideBySuffix (
- IN CHAR16 *Suffix,
- IN CHAR16 *Name,
- IN EFI_GUID *Guid,
- IN UINTN Size,
- OUT VOID *Var
- )
-/*++
-
-Routine Description:
- Overrrides the variable with NV data if found.
- But it only does it if the NV contains the same variable with Name is appended with Suffix.
- For example, if Suffix="MyOverride" and the Name="XyzSetup",
- the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride"
- will be loaded from NV provided the variable exists and the GUID and Size matches.
-
-Arguments:
- Suffix - Suffix the variable will be appended with.
- Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly.
- Var - Variable will be retrieved into this buffer.
- Caller is responsible for providing storage of exactly Size size in bytes.
-
-Returns:
- EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size.
- EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV.
- EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error.
-
---*/
-{
- EFI_STATUS Status;
- CHAR16 *NameSuffixed;
- UINTN NameLength;
- UINTN SuffixLength;
-
- //
- // enough to concatenate both strings.
- //
- NameLength = EfiStrLen (Name);
- SuffixLength = EfiStrLen (Suffix);
- NameSuffixed = EfiLibAllocateZeroPool ((NameLength + SuffixLength + 1) * sizeof (CHAR16));
-
- EfiStrCpy (NameSuffixed, Name);
- EfiStrCat (NameSuffixed, Suffix);
-
- Status = EfiLibHiiVariableRetrieveFromNv (NameSuffixed, Guid, Size, &Var);
- gBS->FreePool (NameSuffixed);
-
- return Status;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c
deleted file mode 100644
index 7b905b49fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.c
+++ /dev/null
@@ -1,710 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiScriptLib.c
-
-Abstract:
-
- Support for EFI script.
-
---*/
-
-#include "EfiScriptLib.h"
-
-EFI_BOOT_SCRIPT_SAVE_PROTOCOL *mBootScriptSave;
-
-UINTN
-EfiScriptLibAsciiStrLen (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
- Return the number of Ascii characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Ascii characters in String
-
---*/
-{
- UINTN Length;
-
- for (Length=0; *String; String++, Length++);
- return Length;
-}
-
-UINTN
-EfiScriptLibStrLen (
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Return the number of Unicode characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Unicode characters in String
-
---*/
-{
- UINTN Length;
-
- for (Length=0; *String; String++, Length++);
- return Length;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Boot Script Lib if it has not yet been initialized.
-
-Arguments:
-
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-// GC_TODO: ImageHandle - add argument and description to function comment
-// GC_TODO: SystemTable - add argument and description to function comment
-{
- EFI_STATUS Status;
- EFI_BOOT_SERVICES *BS;
-
- BS = SystemTable->BootServices;
-
- Status = BS->LocateProtocol (&gEfiBootScriptSaveGuid, NULL, (VOID **)&mBootScriptSave);
- if (EFI_ERROR (Status) && Status != EFI_ALREADY_STARTED) {
- mBootScriptSave = NULL;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveIoWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI IO write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Count - add argument and description to function comment
-// GC_TODO: Buffer - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_IO_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveIoReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI IO read write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Data - add argument and description to function comment
-// GC_TODO: DataMask - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveMemWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI MEM write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Count - add argument and description to function comment
-// GC_TODO: Buffer - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveMemReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI MEM read write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Data - add argument and description to function comment
-// GC_TODO: DataMask - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSavePciCfgWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI PCI write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Count - add argument and description to function comment
-// GC_TODO: Buffer - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSavePciCfgReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI PCI read write script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Width - add argument and description to function comment
-// GC_TODO: Address - add argument and description to function comment
-// GC_TODO: Data - add argument and description to function comment
-// GC_TODO: DataMask - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveSmbusExecute (
- IN UINT16 TableName,
- IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
- IN EFI_SMBUS_DEVICE_COMMAND Command,
- IN EFI_SMBUS_OPERATION Operation,
- IN BOOLEAN PecCheck,
- IN UINTN *Length,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI Smbus execute script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: SlaveAddress - add argument and description to function comment
-// GC_TODO: Command - add argument and description to function comment
-// GC_TODO: Operation - add argument and description to function comment
-// GC_TODO: PecCheck - add argument and description to function comment
-// GC_TODO: Length - add argument and description to function comment
-// GC_TODO: Buffer - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE,
- SlaveAddress,
- Command,
- Operation,
- PecCheck,
- Length,
- Buffer
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveStall (
- IN UINT16 TableName,
- IN UINTN Duration
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
-
- TableName - Desired boot script table
-
- (Standard EFI stall script parameter)
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-// GC_TODO: Duration - add argument and description to function comment
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_STALL_OPCODE,
- Duration
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveDispatch (
- IN UINT16 TableName,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- GC_TODO: Add function description
-
-Arguments:
-
- TableName - GC_TODO: add argument description
- EntryPoint - GC_TODO: add argument description
-
-Returns:
-
- EFI_NOT_FOUND - GC_TODO: Add description for return value
- EFI_SUCCESS - GC_TODO: Add description for return value
-
---*/
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_DISPATCH_OPCODE,
- EntryPoint
- );
-
- return EFI_SUCCESS;
-
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptMemPoll (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *BitMask,
- IN VOID *BitValue,
- IN UINTN Duration,
- IN UINTN LoopTimes
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script
-
-Arguments:
- TableName - Desired boot script table
-
- Width - The width of the memory operations.
-
- Address - The base address of the memory operations.
-
- BitMask - A pointer to the bit mask to be AND-ed with the data read from the register.
-
- BitValue - A pointer to the data value after to be Masked.
-
- Duration - Duration in microseconds of the stall.
-
- LoopTimes - The times of the register polling.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-{
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_MEM_POLL_OPCODE,
- Width,
- Address,
- BitMask,
- BitValue,
- Duration,
- LoopTimes
- );
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformation (
- IN UINT16 TableName,
- IN UINT32 Length,
- IN EFI_PHYSICAL_ADDRESS Buffer
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName
-
-Arguments:
-
- TableName - Desired boot script table
- Length - Length of information in bytes
- Buffer - Content of information that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-{
- if (mBootScriptSave == NULL) {
- return EFI_NOT_FOUND;
- }
-
- mBootScriptSave->Write (
- mBootScriptSave,
- TableName,
- EFI_BOOT_SCRIPT_INFORMATION_OPCODE,
- Length,
- Buffer
- );
-
- return EFI_SUCCESS;
-
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformationUnicodeString (
- IN UINT16 TableName,
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName, the information
- is a unicode string.
-
-Arguments:
-
- TableName - Desired boot script table
- String - The string that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-{
- return BootScriptSaveInformation (
- TableName,
- (UINT32) EfiScriptLibStrLen (String) * 2 + 2,
- (EFI_PHYSICAL_ADDRESS) (UINTN) String
- );
-}
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformationAsciiString (
- IN UINT16 TableName,
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName, the information
- is a ascii string.
-
-Arguments:
-
- TableName - Desired boot script table
- String - The string that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-{
- return BootScriptSaveInformation (
- TableName,
- (UINT32) EfiScriptLibAsciiStrLen (String) + 1,
- (EFI_PHYSICAL_ADDRESS) (UINTN) String
- );
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
deleted file mode 100644
index a6b7f06a50..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
+++ /dev/null
@@ -1,45 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# EfiScriptLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiScriptLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- EfiScriptLib.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EFI_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
- EdkFrameworkProtocolLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
deleted file mode 100644
index da3904d238..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
+++ /dev/null
@@ -1,493 +0,0 @@
-/*++
-
-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
-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:
- EfiUiLib.c
-
-Abstract:
- Collection of usefull UI functions.
-
-Revision History:
-
---*/
-
-#include "EfiUiLib.h"
-
-#define IS_DIGIT(Ch) (((Ch) >= L'0') && ((Ch) <= L'9'))
-
-EFI_STATUS
-EfiStringToValue (
- OUT UINT64 *Val,
- IN CHAR16 *String,
- OUT UINT8 *EndIdx OPTIONAL
- )
-/*++
-
-Routine Description:
- Parses and converts Unicode string to decimal value.
- The returned value is 64-bit.
- The string is expected in decimal format,
- the string is parsed and format verified.
-
-Arguments:
- Val - pointer to the variable to store the value to
- String - string that contains the value to parse and convert
- EndIdx - index on which the parsing stopped. It points to the
- first character that was not part of the returned Val.
- It's valid only if the function returns success.
- It's optional and it could be NULL.
-
-Returns:
- EFI_SUCCESS - if successful
- EFI_INVALID_PARAMETER - if String is in unexpected format
-
---*/
-{
- UINT8 i;
- UINT64 TempVal;
-
- TempVal = 0;
- //
- // Iterate upto 20 digits, only so many could fit in the UINT64
- //
- for (i = 0; i <= 20; i++) {
- //
- // test if the next character is not a digit
- //
- if (!IS_DIGIT (String[i])) {
- //
- // If here, there is no more digits,
- // return with success if there was at least one to process
- //
- if (i == 0) {
- break;
- }
-
- *Val = TempVal;
-
- if (EndIdx != NULL) {
- *EndIdx = i;
- }
-
- return EFI_SUCCESS;
- }
- //
- // If here, there is a digit to process
- //
- TempVal = MultU64x32 (TempVal, 10) + String[i] - L'0';
- }
- //
- // if here, there was some sort of format error
- //
- return EFI_INVALID_PARAMETER;
-}
-
-CHAR16 *
-StrHzToString (
- OUT CHAR16 *String,
- IN UINT64 Val
- )
-/*++
-
-Routine Description:
- Converts frequency in Hz to Unicode string.
- Three significant digits are delivered.
- Used for things like processor info display.
-
-Arguments:
- String - string that will contain the frequency.
- Val - value to convert, minimum is 100000 i.e., 0.1 MHz.
-
---*/
-// GC_TODO: function comment is missing 'Returns:'
-{
- CHAR16 HlpStr[8];
- UINT32 i;
- UINT32 IdxPoint;
- UINT32 IdxUnits;
- static CHAR16 *FreqUnits[] = { L" Hz", L" kHz", L" MHz", L" GHz", L" THz", L" PHz" };
-
- //
- // Normalize to 9999 or less.
- //
- i = 0;
- while (Val >= 10000) {
- Val = DivU64x32 (Val, 10, NULL);
- i++;
- }
- //
- // Make it rounded to the nearest, but only by
- // a .3. This assures that .6 is not rounded.
- //
- if (Val >= 1000) {
- Val += 3;
- Val = DivU64x32 (Val, 10, NULL);
- i++;
- }
-
- EfiValueToString (String, Val, 0, 0);
-
- //
- // Get rid of that cursed number!
- //
- if (!EfiStrCmp (&String[1], L"66")) {
- String[2] = L'7';
- }
- //
- // Compute index to the units substrings.
- //
- IdxUnits = (i + 2) / 3;
-
- if (IdxUnits >= (sizeof (FreqUnits) / sizeof (FreqUnits)[0])) {
- //
- // Frequency is too high.
- //
- EfiStrCpy (String, L"OVERFLOW");
- return String;
- }
- //
- // Compute the position of the decimal point.
- //
- IdxPoint = i % 3;
-
- //
- // Test if decimal point needs to be inserted.
- //
- if (IdxPoint != 0) {
- //
- // Save the part after decimal point.
- //
- EfiStrCpy (HlpStr, &String[IdxPoint]);
-
- //
- // Insert the point.
- //
- String[IdxPoint] = L'.';
-
- //
- // Reattach the saved part.
- //
- EfiStrCpy (&String[IdxPoint + 1], HlpStr);
-
- //
- // Clear the insignificant zero.
- //
- if (String[3] == L'0') {
- String[4 - IdxPoint] = L'\0';
- }
- }
- //
- // Attach units.
- //
- EfiStrCat (String, FreqUnits[IdxUnits]);
-
- return String;
-}
-
-CHAR16 *
-StrBytesToString (
- OUT CHAR16 *String,
- IN UINT64 Val
- )
-/*++
-
-Routine Description:
- Converts size in bytes to Unicode string.
- Used for memory/cache size display.
-
-Arguments:
- String - string that will contain the value
- Val - value to convert in bytes
-
---*/
-// GC_TODO: function comment is missing 'Returns:'
-{
- UINTN i;
- UINTN Rem;
- static CHAR16 *SizeUnits[] = { L" B", L" kB", L" MB", L" GB", L" TB", L" PB" };
-
- Rem = 0;
-
- for (i = 0; i < (sizeof (SizeUnits) / sizeof (SizeUnits)[0]); i++) {
-
- DivU64x32 (Val, 1024, &Rem);
-
- //
- // Done if:
- // 1. less than 1k
- // 2. less than 8k and there are fractions of 1k
- //
- if ((Val < 1024) || ((Val < 8192) && (Rem != 0))) {
-
- EfiValueToString (String, Val, 0, 0);
-
- //
- // attach units
- //
- EfiStrCat (String, SizeUnits[i]);
- return String;
- }
- //
- // prescale down by 1k with rounding to the nearest
- //
- Val = DivU64x32 (Val + 511, 1024, NULL);
- }
-
- EfiStrCpy (String, L"OVERFLOW");
-
- return String;
-}
-
-CHAR16 *
-StrVersionToString (
- OUT CHAR16 *String,
- IN UINT8 Version
- )
-/*++
-
-Routine Description:
- Converts 8 bit version value to Unicode string.
- The upper nibble contains the upper part, the lower nibble contains the minor part.
- The output format is <major>.<minor>.
-
-Arguments:
- String - string that will contain the value
- Version - value to convert
-
---*/
-// GC_TODO: function comment is missing 'Returns:'
-{
- CHAR16 HlpStr[4];
-
- EfiValueToString (String, 0x0F & Version, 0, 0);
- EfiStrCat (String, L".");
- EfiValueToString (HlpStr, 0x0F & (Version >> 4), 0, 0);
- EfiStrCat (String, HlpStr);
-
- return String;
-}
-
-CHAR16 *
-StrMacToString (
- OUT CHAR16 *String,
- IN EFI_MAC_ADDRESS *MacAddr,
- IN UINT32 AddrSize
- )
-/*++
-
-Routine Description:
- Converts MAC address to Unicode string.
- The value is 64-bit and the resulting string will be 12
- digit hex number in pairs of digits separated by dashes.
-
-Arguments:
- String - string that will contain the value
- Val - value to convert
-
---*/
-// GC_TODO: function comment is missing 'Returns:'
-// GC_TODO: MacAddr - add argument and description to function comment
-// GC_TODO: AddrSize - add argument and description to function comment
-{
- UINT32 i;
-
- for (i = 0; i < AddrSize; i++) {
-
- EfiValueToHexStr (
- &String[2 * i],
- MacAddr->Addr[i] & 0xFF,
- PREFIX_ZERO,
- 2
- );
- }
- //
- // Terminate the string.
- //
- String[2 * AddrSize] = L'\0';
-
- return String;
-}
-
-CHAR16 *
-StrIp4AdrToString (
- OUT CHAR16 *String,
- IN EFI_IPv4_ADDRESS *Ip4Addr
- )
-/*++
-
-Routine Description:
- Converts IP v4 address to Unicode string.
- The value is 64-bit and the resulting string will
- be four decimal values 0-255 separated by dots.
-
-Arguments:
- String - string that will contain the value
- Ip4Addr - value to convert from
-
---*/
-// GC_TODO: function comment is missing 'Returns:'
-{
- INT32 i;
- CHAR16 HlpStr[4];
-
- String[0] = L'\0';
-
- for (i = 0; i < 4; i++) {
-
- EfiValueToString (HlpStr, Ip4Addr->Addr[i], 0, 0);
- EfiStrCat (String, HlpStr);
-
- if (i < 3) {
- EfiStrCat (String, L".");
- }
- }
-
- return String;
-}
-
-EFI_STATUS
-StrStringToIp4Adr (
- OUT EFI_IPv4_ADDRESS *Ip4Addr,
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Parses and converts Unicode string to IP v4 address.
- The value will 64-bit.
- The string must be four decimal values 0-255 separated by dots.
- The string is parsed and format verified.
-
-Arguments:
- Ip4Addr - pointer to the variable to store the value to
- String - string that contains the value to parse and convert
-
-Returns:
- EFI_SUCCESS - if successful
- EFI_INVALID_PARAMETER - if String contains invalid IP v4 format
-
---*/
-{
- EFI_STATUS Status;
-
- EFI_IPv4_ADDRESS RetVal;
- UINT64 TempVal;
- UINT8 Idx;
- UINT8 i;
-
- Idx = 0;
- TempVal = 0;
- //
- // Iterate the decimal values separated by dots
- //
- for (i = 0; i < 4; i++) {
- //
- // get the value of a decimal
- //
- Status = EfiStringToValue (&TempVal, String, &Idx);
- if ((EFI_ERROR (Status)) || (TempVal > 255)) {
- break;
- }
-
- RetVal.Addr[i] = (UINT8) TempVal;
- String += Idx;
-
- //
- // test if it is the last decimal value
- //
- if (i == 3) {
- if (String[0] != L'\0') {
- //
- // the string must end with string termination character
- //
- break;
- }
-
- *Ip4Addr = RetVal;
- return EFI_SUCCESS;
- }
- //
- // Test for presence of a dot, it is required between the values
- //
- if (String++[0] != L'.') {
- break;
- }
- }
-
- return EFI_INVALID_PARAMETER;
-}
-
-CHAR16 *
-Ascii2Unicode (
- OUT CHAR16 *UnicodeStr,
- IN CHAR8 *AsciiStr
- )
-/*++
-
-Routine Description:
- Converts ASCII characters to Unicode.
-
-Arguments:
- UnicodeStr - the Unicode string to be written to. The buffer must be large enough.
- AsciiStr - The ASCII string to be converted.
-
-Returns:
- The address to the Unicode string - same as UnicodeStr.
-
---*/
-{
- CHAR16 *Str;
-
- Str = UnicodeStr;
-
- while (TRUE) {
-
- *(UnicodeStr++) = (CHAR16) *AsciiStr;
-
- if (*(AsciiStr++) == '\0') {
- return Str;
- }
- }
-}
-
-CHAR8 *
-Unicode2Ascii (
- OUT CHAR8 *AsciiStr,
- IN CHAR16 *UnicodeStr
- )
-/*++
-
-Routine Description:
- Converts ASCII characters to Unicode.
- Assumes that the Unicode characters are only these defined in the ASCII set.
-
-Arguments:
- AsciiStr - The ASCII string to be written to. The buffer must be large enough.
- UnicodeStr - the Unicode string to be converted.
-
-Returns:
- The address to the ASCII string - same as AsciiStr.
-
---*/
-{
- CHAR8 *Str;
-
- Str = AsciiStr;
-
- while (TRUE) {
-
- *AsciiStr = (CHAR8) *(UnicodeStr++);
-
- if (*(AsciiStr++) == '\0') {
- return Str;
- }
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.inf
deleted file mode 100644
index c6e3240743..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.inf
+++ /dev/null
@@ -1,43 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# EfiUiLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiUiLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- EfiUiLib.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/PrintWidth.h
deleted file mode 100644
index 91848e9157..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/PrintWidth.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Ascii
- STRING_W is ""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR8 CHAR_W;
-#define STRING_W(_s) _s
-
-#define ASPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define AvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-UINTN
-UvSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN StrLen,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- StartOfBuffer - Wide char buffer to print the results of the parsing of Format into.
- StrLen - Maximum number of characters to put into buffer.
- Format - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/Sprint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/Sprint.c
deleted file mode 100644
index d599f0f133..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Ascii/Sprint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-UvSPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR8 AsciiFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR8 AsciiResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- AsciiFormat[Index] = (CHAR8) FormatString[Index];
- }
-
- AsciiFormat[Index] = '\0';
-
- Index = VSPrint (AsciiResult, EFI_DRIVER_LIB_MAX_PRINT_BUFFER, AsciiFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && AsciiResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR16) AsciiResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.c
deleted file mode 100644
index 9549217388..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Graphics.c
-
-Abstract:
-
- Support for Basic Graphics operations.
-
- BugBug: Currently *.BMP files are supported. This will be replaced
- when Tiano graphics format is supported.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "GraphicsLib.h"
-
-EFI_STATUS
-GetGraphicsBitMapFromFV (
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-{
- return GetGraphicsBitMapFromFVEx (NULL, FileNameGuid, Image, ImageSize);
-}
-
-EFI_STATUS
-GetGraphicsBitMapFromFVEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- ImageHandle - The driver image handle of the caller. The parameter is used to
- optimize the loading of the image file so that the FV from which
- the driver image is loaded will be tried first.
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-{
- return GetImageEx (
- ImageHandle,
- FileNameGuid,
- EFI_SECTION_RAW,
- Image,
- ImageSize,
- FALSE
- );
-}
-
-
-EFI_STATUS
-ConvertBmpToGopBlt (
- IN VOID *BmpImage,
- IN UINTN BmpImageSize,
- IN OUT VOID **GopBlt,
- IN OUT UINTN *GopBltSize,
- OUT UINTN *PixelHeight,
- OUT UINTN *PixelWidth
- )
-/*++
-
-Routine Description:
-
- Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer
- is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
- buffer is passed in it will be used if it is big enough.
-
-Arguments:
-
- BmpImage - Pointer to BMP file
-
- BmpImageSize - Number of bytes in BmpImage
-
- GopBlt - Buffer containing GOP version of BmpImage.
-
- GopBltSize - Size of GopBlt in bytes.
-
- PixelHeight - Height of GopBlt/BmpImage in pixels
-
- PixelWidth - Width of GopBlt/BmpImage in pixels
-
-
-Returns:
-
- EFI_SUCCESS - GopBlt and GopBltSize are returned.
- EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image
- EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough.
- GopBltSize will contain the required size.
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
---*/
-{
- UINT8 *Image;
- UINT8 *ImageHeader;
- BMP_IMAGE_HEADER *BmpHeader;
- BMP_COLOR_MAP *BmpColorMap;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
- UINT64 BltBufferSize;
- UINTN Index;
- UINTN Height;
- UINTN Width;
- UINTN ImageIndex;
- UINTN DataSizePerLine;
- BOOLEAN IsAllocated;
- UINT32 ColorMapNum;
-
- if (sizeof (BMP_IMAGE_HEADER) > BmpImageSize) {
- return EFI_INVALID_PARAMETER;
- }
-
- BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;
-
- if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Doesn't support compress.
- //
- if (BmpHeader->CompressionType != 0) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Only support BITMAPINFOHEADER format.
- // BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER
- //
- if (BmpHeader->HeaderSize != sizeof (BMP_IMAGE_HEADER) - ((UINTN) &(((BMP_IMAGE_HEADER *)0)->HeaderSize))) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // The data size in each line must be 4 byte alignment.
- //
- DataSizePerLine = ((BmpHeader->PixelWidth * BmpHeader->BitPerPixel + 31) >> 3) & (~0x3);
- BltBufferSize = MultU64x32 (DataSizePerLine, BmpHeader->PixelHeight);
- if (BltBufferSize > (UINT32) ~0) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((BmpHeader->Size != BmpImageSize) ||
- (BmpHeader->Size < BmpHeader->ImageOffset) ||
- (BmpHeader->Size - BmpHeader->ImageOffset != BmpHeader->PixelHeight * DataSizePerLine)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Calculate Color Map offset in the image.
- //
- Image = BmpImage;
- BmpColorMap = (BMP_COLOR_MAP *) (Image + sizeof (BMP_IMAGE_HEADER));
- if (BmpHeader->ImageOffset < sizeof (BMP_IMAGE_HEADER)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
- switch (BmpHeader->BitPerPixel) {
- case 1:
- ColorMapNum = 2;
- break;
- case 4:
- ColorMapNum = 16;
- break;
- case 8:
- ColorMapNum = 256;
- break;
- default:
- ColorMapNum = 0;
- break;
- }
- if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) != sizeof (BMP_COLOR_MAP) * ColorMapNum) {
- return EFI_INVALID_PARAMETER;
- }
- }
-
- //
- // Calculate graphics image data address in the image
- //
- Image = ((UINT8 *) BmpImage) + BmpHeader->ImageOffset;
- ImageHeader = Image;
-
- BltBufferSize = MultU64x32 ((UINT64) BmpHeader->PixelWidth, BmpHeader->PixelHeight);
- //
- // Ensure the BltBufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow
- //
- if (BltBufferSize > DivU64x32 ((UINTN) ~0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), NULL)) {
- return EFI_UNSUPPORTED;
- }
- BltBufferSize = MultU64x32 (BltBufferSize, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- IsAllocated = FALSE;
- if (*GopBlt == NULL) {
- *GopBltSize = (UINTN) BltBufferSize;
- *GopBlt = EfiLibAllocatePool (*GopBltSize);
- IsAllocated = TRUE;
- if (*GopBlt == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- } else {
- if (*GopBltSize < (UINTN) BltBufferSize) {
- *GopBltSize = (UINTN) BltBufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
- }
-
- *PixelWidth = BmpHeader->PixelWidth;
- *PixelHeight = BmpHeader->PixelHeight;
-
- //
- // Convert image from BMP to Blt buffer format
- //
- BltBuffer = *GopBlt;
- for (Height = 0; Height < BmpHeader->PixelHeight; Height++) {
- Blt = &BltBuffer[(BmpHeader->PixelHeight - Height - 1) * BmpHeader->PixelWidth];
- for (Width = 0; Width < BmpHeader->PixelWidth; Width++, Image++, Blt++) {
- switch (BmpHeader->BitPerPixel) {
- case 1:
- //
- // Convert 1bit BMP to 24-bit color
- //
- for (Index = 0; Index < 8 && Width < BmpHeader->PixelWidth; Index++) {
- Blt->Red = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Red;
- Blt->Green = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Green;
- Blt->Blue = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Blue;
- Blt++;
- Width++;
- }
-
- Blt --;
- Width --;
- break;
-
- case 4:
- //
- // Convert BMP Palette to 24-bit color
- //
- Index = (*Image) >> 4;
- Blt->Red = BmpColorMap[Index].Red;
- Blt->Green = BmpColorMap[Index].Green;
- Blt->Blue = BmpColorMap[Index].Blue;
- if (Width < (BmpHeader->PixelWidth - 1)) {
- Blt++;
- Width++;
- Index = (*Image) & 0x0f;
- Blt->Red = BmpColorMap[Index].Red;
- Blt->Green = BmpColorMap[Index].Green;
- Blt->Blue = BmpColorMap[Index].Blue;
- }
- break;
-
- case 8:
- //
- // Convert BMP Palette to 24-bit color
- //
- Blt->Red = BmpColorMap[*Image].Red;
- Blt->Green = BmpColorMap[*Image].Green;
- Blt->Blue = BmpColorMap[*Image].Blue;
- break;
-
- case 24:
- Blt->Blue = *Image++;
- Blt->Green = *Image++;
- Blt->Red = *Image;
- break;
-
- default:
- if (IsAllocated) {
- gBS->FreePool (*GopBlt);
- *GopBlt = NULL;
- }
- return EFI_UNSUPPORTED;
- break;
- };
-
- }
-
- ImageIndex = (UINTN) (Image - ImageHeader);
- if ((ImageIndex % 4) != 0) {
- //
- // Bmp Image starts each row on a 32-bit boundary!
- //
- Image = Image + (4 - (ImageIndex % 4));
- }
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-LockKeyboards (
- IN CHAR16 *Password
- )
-/*++
-
-Routine Description:
- Use Console Control Protocol to lock the Console In Spliter virtual handle.
- This is the ConInHandle and ConIn handle in the EFI system table. All key
- presses will be ignored until the Password is typed in. The only way to
- disable the password is to type it in to a ConIn device.
-
-Arguments:
- Password - Password used to lock ConIn device
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID**)&ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- Status = ConsoleControl->LockStdIn (ConsoleControl, Password);
- return Status;
-}
-
-EFI_STATUS
-EnableQuietBoot (
- IN EFI_GUID *LogoFile
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off UGA based Simple Text Out consoles from going
- to the UGA device. Put up LogoFile on every UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- return EnableQuietBootEx (LogoFile, NULL);
-}
-
-EFI_STATUS
-EnableQuietBootEx (
- IN EFI_GUID *LogoFile,
- IN EFI_HANDLE ImageHandle
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off GOP/UGA based Simple Text Out consoles from going
- to the GOP/UGA device. Put up LogoFile on every GOP/UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
- ImageHandle - The driver image handle of the caller. The parameter is used to
- optimize the loading of the logo file so that the FV from which
- the driver image is loaded will be tried first.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
- EFI_OEM_BADGING_PROTOCOL *Badging;
- UINT32 SizeOfX;
- UINT32 SizeOfY;
- INTN DestX;
- INTN DestY;
- UINT8 *ImageData;
- UINTN ImageSize;
- UINTN BltSize;
- UINT32 Instance;
- EFI_BADGING_FORMAT Format;
- EFI_BADGING_DISPLAY_ATTRIBUTE Attribute;
- UINTN CoordinateX;
- UINTN CoordinateY;
- UINTN Height;
- UINTN Width;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID**)&ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- UgaDraw = NULL;
- //
- // Try to open GOP first
- //
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID**)&GraphicsOutput);
- if (EFI_ERROR (Status)) {
- GraphicsOutput = NULL;
- //
- // Open GOP failed, try to open UGA
- //
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID**)&UgaDraw);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- }
-
- Badging = NULL;
- Status = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID**)&Badging);
-
- ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenGraphics);
-
- if (GraphicsOutput != NULL) {
- SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
- SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
- } else if (UgaDraw != NULL) {
- Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- } else {
- return EFI_UNSUPPORTED;
- }
-
- Instance = 0;
- while (1) {
- ImageData = NULL;
- ImageSize = 0;
-
- if (Badging != NULL) {
- Status = Badging->GetImage (
- Badging,
- &Instance,
- &Format,
- &ImageData,
- &ImageSize,
- &Attribute,
- &CoordinateX,
- &CoordinateY
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Currently only support BMP format
- //
- if (Format != EfiBadgingFormatBMP) {
- gBS->FreePool (ImageData);
- continue;
- }
- } else {
- Status = GetGraphicsBitMapFromFVEx (ImageHandle, LogoFile, (VOID **) &ImageData, &ImageSize);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- CoordinateX = 0;
- CoordinateY = 0;
- Attribute = EfiBadgingDisplayAttributeCenter;
- }
-
- Blt = NULL;
- Status = ConvertBmpToGopBlt (
- ImageData,
- ImageSize,
- (VOID**)&Blt,
- &BltSize,
- &Height,
- &Width
- );
- if (EFI_ERROR (Status)) {
- gBS->FreePool (ImageData);
- if (Badging == NULL) {
- return Status;
- } else {
- continue;
- }
- }
-
- switch (Attribute) {
- case EfiBadgingDisplayAttributeLeftTop:
- DestX = CoordinateX;
- DestY = CoordinateY;
- break;
-
- case EfiBadgingDisplayAttributeCenterTop:
- DestX = (SizeOfX - Width) / 2;
- DestY = CoordinateY;
- break;
-
- case EfiBadgingDisplayAttributeRightTop:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = CoordinateY;;
- break;
-
- case EfiBadgingDisplayAttributeCenterRight:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = (SizeOfY - Height) / 2;
- break;
-
- case EfiBadgingDisplayAttributeRightBottom:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeCenterBottom:
- DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeLeftBottom:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeCenterLeft:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height) / 2;
- break;
-
- case EfiBadgingDisplayAttributeCenter:
- DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height) / 2;
- break;
-
- default:
- DestX = CoordinateX;
- DestY = CoordinateY;
- break;
- }
-
- if ((DestX >= 0) && (DestY >= 0)) {
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- Blt,
- EfiBltBufferToVideo,
- 0,
- 0,
- (UINTN) DestX,
- (UINTN) DestY,
- Width,
- Height,
- Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) Blt,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- (UINTN) DestX,
- (UINTN) DestY,
- Width,
- Height,
- Width * sizeof (EFI_UGA_PIXEL)
- );
- }
- }
-
- gBS->FreePool (ImageData);
- gBS->FreePool (Blt);
-
- if (Badging == NULL) {
- break;
- }
- }
-
- return Status;
-}
-
-
-EFI_STATUS
-DisableQuietBoot (
- VOID
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA
- Simple Text Out screens will now be synced up with all non GOP/UGA output devices
-
-Arguments:
-
- NONE
-
-Returns:
-
- EFI_SUCCESS - GOP/UGA devices are back in text mode and synced up.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID**)&ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- return ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.inf
deleted file mode 100644
index 77ab1c411b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Graphics.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# Graphics.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = Graphics
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Graphics.c
- Print.c
- Print.h
- Unicode/PrintWidth.h
- Unicode/Sprint.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Graphics/Unicode
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
- EfiDriverLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.c
deleted file mode 100644
index 83939670f6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Print.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include EFI_PROTOCOL_DEFINITION (HiiFont)
-#else
-#include EFI_PROTOCOL_DEFINITION (Hii)
-#endif
-
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- IN OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-static EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {
- {0x00, 0x00, 0x00, 0x00},
- {0x98, 0x00, 0x00, 0x00},
- {0x00, 0x98, 0x00, 0x00},
- {0x98, 0x98, 0x00, 0x00},
- {0x00, 0x00, 0x98, 0x00},
- {0x98, 0x00, 0x98, 0x00},
- {0x00, 0x98, 0x98, 0x00},
- {0x98, 0x98, 0x98, 0x00},
- {0x10, 0x10, 0x10, 0x00},
- {0xff, 0x10, 0x10, 0x00},
- {0x10, 0xff, 0x10, 0x00},
- {0xff, 0xff, 0x10, 0x00},
- {0x10, 0x10, 0xff, 0x00},
- {0xf0, 0x10, 0xff, 0x00},
- {0x10, 0xff, 0xff, 0x00},
- {0xff, 0xff, 0xff, 0x00},
-};
-
-
-UINTN
-_IPrint (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw,
- IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *Sto,
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background,
- IN CHAR16 *fmt,
- IN VA_LIST args
- )
-/*++
-
-Routine Description:
-
- Display string worker for: Print, PrintAt, IPrint, IPrintAt
-
-Arguments:
-
- GraphicsOutput - Graphics output protocol interface
-
- UgaDraw - UGA draw protocol interface
-
- Sto - Simple text out protocol interface
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- Foreground - Foreground color
-
- Background - Background color
-
- fmt - Format string
-
- args - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
-{
- VOID *Buffer;
- EFI_STATUS Status;
- UINTN Index;
- CHAR16 *UnicodeWeight;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- UINTN BufferLen;
- UINTN LineBufferLen;
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- EFI_HII_FONT_PROTOCOL *HiiFont;
- EFI_IMAGE_OUTPUT *Blt;
- EFI_FONT_DISPLAY_INFO *FontInfo;
-#else
- EFI_HII_PROTOCOL *Hii;
- UINT16 GlyphWidth;
- UINT32 GlyphStatus;
- UINT16 StringIndex;
- EFI_NARROW_GLYPH *Glyph;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;
-#endif
-
- //
- // For now, allocate an arbitrarily long buffer
- //
- BufferLen = 0;
- Buffer = EfiLibAllocateZeroPool (0x10000);
- if (Buffer == NULL) {
- return 0;
- }
-
- if (GraphicsOutput != NULL) {
- HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
- VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
- } else {
- UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
- }
- ASSERT ((HorizontalResolution != 0) && (VerticalResolution !=0));
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- Blt = NULL;
- FontInfo = NULL;
- ASSERT (GraphicsOutput != NULL);
- Status = gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &HiiFont);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-#else
- LineBuffer = NULL;
- Status = gBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, (VOID**)&Hii);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
- LineBufferLen = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * HorizontalResolution * GLYPH_HEIGHT;
- LineBuffer = EfiLibAllocatePool (LineBufferLen);
- if (LineBuffer == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-#endif
-
- VSPrint (Buffer, 0x10000, fmt, args);
-
- UnicodeWeight = (CHAR16 *) Buffer;
-
- for (Index = 0; UnicodeWeight[Index] != 0; Index++) {
- if (UnicodeWeight[Index] == CHAR_BACKSPACE ||
- UnicodeWeight[Index] == CHAR_LINEFEED ||
- UnicodeWeight[Index] == CHAR_CARRIAGE_RETURN) {
- UnicodeWeight[Index] = 0;
- }
- }
-
- BufferLen = EfiStrLen (Buffer);
-
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- LineBufferLen = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * HorizontalResolution * EFI_GLYPH_HEIGHT;
- if (EFI_GLYPH_WIDTH * EFI_GLYPH_HEIGHT * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * BufferLen > LineBufferLen) {
- Status = EFI_INVALID_PARAMETER;
- goto Error;
- }
-
- Blt = (EFI_IMAGE_OUTPUT *) EfiLibAllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
- if (Blt == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-
- Blt->Width = (UINT16) (HorizontalResolution);
- Blt->Height = (UINT16) (VerticalResolution);
- Blt->Image.Screen = GraphicsOutput;
-
- FontInfo = (EFI_FONT_DISPLAY_INFO *) EfiLibAllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
- if (FontInfo == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
- if (Foreground != NULL) {
- EfiCopyMem (&FontInfo->ForegroundColor, Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- } else {
- EfiCopyMem (
- &FontInfo->ForegroundColor,
- &mEfiColors[Sto->Mode->Attribute & 0x0f],
- sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
- if (Background != NULL) {
- EfiCopyMem (&FontInfo->BackgroundColor, Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- } else {
- EfiCopyMem (
- &FontInfo->BackgroundColor,
- &mEfiColors[Sto->Mode->Attribute >> 4],
- sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
-
- Status = HiiFont->StringToImage (
- HiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_DIRECT_TO_SCREEN,
- Buffer,
- FontInfo,
- &Blt,
- X,
- Y,
- NULL,
- NULL,
- NULL
- );
-
-#else
- GlyphStatus = 0;
-
- if (GLYPH_WIDTH * GLYPH_HEIGHT * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * BufferLen > LineBufferLen) {
- Status = EFI_INVALID_PARAMETER;
- goto Error;
- }
-
- for (Index = 0; Index < BufferLen; Index++) {
- StringIndex = (UINT16) Index;
- Status = Hii->GetGlyph (Hii, UnicodeWeight, &StringIndex, (UINT8 **) &Glyph, &GlyphWidth, &GlyphStatus);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- if (Foreground == NULL || Background == NULL) {
- Status = Hii->GlyphToBlt (
- Hii,
- (UINT8 *) Glyph,
- mEfiColors[Sto->Mode->Attribute & 0x0f],
- mEfiColors[Sto->Mode->Attribute >> 4],
- BufferLen,
- GlyphWidth,
- GLYPH_HEIGHT,
- &LineBuffer[Index * GLYPH_WIDTH]
- );
- } else {
- Status = Hii->GlyphToBlt (
- Hii,
- (UINT8 *) Glyph,
- *Foreground,
- *Background,
- BufferLen,
- GlyphWidth,
- GLYPH_HEIGHT,
- &LineBuffer[Index * GLYPH_WIDTH]
- );
- }
- }
-
- //
- // Blt a character to the screen
- //
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- LineBuffer,
- EfiBltBufferToVideo,
- 0,
- 0,
- X,
- Y,
- GLYPH_WIDTH * BufferLen,
- GLYPH_HEIGHT,
- GLYPH_WIDTH * BufferLen * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) LineBuffer,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- X,
- Y,
- GLYPH_WIDTH * BufferLen,
- GLYPH_HEIGHT,
- GLYPH_WIDTH * BufferLen * sizeof (EFI_UGA_PIXEL)
- );
- }
-
-#endif
-
-Error:
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- EfiLibSafeFreePool (Blt);
- EfiLibSafeFreePool (FontInfo);
-#else
- EfiLibSafeFreePool (LineBuffer);
-#endif
- gBS->FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- return BufferLen;
-}
-
-
-UINTN
-PrintXY (
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
- IN CHAR_W *Fmt,
- ...
- )
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to the default console
-
-Arguments:
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- ForeGround - Foreground color
-
- BackGround - Background color
-
- Fmt - Format string
-
- ... - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
-{
- EFI_HANDLE Handle;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_SIMPLE_TEXT_OUT_PROTOCOL *Sto;
- EFI_STATUS Status;
- VA_LIST Args;
- UINTN LengthOfPrinted;
-
- Handle = gST->ConsoleOutHandle;
-
- GraphicsOutput = NULL;
- UgaDraw = NULL;
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiGraphicsOutputProtocolGuid,
- (VOID**)&GraphicsOutput
- );
-
- if (EFI_ERROR (Status) || (GraphicsOutput == NULL)) {
- GraphicsOutput = NULL;
-
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiUgaDrawProtocolGuid,
- (VOID**)&UgaDraw
- );
-
- if (EFI_ERROR (Status) || (UgaDraw == NULL)) {
- return 0;
- }
- }
-
- Sto = NULL;
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiSimpleTextOutProtocolGuid,
- (VOID**)&Sto
- );
-
- if (EFI_ERROR (Status) || (Sto == NULL)) {
- return 0;
- }
-
- VA_START (Args, Fmt);
- LengthOfPrinted = _IPrint (GraphicsOutput, UgaDraw, Sto, X, Y, ForeGround, BackGround, Fmt, Args);
- VA_END (Args);
- return LengthOfPrinted;
-}
-
-
-UINTN
-SPrint (
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- SPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-UINTN
-EFIAPI
-VSPrint (
- OUT CHAR_W *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Unicode format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR_W *Buffer;
- CHAR8 *AsciiStr;
- CHAR16 *UnicodeStr;
- CHAR_W *Format;
- UINTN Index;
- UINTN Flags;
- UINTN Width;
- UINTN Count;
- UINTN NumberOfCharacters;
- UINTN BufferLeft;
- UINT64 Value;
- EFI_GUID *TmpGUID;
- BOOLEAN Done;
-
- //
- // Process the format string. Stop if Buffer is over run.
- //
-
- Buffer = StartOfBuffer;
- Format = (CHAR_W *) FormatString;
- NumberOfCharacters = BufferSize / sizeof (CHAR_W);
- BufferLeft = BufferSize;
- for (Index = 0; (*Format != '\0') && (Index < NumberOfCharacters - 1); Format++) {
- if (*Format != '%') {
- if ((*Format == '\n') && (Index < NumberOfCharacters - 2)) {
- //
- // If carage return add line feed
- //
- Buffer[Index++] = '\r';
- BufferLeft -= sizeof (CHAR_W);
- }
-
- Buffer[Index++] = *Format;
- BufferLeft -= sizeof (CHAR_W);
- } else {
-
- //
- // Now it's time to parse what follows after %
- //
- Flags = 0;
- Width = 0;
- for (Done = FALSE; !Done;) {
- Format++;
-
- switch (*Format) {
-
- case '-':
- Flags |= LEFT_JUSTIFY;
- break;
-
- case '+':
- Flags |= PREFIX_SIGN;
- break;
-
- case ' ':
- Flags |= PREFIX_BLANK;
- break;
-
- case ',':
- Flags |= COMMA_TYPE;
- break;
-
- case 'L':
- case 'l':
- Flags |= LONG_TYPE;
- break;
-
- case '*':
- Width = VA_ARG (Marker, UINTN);
- break;
-
- case '0':
- Flags |= PREFIX_ZERO;
-
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- Count = 0;
- do {
- Count = (Count * 10) +*Format - '0';
- Format++;
- } while ((*Format >= '0') && (*Format <= '9'));
- Format--;
- Width = Count;
- break;
-
- default:
- Done = TRUE;
- }
- }
-
- switch (*Format) {
- case 'p':
- //
- // Flag space, +, 0, L & l are invalid for type p.
- //
- Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);
- if (sizeof (VOID *) > 4) {
- Flags |= LONG_TYPE;
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
- Flags |= PREFIX_ZERO;
-
- EfiValueToHexStr (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 'X':
- Flags |= PREFIX_ZERO;
- Width = sizeof (UINT64) * 2;
-
- //
- // break skiped on purpose
- //
- case 'x':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
-
- EfiValueToHexStr (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for (; (*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 'd':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = (UINTN) VA_ARG (Marker, UINTN);
- }
-
- EfiValueToString (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for (; (*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 's':
- case 'S':
- UnicodeStr = (CHAR16 *) VA_ARG (Marker, CHAR_W *);
- if (UnicodeStr == NULL) {
- UnicodeStr = L"<null string>";
- }
-
- for (Count = 0; (*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++, Count++) {
- Buffer[Index++] = *UnicodeStr;
- }
- //
- // Add padding if needed
- //
- for (; (Count < Width) && (Index < NumberOfCharacters - 1); Count++) {
- Buffer[Index++] = ' ';
- }
-
- break;
-
- case 'a':
- AsciiStr = (CHAR8 *) VA_ARG (Marker, CHAR8 *);
- if (AsciiStr == NULL) {
- AsciiStr = (CHAR8 *) "<null string>";
- }
-
- for (Count = 0; (*AsciiStr != '\0') && (Index < NumberOfCharacters - 1); AsciiStr++, Count++) {
- Buffer[Index++] = (CHAR_W) * AsciiStr;
- }
- //
- // Add padding if needed
- //
- for (; (Count < Width) && (Index < NumberOfCharacters - 1); Count++) {
- Buffer[Index++] = ' ';
- }
- break;
-
- case 'c':
- Buffer[Index++] = (CHAR_W) VA_ARG (Marker, UINTN);
- break;
-
- case 'g':
- TmpGUID = VA_ARG (Marker, EFI_GUID *);
- if (TmpGUID != NULL) {
- Index += GuidToString (
- TmpGUID,
- &Buffer[Index],
- BufferLeft
- );
- }
- break;
-
- case 't':
- Index += TimeToString (
- VA_ARG (Marker, EFI_TIME *),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case 'r':
- Index += EfiStatusToString (
- VA_ARG (Marker, EFI_STATUS),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case '%':
- Buffer[Index++] = *Format;
- break;
-
- default:
- //
- // if the type is unknown print it to the screen
- //
- Buffer[Index++] = *Format;
- }
-
- BufferLeft = BufferSize - Index * sizeof (CHAR_W);
- }
- }
-
- Buffer[Index++] = '\0';
-
- return &Buffer[Index] - StartOfBuffer;
-}
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints an EFI_GUID.
-
-Arguments:
-
- Guid - Pointer to GUID to print.
-
- Buffer - Buffe to print Guid into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = SPrint (
- Buffer,
- BufferSize,
- STRING_W ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"),
- (UINTN)Guid->Data1,
- (UINTN)Guid->Data2,
- (UINTN)Guid->Data3,
- (UINTN)Guid->Data4[0],
- (UINTN)Guid->Data4[1],
- (UINTN)Guid->Data4[2],
- (UINTN)Guid->Data4[3],
- (UINTN)Guid->Data4[4],
- (UINTN)Guid->Data4[5],
- (UINTN)Guid->Data4[6],
- (UINTN)Guid->Data4[7]
- );
-
- //
- // SPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints EFI_TIME.
-
-Arguments:
-
- Time - Pointer to EFI_TIME sturcture to print.
-
- Buffer - Buffer to print Time into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = SPrint (
- Buffer,
- BufferSize,
- STRING_W ("%02d/%02d/%04d %02d:%02d"),
- (UINTN)Time->Month,
- (UINTN)Time->Day,
- (UINTN)Time->Year,
- (UINTN)Time->Hour,
- (UINTN)Time->Minute
- );
-
- //
- // SPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints EFI_STATUS as a string. If string is
- not known a hex value will be printed.
-
-Arguments:
-
- Status - EFI_STATUS sturcture to print.
-
- Buffer - Buffer to print EFI_STATUS message string into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
- CHAR8 *Desc;
-
- Desc = NULL;
-
- //
- // Can't use global Status String Array as UINTN is not constant for EBC
- //
- if (Status == EFI_SUCCESS) { Desc = (CHAR8 *) "Success"; } else
- if (Status == EFI_LOAD_ERROR) { Desc = (CHAR8 *) "Load Error"; } else
- if (Status == EFI_INVALID_PARAMETER) { Desc = (CHAR8 *) "Invalid Parameter"; } else
- if (Status == EFI_UNSUPPORTED) { Desc = (CHAR8 *) "Unsupported"; } else
- if (Status == EFI_BAD_BUFFER_SIZE) { Desc = (CHAR8 *) "Bad Buffer Size"; } else
- if (Status == EFI_BUFFER_TOO_SMALL) { Desc = (CHAR8 *) "Buffer Too Small"; } else
- if (Status == EFI_NOT_READY) { Desc = (CHAR8 *) "Not Ready"; } else
- if (Status == EFI_DEVICE_ERROR) { Desc = (CHAR8 *) "Device Error"; } else
- if (Status == EFI_WRITE_PROTECTED) { Desc = (CHAR8 *) "Write Protected"; } else
- if (Status == EFI_OUT_OF_RESOURCES) { Desc = (CHAR8 *) "Out of Resources"; } else
- if (Status == EFI_VOLUME_CORRUPTED) { Desc = (CHAR8 *) "Volume Corrupt"; } else
- if (Status == EFI_VOLUME_FULL) { Desc = (CHAR8 *) "Volume Full"; } else
- if (Status == EFI_NO_MEDIA) { Desc = (CHAR8 *) "No Media"; } else
- if (Status == EFI_MEDIA_CHANGED) { Desc = (CHAR8 *) "Media changed"; } else
- if (Status == EFI_NOT_FOUND) { Desc = (CHAR8 *) "Not Found"; } else
- if (Status == EFI_ACCESS_DENIED) { Desc = (CHAR8 *) "Access Denied"; } else
- if (Status == EFI_NO_RESPONSE) { Desc = (CHAR8 *) "No Response"; } else
- if (Status == EFI_NO_MAPPING) { Desc = (CHAR8 *) "No mapping"; } else
- if (Status == EFI_TIMEOUT) { Desc = (CHAR8 *) "Time out"; } else
- if (Status == EFI_NOT_STARTED) { Desc = (CHAR8 *) "Not started"; } else
- if (Status == EFI_ALREADY_STARTED) { Desc = (CHAR8 *) "Already started"; } else
- if (Status == EFI_ABORTED) { Desc = (CHAR8 *) "Aborted"; } else
- if (Status == EFI_ICMP_ERROR) { Desc = (CHAR8 *) "ICMP Error"; } else
- if (Status == EFI_TFTP_ERROR) { Desc = (CHAR8 *) "TFTP Error"; } else
- if (Status == EFI_PROTOCOL_ERROR) { Desc = (CHAR8 *) "Protocol Error"; } else
- if (Status == EFI_WARN_UNKNOWN_GLYPH) { Desc = (CHAR8 *) "Warning Unknown Glyph"; } else
- if (Status == EFI_WARN_DELETE_FAILURE) { Desc = (CHAR8 *) "Warning Delete Failure"; } else
- if (Status == EFI_WARN_WRITE_FAILURE) { Desc = (CHAR8 *) "Warning Write Failure"; } else
- if (Status == EFI_WARN_BUFFER_TOO_SMALL) { Desc = (CHAR8 *) "Warning Buffer Too Small"; }
-
- //
- // If we found a match, copy the message to the user's buffer. Otherwise
- // sprint the hex status code to their buffer.
- //
- if (Desc != NULL) {
- Size = SPrint (Buffer, BufferSize, STRING_W ("%a"), Desc);
- } else {
- Size = SPrint (Buffer, BufferSize, STRING_W ("%X"), Status);
- }
-
- return Size - 1;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.h
deleted file mode 100644
index 52fbee566f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Print.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Print.h
-
-Abstract:
-
- Private data for Print.c
-
---*/
-
-#ifndef _PRINT_H_
-#define _PRINT_H_
-
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Largest number of characters that can be printed out.
-//
-#define EFI_DRIVER_LIB_MAX_PRINT_BUFFER (80 * 4)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/PrintWidth.h
deleted file mode 100644
index 71f0f541a5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/PrintWidth.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Unicode
- STRING_W is L""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR16 CHAR_W;
-#define STRING_W(_s) L##_s
-
-#define USPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define UvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-#include "EfiCommonLib.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/Sprint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/Sprint.c
deleted file mode 100644
index de99ee07ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Graphics/Unicode/Sprint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = AvSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-AvSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of ASPrint.
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
- CHAR16 UnicodeResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- UnicodeFormat[Index] = (CHAR16) FormatString[Index];
- }
-
- UnicodeFormat[Index] = '\0';
-
- Index = VSPrint (UnicodeResult, sizeof (UnicodeResult), UnicodeFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && UnicodeResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR8) UnicodeResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/PrintWidth.h
deleted file mode 100644
index 91848e9157..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/PrintWidth.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Ascii
- STRING_W is ""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR8 CHAR_W;
-#define STRING_W(_s) _s
-
-#define ASPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define AvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-UINTN
-UvSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN StrLen,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- StartOfBuffer - Wide char buffer to print the results of the parsing of Format into.
- StrLen - Maximum number of characters to put into buffer.
- Format - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/Sprint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/Sprint.c
deleted file mode 100644
index d599f0f133..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Ascii/Sprint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-UvSPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR8 AsciiFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR8 AsciiResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- AsciiFormat[Index] = (CHAR8) FormatString[Index];
- }
-
- AsciiFormat[Index] = '\0';
-
- Index = VSPrint (AsciiResult, EFI_DRIVER_LIB_MAX_PRINT_BUFFER, AsciiFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && AsciiResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR16) AsciiResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.c
deleted file mode 100644
index 5123aacf45..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.c
+++ /dev/null
@@ -1,684 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Graphics.c
-
-Abstract:
-
- Support for Basic Graphics operations.
-
- BugBug: Currently *.BMP files are supported. This will be replaced
- when Tiano graphics format is supported.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "GraphicsLib.h"
-
-
-EFI_STATUS
-GetGraphicsBitMapFromFV (
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-{
- return GetGraphicsBitMapFromFVEx (NULL, FileNameGuid, Image, ImageSize);
-}
-
-EFI_STATUS
-GetGraphicsBitMapFromFVEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- ImageHandle - The driver image handle of the caller. The parameter is used to
- optimize the loading of the image file so that the FV from which
- the driver image is loaded will be tried first.
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-{
- return GetImageEx (
- ImageHandle,
- FileNameGuid,
- EFI_SECTION_RAW,
- Image,
- ImageSize,
- FALSE
- );
-}
-
-
-EFI_STATUS
-ConvertBmpToGopBlt (
- IN VOID *BmpImage,
- IN UINTN BmpImageSize,
- IN OUT VOID **GopBlt,
- IN OUT UINTN *GopBltSize,
- OUT UINTN *PixelHeight,
- OUT UINTN *PixelWidth
- )
-/*++
-
-Routine Description:
-
- Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer
- is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
- buffer is passed in it will be used if it is big enough.
-
-Arguments:
-
- BmpImage - Pointer to BMP file
-
- BmpImageSize - Number of bytes in BmpImage
-
- GopBlt - Buffer containing GOP version of BmpImage.
-
- GopBltSize - Size of GopBlt in bytes.
-
- PixelHeight - Height of GopBlt/BmpImage in pixels
-
- PixelWidth - Width of GopBlt/BmpImage in pixels
-
-
-Returns:
-
- EFI_SUCCESS - GopBlt and GopBltSize are returned.
- EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image
- EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough.
- GopBltSize will contain the required size.
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
---*/
-{
- UINT8 *Image;
- UINT8 *ImageHeader;
- BMP_IMAGE_HEADER *BmpHeader;
- BMP_COLOR_MAP *BmpColorMap;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
- UINT64 BltBufferSize;
- UINTN Index;
- UINTN Height;
- UINTN Width;
- UINTN ImageIndex;
- UINTN DataSizePerLine;
- BOOLEAN IsAllocated;
- UINT32 ColorMapNum;
-
- if (sizeof (BMP_IMAGE_HEADER) > BmpImageSize) {
- return EFI_INVALID_PARAMETER;
- }
-
- BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;
-
- if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Doesn't support compress.
- //
- if (BmpHeader->CompressionType != 0) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Only support BITMAPINFOHEADER format.
- // BITMAPFILEHEADER + BITMAPINFOHEADER = BMP_IMAGE_HEADER
- //
- if (BmpHeader->HeaderSize != sizeof (BMP_IMAGE_HEADER) - ((UINTN) &(((BMP_IMAGE_HEADER *)0)->HeaderSize))) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // The data size in each line must be 4 byte alignment.
- //
- DataSizePerLine = ((BmpHeader->PixelWidth * BmpHeader->BitPerPixel + 31) >> 3) & (~0x3);
- BltBufferSize = MultU64x32 (DataSizePerLine, BmpHeader->PixelHeight);
- if (BltBufferSize > (UINT32) ~0) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((BmpHeader->Size != BmpImageSize) ||
- (BmpHeader->Size < BmpHeader->ImageOffset) ||
- (BmpHeader->Size - BmpHeader->ImageOffset != BmpHeader->PixelHeight * DataSizePerLine)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Calculate Color Map offset in the image.
- //
- Image = BmpImage;
- BmpColorMap = (BMP_COLOR_MAP *) (Image + sizeof (BMP_IMAGE_HEADER));
- if (BmpHeader->ImageOffset < sizeof (BMP_IMAGE_HEADER)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (BmpHeader->ImageOffset > sizeof (BMP_IMAGE_HEADER)) {
- switch (BmpHeader->BitPerPixel) {
- case 1:
- ColorMapNum = 2;
- break;
- case 4:
- ColorMapNum = 16;
- break;
- case 8:
- ColorMapNum = 256;
- break;
- default:
- ColorMapNum = 0;
- break;
- }
- if (BmpHeader->ImageOffset - sizeof (BMP_IMAGE_HEADER) != sizeof (BMP_COLOR_MAP) * ColorMapNum) {
- return EFI_INVALID_PARAMETER;
- }
- }
-
- //
- // Calculate graphics image data address in the image
- //
- Image = ((UINT8 *) BmpImage) + BmpHeader->ImageOffset;
- ImageHeader = Image;
-
- BltBufferSize = MultU64x32 ((UINT64) BmpHeader->PixelWidth, BmpHeader->PixelHeight);
- //
- // Ensure the BltBufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) doesn't overflow
- //
- if (BltBufferSize > DivU64x32 ((UINTN) ~0, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), NULL)) {
- return EFI_UNSUPPORTED;
- }
- BltBufferSize = MultU64x32 (BltBufferSize, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- IsAllocated = FALSE;
- if (*GopBlt == NULL) {
- *GopBltSize = (UINTN) BltBufferSize;
- *GopBlt = EfiLibAllocatePool (*GopBltSize);
- IsAllocated = TRUE;
- if (*GopBlt == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- } else {
- if (*GopBltSize < (UINTN) BltBufferSize) {
- *GopBltSize = (UINTN) BltBufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
- }
-
- *PixelWidth = BmpHeader->PixelWidth;
- *PixelHeight = BmpHeader->PixelHeight;
-
- //
- // Convert image from BMP to Blt buffer format
- //
- BltBuffer = *GopBlt;
- for (Height = 0; Height < BmpHeader->PixelHeight; Height++) {
- Blt = &BltBuffer[(BmpHeader->PixelHeight - Height - 1) * BmpHeader->PixelWidth];
- for (Width = 0; Width < BmpHeader->PixelWidth; Width++, Image++, Blt++) {
- switch (BmpHeader->BitPerPixel) {
- case 1:
- //
- // Convert 1bit BMP to 24-bit color
- //
- for (Index = 0; Index < 8 && Width < BmpHeader->PixelWidth; Index++) {
- Blt->Red = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Red;
- Blt->Green = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Green;
- Blt->Blue = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Blue;
- Blt++;
- Width++;
- }
-
- Blt --;
- Width --;
- break;
-
- case 4:
- //
- // Convert BMP Palette to 24-bit color
- //
- Index = (*Image) >> 4;
- Blt->Red = BmpColorMap[Index].Red;
- Blt->Green = BmpColorMap[Index].Green;
- Blt->Blue = BmpColorMap[Index].Blue;
- if (Width < (BmpHeader->PixelWidth - 1)) {
- Blt++;
- Width++;
- Index = (*Image) & 0x0f;
- Blt->Red = BmpColorMap[Index].Red;
- Blt->Green = BmpColorMap[Index].Green;
- Blt->Blue = BmpColorMap[Index].Blue;
- }
- break;
-
- case 8:
- //
- // Convert BMP Palette to 24-bit color
- //
- Blt->Red = BmpColorMap[*Image].Red;
- Blt->Green = BmpColorMap[*Image].Green;
- Blt->Blue = BmpColorMap[*Image].Blue;
- break;
-
- case 24:
- Blt->Blue = *Image++;
- Blt->Green = *Image++;
- Blt->Red = *Image;
- break;
-
- default:
- if (IsAllocated) {
- gBS->FreePool (*GopBlt);
- *GopBlt = NULL;
- }
- return EFI_UNSUPPORTED;
- break;
- };
-
- }
-
- ImageIndex = (UINTN) (Image - ImageHeader);
- if ((ImageIndex % 4) != 0) {
- //
- // Bmp Image starts each row on a 32-bit boundary!
- //
- Image = Image + (4 - (ImageIndex % 4));
- }
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-LockKeyboards (
- IN CHAR16 *Password
- )
-/*++
-
-Routine Description:
- Use Console Control Protocol to lock the Console In Spliter virtual handle.
- This is the ConInHandle and ConIn handle in the EFI system table. All key
- presses will be ignored until the Password is typed in. The only way to
- disable the password is to type it in to a ConIn device.
-
-Arguments:
- Password - Password used to lock ConIn device
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- Status = ConsoleControl->LockStdIn (ConsoleControl, Password);
- return Status;
-}
-
-EFI_STATUS
-EnableQuietBoot (
- IN EFI_GUID *LogoFile
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off UGA based Simple Text Out consoles from going
- to the UGA device. Put up LogoFile on every UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- return EnableQuietBootEx (LogoFile, NULL);
-}
-
-
-EFI_STATUS
-EnableQuietBootEx (
- IN EFI_GUID *LogoFile,
- IN EFI_HANDLE ImageHandle
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off GOP/UGA based Simple Text Out consoles from going
- to the GOP/UGA device. Put up LogoFile on every GOP/UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
- EFI_OEM_BADGING_PROTOCOL *Badging;
- UINT32 SizeOfX;
- UINT32 SizeOfY;
- INTN DestX;
- INTN DestY;
- UINT8 *ImageData;
- UINTN ImageSize;
- UINTN BltSize;
- UINT32 Instance;
- EFI_BADGING_FORMAT Format;
- EFI_BADGING_DISPLAY_ATTRIBUTE Attribute;
- UINTN CoordinateX;
- UINTN CoordinateY;
- UINTN Height;
- UINTN Width;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- UgaDraw = NULL;
- //
- // Try to open GOP first
- //
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);
- if (EFI_ERROR (Status)) {
- GraphicsOutput = NULL;
- //
- // Open GOP failed, try to open UGA
- //
- Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- }
-
- Badging = NULL;
- Status = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID **) &Badging);
-
- ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenGraphics);
-
- if (GraphicsOutput != NULL) {
- SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
- SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
- } else if (UgaDraw != NULL) {
- Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- } else {
- return EFI_UNSUPPORTED;
- }
-
- Instance = 0;
- while (1) {
- ImageData = NULL;
- ImageSize = 0;
-
- if (Badging != NULL) {
- Status = Badging->GetImage (
- Badging,
- &Instance,
- &Format,
- &ImageData,
- &ImageSize,
- &Attribute,
- &CoordinateX,
- &CoordinateY
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Currently only support BMP format
- //
- if (Format != EfiBadgingFormatBMP) {
- gBS->FreePool (ImageData);
- continue;
- }
- } else {
- Status = GetGraphicsBitMapFromFVEx (ImageHandle, LogoFile, (VOID **) &ImageData, &ImageSize);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- CoordinateX = 0;
- CoordinateY = 0;
- Attribute = EfiBadgingDisplayAttributeCenter;
- }
-
- Blt = NULL;
- Status = ConvertBmpToGopBlt (
- ImageData,
- ImageSize,
- (VOID **) &Blt,
- &BltSize,
- &Height,
- &Width
- );
- if (EFI_ERROR (Status)) {
- gBS->FreePool (ImageData);
- if (Badging == NULL) {
- return Status;
- } else {
- continue;
- }
- }
-
- switch (Attribute) {
- case EfiBadgingDisplayAttributeLeftTop:
- DestX = CoordinateX;
- DestY = CoordinateY;
- break;
-
- case EfiBadgingDisplayAttributeCenterTop:
- DestX = (SizeOfX - Width) / 2;
- DestY = CoordinateY;
- break;
-
- case EfiBadgingDisplayAttributeRightTop:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = CoordinateY;;
- break;
-
- case EfiBadgingDisplayAttributeCenterRight:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = (SizeOfY - Height) / 2;
- break;
-
- case EfiBadgingDisplayAttributeRightBottom:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeCenterBottom:
- DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeLeftBottom:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height - CoordinateY);
- break;
-
- case EfiBadgingDisplayAttributeCenterLeft:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height) / 2;
- break;
-
- case EfiBadgingDisplayAttributeCenter:
- DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height) / 2;
- break;
-
- default:
- DestX = CoordinateX;
- DestY = CoordinateY;
- break;
- }
-
- if ((DestX >= 0) && (DestY >= 0)) {
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- Blt,
- EfiBltBufferToVideo,
- 0,
- 0,
- (UINTN) DestX,
- (UINTN) DestY,
- Width,
- Height,
- Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) Blt,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- (UINTN) DestX,
- (UINTN) DestY,
- Width,
- Height,
- Width * sizeof (EFI_UGA_PIXEL)
- );
- }
- }
-
- gBS->FreePool (ImageData);
- gBS->FreePool (Blt);
-
- if (Badging == NULL) {
- break;
- }
- }
-
- return Status;
-}
-
-
-EFI_STATUS
-DisableQuietBoot (
- VOID
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA
- Simple Text Out screens will now be synced up with all non GOP/UGA output devices
-
-Arguments:
-
- NONE
-
-Returns:
-
- EFI_SUCCESS - GOP/UGA devices are back in text mode and synced up.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-{
- EFI_STATUS Status;
- EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
-
- Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- return ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.inf
deleted file mode 100644
index 46b4b7cc1f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Graphics.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# Graphics.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = GraphicsLite
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Graphics.c
- Print.c
- Print.h
- Unicode/PrintWidth.h
- Unicode/Sprint.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Graphics/Unicode
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
- EfiDriverLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.c
deleted file mode 100644
index 1492e53d68..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.c
+++ /dev/null
@@ -1,528 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Print.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include EFI_PROTOCOL_DEFINITION (HiiFont)
-#else
-#include EFI_PROTOCOL_DEFINITION (Hii)
-#endif
-
-static EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {
- {0x00, 0x00, 0x00, 0x00},
- {0x98, 0x00, 0x00, 0x00},
- {0x00, 0x98, 0x00, 0x00},
- {0x98, 0x98, 0x00, 0x00},
- {0x00, 0x00, 0x98, 0x00},
- {0x98, 0x00, 0x98, 0x00},
- {0x00, 0x98, 0x98, 0x00},
- {0x98, 0x98, 0x98, 0x00},
- {0x10, 0x10, 0x10, 0x00},
- {0xff, 0x10, 0x10, 0x00},
- {0x10, 0xff, 0x10, 0x00},
- {0xff, 0xff, 0x10, 0x00},
- {0x10, 0x10, 0xff, 0x00},
- {0xf0, 0x10, 0xff, 0x00},
- {0x10, 0xff, 0xff, 0x00},
- {0xff, 0xff, 0xff, 0x00},
-};
-
-
-UINTN
-_IPrint (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw,
- IN EFI_SIMPLE_TEXT_OUT_PROTOCOL *Sto,
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background,
- IN CHAR16 *fmt,
- IN VA_LIST args
- )
-/*++
-
-Routine Description:
-
- Display string worker for: Print, PrintAt, IPrint, IPrintAt
-
-Arguments:
-
- GraphicsOutput - Graphics output protocol interface
-
- UgaDraw - UGA draw protocol interface
-
- Sto - Simple text out protocol interface
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- Foreground - Foreground color
-
- Background - Background color
-
- fmt - Format string
-
- args - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
-{
- VOID *Buffer;
- EFI_STATUS Status;
- UINTN Index;
- CHAR16 *UnicodeWeight;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- UINTN BufferLen;
- UINTN LineBufferLen;
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- EFI_HII_FONT_PROTOCOL *HiiFont;
- EFI_IMAGE_OUTPUT *Blt;
- EFI_FONT_DISPLAY_INFO *FontInfo;
-#else
- EFI_HII_PROTOCOL *Hii;
- UINT16 GlyphWidth;
- UINT32 GlyphStatus;
- UINT16 StringIndex;
- EFI_NARROW_GLYPH *Glyph;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;
-#endif
-
- //
- // For now, allocate an arbitrarily long buffer
- //
- BufferLen = 0;
- Buffer = EfiLibAllocateZeroPool (0x10000);
- if (Buffer == NULL) {
- return 0;
- }
-
- if (GraphicsOutput != NULL) {
- HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;
- VerticalResolution = GraphicsOutput->Mode->Info->VerticalResolution;
- } else {
- UgaDraw->GetMode (UgaDraw, &HorizontalResolution, &VerticalResolution, &ColorDepth, &RefreshRate);
- }
- ASSERT ((HorizontalResolution != 0) && (VerticalResolution !=0));
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- Blt = NULL;
- FontInfo = NULL;
- ASSERT (GraphicsOutput != NULL);
- Status = gBS->LocateProtocol (&gEfiHiiFontProtocolGuid, NULL, (VOID **) &HiiFont);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-#else
- LineBuffer = NULL;
- Status = gBS->LocateProtocol (&gEfiHiiProtocolGuid, NULL, (VOID**)&Hii);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
- LineBufferLen = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * HorizontalResolution * GLYPH_HEIGHT;
- LineBuffer = EfiLibAllocatePool (LineBufferLen);
- if (LineBuffer == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-#endif
-
- VSPrint (Buffer, 0x10000, fmt, args);
-
- UnicodeWeight = (CHAR16 *) Buffer;
-
- for (Index = 0; UnicodeWeight[Index] != 0; Index++) {
- if (UnicodeWeight[Index] == CHAR_BACKSPACE ||
- UnicodeWeight[Index] == CHAR_LINEFEED ||
- UnicodeWeight[Index] == CHAR_CARRIAGE_RETURN) {
- UnicodeWeight[Index] = 0;
- }
- }
-
- BufferLen = EfiStrLen (Buffer);
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- LineBufferLen = sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * HorizontalResolution * EFI_GLYPH_HEIGHT;
- if (EFI_GLYPH_WIDTH * EFI_GLYPH_HEIGHT * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * BufferLen > LineBufferLen) {
- Status = EFI_INVALID_PARAMETER;
- goto Error;
- }
-
- Blt = (EFI_IMAGE_OUTPUT *) EfiLibAllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
- if (Blt == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
-
- Blt->Width = (UINT16) (HorizontalResolution);
- Blt->Height = (UINT16) (VerticalResolution);
- Blt->Image.Screen = GraphicsOutput;
-
- FontInfo = (EFI_FONT_DISPLAY_INFO *) EfiLibAllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
- if (FontInfo == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- goto Error;
- }
- if (Foreground != NULL) {
- EfiCopyMem (&FontInfo->ForegroundColor, Foreground, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- } else {
- EfiCopyMem (
- &FontInfo->ForegroundColor,
- &mEfiColors[Sto->Mode->Attribute & 0x0f],
- sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
- if (Background != NULL) {
- EfiCopyMem (&FontInfo->BackgroundColor, Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- } else {
- EfiCopyMem (
- &FontInfo->BackgroundColor,
- &mEfiColors[Sto->Mode->Attribute >> 4],
- sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
-
- Status = HiiFont->StringToImage (
- HiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_DIRECT_TO_SCREEN,
- Buffer,
- FontInfo,
- &Blt,
- X,
- Y,
- NULL,
- NULL,
- NULL
- );
-
-#else
- GlyphStatus = 0;
-
- if (GLYPH_WIDTH * GLYPH_HEIGHT * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * BufferLen > LineBufferLen) {
- Status = EFI_INVALID_PARAMETER;
- goto Error;
- }
-
- for (Index = 0; Index < BufferLen; Index++) {
- StringIndex = (UINT16) Index;
- Status = Hii->GetGlyph (Hii, UnicodeWeight, &StringIndex, (UINT8 **) &Glyph, &GlyphWidth, &GlyphStatus);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- if (Foreground == NULL || Background == NULL) {
- Status = Hii->GlyphToBlt (
- Hii,
- (UINT8 *) Glyph,
- mEfiColors[Sto->Mode->Attribute & 0x0f],
- mEfiColors[Sto->Mode->Attribute >> 4],
- BufferLen,
- GlyphWidth,
- GLYPH_HEIGHT,
- &LineBuffer[Index * GLYPH_WIDTH]
- );
- } else {
- Status = Hii->GlyphToBlt (
- Hii,
- (UINT8 *) Glyph,
- *Foreground,
- *Background,
- BufferLen,
- GlyphWidth,
- GLYPH_HEIGHT,
- &LineBuffer[Index * GLYPH_WIDTH]
- );
- }
- }
-
- //
- // Blt a character to the screen
- //
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- LineBuffer,
- EfiBltBufferToVideo,
- 0,
- 0,
- X,
- Y,
- GLYPH_WIDTH * BufferLen,
- GLYPH_HEIGHT,
- GLYPH_WIDTH * BufferLen * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) LineBuffer,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- X,
- Y,
- GLYPH_WIDTH * BufferLen,
- GLYPH_HEIGHT,
- GLYPH_WIDTH * BufferLen * sizeof (EFI_UGA_PIXEL)
- );
- }
-
-#endif
-
-Error:
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- EfiLibSafeFreePool (Blt);
- EfiLibSafeFreePool (FontInfo);
-#else
- EfiLibSafeFreePool (LineBuffer);
-#endif
- gBS->FreePool (Buffer);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- return BufferLen;
-}
-
-
-UINTN
-PrintXY (
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *ForeGround, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BackGround, OPTIONAL
- IN CHAR_W *Fmt,
- ...
- )
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to the default console
-
-Arguments:
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- ForeGround - Foreground color
-
- BackGround - Background color
-
- Fmt - Format string
-
- ... - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
-{
- EFI_HANDLE Handle;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_SIMPLE_TEXT_OUT_PROTOCOL *Sto;
- EFI_STATUS Status;
- VA_LIST Args;
- UINTN LengthOfPrinted;
-
- Handle = gST->ConsoleOutHandle;
-
- GraphicsOutput = NULL;
- UgaDraw = NULL;
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiGraphicsOutputProtocolGuid,
- (VOID **) &GraphicsOutput
- );
-
- if (EFI_ERROR (Status) || (GraphicsOutput == NULL)) {
- GraphicsOutput = NULL;
-
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **) &UgaDraw
- );
-
- if (EFI_ERROR (Status) || (UgaDraw == NULL)) {
- return 0;
- }
- }
-
- Sto = NULL;
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiSimpleTextOutProtocolGuid,
- (VOID **) &Sto
- );
-
- if (EFI_ERROR (Status) || (Sto == NULL)) {
- return 0;
- }
-
- VA_START (Args, Fmt);
- LengthOfPrinted = _IPrint (GraphicsOutput, UgaDraw, Sto, X, Y, ForeGround, BackGround, Fmt, Args);
- VA_END (Args);
- return LengthOfPrinted;
-}
-
-
-UINTN
-SPrint (
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- SPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-UINTN
-EFIAPI
-VSPrint (
- OUT CHAR_W *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Unicode format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PRINT_PROTOCOL *PrintProtocol;
-
- Status = gBS->LocateProtocol (
- &gEfiPrintProtocolGuid,
- NULL,
- (VOID **) &PrintProtocol
- );
- if (EFI_ERROR (Status)) {
- return 0;
- } else {
- return PrintProtocol->VSPrint (
- StartOfBuffer,
- BufferSize,
- FormatString,
- Marker
- );
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.h
deleted file mode 100644
index 52fbee566f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Print.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Print.h
-
-Abstract:
-
- Private data for Print.c
-
---*/
-
-#ifndef _PRINT_H_
-#define _PRINT_H_
-
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Largest number of characters that can be printed out.
-//
-#define EFI_DRIVER_LIB_MAX_PRINT_BUFFER (80 * 4)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/PrintWidth.h
deleted file mode 100644
index 7bc83283e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/PrintWidth.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Unicode
- STRING_W is L""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR16 CHAR_W;
-#define STRING_W(_s) L##_s
-
-#define USPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define UvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-#include "EfiCommonLib.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/Sprint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/Sprint.c
deleted file mode 100644
index de99ee07ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/GraphicsLite/Unicode/Sprint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = AvSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-AvSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of ASPrint.
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
- CHAR16 UnicodeResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- UnicodeFormat[Index] = (CHAR16) FormatString[Index];
- }
-
- UnicodeFormat[Index] = '\0';
-
- Index = VSPrint (UnicodeResult, sizeof (UnicodeResult), UnicodeFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && UnicodeResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR8) UnicodeResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/Hob.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/Hob.c
deleted file mode 100644
index ae35d990be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/Hob.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- hob.c
-
-Abstract:
-
- Support for hob operation
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "PeiHob.h"
-#include EFI_GUID_DEFINITION (IoBaseHob)
-#include EFI_GUID_DEFINITION (MemoryAllocationHob)
-
-VOID *
-GetHob (
- IN UINT16 Type,
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- This function returns the first instance of a HOB type in a HOB list.
-
-Arguments:
-
- Type The HOB type to return.
- HobStart The first HOB in the HOB list.
-
-Returns:
-
- HobStart There were no HOBs found with the requested type.
- else Returns the first HOB with the matching type.
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
- //
- // Return input if not found
- //
- if (HobStart == NULL) {
- return HobStart;
- }
-
- //
- // Parse the HOB list, stop if end of list or matching type found.
- //
- while (!END_OF_HOB_LIST (Hob)) {
-
- if (Hob.Header->HobType == Type) {
- break;
- }
-
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
-
- //
- // Return input if not found
- //
- if (END_OF_HOB_LIST (Hob)) {
- return HobStart;
- }
-
- return (VOID *) (Hob.Raw);
-}
-
-UINTN
-GetHobListSize (
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- Get size of hob list.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
-Returns:
-
- Size of hob list.
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- UINTN Size;
-
- Hob.Raw = HobStart;
- Size = 0;
-
- while (Hob.Header->HobType != EFI_HOB_TYPE_END_OF_HOB_LIST) {
- Size += Hob.Header->HobLength;
- Hob.Raw += Hob.Header->HobLength;
- }
-
- Size += Hob.Header->HobLength;
-
- return Size;
-}
-
-UINT32
-GetHobVersion (
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- Get hob version.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
-Returns:
-
- Hob version.
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
- return Hob.HandoffInformationTable->Version;
-}
-
-EFI_STATUS
-GetHobBootMode (
- IN VOID *HobStart,
- OUT EFI_BOOT_MODE *BootMode
- )
-/*++
-
-Routine Description:
-
- Get current boot mode.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BootMode - Current boot mode recorded in PHIT hob
-
-Returns:
-
- EFI_NOT_FOUND - Invalid hob header
-
- EFI_SUCCESS - Boot mode found
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
- if (Hob.Header->HobType != EFI_HOB_TYPE_HANDOFF) {
- return EFI_NOT_FOUND;
- }
-
- *BootMode = Hob.HandoffInformationTable->BootMode;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetCpuHobInfo (
- IN VOID *HobStart,
- OUT UINT8 *SizeOfMemorySpace,
- OUT UINT8 *SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Get information recorded in CPU hob (Memory space size, Io space size)
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- SizeOfMemorySpace - Size of memory size
-
- SizeOfIoSpace - Size of IO size
-
-Returns:
-
- EFI_NOT_FOUND - CPU hob not found
-
- EFI_SUCCESS - CPU hob found and information got.
-
---*/
-{
- EFI_PEI_HOB_POINTERS CpuHob;
-
- CpuHob.Raw = HobStart;
- CpuHob.Raw = GetHob (EFI_HOB_TYPE_CPU, CpuHob.Raw);
- if (CpuHob.Header->HobType != EFI_HOB_TYPE_CPU) {
- return EFI_NOT_FOUND;
- }
-
- *SizeOfMemorySpace = CpuHob.Cpu->SizeOfMemorySpace;
- *SizeOfIoSpace = CpuHob.Cpu->SizeOfIoSpace;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetDxeCoreHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length,
- OUT VOID **EntryPoint,
- OUT EFI_GUID **FileName
- )
-/*++
-
-Routine Description:
-
- Get memory allocation hob created for DXE core and extract its information
-
-Arguments:
-
- HobStart - Start pointer of the hob list
- BaseAddress - Start address of memory allocated for DXE core
- Length - Length of memory allocated for DXE core
- EntryPoint - DXE core file name
- FileName - File Name
-
-Returns:
-
- EFI_NOT_FOUND - DxeCoreHob not found
- EFI_SUCCESS - DxeCoreHob found and information got
-
---*/
-{
- EFI_PEI_HOB_POINTERS DxeCoreHob;
-
-
- DxeCoreHob.Raw = HobStart;
- DxeCoreHob.Raw = GetHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, DxeCoreHob.Raw);
- while (DxeCoreHob.Header->HobType == EFI_HOB_TYPE_MEMORY_ALLOCATION &&
- !EfiCompareGuid (&DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.Name,
- &gEfiHobMemeryAllocModuleGuid)) {
-
- DxeCoreHob.Raw = GET_NEXT_HOB (DxeCoreHob);
- DxeCoreHob.Raw = GetHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, DxeCoreHob.Raw);
-
- }
-
- if (DxeCoreHob.Header->HobType != EFI_HOB_TYPE_MEMORY_ALLOCATION) {
- return EFI_NOT_FOUND;
- }
-
- *BaseAddress = DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.MemoryBaseAddress;
- *Length = DxeCoreHob.MemoryAllocationModule->MemoryAllocationHeader.MemoryLength;
- *EntryPoint = (VOID *) (UINTN) DxeCoreHob.MemoryAllocationModule->EntryPoint;
- *FileName = &DxeCoreHob.MemoryAllocationModule->ModuleName;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetNextFirmwareVolumeHob (
- IN OUT VOID **HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length
- )
-/*++
-
-Routine Description:
-
- Get next firmware volume hob from HobStart
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - Start address of next firmware volume
-
- Length - Length of next firmware volume
-
-Returns:
-
- EFI_NOT_FOUND - Next firmware volume not found
-
- EFI_SUCCESS - Next firmware volume found with address information
-
---*/
-{
- EFI_PEI_HOB_POINTERS FirmwareVolumeHob;
-
- FirmwareVolumeHob.Raw = *HobStart;
- if (END_OF_HOB_LIST (FirmwareVolumeHob)) {
- return EFI_NOT_FOUND;
- }
-
- FirmwareVolumeHob.Raw = GetHob (EFI_HOB_TYPE_FV, *HobStart);
- if (FirmwareVolumeHob.Header->HobType != EFI_HOB_TYPE_FV) {
- return EFI_NOT_FOUND;
- }
-
- *BaseAddress = FirmwareVolumeHob.FirmwareVolume->BaseAddress;
- *Length = FirmwareVolumeHob.FirmwareVolume->Length;
-
- *HobStart = GET_NEXT_HOB (FirmwareVolumeHob);
-
- return EFI_SUCCESS;
-}
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-EFI_STATUS
-GetNextFirmwareVolume2Hob (
- IN OUT VOID **HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length,
- OUT EFI_GUID *FileName
- )
-/*++
-
-Routine Description:
-
- Get next firmware volume2 hob from HobStart
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - Start address of next firmware volume
-
- Length - Length of next firmware volume
-
-Returns:
-
- EFI_NOT_FOUND - Next firmware volume not found
-
- EFI_SUCCESS - Next firmware volume found with address information
-
---*/
-{
- EFI_PEI_HOB_POINTERS FirmwareVolumeHob;
-
- FirmwareVolumeHob.Raw = *HobStart;
- if (END_OF_HOB_LIST (FirmwareVolumeHob)) {
- return EFI_NOT_FOUND;
- }
-
- FirmwareVolumeHob.Raw = GetHob (EFI_HOB_TYPE_FV2, *HobStart);
- if (FirmwareVolumeHob.Header->HobType != EFI_HOB_TYPE_FV2) {
- return EFI_NOT_FOUND;
- }
-
- *BaseAddress = FirmwareVolumeHob.FirmwareVolume2->BaseAddress;
- *Length = FirmwareVolumeHob.FirmwareVolume2->Length;
- EfiCommonLibCopyMem(FileName,&FirmwareVolumeHob.FirmwareVolume2->FileName,sizeof(EFI_GUID));
-
- *HobStart = GET_NEXT_HOB (FirmwareVolumeHob);
-
- return EFI_SUCCESS;
-}
-#endif
-
-EFI_STATUS
-GetNextGuidHob (
- IN OUT VOID **HobStart,
- IN EFI_GUID * Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
- Get the next guid hob.
-
-Arguments:
- HobStart A pointer to the start hob.
- Guid A pointer to a guid.
- Buffer A pointer to the buffer.
- BufferSize Buffer size.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - Next Guid hob not found
-
- EFI_SUCCESS - Next Guid hob found and data for this Guid got
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- if (Buffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
-
- GuidHob.Raw = *HobStart;
- if (END_OF_HOB_LIST (GuidHob)) {
- return EFI_NOT_FOUND;
- }
-
- GuidHob.Raw = GetHob (EFI_HOB_TYPE_GUID_EXTENSION, *HobStart);
- if (GuidHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {
- if (EfiCompareGuid (Guid, &GuidHob.Guid->Name)) {
- Status = EFI_SUCCESS;
- *Buffer = (VOID *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
- if (BufferSize != NULL) {
- *BufferSize = GuidHob.Header->HobLength - sizeof (EFI_HOB_GUID_TYPE);
- }
- }
- }
-
- *HobStart = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
-
-
-#define PAL_ENTRY_HOB {0xe53cb8cc, 0xd62c, 0x4f74, {0xbd, 0xda, 0x31, 0xe5, 0x8d, 0xe5, 0x3e, 0x2}}
-EFI_GUID gPalEntryHob = PAL_ENTRY_HOB;
-
-EFI_STATUS
-GetPalEntryHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *PalEntry
- )
-/*++
-
-Routine Description:
-
- Get PAL entry from PalEntryHob
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- PalEntry - Pointer to PAL entry
-
-Returns:
-
- Status code.
-
---*/
-{
- VOID *Buffer;
- UINTN BufferSize;
- EFI_STATUS Status;
- VOID *HobStart2;
-
- //
- // Initialize 'Buffer' to NULL before usage
- //
- Buffer = NULL;
- HobStart2 = HobStart;
- Status = GetNextGuidHob (
- &HobStart2,
- &gPalEntryHob,
- &Buffer,
- &BufferSize
- );
- if (EFI_ERROR (Status) || (Buffer == NULL)) {
- //
- // Failed to get HOB for gPalEntryHob
- //
- return EFI_NOT_FOUND;
- }
- *PalEntry = *((EFI_PHYSICAL_ADDRESS *) Buffer);
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-GetIoPortSpaceAddressHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *IoPortSpaceAddress
- )
-/*++
-
-Routine Description:
-
- Get IO port space address from IoBaseHob.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- IoPortSpaceAddress - IO port space address
-
-Returns:
-
- Status code
-
---*/
-{
-
- VOID *Buffer;
- UINTN BufferSize;
- EFI_STATUS Status;
- VOID *HobStart2;
-
- //
- // Initialize 'Buffer' to NULL before usage
- //
- Buffer = NULL;
- HobStart2 = HobStart;
- Status = GetNextGuidHob (
- &HobStart2,
- &gEfiIoBaseHobGuid,
- &Buffer,
- &BufferSize
- );
- if (EFI_ERROR (Status) || (Buffer == NULL)) {
- //
- // Failed to get HOB for gEfiIoBaseHobGuid
- //
- return EFI_NOT_FOUND;
- }
-
- *IoPortSpaceAddress = *((EFI_PHYSICAL_ADDRESS *) Buffer);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/HobLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/HobLib.inf
deleted file mode 100644
index 20895fba7a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Hob/HobLib.inf
+++ /dev/null
@@ -1,46 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# HobLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = HobLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Hob.c
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
- EdkGuidLib
- EdkFrameworkGuidLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Aarch64/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Aarch64/ProcDep.h
deleted file mode 100644
index bd9b6cde1c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Aarch64/ProcDep.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @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.
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- AArch64 specific Runtime Lib code. At this time there is none.
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/CpuFuncs.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/CpuFuncs.h
deleted file mode 100755
index e030a7e73d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/CpuFuncs.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- CpuFuncs.h
-
-Abstract:
-
---*/
-
-#ifndef _CPU_FUNCS_H_
-#define _CPU_FUNCS_H_
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/ProcDep.h
deleted file mode 100755
index 70f33754af..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Arm/ProcDep.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- IA-32 specific Runtime Lib code. At this time there is non.
- IPF has different code due to extra API requirements.
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ebc/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ebc/ProcDep.h
deleted file mode 100644
index 996c5434b6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ebc/ProcDep.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- EBC- specific runtime lib. Only used to get a clean build of
- EFI libraries.
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCombinationLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCombinationLib.h
deleted file mode 100644
index 6675ff7800..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCombinationLib.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiCombinationLib.h
-
-Abstract:
-
- Library functions that can be called in both PEI and DXE phase
-
---*/
-
-#ifndef _EFI_COMBINATION_LIB_H_
-#define _EFI_COMBINATION_LIB_H_
-
-EFI_STATUS
-EfiInitializeCommonDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN VOID *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize lib function calling phase: PEI or DXE
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiCommonIoRead (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io read operation.
-
-Arguments:
-
- Width - Width of read operation
- Address - Start IO address to read
- Count - Read count
- Buffer - Buffer to store result
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonIoWrite (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io write operation.
-
-Arguments:
-
- Width - Width of write operation
- Address - Start IO address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonPciRead (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci read operation
-
-Arguments:
-
- Width - Width of PCI read
- Address - PCI address to read
- Count - Read count
- Buffer - Output buffer for the read
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonPciWrite (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci write operation
-
-Arguments:
-
- Width - Width of PCI write
- Address - PCI address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonStall (
- IN UINTN Microseconds
- )
-/*++
-
-Routine Description:
-
- Induces a fine-grained stall.
-
-Arguments:
-
- Microseconds - The number of microseconds to stall execution.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonAllocatePages (
- IN EFI_ALLOCATE_TYPE Type,
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN OUT EFI_PHYSICAL_ADDRESS *Memory
- )
-/*++
-
-Routine Description:
-
- Allocates memory pages from the system.
-
-Arguments:
-
- Type - The type of allocation to perform.
- MemoryType - The type of memory to allocate.
- Pages - The number of contiguous pages to allocate.
- Memory - Pointer to a physical address.
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - The pages could not be allocated.
-
- EFI_INVALID_PARAMETER - Invalid parameter
-
- EFI_NOT_FOUND - The requested pages could not be found.
-
- EFI_SUCCESS - The requested pages were allocated.
-
---*/
-;
-
-EFI_STATUS
-EfiCommonLocateInterface (
- IN EFI_GUID *Guid,
- OUT VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Returns the first protocol instance that matches the given protocol.
-
-Arguments:
-
- Guid - Provides the protocol to search for.
- Interface - On return, a pointer to the first interface that matches Protocol
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId,
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCommonLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCommonLib.h
deleted file mode 100644
index a80446e362..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCommonLib.h
+++ /dev/null
@@ -1,1359 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiCommonLib.h
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#ifndef _EFI_COMMON_LIB_H_
-#define _EFI_COMMON_LIB_H_
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Return the EFI 1.0 System Tabl entry with TableGuid
-
-Arguments:
-
- TableGuid - Name of entry to return in the system table
- Table - Pointer in EFI system table associated with TableGuid
-
-Returns:
-
- EFI_SUCCESS - Table returned;
- EFI_NOT_FOUND - TableGuid not in EFI system table
-
---*/
-;
-
-//
-// ASPrint and AvSPrint definitions you must include the specific library
-// to get the expected behavior from the two functions
-// PEI: PeiLib
-// Graphics: Dxe\Graphics\Unicode Dxe\Graphics\ASCII
-// ASCII: Dxe\Print\ASCII
-// Unicode: Dxe\Print\Unicode
-//
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-AvSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN StrSize,
- IN CONST CHAR8 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of ASPrint.
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- StartOfBuffer - Narrow char buffer to print the results of the parsing of Format into.
- StrSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-//
-// Lib functions which can be used in both PEI and DXE pahse
-//
-EFI_STATUS
-EfiInitializeCommonDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN VOID *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize lib function calling phase: PEI or DXE
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiCommonIoRead (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io read operation.
-
-Arguments:
-
- Width - Width of read operation
- Address - Start IO address to read
- Count - Read count
- Buffer - Buffer to store result
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonIoWrite (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io write operation.
-
-Arguments:
-
- Width - Width of write operation
- Address - Start IO address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonPciRead (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci read operation
-
-Arguments:
-
- Width - Width of PCI read
- Address - PCI address to read
- Count - Read count
- Buffer - Output buffer for the read
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCommonPciWrite (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci write operation
-
-Arguments:
-
- Width - Width of PCI write
- Address - PCI address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-;
-
-BOOLEAN
-EfiCompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-/*++
-
-Routine Description:
-
- Compares two GUIDs
-
-Arguments:
-
- Guid1 - guid to compare
-
- Guid2 - guid to compare
-
-Returns:
- TRUE if Guid1 == Guid2
- FALSE if Guid1 != Guid2
-
---*/
-;
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN UINT8 Value
- )
-/*++
-
-Routine Description:
-
- Set Buffer to Value for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
- Value - Value of the set operation.
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-;
-
-INTN
-EfiCompareMem (
- IN VOID *MemOne,
- IN VOID *MemTwo,
- IN UINTN Len
- )
-/*++
-
-Routine Description:
-
- Compares two memory buffers of a given length.
-
-Arguments:
-
- MemOne - First memory buffer
-
- MemTwo - Second memory buffer
-
- Len - Length of Mem1 and Mem2 memory regions to compare
-
-Returns:
-
- = 0 if MemOne == MemTwo
-
- > 0 if MemOne > MemTwo
-
- < 0 if MemOne < MemTwo
-
---*/
-;
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Set Buffer to 0 for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
-Returns:
-
- None
-
---*/
-;
-
-//
-// Min Max
-//
-#define EFI_MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define EFI_MAX(a, b) (((a) > (b)) ? (a) : (b))
-
-//
-// Align a pointer. The pointer represented by ptr is aligned to the bound.
-// The resulting pointer is always equal or greater (by no more than bound-1)
-// than the ptr. I.e., if the ptr is already aligned, the result will be equal to ptr.
-// Valid values for bound are powers of two: 2, 4, 8, 16, 32 etc.
-// The returned pointer is VOID* this assignment-compatible with all pointer types.
-//
-#define EFI_ALIGN(ptr, bound) ((VOID *) (((UINTN) (ptr) + ((UINTN) (bound) - 1)) &~((UINTN) (bound) - 1)))
-
-//
-// Alignment tests.
-//
-#define EFI_UINTN_ALIGN_MASK (sizeof (UINTN) - 1)
-#define EFI_UINTN_ALIGNED(ptr) (((UINTN) (ptr)) & EFI_UINTN_ALIGN_MASK)
-
-//
-// Integer division with rounding to the nearest rather than truncating.
-// For example 8/3=2 but EFI_IDIV_ROUND(8,3)=3. 1/3=0 and EFI_IDIV_ROUND(1,3)=0.
-// A half is rounded up e.g., EFI_IDIV_ROUND(1,2)=1 but 1/2=0.
-//
-#define EFI_IDIV_ROUND(r, s) ((r) / (s) + (((2 * ((r) % (s))) < (s)) ? 0 : 1))
-
-//
-// ReportStatusCode.c init
-//
-VOID *
-EfiConstructStatusCodeData (
- IN UINT16 DataSize,
- IN EFI_GUID *TypeGuid,
- IN OUT EFI_STATUS_CODE_DATA *Data
- )
-/*++
-
-Routine Description:
-
- Construct stanader header for optional data passed into ReportStatusCode
-
-Arguments:
-
- DataSize - Size of optional data. Does not include EFI_STATUS_CODE_DATA header
- TypeGuid - GUID to place in EFI_STATUS_CODE_DATA
- Data - Buffer to use.
-
-Returns:
-
- Return pointer to Data buffer pointing past the end of EFI_STATUS_CODE_DATA
-
---*/
-;
-
-EFI_STATUS
-EfiDebugVPrintWorker (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- IN VA_LIST Marker,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- Marker - VarArgs
-
- BufferSize - Size of Buffer.
-
- Buffer - Caller allocated buffer, contains ReportStatusCode extended data
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiDebugAssertWorker (
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded DEADLOOP ().
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- FileName - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT().
-
- Description - Description, usually the assertion,
-
- BufferSize - Size of Buffer.
-
- Buffer - Caller allocated buffer, contains ReportStatusCode extendecd data
-
-Returns:
-
- Status code
-
---*/
-;
-
-BOOLEAN
-ReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- )
-/*++
-
-Routine Description:
-
- Extract assert information from status code data.
-
-Arguments:
-
- CodeType - Code type
- Value - Code value
- Data - Optional data associated with this status code.
- Filename - Filename extracted from Data
- Description - Description extracted from Data
- LineNumber - Line number extracted from Data
-
-Returns:
-
- TRUE - Successfully extracted
-
- FALSE - Extraction failed
-
---*/
-;
-
-BOOLEAN
-ReportStatusCodeExtractDebugInfo (
- IN EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- )
-/*++
-
-Routine Description:
-
- Extract debug information from status code data.
-
-Arguments:
-
- Data - Optional data associated with status code.
- ErrorLevel - Error level extracted from Data
- Marker - VA_LIST extracted from Data
- Format - Format string extracted from Data
-
-Returns:
-
- TRUE - Successfully extracted
-
- FALSE - Extraction failed
-
---*/
-;
-
-BOOLEAN
-CodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- )
-/*++
-
-Routine Description:
-
- Convert code value to an 8 bit post code
-
-Arguments:
-
- CodeType - Code type
- Value - Code value
- PostCode - Post code as output
-
-Returns:
-
- TRUE - Successfully converted
-
- FALSE - Convertion failed
-
---*/
-;
-
-//
-// math.c
-//
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit
- value returns 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand - multiplicand
- Multiplier - multiplier
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-;
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
-
-Arguments:
-
- Dividend - dividend
- Divisor - divisor
- Remainder - buffer for remainder
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
---*/
-;
-
-UINT64
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be right shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift right.
-
-Returns:
-
- Value shifted right identified by the Count.
-
---*/
-;
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and
- returns the shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-;
-
-UINT64
-Power10U64 (
- IN UINT64 Operand,
- IN UINTN Power
- )
-/*++
-
-Routine Description:
-
- Raise 10 to the power of Power, and multiply the result with Operand
-
-Arguments:
-
- Operand - multiplicand
- Power - power
-
-Returns:
-
- Operand * 10 ^ Power
-
---*/
-;
-
-UINT8
-Log2 (
- IN UINT64 Operand
- )
-/*++
-
-Routine Description:
-
- Calculates and floors logarithms based on 2
-
-Arguments:
-
- Operand - value to calculate logarithm
-
-Returns:
-
- The largest integer that is less than or equal
- to the logarithm of Operand based on 2
-
---*/
-;
-
-UINT64
-GetPowerOfTwo (
- IN UINT64 Input
- )
-/*++
-
-Routine Description:
-
- Calculates the largest integer that is both
- a power of two and less than Input
-
-Arguments:
-
- Input - value to calculate power of two
-
-Returns:
-
- the largest integer that is both a power of
- two and less than Input
-
---*/
-;
-
-//
-// Unicode String primatives
-//
-VOID
-EfiStrCpy (
- IN CHAR16 *Destination,
- IN CHAR16 *Source
- )
-/*++
-
-Routine Description:
- Copy the Unicode string Source to Destination.
-
-Arguments:
- Destination - Location to copy string
- Source - String to copy
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-EfiStrnCpy (
- OUT CHAR16 *Dst,
- IN CHAR16 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Copy a string from source to destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-;
-
-UINTN
-EfiStrLen (
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Return the number of Unicode characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Unicode characters in String
-
---*/
-;
-
-UINTN
-EfiStrSize (
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Return the number bytes in the Unicode String. This is not the same as
- the length of the string in characters. The string size includes the NULL
-
-Arguments:
- String - String to process
-
-Returns:
- Number of bytes in String
-
---*/
-;
-
-INTN
-EfiStrCmp (
- IN CHAR16 *String,
- IN CHAR16 *String2
- )
-/*++
-
-Routine Description:
- Return the alphabetic relationship between two stirngs.
-
-Arguments:
- String - Compare to String2
-
- String2 - Compare to String
-
-Returns:
- 0 - Identical
-
- > 0 - String is alphabeticly greater than String2
-
- < 0 - String is alphabeticly less than String2
-
---*/
-;
-
-INTN
-EfiStrnCmp (
- IN CHAR16 *String,
- IN CHAR16 *String2,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- This function compares the Unicode string String to the Unicode
- string String2 for len characters. If the first len characters
- of String is identical to the first len characters of String2,
- then 0 is returned. If substring of String sorts lexicographically
- after String2, the function returns a number greater than 0. If
- substring of String sorts lexicographically before String2, the
- function returns a number less than 0.
-
-Arguments:
- String - Compare to String2
- String2 - Compare to String
- Length - Number of Unicode characters to compare
-
-Returns:
- 0 - The substring of String and String2 is identical.
- > 0 - The substring of String sorts lexicographically after String2
- < 0 - The substring of String sorts lexicographically before String2
-
---*/
-;
-
-VOID
-EfiStrCat (
- IN CHAR16 *Destination,
- IN CHAR16 *Source
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-EfiStrnCat (
- IN CHAR16 *Dest,
- IN CHAR16 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-;
-
-UINTN
-EfiAsciiStrLen (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
- Return the number of Ascii characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Unicode characters in String
-
---*/
-;
-
-CHAR8 *
-EfiAsciiStrCpy (
- IN CHAR8 *Destination,
- IN CHAR8 *Source
- )
-/*++
-
-Routine Description:
- Copy the Ascii string Source to Destination.
-
-Arguments:
- Destination - Location to copy string
- Source - String to copy
-
-Returns:
- Pointer just pass the end of Destination
-
---*/
-;
-
-VOID
-EfiAsciiStrnCpy (
- OUT CHAR8 *Dst,
- IN CHAR8 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Copy the Ascii string from source to destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-;
-
-UINTN
-EfiAsciiStrSize (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
- Return the number bytes in the Ascii String. This is not the same as
- the length of the string in characters. The string size includes the NULL
-
-Arguments:
- String - String to process
-
-Returns:
- Number of bytes in String
-
---*/
-;
-
-
-INTN
-EfiAsciiStrCmp (
- IN CHAR8 *String,
- IN CHAR8 *String2
- )
-/*++
-
-Routine Description:
- Compare the Ascii string pointed by String to the string pointed by String2.
-
-Arguments:
- String - String to process
-
- String2 - The other string to process
-
-Returns:
- Return a positive integer if String is lexicall greater than String2; Zero if
- the two strings are identical; and a negative integer if String is lexically
- less than String2.
---*/
-;
-
-INTN
-EfiAsciiStrnCmp (
- IN CHAR8 *String,
- IN CHAR8 *String2,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- This function compares the ASCII string String to the ASCII
- string String2 for len characters. If the first len characters
- of String is identical to the first len characters of String2,
- then 0 is returned. If substring of String sorts lexicographically
- after String2, the function returns a number greater than 0. If
- substring of String sorts lexicographically before String2, the
- function returns a number less than 0.
-
-Arguments:
- String - Compare to String2
- String2 - Compare to String
- Length - Number of ASCII characters to compare
-
-Returns:
- 0 - The substring of String and String2 is identical.
- > 0 - The substring of String sorts lexicographically after String2
- < 0 - The substring of String sorts lexicographically before String2
-
---*/
-;
-
-VOID
-EfiAsciiStrCat (
- IN CHAR8 *Destination,
- IN CHAR8 *Source
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-EfiAsciiStrnCat (
- IN CHAR8 *Destination,
- IN CHAR8 *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-;
-
-//
-// Print primitives
-//
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Length of temp string buffer to store value string.
-//
-#define CHARACTER_NUMBER_FOR_VALUE 30
-
-UINTN
-EfiValueToHexStr (
- IN OUT CHAR16 *Buffer,
- IN UINT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints a Value as a hex number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii hex string of Value.
-
- Value - Hex value to convert to a string in Buffer.
-
- Flags - Flags to use in printing Hex string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-EfiValueToString (
- IN OUT CHAR16 *Buffer,
- IN INT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints a Value as a decimal number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii decimal number string of Value.
-
- Value - Decimal value to convert to a string in Buffer.
-
- Flags - Flags to use in printing decimal string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-BOOLEAN
-IsHexDigit (
- OUT UINT8 *Digit,
- IN CHAR16 Char
- )
-/*++
-
- Routine Description:
- Determines if a Unicode character is a hexadecimal digit.
- The test is case insensitive.
-
- Arguments:
- Digit - Pointer to byte that receives the value of the hex character.
- Char - Unicode character to test.
-
- Returns:
- TRUE - If the character is a hexadecimal digit.
- FALSE - Otherwise.
-
---*/
-;
-
-CHAR16
-NibbleToHexChar (
- UINT8 Nibble
- )
-/*++
-
- Routine Description:
- Converts the low nibble of a byte to hex unicode character.
-
- Arguments:
- Nibble - lower nibble of a byte.
-
- Returns:
- Hex unicode character.
-
---*/
-;
-
-EFI_STATUS
-HexStringToBuf (
- IN OUT UINT8 *Buf,
- IN OUT UINTN *Len,
- IN CHAR16 *Str,
- OUT UINTN *ConvertedStrLen OPTIONAL
- )
-/*++
-
- Routine Description:
- Converts Unicode string to binary buffer.
- The conversion may be partial.
- The first character in the string that is not hex digit stops the conversion.
- At a minimum, any blob of data could be represented as a hex string.
-
- Arguments:
- Buf - Pointer to buffer that receives the data.
- Len - Length in bytes of the buffer to hold converted data.
- If routine return with EFI_SUCCESS, containing length of converted data.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Str - String to be converted from.
- ConvertedStrLen - Length of the Hex String consumed.
-
- Returns:
- EFI_SUCCESS: Routine Success.
- EFI_BUFFER_TOO_SMALL: The buffer is too small to hold converted data.
- EFI_
-
---*/
-;
-
-EFI_STATUS
-BufToHexString (
- IN OUT CHAR16 *Str,
- IN OUT UINTN *HexStringBufferLength,
- IN UINT8 *Buf,
- IN UINTN Len
- )
-/*++
-
- Routine Description:
- Converts binary buffer to Unicode string.
- At a minimum, any blob of data could be represented as a hex string.
-
- Arguments:
- Str - Pointer to the string.
- HexStringBufferLength - Length in bytes of buffer to hold the hex string. Includes tailing '\0' character.
- If routine return with EFI_SUCCESS, containing length of hex string buffer.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of hex string buffer desired.
- Buf - Buffer to be converted from.
- Len - Length in bytes of the buffer to be converted.
-
- Returns:
- EFI_SUCCESS: Routine success.
- EFI_BUFFER_TOO_SMALL: The hex string buffer is too small.
-
---*/
-;
-
-VOID
-EfiStrTrim (
- IN OUT CHAR16 *str,
- IN CHAR16 CharC
- )
-/*++
-
-Routine Description:
-
- Removes (trims) specified leading and trailing characters from a string.
-
-Arguments:
-
- str - Pointer to the null-terminated string to be trimmed. On return,
- str will hold the trimmed string.
- CharC - Character will be trimmed from str.
-
-Returns:
-
- None
-
---*/
-;
-CHAR16*
-EfiStrStr (
- IN CHAR16 *String,
- IN CHAR16 *StrCharSet
- )
-/*++
-
-Routine Description:
-
- Find a substring.
-
-Arguments:
-
- String - Null-terminated string to search.
- StrCharSet - Null-terminated string to search for.
-
-Returns:
- The address of the first occurrence of the matching substring if successful, or NULL otherwise.
---*/
-;
-
-CHAR8*
-EfiAsciiStrStr (
- IN CHAR8 *String,
- IN CHAR8 *StrCharSet
- )
-/*++
-
-Routine Description:
-
- Find a Ascii substring.
-
-Arguments:
-
- String - Null-terminated Ascii string to search.
- StrCharSet - Null-terminated Ascii string to search for.
-
-Returns:
- The address of the first occurrence of the matching Ascii substring if successful, or NULL otherwise.
---*/
-;
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
deleted file mode 100644
index f28f209fb1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
+++ /dev/null
@@ -1,1282 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- EfiDriverLib.h
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#ifndef _EFI_DRIVER_LIB_H_
-#define _EFI_DRIVER_LIB_H_
-
-#include "EfiStatusCode.h"
-#include "EfiCommonLib.h"
-#include "EfiPerf.h"
-#include "LinkedList.h"
-#include "GetImage.h"
-#include "EfiImageFormat.h"
-#include "EfiCompNameSupport.h"
-
-#include EFI_GUID_DEFINITION (DxeServices)
-#include EFI_GUID_DEFINITION (EventGroup)
-#include EFI_GUID_DEFINITION (EventLegacyBios)
-#include EFI_GUID_DEFINITION (FrameworkDevicePath)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
-#include EFI_PROTOCOL_DEFINITION (DataHub)
-#include EFI_PROTOCOL_DEFINITION (DriverBinding)
-#include EFI_PROTOCOL_DEFINITION (ComponentName)
-#include EFI_PROTOCOL_DEFINITION (ComponentName2)
-#include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
-#include EFI_PROTOCOL_DEFINITION (DriverConfiguration2)
-#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
-#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics2)
-
-#include EFI_PROTOCOL_DEFINITION (DebugMask)
-
-#if defined(__GNUC__) && defined(ECP_CPU_IPF)
-
-VOID
-EFIAPI
-EcpEfiBreakPoint (
- VOID
- )
-/*++
-
-Routine Description:
-
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-VOID
-EFIAPI
-EcpMemoryFence (
- VOID
- )
-/*++
-
-Routine Description:
-
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-#endif
-
-typedef struct {
- CHAR8 *Language;
- CHAR16 *UnicodeString;
-} EFI_UNICODE_STRING_TABLE;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#define LANGUAGE_CODE_ENGLISH "en-US"
-#else
-#define LANGUAGE_CODE_ENGLISH "eng"
-#endif
-
-//
-// Macros for EFI Driver Library Functions that are really EFI Boot Services
-//
-#define EfiCopyMem(_Destination, _Source, _Length) gBS->CopyMem ((_Destination), (_Source), (_Length))
-#define EfiSetMem(_Destination, _Length, _Value) gBS->SetMem ((_Destination), (_Length), (_Value))
-#define EfiZeroMem(_Destination, _Length) gBS->SetMem ((_Destination), (_Length), 0)
-
-//
-// Driver Lib Globals.
-//
-extern EFI_BOOT_SERVICES *gBS;
-extern EFI_DXE_SERVICES *gDS;
-extern EFI_RUNTIME_SERVICES *gRT;
-extern EFI_SYSTEM_TABLE *gST;
-extern UINTN gErrorLevel;
-extern EFI_GUID gEfiCallerIdGuid;
-extern EFI_DEBUG_MASK_PROTOCOL *gDebugMaskInterface;
-
-EFI_STATUS
-EfiInitializeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-DxeInitializeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiLibInstallDriverBinding (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
-Returns:
-
- EFI_SUCCESS is DriverBinding is installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-;
-
-EFI_STATUS
-EfiLibInstallAllDriverProtocols (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_COMPONENT_NAME_PROTOCOL *ComponentName, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
- ComponentName - A Component Name Protocol instance that this driver is producing
-
- DriverConfiguration - A Driver Configuration Protocol instance that this driver is producing
-
- DriverDiagnostics - A Driver Diagnostics Protocol instance that this driver is producing
-
-Returns:
-
- EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-;
-
-EFI_STATUS
-EfiLibInstallAllDriverProtocols2 (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2, OPTIONAL
- IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2, OPTIONAL
- IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Intialize a driver by installing the Driver Binding Protocol onto the
- driver's DriverBindingHandle. This is typically the same as the driver's
- ImageHandle, but it can be different if the driver produces multiple
- DriverBinding Protocols. This function also initializes the EFI Driver
- Library that initializes the global variables gST, gBS, gRT.
-
-Arguments:
-
- ImageHandle - The image handle of the driver
-
- SystemTable - The EFI System Table that was passed to the driver's entry point
-
- DriverBinding - A Driver Binding Protocol instance that this driver is producing
-
- DriverBindingHandle - The handle that DriverBinding is to be installe onto. If this
- parameter is NULL, then a new handle is created.
-
- ComponentName2 - A Component Name2 Protocol instance that this driver is producing
-
- DriverConfiguration2- A Driver Configuration2 Protocol instance that this driver is producing
-
- DriverDiagnostics2 - A Driver Diagnostics2 Protocol instance that this driver is producing
-
-Returns:
-
- EFI_SUCCESS if all the protocols were installed onto DriverBindingHandle
-
- Otherwise, then return status from gBS->InstallProtocolInterface()
-
---*/
-;
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Return the EFI 1.0 System Tabl entry with TableGuid
-
-Arguments:
-
- TableGuid - Name of entry to return in the system table
- Table - Pointer in EFI system table associated with TableGuid
-
-Returns:
-
- EFI_SUCCESS - Table returned;
- EFI_NOT_FOUND - TableGuid not in EFI system table
-
---*/
-;
-
-BOOLEAN
-EfiLibCompareLanguage (
- CHAR8 *Language1,
- CHAR8 *Language2
- )
-/*++
-
-Routine Description:
-
- Compare two languages to say whether they are identical.
-
-Arguments:
-
- Language1 - first language
- Language2 - second language
-
-Returns:
-
- TRUE - identical
- FALSE - not identical
-
---*/
-;
-
-//
-// DevicePath.c
-//
-BOOLEAN
-EfiIsDevicePathMultiInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Return TRUE is this is a multi instance device path.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
-
-Returns:
- TRUE - If DevicePath is multi instance.
- FALSE - If DevicePath is not multi instance.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Function retrieves the next device path instance from a device path data structure.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
- Size - A pointer to the size of a device path instance in bytes.
-
-Returns:
-
- This function returns a pointer to the current device path instance.
- In addition, it returns the size in bytes of the current device path instance in Size,
- and a pointer to the next device path instance in DevicePath.
- If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
-
---*/
-;
-
-UINTN
-EfiDevicePathSize (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- )
-/*++
-
-Routine Description:
-
- Calculate the size of a whole device path.
-
-Arguments:
-
- DevPath - The pointer to the device path data.
-
-Returns:
-
- Size of device path data structure..
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a Src1 and Src2 together.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
-
- A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDevicePathFromHandle (
- IN EFI_HANDLE Handle
- )
-/*++
-
-Routine Description:
-
- Locate device path protocol interface on a device handle.
-
-Arguments:
-
- Handle - The device handle
-
-Returns:
-
- Device path protocol interface located.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiDuplicateDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- )
-/*++
-
-Routine Description:
- Duplicate a new device path data structure from the old one.
-
-Arguments:
- DevPath - A pointer to a device path data structure.
-
-Returns:
- A pointer to the new allocated device path data.
- Caller must free the memory used by DevicePath if it is no longer needed.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePathNode (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a device path node to the end of another device path.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
- This function returns a pointer to the new device path.
- If there is not enough temporary pool memory available to complete this function,
- then NULL is returned.
-
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiFileDevicePath (
- IN EFI_HANDLE Device OPTIONAL,
- IN CHAR16 *FileName
- )
-/*++
-
-Routine Description:
- Create a device path that appends a MEDIA_DEVICE_PATH with
- FileNameGuid to the device path of DeviceHandle.
-
-Arguments:
- Device - Optional Device Handle to use as Root of the Device Path
-
- FileName - FileName
-
-Returns:
- EFI_DEVICE_PATH_PROTOCOL that was allocated from dynamic memory
- or NULL pointer.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-EfiAppendDevicePathInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *Src,
- IN EFI_DEVICE_PATH_PROTOCOL *Instance
- )
-/*++
-
-Routine Description:
-
- Append a device path instance to another.
-
-Arguments:
-
- Src - The device path instance to be appended with.
- Instance - The device path instance appending the other.
-
-Returns:
-
- The contaction of these two.
-
---*/
-;
-
-//
-// Lock.c
-//
-typedef struct {
- EFI_TPL Tpl;
- EFI_TPL OwnerTpl;
- UINTN Lock;
-} EFI_LOCK;
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
- Note on a check build ASSERT()s are used to ensure proper
- lock usage.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - The task priority level of the lock
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-;
-
-//
-// Macro to initialize the state of a lock when a lock variable is declared
-//
-#define EFI_INITIALIZE_LOCK_VARIABLE(Tpl) {Tpl,0,0}
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Raising to the task priority level of the mutual exclusion
- lock, and then acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-;
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock, and
- restores the previous task priority level.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- None
-
---*/
-;
-
-VOID *
-EfiLibAllocatePool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate EfiBootServicesData pool of size AllocationSize
-
-Arguments:
-
- AllocationSize - Pool size
-
-Returns:
-
- Pointer to the pool allocated
-
---*/
-;
-
-VOID *
-EfiLibAllocateRuntimePool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate EfiRuntimeServicesData pool of size AllocationSize
-
-Arguments:
-
- AllocationSize - Pool size
-
-Returns:
-
- Pointer to the pool allocated
-
---*/
-;
-
-VOID *
-EfiLibAllocateZeroPool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate EfiBootServicesData pool of size AllocationSize and set memory to zero.
-
-Arguments:
-
- AllocationSize - Pool size
-
-Returns:
-
- Pointer to the pool allocated
-
---*/
-;
-
-VOID *
-EfiLibAllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate EfiRuntimeServicesData pool of size AllocationSize and set memory to zero.
-
-Arguments:
-
- AllocationSize - Pool size
-
-Returns:
-
- Pointer to the pool allocated
-
---*/
-;
-
-VOID *
-EfiLibAllocateCopyPool (
- IN UINTN AllocationSize,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool and use a buffer provided by
- caller to fill it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
- Buffer - Buffer that will be filled into the buffer allocated
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-;
-
-VOID *
-EfiLibAllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate RuntimeServicesData pool and use a buffer provided by
- caller to fill it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
- Buffer - Buffer that will be filled into the buffer allocated
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-;
-
-//
-// Event.c
-//
-EFI_EVENT
-EfiLibCreateProtocolNotifyEvent (
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT VOID **Registration
- )
-/*++
-
-Routine Description:
-
- Create a protocol notification event and return it.
-
-Arguments:
-
- ProtocolGuid - Protocol to register notification event on.
-
- NotifyTpl - Maximum TPL to single the NotifyFunction.
-
- NotifyFunction - EFI notification routine.
-
- NotifyContext - Context passed into Event when it is created.
-
- Registration - Registration key returned from RegisterProtocolNotify().
-
-Returns:
-
- The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
- is added to the system.
-
---*/
-;
-
-EFI_STATUS
-EfiLibNamedEventSignal (
- IN EFI_GUID *Name
- )
-/*++
-
-Routine Description:
- Signals a named event. All registered listeners will run.
- The listeners should register using EfiLibNamedEventListen() function.
-
- NOTE: For now, the named listening/signalling is implemented
- on a protocol interface being installed and uninstalled.
- In the future, this maybe implemented based on a dedicated mechanism.
-
-Arguments:
- Name - Name to perform the signaling on. The name is a GUID.
-
-Returns:
- EFI_SUCCESS if successfull.
-
---*/
-;
-
-EFI_STATUS
-EfiLibNamedEventListen (
- IN EFI_GUID * Name,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext
- )
-/*++
-
-Routine Description:
- Listenes to signals on the name.
- EfiLibNamedEventSignal() signals the event.
-
- NOTE: For now, the named listening/signalling is implemented
- on a protocol interface being installed and uninstalled.
- In the future, this maybe implemented based on a dedicated mechanism.
-
-Arguments:
- Name - Name to register the listener on.
- NotifyTpl - Maximum TPL to singnal the NotifyFunction.
- NotifyFunction - The listener routine.
- NotifyContext - Context passed into the listener routine.
-
-Returns:
- EFI_SUCCESS if successful.
-
---*/
-;
-
-//
-// Handle.c
-//
-EFI_STATUS
-EfiLibLocateHandleProtocolByProtocols (
- IN OUT EFI_HANDLE * Handle, OPTIONAL
- OUT VOID **Interface, OPTIONAL
- ...
- )
-/*++
-Routine Description:
-
- Function locates Protocol and/or Handle on which all Protocols specified
- as a variable list are installed.
- It supports continued search. The caller must assure that no handles are added
- or removed while performing continued search, by e.g., rising the TPL and not
- calling any handle routines. Otherwise the behavior is undefined.
-
-Arguments:
-
- Handle - The address of handle to receive the handle on which protocols
- indicated by the variable list are installed.
- If points to NULL, all handles are searched. If pointing to a
- handle returned from previous call, searches starting from next handle.
- If NULL, the parameter is ignored.
-
- Interface - The address of a pointer to a protocol interface that will receive
- the interface indicated by first variable argument.
- If NULL, the parameter is ignored.
-
- ... - A variable argument list containing protocol GUIDs. Must end with NULL.
-
-Returns:
-
- EFI_SUCCESS - All the protocols where found on same handle.
- EFI_NOT_FOUND - A Handle with all the protocols installed was not found.
- Other values as may be returned from LocateHandleBuffer() or HandleProtocol().
-
---*/
-;
-
-//
-// Debug.c init
-//
-EFI_STATUS
-EfiDebugAssertInit (
- VOID
- )
-/*++
-
-Routine Description:
-
- Locate Debug Assert Protocol and set as mDebugAssert
-
-Arguments:
-
- None
-
-Returns:
-
- Status code
-
---*/
-;
-
-//
-// Unicode String Support
-//
-EFI_STATUS
-EfiLibLookupUnicodeString (
- CHAR8 *Language,
- CHAR8 *SupportedLanguages,
- EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- CHAR16 **UnicodeString
- )
-/*++
-
-Routine Description:
-
- Translate a unicode string to a specified language if supported.
-
-Arguments:
-
- Language - The name of language to translate to
- SupportedLanguages - Supported languages set
- UnicodeStringTable - Pointer of one item in translation dictionary
- UnicodeString - The translated string
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
- EFI_UNSUPPORTED - System not supported this language or this string translation
- EFI_SUCCESS - String successfully translated
-
---*/
-;
-
-EFI_STATUS
-EfiLibAddUnicodeString (
- CHAR8 *Language,
- CHAR8 *SupportedLanguages,
- EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- CHAR16 *UnicodeString
- )
-/*++
-
-Routine Description:
-
- Add an translation to the dictionary if this language if supported.
-
-Arguments:
-
- Language - The name of language to translate to
- SupportedLanguages - Supported languages set
- UnicodeStringTable - Translation dictionary
- UnicodeString - The corresponding string for the language to be translated to
-
-Returns:
-
- EFI_INVALID_PARAMETER - Invalid parameter
- EFI_UNSUPPORTED - System not supported this language
- EFI_ALREADY_STARTED - Already has a translation item of this language
- EFI_OUT_OF_RESOURCES - No enough buffer to be allocated
- EFI_SUCCESS - String successfully translated
-
---*/
-;
-
-EFI_STATUS
-EfiLibFreeUnicodeStringTable (
- EFI_UNICODE_STRING_TABLE *UnicodeStringTable
- )
-/*++
-
-Routine Description:
-
- Free a string table.
-
-Arguments:
-
- UnicodeStringTable - The string table to be freed.
-
-Returns:
-
- EFI_SUCCESS - The table successfully freed.
-
---*/
-;
-
-EFI_STATUS
-EfiLibReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Report status code.
-
-Arguments:
-
- Type - Code type
- Value - Code value
- Instance - Instance number
- CallerId - Caller name
- DevicePath - Device path that to be reported
-
-Returns:
-
- Status code.
-
- EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
-
---*/
-;
-
-EFI_STATUS
-ReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId OPTIONAL,
- IN EFI_DEVICE_PATH_PROTOCOL * DevicePath
- )
-/*++
-
-Routine Description:
-
- Report device path through status code.
-
-Arguments:
-
- Type - Code type
- Value - Code value
- Instance - Instance number
- CallerId - Caller name
- DevicePath - Device path that to be reported
-
-Returns:
-
- Status code.
-
- EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *LegacyBootEvent
- )
-/*++
-
-Routine Description:
- Create a Legacy Boot Event.
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Returns:
- EFI_SUCCESS Event was created.
- Other Event was not created.
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *ReadyToBootEvent
- )
-/*++
-
-Routine Description:
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Return:
- EFI_SUCCESS - Event was created.
- Other - Event was not created.
-
---*/
-;
-
-VOID
-EFIAPI
-EfiInitializeFwVolDevicepathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN EFI_GUID *NameGuid
- )
-/*++
-Routine Description:
- Initialize a Firmware Volume (FV) Media Device Path node.
-
-Arguments:
- FvDevicePathNode - Pointer to a FV device path node to initialize
- NameGuid - FV file name to use in FvDevicePathNode
-
---*/
-;
-
-EFI_GUID *
-EFIAPI
-EfiGetNameGuidFromFwVolDevicePathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- )
-/*++
-Routine Description:
- Check to see if the Firmware Volume (FV) Media Device Path is valid.
-
-Arguments:
- FvDevicePathNode - Pointer to FV device path to check
-
-Return:
- NULL - FvDevicePathNode is not valid.
- Other - FvDevicePathNode is valid and pointer to NameGuid was returned.
-
---*/
-;
-
-VOID
-EfiLibSafeFreePool (
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Free pool safely.
-
-Arguments:
-
- Buffer - The allocated pool entry to free
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-;
-
-EFI_STATUS
-EfiLibTestManagedDevice (
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE DriverBindingHandle,
- IN EFI_GUID *ManagedProtocolGuid
- )
-/*++
-
-Routine Description:
-
- Test to see if the controller is managed by a specific driver.
-
-Arguments:
-
- ControllerHandle - Handle for controller to test
-
- DriverBindingHandle - Driver binding handle for controller
-
- ManagedProtocolGuid - The protocol guid the driver opens on controller
-
-Returns:
-
- EFI_SUCCESS - The controller is managed by the driver
-
- EFI_UNSUPPORTED - The controller is not managed by the driver
-
---*/
-;
-
-EFI_STATUS
-EfiLibTestChildHandle (
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle,
- IN EFI_GUID *ConsumedGuid
- )
-/*++
-
-Routine Description:
-
- Test to see if the child handle is the child of the controller
-
-Arguments:
-
- ControllerHandle - Handle for controller (parent)
-
- ChildHandle - Child handle to test
-
- ConsumsedGuid - Protocol guid consumed by child from controller
-
-Returns:
-
- EFI_SUCCESS - The child handle is the child of the controller
-
- EFI_UNSUPPORTED - The child handle is not the child of the controller
-
---*/
-;
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiHobLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiHobLib.h
deleted file mode 100644
index ad777d4ef2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiHobLib.h
+++ /dev/null
@@ -1,297 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiHobLib.h
-
-Abstract:
-
-
---*/
-
-#ifndef _EFI_HOB_LIB_H_
-#define _EFI_HOB_LIB_H_
-
-#include "PeiHob.h"
-
-VOID *
-GetHob (
- IN UINT16 Type,
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- This function returns the first instance of a HOB type in a HOB list.
-
-Arguments:
-
- Type The HOB type to return.
- HobStart The first HOB in the HOB list.
-
-Returns:
-
- HobStart There were no HOBs found with the requested type.
- else Returns the first HOB with the matching type.
-
---*/
-;
-
-UINTN
-GetHobListSize (
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- Get size of hob list.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
-Returns:
-
- Size of hob list.
-
---*/
-;
-
-UINT32
-GetHobVersion (
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- Get hob version.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
-Returns:
-
- Hob version.
-
---*/
-;
-
-EFI_STATUS
-GetHobBootMode (
- IN VOID *HobStart,
- OUT EFI_BOOT_MODE *BootMode
- )
-/*++
-
-Routine Description:
-
- Get current boot mode.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BootMode - Current boot mode recorded in PHIT hob
-
-Returns:
-
- EFI_NOT_FOUND - Invalid hob header
-
- EFI_SUCCESS - Boot mode found
-
---*/
-;
-
-EFI_STATUS
-GetCpuHobInfo (
- IN VOID *HobStart,
- OUT UINT8 *SizeOfMemorySpace,
- OUT UINT8 *SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Get information recorded in CPU hob (Memory space size, Io space size)
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- SizeOfMemorySpace - Size of memory size
-
- SizeOfIoSpace - Size of IO size
-
-Returns:
-
- EFI_NOT_FOUND - CPU hob not found
-
- EFI_SUCCESS - CPU hob found and information got.
-
---*/
-;
-
-EFI_STATUS
-GetDxeCoreHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length,
- OUT VOID **EntryPoint,
- OUT EFI_GUID **FileName
- )
-/*++
-
-Routine Description:
-
- Get memory allocation hob created for DXE core and extract its information
-
-Arguments:
-
- HobStart - Start pointer of the hob list
-
- BaseAddress - Start address of memory allocated for DXE core
-
- Length - Length of memory allocated for DXE core
-
- EntryPoint - DXE core file name
-
- FileName - FileName
-
-Returns:
-
- EFI_NOT_FOUND - DxeCoreHob not found
-
- EFI_SUCCESS - DxeCoreHob found and information got
-
---*/
-;
-
-EFI_STATUS
-GetNextFirmwareVolumeHob (
- IN OUT VOID **HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length
- )
-/*++
-
-Routine Description:
-
- Get next firmware volume hob from HobStart
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - Start address of next firmware volume
-
- Length - Length of next firmware volume
-
-Returns:
-
- EFI_NOT_FOUND - Next firmware volume not found
-
- EFI_SUCCESS - Next firmware volume found with address information
-
---*/
-;
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-EFI_STATUS
-GetNextFirmwareVolume2Hob (
- IN OUT VOID **HobStart,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
- OUT UINT64 *Length,
- OUT EFI_GUID *FileName
- );
-#endif
-
-EFI_STATUS
-GetNextGuidHob (
- IN OUT VOID **HobStart,
- IN EFI_GUID * Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
- Get the next guid hob.
-
-Arguments:
- HobStart A pointer to the start hob.
- Guid A pointer to a guid.
- Buffer A pointer to the buffer.
- BufferSize Buffer size.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - Next Guid hob not found
-
- EFI_SUCCESS - Next Guid hob found and data for this Guid got
-
---*/
-;
-
-EFI_STATUS
-GetPalEntryHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *PalEntry
- )
-/*++
-
-Routine Description:
-
- Get PAL entry from PalEntryHob
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- PalEntry - Pointer to PAL entry
-
-Returns:
-
- Status code.
-
---*/
-;
-
-EFI_STATUS
-GetIoPortSpaceAddressHobInfo (
- IN VOID *HobStart,
- OUT EFI_PHYSICAL_ADDRESS *IoPortSpaceAddress
- )
-/*++
-
-Routine Description:
-
- Get IO port space address from IoBaseHob.
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- IoPortSpaceAddress - IO port space address
-
-Returns:
-
- Status code
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiMgmtModeRuntimeLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiMgmtModeRuntimeLib.h
deleted file mode 100644
index b718c549ca..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiMgmtModeRuntimeLib.h
+++ /dev/null
@@ -1,429 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiMgmtModeRuntimeLib.h
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#ifndef _EFI_RT_SUPPORT_LIB_H_
-#define _EFI_RT_SUPPORT_LIB_H_
-
-#ifndef EFI_LOAD_IMAGE_SMM
-#define EFI_LOAD_DRIVER_SMM FALSE
-#else
-#define EFI_LOAD_DRIVER_SMM TRUE
-#endif
-
-#ifndef EFI_NO_LOAD_IMAGE_RT
-#define EFI_NO_LOAD_DRIVER_RT FALSE
-#else
-#define EFI_NO_LOAD_DRIVER_RT TRUE
-#endif
-
-#include "EfiCommonLib.h"
-#include "LinkedList.h"
-#include "ProcDep.h"
-
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-
-//
-// Driver Lib Globals.
-//
-extern EFI_BOOT_SERVICES *gBS;
-extern EFI_SYSTEM_TABLE *gST;
-extern UINTN gRtErrorLevel;
-extern BOOLEAN mEfiLoadDriverSmm;
-extern BOOLEAN mEfiNoLoadDriverRt;
-extern EFI_DEVICE_PATH_PROTOCOL *mFilePath;
-
-//
-// Runtime Memory Allocation/De-Allocation tools (Should be used in Boot Phase only)
-//
-EFI_STATUS
-EfiAllocateRuntimeMemoryPool (
- IN UINTN Size,
- OUT VOID **Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate EfiRuntimeServicesData pool of specified size.
-
-Arguments:
-
- Size - Pool size
- Buffer - Memory pointer for output
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFreeRuntimeMemoryPool (
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Free allocated pool
-
-Arguments:
-
- Buffer - Pool to be freed
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiLocateProtocolHandleBuffers (
- IN EFI_GUID *Protocol,
- IN OUT UINTN *NumberHandles,
- OUT EFI_HANDLE **Buffer
- )
-/*++
-
-Routine Description:
-
- Returns an array of handles that support the requested protocol in a buffer allocated from pool.
-
-Arguments:
-
- Protocol - Provides the protocol to search by.
- NumberHandles - The number of handles returned in Buffer.
- Buffer - A pointer to the buffer to return the requested array of handles that
- support Protocol.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiHandleProtocol (
- IN EFI_HANDLE Handle,
- IN EFI_GUID *Protocol,
- OUT VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Queries a handle to determine if it supports a specified protocol.
-
-Arguments:
-
- Handle - The handle being queried.
- Protocol - The published unique identifier of the protocol.
- Interface - Supplies the address where a pointer to the corresponding Protocol
- Interface is returned. NULL will be returned in *Interface if a
- structure is not associated with Protocol.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiInstallProtocolInterface (
- IN OUT EFI_HANDLE *Handle,
- IN EFI_GUID *Protocol,
- IN EFI_INTERFACE_TYPE InterfaceType,
- IN VOID *Interface
- )
-/*++
-
-Routine Description:
-
- Installs a protocol interface on a device handle. If the handle does not exist, it is created and added
-to the list of handles in the system.
-
-Arguments:
-
- Handle - A pointer to the EFI_HANDLE on which the interface is to be installed.
- Protocol - The numeric ID of the protocol interface.
- InterfaceType - Indicates whether Interface is supplied in native form.
- Interface - A pointer to the protocol interface.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiReinstallProtocolInterface (
- IN EFI_HANDLE SmmProtocolHandle,
- IN EFI_GUID *Protocol,
- IN VOID *OldInterface,
- IN VOID *NewInterface
- )
-/*++
-
-Routine Description:
-
- Reinstalls a protocol interface on a device handle.
-
-Arguments:
-
- SmmProtocolHandle - Handle on which the interface is to be reinstalled.
- Protocol - The numeric ID of the interface.
- OldInterface - A pointer to the old interface.
- NewInterface - A pointer to the new interface.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiLocateProtocolInterface (
- EFI_GUID *Protocol,
- VOID *Registration, OPTIONAL
- VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Returns the first protocol instance that matches the given protocol.
-
-Arguments:
-
- Protocol - Provides the protocol to search for.
- Registration - Optional registration key returned from
- RegisterProtocolNotify(). If Registration is NULL, then
- it is ignored.
- Interface - On return, a pointer to the first interface that matches Protocol and
- Registration.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-UninstallProtocolInterface (
- IN EFI_HANDLE SmmProtocolHandle,
- IN EFI_GUID *Protocol,
- IN VOID *Interface
- )
-/*++
-
-Routine Description:
-
- Removes a protocol interface from a device handle.
-
-Arguments:
-
- SmmProtocolHandle - The handle on which the interface was installed.
- Protocol - The numeric ID of the interface.
- Interface - A pointer to the interface.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiRegisterProtocolCallback (
- IN EFI_EVENT_NOTIFY CallbackFunction,
- IN VOID *Context,
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- OUT VOID **Registeration,
- OUT EFI_EVENT *Event
- )
-/*++
-
-Routine Description:
-
- Register a callback function to be signaled whenever an interface is installed for
- a specified protocol.
-
-Arguments:
-
- CallbackFunction - Call back function
- Context - Context of call back function
- ProtocolGuid - The numeric ID of the protocol for which the callback function
- is to be registered.
- NotifyTpl - Notify tpl of callback function
- Registeration - A pointer to a memory location to receive the registration value.
- Event - Event that is to be signaled whenever a protocol interface is registered
- for Protocol.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiSignalProtocolEvent (
- EFI_EVENT Event
- )
-/*++
-
-Routine Description:
-
- Signals an event.
-
-Arguments:
-
- Event - The event to signal.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiInstallVendorConfigurationTable (
- IN EFI_GUID *Guid,
- IN VOID *Table
- )
-/*++
-
-Routine Description:
-
- Adds, updates, or removes a configuration table entry from the EFI System Table.
-
-Arguments:
-
- Guid - A pointer to the GUID for the entry to add, update, or remove.
- Table - A pointer to the configuration table for the entry to add, update, or
- remove. May be NULL.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiGetVendorConfigurationTable (
- IN EFI_GUID *Guid,
- OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Return the EFI 1.0 System Tabl entry with TableGuid
-
-Arguments:
-
- Guid - Name of entry to return in the system table
- Table - Pointer in EFI system table associated with TableGuid
-
-Returns:
-
- EFI_SUCCESS - Table returned;
- EFI_NOT_FOUND - TableGuid not in EFI system table
-
---*/
-;
-
-EFI_STATUS
-EfiInitializeUtilsRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY GoVirtualChildEvent
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-BOOLEAN
-EfiInManagementInterrupt (
- VOID
- )
-/*++
-
-Routine Description:
-
- Indicate whether the caller is already in SMM or not.
-
-Arguments:
-
- None
-
-Returns:
-
- TRUE - In SMM
- FALSE - Not in SMM
-
---*/
-;
-
-//
-// This MACRO initializes the RUNTIME invironment and optionally loads Image to SMM or Non-SMM space
-// based upon the presence of build flags EFI_LOAD_DRIVER_SMM and EFI_NO_LOAD_DRIVER_RT.
-//
-#define EFI_INITIALIZE_RUNTIME_DRIVER_LIB(ImageHandle, SystemTable, GoVirtualChildEvent, FilePath) \
- mEfiLoadDriverSmm = EFI_LOAD_DRIVER_SMM; \
- mEfiNoLoadDriverRt = EFI_NO_LOAD_DRIVER_RT; \
- mFilePath = (EFI_DEVICE_PATH_PROTOCOL*) FilePath; \
- EfiInitializeUtilsRuntimeDriverLib ((EFI_HANDLE) ImageHandle, (EFI_SYSTEM_TABLE*) SystemTable, (EFI_EVENT_NOTIFY) GoVirtualChildEvent); \
- if (!EfiInManagementInterrupt()) { \
- if (mEfiNoLoadDriverRt) { \
- return EFI_SUCCESS; \
- } \
- }
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiPrintLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiPrintLib.h
deleted file mode 100644
index 38823bf163..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiPrintLib.h
+++ /dev/null
@@ -1,327 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiPrintLib.h
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#ifndef _EFI_PRINT_LIB_H_
-#define _EFI_PRINT_LIB_H_
-
-#include EFI_PROTOCOL_DEFINITION(GraphicsOutput)
-#include EFI_PROTOCOL_DEFINITION(UgaDraw)
-#include EFI_PROTOCOL_DEFINITION(Print)
-
-UINTN
-ErrorPrint (
- IN CONST CHAR16 *ErrorString,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- ErrorString - Error message printed first
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-VOID
-ErrorDumpHex (
- IN UINTN Indent,
- IN UINTN Offset,
- IN UINTN DataSize,
- IN VOID *UserData
- )
-/*++
-
-Routine Description:
-
- Dump error info by hex.
-
-Arguments:
-
- Indent - Indent number
- Offset - Offset number
- DataSize - Size of user data
- UserData - User data to dump
-
-Returns:
-
- None
-
---*/
-;
-
-UINTN
-Print (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to the default console
-
-Arguments:
-
- fmt - Format string
-
-Returns:
-
- Length of string printed to the console
-
---*/
-;
-
-UINTN
-PrintXY (
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background, OPTIONAL
- IN CHAR16 *Fmt,
- ...
- )
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to the default console
-
-Arguments:
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- ForeGround - Foreground color
-
- BackGround - Background color
-
- Fmt - Format string
-
- ... - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
-;
-
-UINTN
-Aprint (
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-UPrint (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-EFIAPI
-VSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN StrLen,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to a buffer
-
-Arguments:
-
- StartOfBuffer - Output buffer to print the formatted string into
- StrLen - Size of Str. String is truncated to this size.
- A size of 0 means there is no limit
- Format - The format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- String length returned in buffer
-
---*/
-;
-
-UINTN
-SPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- SPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-//
-// BoxDraw support
-//
-BOOLEAN
-IsValidEfiCntlChar (
- IN CHAR16 CharC
- )
-/*++
-
-Routine Description:
-
- Test whether a wide char is a valid control char.
-
-Arguments:
-
- CharC - A char
-
-Returns:
-
- TRUE - A control char
-
- FALSE - Not a control char
-
---*/
-;
-
-BOOLEAN
-IsValidAscii (
- IN CHAR16 Ascii
- )
-/*++
-
-Routine Description:
-
- Test whether a wide char is a normal printable char
-
-Arguments:
-
- Ascii - A char
-
-Returns:
-
- True - A normal, printable char
- FALSE - Not a normal, printable char
-
---*/
-;
-
-BOOLEAN
-LibIsValidTextGraphics (
- IN CHAR16 Graphic,
- OUT CHAR8 *PcAnsi, OPTIONAL
- OUT CHAR8 *Ascii OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Detects if a Unicode char is for Box Drawing text graphics.
-
-Arguments:
-
- Graphic - Unicode char to test.
-
- PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
-
- Ascii - Optional pointer to return Ascii equivalent of Graphic.
-
-Returns:
-
- TRUE if Gpaphic is a supported Unicode Box Drawing character.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRegTableLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRegTableLib.h
deleted file mode 100644
index e00f6bae6f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRegTableLib.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiRegTableLib.h
-
-Abstract:
-
- Definitions and macros for building register tables for chipset
- initialization..
-
- Components linking this lib must include CpuIo, PciRootBridgeIo, and
- BootScriptSave protocols in their DPX.
-
-Revision History:
-
---*/
-
-#ifndef EFI_REG_TABLE_H
-#define EFI_REG_TABLE_H
-
-#include "Tiano.h"
-#include "EfiScriptLib.h"
-#include EFI_PROTOCOL_CONSUMER (CpuIo)
-#include EFI_PROTOCOL_CONSUMER (PciRootBridgeIo)
-
-//
-// RegTable OpCodes are encoded as follows:
-//
-// |31----------------------------16|15---------8|7-------0|
-// \ \ \
-// \ \ \
-// 31:16 defined by Base OpCode---+ \ \
-// Opcode Flags---+ \
-// Base OpCode---+
-//
-#define OPCODE_BASE(OpCode) ((UINT8)((OpCode) & 0xFF))
-#define OPCODE_FLAGS(OpCode) ((UINT8)(((OpCode) >> 8) & 0xFF))
-#define OPCODE_EXTRA_DATA(OpCode) ((UINT16)((OpCode) >> 16))
-
-//
-// RegTable Base OpCodes
-//
-#define OP_TERMINATE_TABLE 0
-#define OP_MEM_WRITE 1
-#define OP_MEM_READ_MODIFY_WRITE 2
-#define OP_IO_WRITE 3
-#define OP_IO_READ_MODIFY_WRITE 4
-#define OP_PCI_WRITE 5
-#define OP_PCI_READ_MODIFY_WRITE 6
-#define OP_STALL 7
-
-//
-// RegTable OpCode Flags
-//
-#define OPCODE_FLAG_S3SAVE 1
-
-
-#define TERMINATE_TABLE { (UINT32) OP_TERMINATE_TABLE, (UINT32) 0, (UINT32) 0 }
-
-
-//
-// REG_TABLE_ENTRY_PCI_WRITE encodes the width in the upper bits of the OpCode
-// as one of the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH values
-//
-typedef struct {
- UINT32 OpCode;
- UINT32 PciAddress;
- UINT32 Data;
-} EFI_REG_TABLE_PCI_WRITE;
-
-#define PCI_WRITE(Bus, Dev, Fnc, Reg, Width, Data, S3Flag) \
- { \
- (UINT32) (OP_PCI_WRITE | ((S3Flag) << 8) | ((Width) << 16)), \
- (UINT32) (EFI_PCI_ADDRESS ((Bus), (Dev), (Fnc), (Reg))), \
- (UINT32) (Data), \
- (UINT32) (0) \
- }
-
-typedef struct {
- UINT32 OpCode;
- UINT32 PciAddress;
- UINT32 OrMask;
- UINT32 AndMask;
-} EFI_REG_TABLE_PCI_READ_MODIFY_WRITE;
-
-#define PCI_READ_MODIFY_WRITE(Bus, Dev, Fnc, Reg, Width, OrMask, AndMask, S3Flag) \
- { \
- (UINT32) (OP_PCI_READ_MODIFY_WRITE | ((S3Flag) << 8) | ((Width) << 16)), \
- (UINT32) (EFI_PCI_ADDRESS ((Bus), (Dev), (Fnc), (Reg))), \
- (UINT32) (OrMask), \
- (UINT32) (AndMask) \
- }
-
-typedef struct {
- UINT32 OpCode;
- UINT32 MemAddress;
- UINT32 OrMask;
- UINT32 AndMask;
-} EFI_REG_TABLE_MEM_READ_MODIFY_WRITE;
-
-#define MEM_READ_MODIFY_WRITE(Address, Width, OrMask, AndMask, S3Flag) \
- { \
- (UINT32) (OP_MEM_READ_MODIFY_WRITE | ((S3Flag) << 8) | ((Width) << 16)), \
- (UINT32) (Address), \
- (UINT32) (OrMask), \
- (UINT32) (AndMask) \
- }
-
-typedef struct {
- UINT32 OpCode;
- UINT32 Field2;
- UINT32 Field3;
- UINT32 Field4;
-} EFI_REG_TABLE_GENERIC;
-
-typedef union {
- EFI_REG_TABLE_GENERIC Generic;
- EFI_REG_TABLE_PCI_WRITE PciWrite;
- EFI_REG_TABLE_PCI_READ_MODIFY_WRITE PciReadModifyWrite;
- EFI_REG_TABLE_MEM_READ_MODIFY_WRITE MemReadModifyWrite;
-} EFI_REG_TABLE;
-
-VOID
-ProcessRegTablePci (
- EFI_REG_TABLE * RegTableEntry,
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * PciRootBridgeIo,
- EFI_CPU_IO_PROTOCOL * CpuIo
- )
-/*++
-
-Routine Description:
- Processes register table assuming which may contain PCI, IO, MEM, and STALL
- entries.
-
- No parameter checking is done so the caller must be careful about omitting
- values for PciRootBridgeIo or CpuIo parameters. If the regtable does
- not contain any PCI accesses, it is safe to omit the PciRootBridgeIo (supply
- NULL). If the regtable does not contain any IO or Mem entries, it is safe to
- omit the CpuIo (supply NULL).
-
- The RegTableEntry parameter is not checked, but is required.
-
- gBS is assumed to have been defined and is used when processing stalls.
-
- The function processes each entry sequentially until an OP_TERMINATE_TABLE
- entry is encountered.
-
-Arguments:
- RegTableEntry - A pointer to the register table to process
-
- PciRootBridgeIo - A pointer to the instance of PciRootBridgeIo that is used
- when processing PCI table entries
-
- CpuIo - A pointer to the instance of CpuIo that is used when processing IO and
- MEM table entries
-
-Returns:
- Nothing.
-
---*/
-;
-
-VOID
-ProcessRegTableCpu (
- EFI_REG_TABLE * RegTableEntry,
- EFI_CPU_IO_PROTOCOL * CpuIo
- )
-/*++
-
-Routine Description:
- Processes register table assuming which may contain IO, MEM, and STALL
- entries, but must NOT contain any PCI entries. Any PCI entries cause an
- ASSERT in a DEBUG build and are skipped in a free build.
-
- No parameter checking is done. Both RegTableEntry and CpuIo parameters are
- required.
-
- gBS is assumed to have been defined and is used when processing stalls.
-
- The function processes each entry sequentially until an OP_TERMINATE_TABLE
- entry is encountered.
-
-Arguments:
- RegTableEntry - A pointer to the register table to process
-
- CpuIo - A pointer to the instance of CpuIo that is used when processing IO and
- MEM table entries
-
-Returns:
- Nothing.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRuntimeLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRuntimeLib.h
deleted file mode 100644
index e130492a7e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiRuntimeLib.h
+++ /dev/null
@@ -1,1743 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- EfiRuntimeLib.h
-
-Abstract:
-
- Light weight lib to support EFI drivers.
-
---*/
-
-#ifndef _EFI_RUNTIME_LIB_H_
-#define _EFI_RUNTIME_LIB_H_
-#define MAX_FVB_COUNT 16
-#include "EfiStatusCode.h"
-#include "EfiCommonLib.h"
-
-#include "LinkedList.h"
-#include "GetImage.h"
-#include "RtDevicePath.h"
-
-#include EFI_GUID_DEFINITION (DxeServices)
-#include EFI_GUID_DEFINITION (EventGroup)
-#include EFI_GUID_DEFINITION (EventLegacyBios)
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_PROTOCOL_DEFINITION (FvbExtension)
-#include "ProcDep.h"
-
-typedef struct {
- EFI_HANDLE Handle;
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
- EFI_FVB_EXTENSION_PROTOCOL *FvbExtension;
-} FVB_ENTRY;
-
-//
-// Driver Lib Globals.
-//
-extern EFI_BOOT_SERVICES *gBS;
-extern EFI_SYSTEM_TABLE *gST;
-extern EFI_DXE_SERVICES *gDS;
-extern UINTN gRtErrorLevel;
-extern FVB_ENTRY *mFvbEntry;
-
-#if defined(__GNUC__) && defined(ECP_CPU_IPF)
-
-VOID
-EFIAPI
-EcpEfiBreakPoint (
- VOID
- )
-/*++
-
-Routine Description:
-
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-VOID
-EFIAPI
-EcpMemoryFence (
- VOID
- )
-/*++
-
-Routine Description:
-
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-#endif
-
-VOID
-EFIAPI
-EfiRuntimeLibFvbVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Notify function to convert pointers to Fvb functions after ExitBootServices
-
-Arguments:
-
- Event - Event whose notification function is being invoked.
- Context - Pointer to the notification function's context, which is
- implementation-dependent.
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_STATUS
-EfiInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY RuntimeNotifyEventHandler
- )
-/*++
-
-Routine Description:
-
- Intialize Runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- RuntimeNotifyEventHandler - Virtual address change notification event
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiShutdownRuntimeDriverLib (
- VOID
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-;
-
-EFI_STATUS
-EfiInitializeSmmDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Smm Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Return the EFI 1.0 System Tabl entry with TableGuid
-
-Arguments:
-
- TableGuid - Name of entry to return in the system table
- Table - Pointer in EFI system table associated with TableGuid
-
-Returns:
-
- EFI_SUCCESS - Table returned;
- EFI_NOT_FOUND - TableGuid not in EFI system table
-
---*/
-;
-
-BOOLEAN
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
-
- Am I at runtime?
-
-Arguments:
-
- None
-
-Returns:
-
- TRUE - At runtime
- FALSE - Not at runtime
-
---*/
-;
-
-BOOLEAN
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
- FALSE - If SetVirtualAddressMap () has not been called
-
---*/
-;
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- )
-/*++
-
-
-
-Routine Description:
-
-
-
- Get table from configuration table by name
-
-
-
-Arguments:
-
-
-
- TableGuid - Table name to search
-
-
-
- Table - Pointer to the table caller wants
-
-
-
-Returns:
-
-
-
- EFI_NOT_FOUND - Not found the table
-
-
-
- EFI_SUCCESS - Found the table
-
-
-
---*/
-
-;
-
-EFI_EVENT
-RtEfiLibCreateProtocolNotifyEvent (
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT VOID **Registration
- )
-/*++
-
-Routine Description:
-
- Create a protocol notification event and return it.
-
-Arguments:
-
- ProtocolGuid - Protocol to register notification event on.
-
- NotifyTpl - Maximum TPL to single the NotifyFunction.
-
- NotifyFunction - EFI notification routine.
-
- NotifyContext - Context passed into Event when it is created.
-
- Registration - Registration key returned from RegisterProtocolNotify().
-
-Returns:
-
- The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
- is added to the system.
-
---*/
-;
-
-//
-// Lock.c
-//
-typedef struct {
- EFI_TPL Tpl;
- EFI_TPL OwnerTpl;
- UINTN Lock;
-} EFI_LOCK;
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
- Note on a check build ASSERT()s are used to ensure proper
- lock usage.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - The task priority level of the lock
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-;
-
-//
-// Macro to initialize the state of a lock when a lock variable is declared
-//
-#define EFI_INITIALIZE_LOCK_VARIABLE(Tpl) {Tpl,0,0}
-
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Raising to the task priority level of the mutual exclusion
- lock, and then acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- Lock owned
-
---*/
-;
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-;
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock, and
- restores the previous task priority level.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- None
-
---*/
-;
-
-#define EfiCopyMem EfiCommonLibCopyMem
-#define EfiSetMem EfiCommonLibSetMem
-#define EfiZeroMem EfiCommonLibZeroMem
-
-INTN
-EfiCompareMem (
- IN VOID *MemOne,
- IN VOID *MemTwo,
- IN UINTN Len
- )
-/*++
-
-Routine Description:
-
- Compares two memory buffers of a given length.
-
-Arguments:
-
- MemOne - First memory buffer
-
- MemTwo - Second memory buffer
-
- Len - Length of Mem1 and Mem2 memory regions to compare
-
-Returns:
-
- = 0 if MemOne == MemTwo
-
- > 0 if MemOne > MemTwo
-
- < 0 if MemOne < MemTwo
-
---*/
-;
-
-//
-// Debug.c init
-//
-EFI_STATUS
-EfiDebugAssertInit (
- VOID
- )
-/*++
-
-Routine Description:
-
- Locate Debug Assert Protocol and set as mDebugAssert
-
-Arguments:
-
- None
-
-Returns:
-
- Status code
-
---*/
-;
-
-//
-// Wrapper for EFI runtime functions
-//
-VOID
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_STATUS
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiSetTime (
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-;
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_STATUS
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-/*++
-
-Routine Description:
-
- This code returns information about the EFI variables.
-
-Arguments:
-
- Attributes Attributes bitmask to specify the type of variables
- on which to return information.
- MaximumVariableStorageSize Pointer to the maximum size of the storage space available
- for the EFI variables associated with the attributes specified.
- RemainingVariableStorageSize Pointer to the remaining size of the storage space available
- for the EFI variables associated with the attributes specified.
- MaximumVariableSize Pointer to the maximum size of the individual EFI variables
- associated with the attributes specified.
-
-Returns:
-
- Status code
-
---*/
-;
-#endif
-
-
-EFI_STATUS
-EfiReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId,
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT EFI_LIST_ENTRY *ListHead
- )
-/*++
-
-Routine Description:
-
- Conver the standard Lib double linked list to a virtual mapping.
-
-Arguments:
-
- DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
-
- ListHead - Head of linked list to convert
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-;
-
-//
-// Base IO Class Functions
-//
-EFI_STATUS
-EfiIoRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO read into Buffer.
-
-Arguments:
- Width - Width of read transaction, and repeat operation to use
- Address - IO address to read
- Count - Number of times to read the IO address.
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-UINT8
-IoRead8 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a one byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-UINT16
-IoRead16 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a two byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-UINT32
-IoRead32 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a four byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-EFI_STATUS
-EfiIoWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-VOID
-IoWrite8 (
- IN UINT64 Address,
- IN UINT8 Data
- )
-/*++
-
-Routine Description:
- Do a one byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-IoWrite16 (
- IN UINT64 Address,
- IN UINT16 Data
- )
-/*++
-
-Routine Description:
- Do a two byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-IoWrite32 (
- IN UINT64 Address,
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
- Do a four byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-EFI_STATUS
-EfiMemRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a Memory mapped IO read into Buffer.
-
-Arguments:
- Width - Width of each read transaction.
- Address - Memory mapped IO address to read
- Count - Number of Width quanta to read
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-UINT8
-MemRead8 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a one byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-UINT16
-MemRead16 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a two byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-UINT32
-MemRead32 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a four byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-UINT64
-MemRead64 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a eight byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-;
-
-EFI_STATUS
-EfiMemWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a memory mapped IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-VOID
-MemWrite8 (
- IN UINT64 Address,
- IN UINT8 Data
- )
-/*++
-
-Routine Description:
- Do a one byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-MemWrite16 (
- IN UINT64 Address,
- IN UINT16 Data
- )
-/*++
-
-Routine Description:
- Do a two byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-MemWrite32 (
- IN UINT64 Address,
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
- Do a four byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-MemWrite64 (
- IN UINT64 Address,
- IN UINT64 Data
- )
-/*++
-
-Routine Description:
- Do a eight byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-;
-
-//
-// Platform specific functions
-//
-UINT8
-PciRead8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-;
-
-UINT16
-PciRead16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-;
-
-UINT32
-PciRead32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-;
-
-VOID
-PciWrite8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT8 Data
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-PciWrite16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT16 Data
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-PciWrite32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT32 Data
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-;
-
-VOID
-EfiStall (
- IN UINTN Microseconds
- )
-/*++
-
-Routine Description:
- Delay for at least the request number of microseconds
-
-Arguments:
- Microseconds - Number of microseconds to delay.
-
-Returns:
- NONE
-
---*/
-;
-
-//
-// FVB Services.
-//
-EFI_STATUS
-EfiFvbInitialize (
- VOID
- )
-/*++
-
-Routine Description:
- Initialize globals and register Fvb Protocol notification function.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiFvbShutdown (
- VOID
- )
-/*++
-
-Routine Description:
- Release resources allocated in EfiFvbInitialize.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EfiFvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Reads specified number of bytes into a buffer from the specified block
-
-Arguments:
- Instance - The FV instance to be read from
- Lba - The logical block address to be read from
- Offset - Offset into the block at which to begin reading
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes read
- Buffer - Pointer to a caller allocated buffer that will be
- used to hold the data read
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Writes specified number of bytes from the input buffer to the block
-
-Arguments:
- Instance - The FV instance to be written to
- Lba - The starting logical block index to write to
- Offset - Offset into the block at which to begin writing
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes actually written
- Buffer - Pointer to a caller allocated buffer that contains
- the source for the write
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbEraseBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba
- )
-/*++
-
-Routine Description:
- Erases and initializes a firmware volume block
-
-Arguments:
- Instance - The FV instance to be erased
- Lba - The logical block index to be erased
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES *Attributes
- )
-/*++
-
-Routine Description:
- Retrieves attributes, insures positive polarity of attribute bits, returns
- resulting attributes in output parameter
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- returned
- Attributes - Output buffer which contains attributes
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbSetVolumeAttributes (
- IN UINTN Instance,
- IN EFI_FVB_ATTRIBUTES Attributes
- )
-/*++
-
-Routine Description:
- Modifies the current settings of the firmware volume according to the
- input parameter.
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- modified
- Attributes - It is a pointer to EFI_FVB_ATTRIBUTES
- containing the desired firmware volume settings.
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *Address
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- Address - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
- that on successful return, contains the base address
- of the firmware volume.
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiFvbGetBlockSize (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
- Retrieve the size of a logical block
-
-Arguments:
- Instance - The FV instance whose block size is going to be
- returned
- Lba - Indicates which block to return the size for.
- BlockSize - A pointer to a caller allocated UINTN in which
- the size of the block is returned
- NumOfBlocks - a 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
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
-
---*/
-;
-EFI_STATUS
-EfiFvbEraseCustomBlockRange (
- IN UINTN Instance,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- Instance - The FV instance to be erased
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetLastLba - Offset into the last block at which to end erasing
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-EfiCpuFlushCache (
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Flush cache with specified range.
-
-Arguments:
-
- Start - Start address
- Length - Length in bytes
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-RtEfiCreateEventLegacyBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *LegacyBootEvent
- )
-/*++
-
-Routine Description:
- Create a Legacy Boot Event.
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Returns:
- EFI_SUCCESS Event was created.
- Other Event was not created.
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-RtEfiCreateEventReadyToBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *ReadyToBootEvent
- )
-/*++
-
-Routine Description:
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Return:
- EFI_SUCCESS - Event was created.
- Other - Event was not created.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiScriptLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiScriptLib.h
deleted file mode 100644
index 5ad5d14632..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiScriptLib.h
+++ /dev/null
@@ -1,591 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiScriptLib.h
-
-Abstract:
-
-
---*/
-
-#ifndef _EFI_SCRIPT_LIB_H_
-#define _EFI_SCRIPT_LIB_H_
-
-#include "Tiano.h"
-#include "EfiCommonLib.h"
-#include "EfiBootScript.h"
-#include EFI_PROTOCOL_DEFINITION (BootScriptSave)
-
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize Boot Script Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveIoWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save I/O write to boot script with opcode EFI_BOOT_SCRIPT_IO_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the I/O operations.
-
- Address - The base address of the I/O operations.
-
- Count - The number of I/O operations to perform.
-
- Buffer - The source buffer from which to write data.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveIoReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save I/O modify to boot script with opcode EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the I/O operations.
-
- Address - The base address of the I/O operations.
-
- Data - A pointer to the data to be OR-ed.
-
- DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveMemWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save memory write to boot script with opcode EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the memory operations.
-
- Address - The base address of the memory operations.
-
- Count - The number of memory operations to perform.
-
- Buffer - The source buffer from which to write the data.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveMemReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save memory modify to boot script with opcode EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the memory operations.
-
- Address - The base address of the memory operations.
-
- Data - A pointer to the data to be OR-ed.
-
- DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSavePciCfgWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save PCI configuration space write operation to boot script with opcode
- EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the PCI operations
-
- Address - The address within the PCI configuration space.
-
- Count - The number of PCI operations to perform.
-
- Buffer - The source buffer from which to write the data.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSavePciCfgReadWrite (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *Data,
- IN VOID *DataMask
- )
-/*++
-
-Routine Description:
-
- Save PCI configuration space modify operation to boot script with opcode
- EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Width - The width of the PCI operations
-
- Address - The address within the PCI configuration space.
-
- Data - A pointer to the data to be OR-ed.
-
- DataMask - A pointer to the data mask to be AND-ed with the data read from the register.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveSmbusExecute (
- IN UINT16 TableName,
- IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
- IN EFI_SMBUS_DEVICE_COMMAND Command,
- IN EFI_SMBUS_OPERATION Operation,
- IN BOOLEAN PecCheck,
- IN UINTN *Length,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Save SMBus command execution to boot script with opcode
- EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
- SlaveAddress - The SMBus address for the slave device that the operation is targeting.
- Command - The command that is transmitted by the SMBus host controller to the
- SMBus slave device.
- Operation - Indicates which particular SMBus protocol it will use to execute the
- SMBus transactions.
- PecCheck - Defines if Packet Error Code (PEC) checking is required for this operation.
- Length - A pointer to signify the number of bytes that this operation will do.
- Buffer - Contains the value of data to execute to the SMBUS slave device.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveStall (
- IN UINT16 TableName,
- IN UINTN Duration
- )
-/*++
-
-Routine Description:
-
- Save execution stall on the processor to boot script with opcode
- EFI_BOOT_SCRIPT_STALL_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- Duration - Duration in microseconds of the stall.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveDispatch (
- IN UINT16 TableName,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- Save dispatching specified arbitrary code to boot script with opcode
- EFI_BOOT_SCRIPT_DISPATCH_OPCODE
-
-Arguments:
-
- TableName - Desired boot script table
-
- EntryPoint - Entry point of the code to be dispatched.
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptMemPoll (
- IN UINT16 TableName,
- IN EFI_BOOT_SCRIPT_WIDTH Width,
- IN UINT64 Address,
- IN VOID *BitMask,
- IN VOID *BitValue,
- IN UINTN Duration,
- IN UINTN LoopTimes
- )
-/*++
-
-Routine Description:
- Polling one memory mapping register
-
-Arguments:
- TableName - Desired boot script table
-
- Width - The width of the memory operations.
-
- Address - The base address of the memory operations.
-
- BitMask - A pointer to the bit mask to be AND-ed with the data read from the register.
-
- BitValue - A pointer to the data value after to be Masked.
-
- Duration - Duration in microseconds of the stall.
-
- LoopTimes - The times of the register polling.
-
-Returns:
-
- EFI_SUCCESS - The operation was executed successfully
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformation (
- IN UINT16 TableName,
- IN UINT32 Length,
- IN EFI_PHYSICAL_ADDRESS Buffer
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName
-
-Arguments:
-
- TableName - Desired boot script table
- Length - Length of information in bytes
- Buffer - Content of information that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformationUnicodeString (
- IN UINT16 TableName,
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName, the information
- is a unicode string.
-
-Arguments:
-
- TableName - Desired boot script table
- String - The string that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-BootScriptSaveInformationAsciiString (
- IN UINT16 TableName,
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
-
- Save a Information Opcode record in table specified with TableName, the information
- is a ascii string.
-
-Arguments:
-
- TableName - Desired boot script table
- String - The string that will be saved in script table
-
-Returns:
-
- EFI_NOT_FOUND - BootScriptSave Protocol not exist.
-
- EFI_STATUS - BootScriptSave Protocol exist, always returns EFI_SUCCESS
-
---*/
-;
-
-#ifdef EFI_S3_RESUME
-
-#define INITIALIZE_SCRIPT(ImageHandle, SystemTable) \
- BootScriptSaveInitialize(ImageHandle, SystemTable)
-
-#define SCRIPT_IO_WRITE(TableName, Width, Address, Count, Buffer) \
- BootScriptSaveIoWrite(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_IO_READ_WRITE(TableName, Width, Address, Data, DataMask) \
- BootScriptSaveIoReadWrite(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_MEM_WRITE(TableName, Width, Address, Count, Buffer) \
- BootScriptSaveMemWrite(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_MEM_WRITE_THIS(TableName, Width, Address, Count) \
- BootScriptSaveMemWrite(TableName, Width, Address, Count, (VOID*)(UINTN)Address)
-
-#define SCRIPT_MEM_READ_WRITE(TableName, Width, Address, Data, DataMask) \
- BootScriptSaveMemReadWrite(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_PCI_CFG_WRITE(TableName, Width, Address, Count, Buffer) \
- BootScriptSavePciCfgWrite(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_PCI_CFG_READ_WRITE(TableName, Width, Address, Data, DataMask) \
- BootScriptSavePciCfgReadWrite(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_SMBUS_EXECUTE(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer) \
- BootScriptSaveSmbusExecute(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer)
-
-#define SCRIPT_STALL(TableName, Duration) \
- BootScriptSaveStall(TableName, Duration)
-
-#define SCRIPT_DISPATCH(TableName, EntryPoint) \
- BootScriptSaveDispatch(TableName, EntryPoint)
-
-#define SCRIPT_MEM_POLL(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes) \
- BootScriptMemPoll(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes)
-
-#define SCRIPT_INFORMATION(TableName, Length, Buffer) \
- BootScriptSaveInformation(TableName, Length, Buffer)
-
-#define SCRIPT_INFORMATION_UNICODE_STRING(TableName, String) \
- BootScriptSaveInformationUnicodeString(TableName, String)
-
-#define SCRIPT_INFORMATION_ASCII_STRING(TableName, String) \
- BootScriptSaveInformationAsciiString(TableName, String)
-
-//
-// For backward compatibility
-//
-#define SCRIPT_INOFRMATION(TableName, Length, Buffer) \
- BootScriptSaveInformation(TableName, Length, Buffer)
-
-#define SCRIPT_INOFRMATION_UNICODE_STRING(TableName, String) \
- BootScriptSaveInformationUnicodeString(TableName, String)
-
-#define SCRIPT_INOFRMATION_ASCII_STRING(TableName, String) \
- BootScriptSaveInformationAsciiString(TableName, String)
-
-#else
-
-#define INITIALIZE_SCRIPT(ImageHandle, SystemTable)
-
-#define SCRIPT_IO_WRITE(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_IO_READ_WRITE(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_MEM_WRITE(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_MEM_WRITE_THIS(TableName, Width, Address, Count)
-
-#define SCRIPT_MEM_READ_WRITE(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_PCI_CFG_WRITE(TableName, Width, Address, Count, Buffer)
-
-#define SCRIPT_PCI_CFG_READ_WRITE(TableName, Width, Address, Data, DataMask)
-
-#define SCRIPT_SMBUS_EXECUTE(TableName, SlaveAddress, Command, Operation, PecCheck, Length, Buffer)
-
-#define SCRIPT_STALL(TableName, Duration)
-
-#define SCRIPT_DISPATCH(TableName, EntryPoint)
-
-#define SCRIPT_MEM_POLL(TableName, Width, Address, BitMask, BitValue, Duration, LoopTimes)
-
-#define SCRIPT_INFORMATION(TableName, Length, Buffer)
-
-#define SCRIPT_INFORMATION_UNICODE_STRING(TableName, String)
-
-#define SCRIPT_INFORMATION_ASCII_STRING(TableName, String)
-
-//
-// For backward compatibility
-//
-#define SCRIPT_INOFRMATION(TableName, Length, Buffer)
-
-#define SCRIPT_INOFRMATION_UNICODE_STRING(TableName, String)
-
-#define SCRIPT_INOFRMATION_ASCII_STRING(TableName, String)
-
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h
deleted file mode 100644
index f1e8471a1a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiSmmDriverLib.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- EfiSmmDriverLib.h
-
-Abstract:
-
- Light weight lib to support EFI Smm drivers.
-
---*/
-
-#ifndef _EFI_SMM_DRIVER_LIB_H_
-#define _EFI_SMM_DRIVER_LIB_H_
-
-#include "Tiano.h"
-#include "GetImage.h"
-#include "EfiCommonLib.h"
-#include EFI_GUID_DEFINITION (EventLegacyBios)
-#include EFI_GUID_DEFINITION (EventGroup)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
-#include EFI_PROTOCOL_DEFINITION (SmmBase)
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
-//
-// Driver Lib Globals.
-//
-extern EFI_BOOT_SERVICES *gBS;
-extern EFI_SYSTEM_TABLE *gST;
-extern EFI_RUNTIME_SERVICES *gRT;
-extern EFI_SMM_BASE_PROTOCOL *gSMM;
-extern EFI_SMM_STATUS_CODE_PROTOCOL *mSmmDebug;
-extern UINTN gErrorLevel;
-
-#define EfiCopyMem EfiCommonLibCopyMem
-#define EfiSetMem EfiCommonLibSetMem
-#define EfiZeroMem EfiCommonLibZeroMem
-
-EFI_STATUS
-EfiInitializeSmmDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN OUT BOOLEAN *InSmm
- )
-/*++
-
-Routine Description:
-
- Intialize Smm Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- InSmm - If InSmm is NULL, it will not register Image to SMM.
- If InSmm is not NULL, it will register Image to SMM and
- return information on currently in SMM mode or not.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-;
-
-VOID
-EfiDebugAssert (
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded DEADLOOP ().
-
-Arguments:
-
- FileName - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT().
-
- Description - Description, usually the assertion,
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-EfiDebugVPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- Marker - VarArgs
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-EfiDebugPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- ... - VAR args for Format
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SmmEfiCreateEventLegacyBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *LegacyBootEvent
- )
-/*++
-
-Routine Description:
- Create a Legacy Boot Event.
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Returns:
- EFI_SUCCESS Event was created.
- Other Event was not created.
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-SmmEfiCreateEventReadyToBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *ReadyToBootEvent
- )
-/*++
-
-Routine Description:
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Return:
- EFI_SUCCESS - Event was created.
- Other - Event was not created.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
deleted file mode 100644
index 946742cb17..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
- EfiUiLib.h
-
-Abstract:
- Collection of usefull UI functions.
-
-Revision History:
-
---*/
-
-#ifndef _EFI_UI_LIB_H_
-#define _EFI_UI_LIB_H_
-
-#include "Tiano.h"
-#include "TianoTypes.h"
-#include "EfiDriverLib.h"
-
-CHAR16 *
-StrHzToString (
- OUT CHAR16 *String,
- IN UINT64 Val
- )
-/*++
-
-Routine Description:
- Converts frequency in Hz to Unicode string.
- Three significant digits are delivered. Used for processor info display.
-
-Arguments:
- String - string that will contain the frequency.
- Val - value to convert, minimum is 100000 i.e., 0.1 MHz.
-
-Returns:
- String that contains the frequency.
-
---*/
-;
-
-CHAR16 *
-StrBytesToString (
- OUT CHAR16 *String,
- IN UINT64 Val
- )
-/*++
-
-Routine Description:
- Converts size in bytes to Unicode string.
- Used for memory/cache size display.
-
-Arguments:
- String - string that will contain the value
- Val - value to convert in bytes
-
-Returns:
- String that contains the value.
-
---*/
-;
-
-CHAR16 *
-StrVersionToString (
- OUT CHAR16 *String,
- IN UINT8 Version
- )
-/*++
-
-Routine Description:
- Converts 8 bit version value to Unicode string.
- The upper nibble contains the upper part, the lower nibble contains the minor part.
- The output format is <major>.<minor>.
-
-Arguments:
- String - string that will contain the version value
- Version - Version value to convert
-
-Returns:
- String that contains the version value.
-
---*/
-;
-
-CHAR16 *
-StrMacToString (
- OUT CHAR16 *String,
- IN EFI_MAC_ADDRESS *MacAddr,
- IN UINT32 AddrSize
- )
-/*++
-
-Routine Description:
- Converts MAC address to Unicode string.
- The value is 64-bit and the resulting string will be 12
- digit hex number in pairs of digits separated by dashes.
-
-Arguments:
- String - string that will contain the value
- MacAddr - MAC address to convert
- AddrSize - Size of address
-
-Returns:
- String that contains the value.
-
---*/
-;
-
-CHAR16 *
-StrIp4AdrToString (
- OUT CHAR16 *String,
- IN EFI_IPv4_ADDRESS *Ip4Addr
- )
-/*++
-
-Routine Description:
- Converts IP v4 address to Unicode string.
- The value is 64-bit and the resulting string will
- be four decimal values 0-255 separated by dots.
-
-Arguments:
- String - string that will contain the value
- Ip4Addr - IP v4 address to convert from
-
-Returns:
-
- String that contain the value
-
---*/
-;
-
-EFI_STATUS
-StrStringToIp4Adr (
- OUT EFI_IPv4_ADDRESS *Ip4Addr,
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Parses and converts Unicode string to IP v4 address.
- The value will 64-bit.
- The string must be four decimal values 0-255 separated by dots.
- The string is parsed and format verified.
-
-Arguments:
- Ip4Addr - pointer to the variable to store the value to
- String - string that contains the value to parse and convert
-
-Returns:
- EFI_SUCCESS - if successful
- EFI_INVALID_PARAMETER - if String contains invalid IP v4 format
-
---*/
-;
-
-CHAR16 *
-Ascii2Unicode (
- OUT CHAR16 *UnicodeStr,
- IN CHAR8 *AsciiStr
- )
-/*++
-
-Routine Description:
- Converts ASCII characters to Unicode.
-
-Arguments:
- UnicodeStr - the Unicode string to be written to. The buffer must be large enough.
- AsciiStr - The ASCII string to be converted.
-
-Returns:
- The address to the Unicode string - same as UnicodeStr.
-
---*/
-;
-
-CHAR8 *
-Unicode2Ascii (
- OUT CHAR8 *AsciiStr,
- IN CHAR16 *UnicodeStr
- )
-/*++
-
-Routine Description:
- Converts ASCII characters to Unicode.
- Assumes that the Unicode characters are only these defined in the ASCII set.
-
-Arguments:
- AsciiStr - The ASCII string to be written to. The buffer must be large enough.
- UnicodeStr - the Unicode string to be converted.
-
-Returns:
- The address to the ASCII string - same as AsciiStr.
-
---*/
-;
-
-EFI_STATUS
-EfiStringToValue (
- OUT UINT64 *Val,
- IN CHAR16 *String,
- OUT UINT8 *EndIdx OPTIONAL
- )
-/*++
-
-Routine Description:
- Parses and converts Unicode string to decimal value.
- The returned value is 64-bit.
- The string is expected in decimal format,
- the string is parsed and format verified.
-
-Arguments:
- Val - pointer to the variable to store the value to
- String - string that contains the value to parse and convert
- EndIdx - index on which the parsing stopped. It points to the
- first character that was not part of the returned Val.
- It's valid only if the function returns success.
- It's optional and it could be NULL.
-
-Returns:
- EFI_SUCCESS - if successful
- EFI_INVALID_PARAMETER - if String is in unexpected format
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiWinNtLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiWinNtLib.h
deleted file mode 100644
index baeab288fa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiWinNtLib.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiWinNtLib.h
-
-Abstract:
-
- Set up gWinNt pointer so we can call WinNT APIs.
-
---*/
-
-#ifndef _EFI_WIN_NT_LIB_H_
-#define _EFI_WIN_NT_LIB_H_
-
-extern EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;
-
-EFI_STATUS
-EfiInitializeWinNtDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize gWinNt and initialize debug console.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- Status code
-
---*/
-;
-
-//
-// NTDebugConsole Prototypes
-//
-VOID
-NtDebugConsoleInit (
- VOID
- )
-/*++
-
-Routine Description:
-
- Nt debug console initialize.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GetImage.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GetImage.h
deleted file mode 100644
index 8d1eb066ce..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GetImage.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 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.
-
-Module Name:
-
- GetImage.h
-
-Abstract:
-
- Image data retrieval support for common use.
-
---*/
-
-#ifndef _GET_IMAGE_H_
-#define _GET_IMAGE_H_
-#include "EfiImageFormat.h"
-
-EFI_STATUS
-GetImage (
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Enumerate all the FVs, and fill Buffer with the SectionType section content in NameGuid file.
-
- Note:
- 1. when SectionType is EFI_SECTION_PE32, it tries to read NameGuid file after failure on
- reading EFI_SECTION_PE32 section.
- 2. when SectionType is EFI_SECTION_TE, it tries to get EFI_SECTION_PE32 section after failure on
- reading EFI_SECTION_TE section. If it's failed again, it tries to read NameGuid file.
- 3. Callee allocates memory, which caller is responsible to free.
-
-Arguments:
-
- NameGuid - Pointer to EFI_GUID, which is file name.
- SectionType - Required section type.
- Buffer - Pointer to a pointer in which the read content is returned.
- Caller is responsible to free Buffer.
- Size - Pointer to a UINTN, which indicates the size of returned *Buffer.
-
-Returns:
- EFI_NOT_FOUND - Required content can not be found.
- EFI_SUCCESS - Required content can be found, but whether the Buffer is filled
- with section content or not depends on the Buffer and Size.
---*/
-;
-
-EFI_STATUS
-GetImageEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size,
- BOOLEAN WithinImageFv
- )
-/*++
-
-Routine Description:
- Search FVs, and fill Buffer with the SectionType section content in NameGuid file.
- If ImageHandle is not NULL, the FV from which the ImageHandle is loaded is searched
- first. If WithinImageFv is TRUE, only the FV from which the ImageHandle is loaded
- is searched. If ImageHandle is NULL or WithinImageFv is FALSE, all FVs in the system
- is searched.
-
- Note:
- 1. when SectionType is EFI_SECTION_PE32, it tries to read NameGuid file after failure on
- reading EFI_SECTION_PE32 section.
- 2. when SectionType is EFI_SECTION_TE, it tries to get EFI_SECTION_PE32 section after failure on
- reading EFI_SECTION_TE section. If it's failed again, it tries to read NameGuid file.
- 3. Callee allocates memory, which caller is responsible to free.
-
-Arguments:
-
- ImageHandle - The caller's driver image handle.
- NameGuid - Pointer to EFI_GUID, which is file name.
- SectionType - Required section type.
- Buffer - Pointer to a pointer in which the read content is returned.
- Caller is responsible to free Buffer.
- Size - Pointer to a UINTN, which indicates the size of returned *Buffer.
- WithinImageFv - Whether the search only performs on the FV from which the caller's
- driver image is loaded.
-
-Returns:
- EFI_INVALID_PARAMETER - ImageHandle is NULL and WithinImageFv is TRUE.
- EFI_NOT_FOUND - Required content can not be found.
- EFI_SUCCESS - Required content can be found, but whether the Buffer is filled
- with section content or not depends on the Buffer and Size.
---*/
-;
-
-#endif //_GET_IMAGE_H_
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GraphicsLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GraphicsLib.h
deleted file mode 100644
index 616adab022..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/GraphicsLib.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- GraphicsLib.h
-
-Abstract:
-
-
---*/
-
-#ifndef _EFI_GRAPHICS_LIB_H_
-#define _EFI_GRAPHICS_LIB_H_
-
-#include EFI_PROTOCOL_DEFINITION (ConsoleControl)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume2)
-#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
-#include EFI_PROTOCOL_DEFINITION (UgaDraw)
-#include EFI_PROTOCOL_DEFINITION (EfiOemBadging)
-
-#include EFI_GUID_DEFINITION (Bmp)
-
-EFI_STATUS
-GetGraphicsBitMapFromFV (
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-;
-
-EFI_STATUS
-GetGraphicsBitMapFromFVEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
- Return the graphics image file named FileNameGuid into Image and return it's
- size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
- file name.
-
-Arguments:
-
- ImageHandle - The driver image handle of the caller. The parameter is used to
- optimize the loading of the image file so that the FV from which
- the driver image is loaded will be tried first.
-
- FileNameGuid - File Name of graphics file in the FV(s).
-
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
-
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
-
-
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
-
---*/
-;
-
-
-EFI_STATUS
-ConvertBmpToGopBlt (
- IN VOID *BmpImage,
- IN UINTN BmpImageSize,
- IN OUT VOID **GopBlt,
- IN OUT UINTN *GopBltSize,
- OUT UINTN *PixelHeight,
- OUT UINTN *PixelWidth
- )
-/*++
-
-Routine Description:
-
- Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer
- is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
- buffer is passed in it will be used if it is big enough.
-
-Arguments:
-
- BmpImage - Pointer to BMP file
-
- BmpImageSize - Number of bytes in BmpImage
-
- GopBlt - Buffer containing GOP version of BmpImage.
-
- GopBltSize - Size of GopBlt in bytes.
-
- PixelHeight - Height of GopBlt/BmpImage in pixels
-
- PixelWidth - Width of GopBlt/BmpImage in pixels
-
-
-Returns:
-
- EFI_SUCCESS - GopBlt and GopBltSize are returned.
- EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image
- EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough.
- GopBltSize will contain the required size.
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-
---*/
-;
-
-EFI_STATUS
-EnableQuietBoot (
- IN EFI_GUID *LogoFile
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off UGA based Simple Text Out consoles from going
- to the UGA device. Put up LogoFile on every UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-;
-
-EFI_STATUS
-EnableQuietBootEx (
- IN EFI_GUID *LogoFile,
- IN EFI_HANDLE ImageHandle
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn off UGA based Simple Text Out consoles from going
- to the UGA device. Put up LogoFile on every UGA device that is a console
-
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
- ImageHandle - The driver image handle of the caller. The parameter is used to
- optimize the loading of the logo file so that the FV from which
- the driver image is loaded will be tried first.
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-;
-
-EFI_STATUS
-DisableQuietBoot (
- VOID
- )
-/*++
-
-Routine Description:
-
- Use Console Control to turn on UGA based Simple Text Out consoles. The UGA
- Simple Text Out screens will now be synced up with all non UGA output devices
-
-Arguments:
-
- NONE
-
-Returns:
-
- EFI_SUCCESS - UGA devices are back in text mode and synced up.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-;
-
-EFI_STATUS
-LockKeyboards (
- IN CHAR16 *Password
- )
-/*++
-
-Routine Description:
- Use Console Control Protocol to lock the Console In Spliter virtual handle.
- This is the ConInHandle and ConIn handle in the EFI system table. All key
- presses will be ignored until the Password is typed in. The only way to
- disable the password is to type it in to a ConIn device.
-
-Arguments:
- Password - Password used to lock ConIn device
-
-
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/CpuFuncs.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/CpuFuncs.h
deleted file mode 100644
index 3d1089f068..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/CpuFuncs.h
+++ /dev/null
@@ -1,260 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- CpuFuncs.h
-
-Abstract:
-
---*/
-
-#ifndef _CPU_FUNCS_H_
-#define _CPU_FUNCS_H_
-
-#define EFI_CPUID_SIGNATURE 0x0
-#define EFI_CPUID_VERSION_INFO 0x1
-#define EFI_CPUID_CACHE_INFO 0x2
-#define EFI_CPUID_SERIAL_NUMBER 0x3
-#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
-#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
-#define EFI_CPUID_BRAND_STRING1 0x80000002
-#define EFI_CPUID_BRAND_STRING2 0x80000003
-#define EFI_CPUID_BRAND_STRING3 0x80000004
-
-//
-// CPUID version information masks
-// Note: leaving masks here is for the compatibility
-// use EfiCpuVersion (...) instead
-//
-#define EFI_CPUID_FAMILY 0x0F00
-#define EFI_CPUID_MODEL 0x00F0
-#define EFI_CPUID_STEPPING 0x000F
-
-#define EFI_CPUID_PENTIUM_M 0x0600
-#define EFI_CPUID_BANIAS 0x0090
-#define EFI_CPUID_DOTHAN 0x00D0
-#define EFI_CPUID_NETBURST 0x0F00
-
-#define EFI_MSR_IA32_PLATFORM_ID 0x17
-#define EFI_MSR_IA32_APIC_BASE 0x1B
-#define EFI_MSR_EBC_HARD_POWERON 0x2A
-#define EFI_MSR_EBC_SOFT_POWERON 0x2B
-#define BINIT_DRIVER_DISABLE 0x40
-#define INTERNAL_MCERR_DISABLE 0x20
-#define INITIATOR_MCERR_DISABLE 0x10
-#define EFI_MSR_EBC_FREQUENCY_ID 0x2C
-#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
-#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
-#define EFI_MSR_PSB_CLOCK_STATUS 0xCD
-#define EFI_APIC_GLOBAL_ENABLE 0x800
-#define EFI_MSR_IA32_MISC_ENABLE 0x1A0
-#define LIMIT_CPUID_MAXVAL_ENABLE_BIT 0x00400000
-#define AUTOMATIC_THERMAL_CONTROL_ENABLE_BIT 0x00000008
-#define COMPATIBLE_FPU_OPCODE_ENABLE_BIT 0x00000004
-#define LOGICAL_PROCESSOR_PRIORITY_ENABLE_BIT 0x00000002
-#define FAST_STRING_ENABLE_BIT 0x00000001
-
-#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
-#define EFI_CACHE_VARIABLE_MTRR_END 0x20F
-#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
-#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
-#define EFI_CACHE_MTRR_VALID 0x800
-#define EFI_CACHE_FIXED_MTRR_VALID 0x400
-#define EFI_MSR_VALID_MASK 0xFFFFFFFFF
-
-#define EFI_IA32_MTRR_FIX64K_00000 0x250
-#define EFI_IA32_MTRR_FIX16K_80000 0x258
-#define EFI_IA32_MTRR_FIX16K_A0000 0x259
-#define EFI_IA32_MTRR_FIX4K_C0000 0x268
-#define EFI_IA32_MTRR_FIX4K_C8000 0x269
-#define EFI_IA32_MTRR_FIX4K_D0000 0x26A
-#define EFI_IA32_MTRR_FIX4K_D8000 0x26B
-#define EFI_IA32_MTRR_FIX4K_E0000 0x26C
-#define EFI_IA32_MTRR_FIX4K_E8000 0x26D
-#define EFI_IA32_MTRR_FIX4K_F0000 0x26E
-#define EFI_IA32_MTRR_FIX4K_F8000 0x26F
-
-#define EFI_IA32_MCG_CAP 0x179
-#define EFI_IA32_MCG_CTL 0x17B
-#define EFI_IA32_MC0_CTL 0x400
-#define EFI_IA32_MC0_STATUS 0x401
-
-#define EFI_CACHE_UNCACHEABLE 0
-#define EFI_CACHE_WRITECOMBINING 1
-#define EFI_CACHE_WRITETHROUGH 4
-#define EFI_CACHE_WRITEPROTECTED 5
-#define EFI_CACHE_WRITEBACK 6
-
-//
-// Combine f(FamilyId), m(Model), s(SteppingId) to a single 32 bit number
-//
-#define EfiMakeCpuVersion(f, m, s) \
- (((UINT32) (f) << 16) | ((UINT32) (m) << 8) | ((UINT32) (s)))
-
-typedef struct {
- UINT32 HeaderVersion;
- UINT32 UpdateRevision;
- UINT32 Date;
- UINT32 ProcessorId;
- UINT32 Checksum;
- UINT32 LoaderRevision;
- UINT32 ProcessorFlags;
- UINT32 DataSize;
- UINT32 TotalSize;
- UINT8 Reserved[12];
-} EFI_CPU_MICROCODE_HEADER;
-
-typedef struct {
- UINT32 ExtSigCount;
- UINT32 ExtChecksum;
- UINT8 Reserved[12];
- UINT32 ProcessorId;
- UINT32 ProcessorFlags;
- UINT32 Checksum;
-} EFI_CPU_MICROCODE_EXT_HEADER;
-
-typedef struct {
- UINT32 RegEax;
- UINT32 RegEbx;
- UINT32 RegEcx;
- UINT32 RegEdx;
-} EFI_CPUID_REGISTER;
-
-VOID
-EfiWriteMsr (
- IN UINT32 Input,
- IN UINT64 Value
- )
-/*++
-
-Routine Description:
-
- Write Cpu MSR
-
-Arguments:
-
- Input -The index value to select the register
- Value -The value to write to the selected register
-
-Returns:
-
- None
-
---*/
-;
-
-UINT64
-EfiReadMsr (
- IN UINT32 Input
- )
-/*++
-
-Routine Description:
-
- Read Cpu MSR.
-
-Arguments:
-
- Input: -The index value to select the register
-
-Returns:
-
- Return the read data
-
---*/
-;
-
-VOID
-EfiCpuid (
- IN UINT32 RegEax,
- OUT EFI_CPUID_REGISTER *Reg
- )
-/*++
-
-Routine Description:
-
- Get the Cpu info by excute the CPUID instruction.
-
-Arguments:
-
- RegEax -The input value to put into register EAX
- Reg -The Output value
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-EfiCpuVersion (
- IN UINT16 *FamilyId, OPTIONAL
- IN UINT8 *Model, OPTIONAL
- IN UINT8 *SteppingId, OPTIONAL
- IN UINT8 *Processor OPTIONAL
- )
-/*++
-
-Routine Description:
- Extract CPU detail version infomation
-
-Arguments:
- FamilyId - FamilyId, including ExtendedFamilyId
- Model - Model, including ExtendedModel
- SteppingId - SteppingId
- Processor - Processor
-
---*/
-;
-
-UINT64
-EfiReadTsc (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read Time stamp.
-
-Arguments:
-
- None
-
-Returns:
-
- Return the read data
-
---*/
-;
-VOID
-EfiCpuidExt (
- IN UINT32 RegisterInEax,
- IN UINT32 CacheLevel,
- OUT EFI_CPUID_REGISTER *Regs
- )
-/*++
-Routine Description:
- When RegisterInEax != 4, the functionality is the same as EfiCpuid.
- When RegisterInEax == 4, the function return the deterministic cache
- parameters by excuting the CPUID instruction
-Arguments:
- RegisterInEax: - The input value to put into register EAX
- CacheLevel: - The deterministic cache level
- Regs: - The Output value
-Returns:
- None
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/ProcDep.h
deleted file mode 100644
index 70f33754af..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32/ProcDep.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- IA-32 specific Runtime Lib code. At this time there is non.
- IPF has different code due to extra API requirements.
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32EfiRuntimeDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32EfiRuntimeDriverLib.h
deleted file mode 100644
index 310c91f56e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ia32EfiRuntimeDriverLib.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Ia32EfiRuntimeDriverLib.h
-
-Abstract:
-
- Light weight lib to support IA32 EFI Libraries.
-
---*/
-
-#ifndef _IA32_EFI_RUNTIME_LIB_H_
-#define _IA32_EFI_RUNTIME_LIB_H_
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-
-typedef
-EFI_STATUS
-(EFIAPI *COMMON_PROC_ENTRY) (
- IN UINTN FunctionId,
- IN UINTN Arg2,
- IN UINTN Arg3,
- IN UINTN Arg4,
- IN UINTN Arg5,
- IN UINTN Arg6,
- IN UINTN Arg7,
- IN UINTN Arg8
- );
-
-typedef struct {
- COMMON_PROC_ENTRY CommonProcEntry;
-} COMMON_PROC_ENTRY_STRUCT;
-
-EFI_STATUS
-InstallPlatformRuntimeLib (
- IN EFI_GUID *Guid,
- IN COMMON_PROC_ENTRY_STRUCT *CommonEntry
- )
-/*++
-
-Routine Description:
-
- Install platform runtime lib.
-
-Arguments:
-
- Guid - Guid for runtime lib
- CommonEntry - Common entry
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-GetPlatformRuntimeLib (
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Get platform runtime lib.
-
-Arguments:
-
- SystemTable - Pointer to system table
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-ConvertPlatformRuntimeLibPtr (
- IN EFI_RUNTIME_SERVICES *mRT
- )
-/*++
-
-Routine Description:
-
- Convert platform runtime lib pointer.
-
-Arguments:
-
- mRT - Pointer to runtime service table.
-
-Returns:
-
- Status code
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h
deleted file mode 100644
index 456569c83a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/CpuFuncs.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- CpuFuncs.h
-
-Abstract:
-
---*/
-
-#ifndef _CPU_FUNCS_H
-#define _CPU_FUNCS_H
-
-#define EFI_CPUID_SIGNATURE 0x0
-#define EFI_CPUID_VERSION_INFO 0x1
-#define EFI_CPUID_CACHE_INFO 0x2
-#define EFI_CPUID_SERIAL_NUMBER 0x3
-#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
-#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
-#define EFI_CPUID_BRAND_STRING1 0x80000002
-#define EFI_CPUID_BRAND_STRING2 0x80000003
-#define EFI_CPUID_BRAND_STRING3 0x80000004
-
-#define EFI_MSR_IA32_APIC_BASE 0x1B
-#define EFI_MSR_EBC_HARD_POWERON 0x2A
-#define EFI_MSR_EBC_SOFT_POWERON 0x2B
-#define EFI_MSR_EBC_FREQUENCY_ID 0x2C
-#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
-#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
-#define EFI_APIC_GLOBAL_ENABLE 0x800
-
-#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
-#define EFI_CACHE_VARIABLE_MTRR_END 0x20F
-#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
-#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
-#define EFI_CACHE_MTRR_VALID 0x800
-#define EFI_CACHE_FIXED_MTRR_VALID 0x400
-#define EFI_MSR_VALID_MASK 0xFFFFFFFFF
-
-#define EFI_IA32_MTRR_FIX64K_00000 0x250
-#define EFI_IA32_MTRR_FIX16K_80000 0x258
-#define EFI_IA32_MTRR_FIX16K_A0000 0x259
-#define EFI_IA32_MTRR_FIX4K_C0000 0x268
-#define EFI_IA32_MTRR_FIX4K_C8000 0x269
-#define EFI_IA32_MTRR_FIX4K_D0000 0x26A
-#define EFI_IA32_MTRR_FIX4K_D8000 0x26B
-#define EFI_IA32_MTRR_FIX4K_E0000 0x26C
-#define EFI_IA32_MTRR_FIX4K_E8000 0x26D
-#define EFI_IA32_MTRR_FIX4K_F0000 0x26E
-#define EFI_IA32_MTRR_FIX4K_F8000 0x26F
-
-#define EFI_IA32_MCG_CAP 0x179
-#define EFI_IA32_MCG_CTL 0x17B
-#define EFI_IA32_MC0_CTL 0x400
-#define EFI_IA32_MC0_STATUS 0x401
-
-#define EFI_CACHE_UNCACHEABLE 0
-#define EFI_CACHE_WRITECOMBINING 1
-#define EFI_CACHE_WRITETHROUGH 4
-#define EFI_CACHE_WRITEPROTECTED 5
-#define EFI_CACHE_WRITEBACK 6
-
-UINT64
-EfiReadTsc (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read Time stamp.
-
-Arguments:
-
- None
-
-Returns:
-
- Return the read data
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h
deleted file mode 100644
index 85a2cb5746..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/EsalRuntimeLib.h
+++ /dev/null
@@ -1,1305 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EsalRuntimeLib.h
-
-Abstract:
-
- SAL Driver Lib
-
-Revision History
-
---*/
-
-#ifndef _ESAL_RUNTIME_LIB_H_
-#define _ESAL_RUNTIME_LIB_H_
-
-#include "SalApi.h"
-#include "EfiFirmwareVolumeHeader.h"
-
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-
-VOID
-EsalRuntimeLibVirtualNotify (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ImageHandle - Image Handle
- SystemTable - the System Table
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-SAL_RETURN_REGS
-CallEsalService (
- IN EFI_GUID *ClassGuid,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ClassGuid - TODO: add argument description
- FunctionId - TODO: add argument description
- Arg2 - TODO: add argument description
- Arg3 - TODO: add argument description
- Arg4 - TODO: add argument description
- Arg5 - TODO: add argument description
- Arg6 - TODO: add argument description
- Arg7 - TODO: add argument description
- Arg8 - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// Assembly Functions
-//
-
-SAL_RETURN_REGS
-EsalGetEntryPoint (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalSetPhysicalEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- EntryPoint - TODO: add argument description
- Gp - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalSetVirtualEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- EntryPoint - TODO: add argument description
- Gp - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalSetPhysicalModuleGlobal (
- IN VOID *Global
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Global - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalSetVirtualModuleGlobal (
- IN VOID *Global
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Global - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalGetModuleGlobal (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-GetIrrData (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-GetPsrData (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-GetProcIdData (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-VOID
-SwitchCpuStack (
- IN UINT64 NewBsp,
- IN UINT64 OldBsp
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- NewBsp - TODO: add argument description
- OldBsp - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// PAL PROC Class
-//
-
-SAL_RETURN_REGS
-SalPalProc (
- IN UINT64 Arg1,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Arg1 - TODO: add argument description
- Arg2 - TODO: add argument description
- Arg3 - TODO: add argument description
- Arg4 - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalRegisterNewPalEntry (
- IN BOOLEAN PhysicalPalAddress,
- IN EFI_PHYSICAL_ADDRESS NewPalAddress
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- PhysicalPalAddress - TODO: add argument description
- NewPalAddress - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalGetPalEntryPointer (
- IN BOOLEAN PhysicalPalAddress
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- PhysicalPalAddress - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// SAL BASE Class
-//
-
-SAL_RETURN_REGS
-SalProcSetVectors (
- IN UINT64 SalVectorType,
- IN UINT64 PhyAddr1,
- IN UINT64 Gp1,
- IN UINT64 LengthCs1,
- IN UINT64 PhyAddr2,
- IN UINT64 Gp2,
- IN UINT64 LengthCs2
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- SalVectorType - TODO: add argument description
- PhyAddr1 - TODO: add argument description
- Gp1 - TODO: add argument description
- LengthCs1 - TODO: add argument description
- PhyAddr2 - TODO: add argument description
- Gp2 - TODO: add argument description
- LengthCs2 - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalProcMcRendez (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalProcMcSetParams (
- IN UINT64 ParamType,
- IN UINT64 IntOrMem,
- IN UINT64 IntOrMemVal,
- IN UINT64 Timeout,
- IN UINT64 McaOpt
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ParamType - TODO: add argument description
- IntOrMem - TODO: add argument description
- IntOrMemVal - TODO: add argument description
- Timeout - TODO: add argument description
- McaOpt - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcGetVectors (
- IN UINT64 VectorType
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- VectorType - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcMcGetParams (
- IN UINT64 ParamInfoType
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ParamInfoType - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcMcGetMcParams (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcGetMcCheckinFlags (
- IN UINT64 ProcessorUnit
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ProcessorUnit - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// Sal Base Class enums
-//
-
-typedef enum {
- McaVector,
- BspInitVector,
- BootRendezVector,
- ApInitVector
-} ESAL_GET_VECTOR_TYPE;
-
-SAL_RETURN_REGS
-SalInitializeThreshold (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ThresholdStruct - TODO: add argument description
- Count - TODO: add argument description
- Duration - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalBumpThresholdCount (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ThresholdStruct - TODO: add argument description
- Count - TODO: add argument description
- Duration - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-SalGetThresholdCount (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ThresholdStruct - TODO: add argument description
- Count - TODO: add argument description
- Duration - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// Common Lib Function
-//
-
-EFI_STATUS
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- FunctionId - TODO: add argument description
- ClassGuid - TODO: add argument description
- Function - TODO: add argument description
- ModuleGlobal - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-RegisterEsalClass (
- IN EFI_GUID *ClassGuid,
- IN VOID *ModuleGlobal,
- ...
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ClassGuid - TODO: add argument description
- ModuleGlobal - TODO: add argument description
- ... - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// MP Class Functions
-//
-SAL_RETURN_REGS
-LibMpAddCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatability
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
- Enabled - TODO: add argument description
- PalCompatability - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpRemoveCpuData (
- IN UINT64 CpuGlobalId
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpModifyCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatability
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
- Enabled - TODO: add argument description
- PalCompatability - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpGetCpuDataByID (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
- IndexByEnabledCpu - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpGetCpuDataByIndex (
- IN UINT64 Index,
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Index - TODO: add argument description
- IndexByEnabledCpu - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpSendIpi (
- IN UINT64 ProcessorNumber,
- IN UINT64 VectorNumber,
- IN EFI_DELIVERY_MODE DeliveryMode,
- IN BOOLEAN IRFlag
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ProcessorNumber - TODO: add argument description
- VectorNumber - TODO: add argument description
- DeliveryMode - TODO: add argument description
- IRFlag - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpCurrentProcessor (
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- IndexByEnabledCpu - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibGetNumProcessors (
- VOID
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- None
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpSaveMinStatePointer (
- IN UINT64 CpuGlobalId,
- IN EFI_PHYSICAL_ADDRESS MinStatePointer
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
- MinStatePointer - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpRestoreMinStatePointer (
- IN UINT64 CpuGlobalId
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuGlobalId - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// MCA Class Functions
-//
-
-EFI_STATUS
-LibMcaGetStateInfo (
- IN UINT64 CpuId,
- OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer,
- OUT UINT64 *RequiredStateBufferSize
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuId - TODO: add argument description
- StateBufferPointer - TODO: add argument description
- RequiredStateBufferSize - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-LibMcaRegisterCpu (
- IN UINT64 CpuId,
- IN EFI_PHYSICAL_ADDRESS StateBufferAddress
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- CpuId - TODO: add argument description
- StateBufferAddress - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// FVB Variables Class
-//
-EFI_STATUS
-EsalReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Lba - TODO: add argument description
- Offset - TODO: add argument description
- NumBytes - TODO: add argument description
- Buffer - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Lba - TODO: add argument description
- Offset - TODO: add argument description
- NumBytes - TODO: add argument description
- Buffer - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalEraseBlock (
- IN UINTN Instance,
- IN UINTN Lba
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Lba - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES *Attributes
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Attributes - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalSetVolumeAttributes (
- IN UINTN Instance,
- IN EFI_FVB_ATTRIBUTES Attributes
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Attributes - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *Address
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Address - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EsalGetBlockSize (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Instance - TODO: add argument description
- Lba - TODO: add argument description
- BlockSize - TODO: add argument description
- NumOfBlocks - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// SAL ELOG Functions
-//
-EFI_STATUS
-LibSalGetStateInfo (
- IN UINT64 McaType,
- IN UINT8 *McaBuffer,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- McaType - TODO: add argument description
- McaBuffer - TODO: add argument description
- Size - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-LibSalGetStateInfoSize (
- IN UINT64 McaType,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- McaType - TODO: add argument description
- Size - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-LibSalClearStateInfo (
- IN UINT64 McaType
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- McaType - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-LibEsalGetStateBuffer (
- IN UINT64 McaType,
- OUT UINT8 **McaBuffer,
- OUT UINTN *Index
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- McaType - TODO: add argument description
- McaBuffer - TODO: add argument description
- Index - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-LibEsalSaveStateBuffer (
- IN UINT64 McaType
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- McaType - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/ProcDep.h
deleted file mode 100644
index ab86b6073d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/ProcDep.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- IPF specific Runtime Lib code. IPF has a SAL API that does not
- exit on IA-32. Thus
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-#include "SalApi.h"
-
-EFI_STATUS
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class Function and it's asociated global.
- This function is boot service only!
-
-Arguments:
- FunctionId - ID of function to register
- ClassGuid - GUID of function class
- Function - Function to register under ClassGuid/FunctionId pair
- ModuleGlobal - Module global for Function.
-
-Returns:
- EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
-
---*/
-;
-
-EFI_STATUS
-RegisterEsalClass (
- IN EFI_GUID *ClassGuid,
- IN VOID *ModuleGlobal,
- ...
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class and it's asociated global.
- This function is boot service only!
-
-Arguments:
- ClassGuid - GUID of function class
- ModuleGlobal - Module global for Function.
- .. - SAL_INTERNAL_EXTENDED_SAL_PROC and FunctionId pairs. NULL
- indicates the end of the list.
-
-Returns:
- EFI_SUCCESS - All members of ClassGuid registered
-
---*/
-;
-
-SAL_RETURN_REGS
-EfiCallEsalService (
- IN EFI_GUID *ClassGuid,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- )
-/*++
-
-Routine Description:
-
- Call module that is not linked direclty to this module. This code is IP
- relative and hides the binding issues of virtual or physical calling. The
- function that gets dispatched has extra arguments that include the registered
- module global and a boolean flag to indicate if the system is in virutal mode.
-
-Arguments:
- ClassGuid - GUID of function
- FunctionId - Function in ClassGuid to call
- Arg2 - Argument 2 ClassGuid/FunctionId defined
- Arg3 - Argument 3 ClassGuid/FunctionId defined
- Arg4 - Argument 4 ClassGuid/FunctionId defined
- Arg5 - Argument 5 ClassGuid/FunctionId defined
- Arg6 - Argument 6 ClassGuid/FunctionId defined
- Arg7 - Argument 7 ClassGuid/FunctionId defined
- Arg8 - Argument 8 ClassGuid/FunctionId defined
-
-Returns:
- Status of ClassGuid/FuncitonId
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h
deleted file mode 100644
index 15926dc4ce..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/Ipf/SalDriverLib.h
+++ /dev/null
@@ -1,1454 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- SalDriverLib.h
-
-Abstract:
-
- SAL Driver Lib
-
-Revision History
-
---*/
-
-#ifndef _SAL_DRIVER_LIB_H_
-#define _SAL_DRIVER_LIB_H_
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "SalApi.h"
-
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-
-//
-// Assembly Functions
-//
-SAL_RETURN_REGS
-LibGetEsalPhyData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get Esal global data in physical mode.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibGetEsalVirtData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get Esal global data in virtual mode.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibSetEsalPhyData (
- IN VOID *Ptr,
- IN UINT64 GP
- )
-/*++
-
-Routine Description:
-
- Set Esal global data in physical mode.
-
-Arguments:
-
- Ptr - Pointer to the data
- GP - Global pointer
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibSetEsalVirtData (
- IN VOID *Ptr,
- IN UINT64 GP
- )
-/*++
-
-Routine Description:
-
- Set Esal global data in virtual mode.
-
-Arguments:
-
- Ptr - Pointer to the data
- GP - Global pointer
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibGetGlobalPhyData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get Esal global data in physical mode.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibGetGlobalVirtData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get Esal global data in virtual mode.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibSetGlobalPhyData (
- IN VOID *Ptr,
- IN UINT64 GP
- )
-/*++
-
-Routine Description:
-
- Set Esal global data in physical mode.
-
-Arguments:
-
- Ptr - Pointer to the data
- GP - Global pointer
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibSetGlobalVirtData (
- IN VOID *Ptr,
- IN UINT64 GP
- )
-/*++
-
-Routine Description:
-
- Set Esal global data in virtual mode.
-
-Arguments:
-
- Ptr - Pointer to the data
- GP - Global pointer
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-GetIrrData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get interrupt request register.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-VOID
-PrepareApsForHandOverToOS (
- VOID
- )
-/*++
-
-Routine Description:
-
- Prepare AP info for hand over to OS.
-
-Arguments:
-
- None
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-HandOverApsToOS (
- IN UINT64 a1,
- IN UINT64 a2,
- IN UINT64 a3
- )
-/*++
-
-Routine Description:
-
- Hand over AP info to OS.
-
-Arguments:
-
- a1 - Address to call into
-
- a2 - GP
-
- a3 - Undefined
-
-Returns:
-
- None
-
---*/
-;
-
-SAL_RETURN_REGS
-GetPsrData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get PSR register.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs.
-
---*/
-;
-
-SAL_RETURN_REGS
-GetProcIdData (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get LID
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-VOID
-SwitchCpuStack (
- IN UINT64 NewBsp,
- IN UINT64 OldBsp
- )
-/*++
-
-Routine Description:
-
- Switch BSP
-
-Arguments:
-
- NewBsp - New BSP index
- OldBsp - Old BSP index
-
-Returns:
-
- None
-
---*/
-;
-
-//
-// SAL Reset Class
-//
-VOID
-SalResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Reset system
-
-Arguments:
-
- ResetType - Reset type
- ResetStatus - Reset status
- DataSize - Size of ResetData
- ResetData - Description string
-
-Returns:
-
- None
-
---*/
-;
-
-//
-// PAL PROC Class
-//
-SAL_RETURN_REGS
-SalPalProc (
- IN UINT64 Arg1,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- )
-/*++
-
-Routine Description:
-
- Call pal proc.
-
-Arguments:
-
- Arg1 - Pal call index
- Arg2 - First arg
- Arg3 - Second arg
- Arg4 - Third arg
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalRegisterNewPalEntry (
- IN BOOLEAN PhysicalPalAddress,
- IN EFI_PHYSICAL_ADDRESS NewPalAddress
- )
-/*++
-
-Routine Description:
-
- Register Pal entry.
-
-Arguments:
-
- PhysicalPalAddress - The address is physical or virtual
- NewPalAddress - New Pal entry address
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalGetPalEntryPointer (
- IN BOOLEAN PhysicalPalAddress
- )
-/*++
-
-Routine Description:
-
- Get Pal entry.
-
-Arguments:
-
- PhysicalPalAddress - The address is physical or virtual
-
-Returns:
-
- Output regs
-
---*/
-;
-
-//
-// SAL MTC Class
-//
-EFI_STATUS
-SalGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Get next high 32 bits of monotonic count.
-
-Arguments:
-
- HighCount - High 32 bits of monotonic count.
-
-Returns:
-
- Status code
-
---*/
-;
-
-//
-// SAL BASE Class
-//
-SAL_RETURN_REGS
-SalProcSetVectors (
- IN UINT64 SalVectorType,
- IN UINT64 PhyAddr1,
- IN UINT64 Gp1,
- IN UINT64 LengthCs1,
- IN UINT64 PhyAddr2,
- IN UINT64 Gp2,
- IN UINT64 LengthCs2
- )
-/*++
-
-Routine Description:
-
- Set vectors.
-
-Arguments:
-
- SalVectorType - Vector type
- PhyAddr1 - OS MCA entry point
- Gp1 - GP for OS MCA entry
- LengthCs1 - Length of OS MCA
- PhyAddr2 - OS INIT entry point
- Gp2 - GP for OS Init entry
- LengthCs2 - Length of OS INIT
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalProcMcRendez (
- VOID
- )
-/*++
-
-Routine Description:
-
- Mc rendezvous function.
-
-Arguments:
-
- None
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalProcMcSetParams (
- IN UINT64 ParamType,
- IN UINT64 IntOrMem,
- IN UINT64 IntOrMemVal,
- IN UINT64 Timeout,
- IN UINT64 McaOpt
- )
-/*++
-
-Routine Description:
-
- Set MCA parameters.
-
-Arguments:
-
- ParamType - Parameter type
- IntOrMem - Interrupt or memory address
- IntOrMemVal - Interrupt number or memory address value
- Timeout - Time out value
- McaOpt - Option for MCA
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcGetVectors (
- IN UINT64 VectorType
- )
-/*++
-
-Routine Description:
-
- Get OS MCA vector.
-
-Arguments:
-
- VectorType - Vector type
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcMcGetParams (
- IN UINT64 ParamInfoType
- )
-/*++
-
-Routine Description:
-
- Get MCA parameter.
-
-Arguments:
-
- ParamInfoType - Parameter info type
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcMcGetMcParams (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get MCA parameter.
-
-Arguments:
-
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-EsalProcGetMcCheckinFlags (
- IN UINT64 ProcessorUnit
- )
-/*++
-
-Routine Description:
-
- Get process status.
-
-Arguments:
-
- ProcessorUnit - Processor Index
-
-Returns:
-
- Output regs
-
---*/
-;
-
-//
-// Sal Base Class enums
-//
-typedef enum {
- McaVector,
- BspInitVector,
- BootRendezVector,
- ApInitVector
-} ESAL_GET_VECTOR_TYPE;
-
-//
-// Sal RTC Class
-//
-EFI_STATUS
-SalGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-SalSetTime (
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-SalGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-SalSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-;
-
-SAL_RETURN_REGS
-SalInitializeThreshold (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- Init threshold structure.
-
-Arguments:
-
- ThresholdStruct - Threshold structure
- Count - Threshold count
- Duration - Duration
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalBumpThresholdCount (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- Bump threshold count.
-
-Arguments:
-
- ThresholdStruct - Threshold structure
- Count - Threshold count
- Duration - Duration
-
-Returns:
-
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalGetThresholdCount (
- IN VOID *ThresholdStruct,
- IN UINT64 Count,
- IN UINT64 Duration
- )
-/*++
-
-Routine Description:
-
- Get threshold structure.
-
-Arguments:
-
- ThresholdStruct - Threshold structure
- Count - Threshold count
- Duration - Duration
-
-Returns:
-
- Output regs
-
---*/
-;
-
-//
-// Common Lib Function
-//
-EFI_STATUS
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class Function and it's asociated global.
- This function is boot service only!
-
-Arguments:
- FunctionId - ID of function to register
- ClassGuid - GUID of function class
- Function - Function to register under ClassGuid/FunctionId pair
- ModuleGlobal - Module global for Function.
-
-Returns:
- EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
-
---*/
-;
-
-EFI_STATUS
-EfiInitializeSalDriverLib (
- IN BOOLEAN Runtime
- )
-/*++
-
-Routine Description:
-
- Initialize Sal driver lib.
-
-Arguments:
- Runtime - At runtime or not?
-
-Returns:
- Status code
-
---*/
-;
-
-//
-// MCA PMI INIT Registeration Functions.
-//
-EFI_STATUS
-LibRegisterMcaFunction (
- IN EFI_SAL_MCA_HANDLER McaHandler,
- IN VOID *ModuleGlobal,
- IN BOOLEAN MakeFirst,
- IN BOOLEAN MakeLast
- )
-/*++
-
-Routine Description:
-
- Register MCA handler.
-
-Arguments:
- McaHandler - MCA handler
- ModuleGlobal - Module global for function
- MakeFirst - Make it as first?
- MakeLast - Make it as last?
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibRegisterPmiFunction (
- IN EFI_SAL_PMI_HANDLER PmiHandler,
- IN VOID *ModuleGlobal,
- IN BOOLEAN MakeFirst,
- IN BOOLEAN MakeLast
- )
-/*++
-
-Routine Description:
-
- Register PMI handler.
-
-Arguments:
- PmiHandler - PMI handler
- ModuleGlobal - Module global for function
- MakeFirst - Make it as first?
- MakeLast - Make it as last?
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibRegisterInitFunction (
- IN EFI_SAL_INIT_HANDLER InitHandler,
- IN VOID *ModuleGlobal,
- IN BOOLEAN MakeFirst,
- IN BOOLEAN MakeLast
- )
-/*++
-
-Routine Description:
-
- Register INIT handler.
-
-Arguments:
- InitHandler - INIT handler
- ModuleGlobal - Module global for function
- MakeFirst - Make it as first?
- MakeLast - Make it as last?
-
-Returns:
- Status code
-
---*/
-;
-
-//
-// Base IO Class Functions
-//
-EFI_STATUS
-ESalIoRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io read operation.
-
-Arguments:
-
- Width - Width of read operation
- Address - Start IO address to read
- Count - Read count
- Buffer - Buffer to store result
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-ESalIoWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io write operation.
-
-Arguments:
-
- Width - Width of write operation
- Address - Start IO address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-ESalMemRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a Memory mapped IO read into Buffer.
-
-Arguments:
- Width - Width of each read transaction.
- Address - Memory mapped IO address to read
- Count - Number of Width quanta to read
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-ESalMemWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a memory mapped IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- Status code
-
---*/
-;
-
-//
-// PCI Class Functions
-//
-SAL_RETURN_REGS
-SalPCIConfigRead (
- IN UINT64 Address,
- IN UINT64 Size
- )
-/*++
-
-Routine Description:
- Pci config space read.
-
-Arguments:
- Address - PCI address to read
- Size - Size to read
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-SalPCIConfigWrite (
- IN UINT64 Address,
- IN UINT64 Size,
- IN UINT64 Value
- )
-/*++
-
-Routine Description:
- Pci config space write.
-
-Arguments:
- Address - PCI address to write
- Size - Size to write
- Value - Value to write
-
-Returns:
- Output regs
-
---*/
-;
-
-//
-// MP Class Functions
-//
-SAL_RETURN_REGS
-LibMPAddCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatability
- )
-/*++
-
-Routine Description:
- Add CPU data.
-
-Arguments:
- CpuGlobalId - CPU ID
- Enabled - Enabled or not
- PalCompatability - Pal compatability
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMPRemoveCpuData (
- IN UINT64 CpuGlobalId
- )
-/*++
-
-Routine Description:
- Remove CPU data.
-
-Arguments:
- CpuGlobalId - CPU ID
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMPModifyCpuData (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN Enabled,
- IN UINT64 PalCompatability
- )
-/*++
-
-Routine Description:
- Modify CPU data.
-
-Arguments:
- CpuGlobalId - CPU ID
- Enabled - Enabled or not
- PalCompatability - Pal compatability
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMPGetCpuDataByID (
- IN UINT64 CpuGlobalId,
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
- Get CPU data.
-
-Arguments:
- CpuGlobalId - CPU ID
- IndexByEnabledCpu - Whether indexed by enabled CPU
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMPGetCpuDataByIndex (
- IN UINT64 Index,
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
- Get CPU data.
-
-Arguments:
- Index - CPU index
- IndexByEnabledCpu - Whether indexed by enabled CPU
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMPSendIpi (
- IN UINT64 ProcessorNumber,
- IN UINT64 VectorNumber,
- IN EFI_DELIVERY_MODE DeliveryMode,
- IN BOOLEAN IRFlag
- )
-/*++
-
-Routine Description:
- Send IPI.
-
-Arguments:
- ProcessorNumber - Processor number
- VectorNumber - Vector number
- DeliveryMode - Delivery mode
- IRFlag - Interrupt Redirection flag
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpCurrentProcessor (
- IN BOOLEAN IndexByEnabledCpu
- )
-/*++
-
-Routine Description:
- Get current processor index.
-
-Arguments:
- IndexByEnabledCpu - Whether indexed by enabled CPU
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibGetNumProcessors (
- VOID
- )
-/*++
-
-Routine Description:
- Get number of processors.
-
-Arguments:
- None
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpSaveMinStatePointer (
- IN UINT64 CpuGlobalId,
- IN EFI_PHYSICAL_ADDRESS MinStatePointer
- )
-/*++
-
-Routine Description:
- Register pointer to save min state.
-
-Arguments:
- CpuGlobalId - CPU global ID
- MinStatePointer - Pointer to save min state
-
-Returns:
- Output regs
-
---*/
-;
-
-SAL_RETURN_REGS
-LibMpRestoreMinStatePointer (
- IN UINT64 CpuGlobalId
- )
-/*++
-
-Routine Description:
- Restore pointer to save min state.
-
-Arguments:
- CpuGlobalId - CPU global ID
-
-Returns:
- Output regs
-
---*/
-;
-
-//
-// MCA Class Functions
-//
-EFI_STATUS
-LibMcaGetStateInfo (
- IN UINT64 CpuId,
- OUT EFI_PHYSICAL_ADDRESS *StateBufferPointer,
- OUT UINT64 *RequiredStateBufferSize
- )
-/*++
-
-Routine Description:
- MCA get state info.
-
-Arguments:
- CpuId - CPU ID
- StateBufferPointer - Pointer of state buffer
- RequiredStateBufferSize - Size of required state buffer
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibMcaRegisterCpu (
- IN UINT64 CpuId,
- IN EFI_PHYSICAL_ADDRESS StateBufferAddress
- )
-/*++
-
-Routine Description:
- MCA register CPU state info.
-
-Arguments:
- CpuId - CPU ID
- StateBufferAddress - Pointer of state buffer
-
-Returns:
- Status code
-
---*/
-;
-
-//
-// SAL ELOG Functions
-//
-EFI_STATUS
-LibSalGetStateInfo (
- IN UINT64 McaType,
- IN UINT8 *McaBuffer,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Get state info.
-
-Arguments:
- McaType - MCA type
- McaBuffer - Info buffer provided by caller
- Size - Size of info
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibSalGetStateInfoSize (
- IN UINT64 McaType,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Get state info size.
-
-Arguments:
- McaType - MCA type
- Size - Size required
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibSalClearStateInfo (
- IN UINT64 McaType
- )
-/*++
-
-Routine Description:
- Clear state info.
-
-Arguments:
- McaType - MCA type
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibEsalGetStateBuffer (
- IN UINT64 McaType,
- OUT UINT8 **McaBuffer,
- OUT UINTN *Index
- )
-/*++
-
-Routine Description:
- Get state buffer.
-
-Arguments:
- McaType - MCA type
- McaBuffer - MCA buffer
- Index - CPU index
-
-Returns:
- Status code
-
---*/
-;
-
-EFI_STATUS
-LibEsalSaveStateBuffer (
- IN UINT64 McaType
- )
-/*++
-
-Routine Description:
- Save state buffer.
-
-Arguments:
- McaType - MCA type
-
-Returns:
- Status code
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/LinkedList.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/LinkedList.h
deleted file mode 100644
index debaf30e79..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/LinkedList.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LinkedList.h
-
-Abstract:
-
- This implementation of a linked list provides data structures for the
- list itself and for list nodes. It provides operations for initializing
- the list, modifying the list, and walking the list.
-
---*/
-
-//
-// Prevent multiple includes in the same source file
-//
-#ifndef _LINKED_LIST_H_
-#define _LINKED_LIST_H_
-
-#ifndef _SHELL_LINKED_LIST_H_
-
-typedef struct _EFI_LIST_ENTRY {
- struct _EFI_LIST_ENTRY *ForwardLink;
- struct _EFI_LIST_ENTRY *BackLink;
-} EFI_LIST_ENTRY;
-
-typedef EFI_LIST_ENTRY EFI_LIST;
-typedef EFI_LIST_ENTRY EFI_LIST_NODE;
-
-#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&ListHead, &ListHead}
-
-//
-// EFI_FIELD_OFFSET - returns the byte offset to a field within a structure
-//
-
-#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
-
-//
-// A lock structure
-//
-
-typedef struct {
- EFI_TPL Tpl;
- EFI_TPL OwnerTpl;
- UINTN Lock;
-} FLOCK;
-
-VOID
-InitializeListHead (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Initialize the head of the List. The caller must allocate the memory
- for the EFI_LIST. This function must be called before the other linked
- list macros can be used.
-
-Arguments:
-
- List - Pointer to list head to initialize
-
-Returns:
-
- None.
-
---*/
-;
-
-BOOLEAN
-IsListEmpty (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Return TRUE is the list contains zero nodes. Otherzise return FALSE.
- The list must have been initialized with InitializeListHead () before using
- this function.
-
-Arguments:
-
- List - Pointer to list head to test
-
-
-Returns:
-
- Return TRUE is the list contains zero nodes. Otherzise return FALSE.
-
---*/
-;
-
-VOID
-RemoveEntryList (
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Remove Node from the doubly linked list. It is the caller's responsibility
- to free any memory used by the entry if needed. The list must have been
- initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- Entry - Element to remove from the list.
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-InsertTailList (
- EFI_LIST_ENTRY *ListHead,
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Insert a Node into the end of a doubly linked list. The list must have
- been initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- ListHead - Head of doubly linked list
-
- Entry - Element to insert at the end of the list.
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-InsertHeadList (
- EFI_LIST_ENTRY *ListHead,
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Insert a Node into the start of a doubly linked list. The list must have
- been initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- ListHead - Head of doubly linked list
-
- Entry - Element to insert to beginning of list
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-SwapListEntries (
- EFI_LIST_ENTRY *Entry1,
- EFI_LIST_ENTRY *Entry2
- )
-/*++
-
-Routine Description:
-
- Swap the location of the two elements of a doubly linked list. Node2
- is placed in front of Node1. The list must have been initialized with
- InitializeListHead () before using this function.
-
-Arguments:
-
- Entry1 - Element in the doubly linked list in front of Node2.
-
- Entry2 - Element in the doubly linked list behind Node1.
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_LIST_ENTRY *
-GetFirstNode (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Return the first node pointed to by the list head. The list must
- have been initialized with InitializeListHead () before using this
- function and must contain data.
-
-Arguments:
-
- List - The head of the doubly linked list.
-
-Returns:
-
- Pointer to the first node, if the list contains nodes. The list will
- return a null value--that is, the value of List--when the list is empty.
- See the description of IsNull for more information.
-
-
---*/
-;
-
-EFI_LIST_ENTRY *
-GetNextNode (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Returns the node following Node in the list. The list must
- have been initialized with InitializeListHead () before using this
- function and must contain data.
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node in the list. This value MUST NOT be the literal value NULL.
- See the description of IsNull for more information.
-
-Returns:
-
- Pointer to the next node, if one exists. Otherwise, returns a null value,
- which is actually a pointer to List.
- See the description of IsNull for more information.
-
---*/
-;
-
-BOOLEAN
-IsNull (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Determines whether the given node is null. Note that Node is null
- when its value is equal to the value of List. It is an error for
- Node to be the literal value NULL [(VOID*)0x0].
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node to test. MUST NOT be the literal value NULL. See
- the description above.
-
-Returns:
-
- Returns true if the node is null.
-
---*/
-;
-
-BOOLEAN
-IsNodeAtEnd (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Determines whether the given node is at the end of the list. Used
- to walk the list. The list must have been initialized with
- InitializeListHead () before using this function and must contain
- data.
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node to test. MUST NOT be the literal value NULL.
- See the description of IsNull for more information.
-
-Returns:
-
- Returns true if the list is the tail.
-
---*/
-;
-
-#endif
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/RtDevicePath.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/RtDevicePath.h
deleted file mode 100644
index 4706dcac08..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/RtDevicePath.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- RtDevicePath.h
-
-Abstract:
-
- Device Path services. The thing to remember is device paths are built out of
- nodes. The device path is terminated by an end node that is length
- sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
- all over this file.
-
- The only place where multi-instance device paths are supported is in
- environment varibles. Multi-instance device paths should never be placed
- on a Handle.
-
---*/
-#ifndef _RT_DEVICE_PATH_H_
-#define _RT_DEVICE_PATH_H_
-
-BOOLEAN
-RtEfiIsDevicePathMultiInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Return TRUE is this is a multi instance device path.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
-
-Returns:
- TRUE - If DevicePath is multi instance.
- FALSE - If DevicePath is not multi instance.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Function retrieves the next device path instance from a device path data structure.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
- Size - A pointer to the size of a device path instance in bytes.
-
-Returns:
-
- This function returns a pointer to the current device path instance.
- In addition, it returns the size in bytes of the current device path instance in Size,
- and a pointer to the next device path instance in DevicePath.
- If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
-
---*/
-;
-
-UINTN
-RtEfiDevicePathSize (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- )
-/*++
-
-Routine Description:
-
- Calculate the size of a whole device path.
-
-Arguments:
-
- DevPath - The pointer to the device path data.
-
-Returns:
-
- Size of device path data structure..
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a Src1 and Src2 together.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
-
- A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDevicePathFromHandle (
- IN EFI_HANDLE Handle
- )
-/*++
-
-Routine Description:
-
- Locate device path protocol interface on a device handle.
-
-Arguments:
-
- Handle - The device handle
-
-Returns:
-
- Device path protocol interface located.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDuplicateDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- )
-/*++
-
-Routine Description:
- Duplicate a new device path data structure from the old one.
-
-Arguments:
- DevPath - A pointer to a device path data structure.
-
-Returns:
- A pointer to the new allocated device path data.
- Caller must free the memory used by DevicePath if it is no longer needed.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePathNode (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a device path node to the end of another device path.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
- This function returns a pointer to the new device path.
- If there is not enough temporary pool memory available to complete this function,
- then NULL is returned.
-
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiFileDevicePath (
- IN EFI_HANDLE Device OPTIONAL,
- IN CHAR16 *FileName
- )
-/*++
-
-Routine Description:
- Create a device path that appends a MEDIA_DEVICE_PATH with
- FileNameGuid to the device path of DeviceHandle.
-
-Arguments:
- Device - Optional Device Handle to use as Root of the Device Path
-
- FileName - FileName
-
-Returns:
- EFI_DEVICE_PATH_PROTOCOL that was allocated from dynamic memory
- or NULL pointer.
-
---*/
-;
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePathInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *Src,
- IN EFI_DEVICE_PATH_PROTOCOL *Instance
- )
-/*++
-
-Routine Description:
-
- Append a device path instance to another.
-
-Arguments:
-
- Src - The device path instance to be appended with.
- Instance - The device path instance appending the other.
-
-Returns:
-
- The contaction of these two.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/SmmRuntimeLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/SmmRuntimeLib.h
deleted file mode 100644
index 538cc0c7ac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/SmmRuntimeLib.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- SmmRuntimeLib.h
-
-Abstract:
-
- SMM Related prototypes that can be referenced for Preboot Configuration only.
-
---*/
-
-#ifndef _SMM_RUNTIME_LIB_H_
-#define _SMM_RUNTIME_LIB_H_
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-
-BOOLEAN
-EfiInSmm (
- VOID
- )
-/*++
-
-Routine Description:
-
- Test whether in Smm mode currently.
-
-Arguments:
-
- None
-
-Returns:
-
- TRUE - In Smm mode
- FALSE - Not in Smm mode
-
---*/
-;
-
-EFI_STATUS
-RegisterSmmRuntimeDriver (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- OUT EFI_HANDLE *SmmImageHandle
- )
-/*++
-
-Routine Description:
-
- Registers a Driver with the SMM.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
- SystemTable - A pointer to the EFI System Table.
- SmmImageHandle - Image handle returned by the SMM driver.
-
-Returns:
-
- Status code
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/CpuFuncs.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/CpuFuncs.h
deleted file mode 100644
index 99d8a62f73..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/CpuFuncs.h
+++ /dev/null
@@ -1,262 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-Module Name:
-
- CpuFuncs.h
-
-Abstract:
-
---*/
-
-#ifndef _CPU_FUNCS_H_
-#define _CPU_FUNCS_H_
-
-#define EFI_CPUID_SIGNATURE 0x0
-#define EFI_CPUID_VERSION_INFO 0x1
-#define EFI_CPUID_CACHE_INFO 0x2
-#define EFI_CPUID_SERIAL_NUMBER 0x3
-#define EFI_CPUID_EXTENDED_FUNCTION 0x80000000
-#define EFI_CPUID_EXTENDED_CPU_SIG 0x80000001
-#define EFI_CPUID_BRAND_STRING1 0x80000002
-#define EFI_CPUID_BRAND_STRING2 0x80000003
-#define EFI_CPUID_BRAND_STRING3 0x80000004
-
-//
-// CPUID version information masks
-// Note: leaving masks here is for the compatibility
-// use EfiCpuVersion (...) instead
-//
-
-#define EFI_CPUID_FAMILY 0x0F00
-#define EFI_CPUID_MODEL 0x00F0
-#define EFI_CPUID_STEPPING 0x000F
-
-#define EFI_CPUID_PENTIUM_M 0x0600
-#define EFI_CPUID_BANIAS 0x0090
-#define EFI_CPUID_DOTHAN 0x00D0
-#define EFI_CPUID_NETBURST 0x0F00
-
-#define EFI_MSR_IA32_PLATFORM_ID 0x17
-#define EFI_MSR_IA32_APIC_BASE 0x1B
-#define EFI_MSR_EBC_HARD_POWERON 0x2A
-#define EFI_MSR_EBC_SOFT_POWERON 0x2B
-#define BINIT_DRIVER_DISABLE 0x40
-#define INTERNAL_MCERR_DISABLE 0x20
-#define INITIATOR_MCERR_DISABLE 0x10
-#define EFI_MSR_EBC_FREQUENCY_ID 0x2C
-#define EFI_MSR_IA32_BIOS_UPDT_TRIG 0x79
-#define EFI_MSR_IA32_BIOS_SIGN_ID 0x8B
-#define EFI_MSR_PSB_CLOCK_STATUS 0xCD
-#define EFI_APIC_GLOBAL_ENABLE 0x800
-#define EFI_MSR_IA32_MISC_ENABLE 0x1A0
-#define LIMIT_CPUID_MAXVAL_ENABLE_BIT 0x00400000
-#define AUTOMATIC_THERMAL_CONTROL_ENABLE_BIT 0x00000008
-#define COMPATIBLE_FPU_OPCODE_ENABLE_BIT 0x00000004
-#define LOGICAL_PROCESSOR_PRIORITY_ENABLE_BIT 0x00000002
-#define FAST_STRING_ENABLE_BIT 0x00000001
-
-#define EFI_CACHE_VARIABLE_MTRR_BASE 0x200
-#define EFI_CACHE_VARIABLE_MTRR_END 0x20F
-#define EFI_CACHE_IA32_MTRR_DEF_TYPE 0x2FF
-#define EFI_CACHE_VALID_ADDRESS 0xFFFFFF000
-#define EFI_CACHE_MTRR_VALID 0x800
-#define EFI_CACHE_FIXED_MTRR_VALID 0x400
-#define EFI_MSR_VALID_MASK 0xFFFFFFFFF
-
-#define EFI_IA32_MTRR_FIX64K_00000 0x250
-#define EFI_IA32_MTRR_FIX16K_80000 0x258
-#define EFI_IA32_MTRR_FIX16K_A0000 0x259
-#define EFI_IA32_MTRR_FIX4K_C0000 0x268
-#define EFI_IA32_MTRR_FIX4K_C8000 0x269
-#define EFI_IA32_MTRR_FIX4K_D0000 0x26A
-#define EFI_IA32_MTRR_FIX4K_D8000 0x26B
-#define EFI_IA32_MTRR_FIX4K_E0000 0x26C
-#define EFI_IA32_MTRR_FIX4K_E8000 0x26D
-#define EFI_IA32_MTRR_FIX4K_F0000 0x26E
-#define EFI_IA32_MTRR_FIX4K_F8000 0x26F
-
-#define EFI_IA32_MCG_CAP 0x179
-#define EFI_IA32_MCG_CTL 0x17B
-#define EFI_IA32_MC0_CTL 0x400
-#define EFI_IA32_MC0_STATUS 0x401
-
-#define EFI_CACHE_UNCACHEABLE 0
-#define EFI_CACHE_WRITECOMBINING 1
-#define EFI_CACHE_WRITETHROUGH 4
-#define EFI_CACHE_WRITEPROTECTED 5
-#define EFI_CACHE_WRITEBACK 6
-
-//
-// Combine f(FamilyId), m(Model), s(SteppingId) to a single 32 bit number
-//
-#define EfiMakeCpuVersion(f, m, s) \
- (((UINT32) (f) << 16) | ((UINT32) (m) << 8) | ((UINT32) (s)))
-
-
-typedef struct {
- UINT32 HeaderVersion;
- UINT32 UpdateRevision;
- UINT32 Date;
- UINT32 ProcessorId;
- UINT32 Checksum;
- UINT32 LoaderRevision;
- UINT32 ProcessorFlags;
- UINT32 DataSize;
- UINT32 TotalSize;
- UINT8 Reserved[12];
-} EFI_CPU_MICROCODE_HEADER;
-
-typedef struct {
- UINT32 ExtSigCount;
- UINT32 ExtChecksum;
- UINT8 Reserved[12];
- UINT32 ProcessorId;
- UINT32 ProcessorFlags;
- UINT32 Checksum;
-} EFI_CPU_MICROCODE_EXT_HEADER;
-
-typedef struct {
- UINT32 RegEax;
- UINT32 RegEbx;
- UINT32 RegEcx;
- UINT32 RegEdx;
-} EFI_CPUID_REGISTER;
-
-VOID
-EfiWriteMsr (
- IN UINT32 Input,
- IN UINT64 Value
- )
-/*++
-
-Routine Description:
-
- Write Cpu MSR
-
-Arguments:
-
- Input -The index value to select the register
- Value -The value to write to the selected register
-
-Returns:
-
- None
-
---*/
-;
-
-UINT64
-EfiReadMsr (
- IN UINT32 Input
- )
-/*++
-
-Routine Description:
-
- Read Cpu MSR.
-
-Arguments:
-
- Input: -The index value to select the register
-
-Returns:
-
- Return the read data
-
---*/
-;
-
-VOID
-EfiCpuid (
- IN UINT32 RegEax,
- OUT EFI_CPUID_REGISTER *Reg
- )
-/*++
-
-Routine Description:
-
- Get the Cpu info by excute the CPUID instruction.
-
-Arguments:
-
- RegEax -The input value to put into register EAX
- Reg -The Output value
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-EfiCpuVersion (
- IN UINT16 *FamilyId, OPTIONAL
- IN UINT8 *Model, OPTIONAL
- IN UINT8 *SteppingId, OPTIONAL
- IN UINT8 *Processor OPTIONAL
- )
-/*++
-
-Routine Description:
- Extract CPU detail version infomation
-
-Arguments:
- FamilyId - FamilyId, including ExtendedFamilyId
- Model - Model, including ExtendedModel
- SteppingId - SteppingId
- Processor - Processor
-
---*/
-;
-
-UINT64
-EfiReadTsc (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read Time stamp.
-
-Arguments:
-
- None
-
-Returns:
-
- Return the read data
-
---*/
-;
-VOID
-EfiCpuidExt (
- IN UINT32 RegisterInEax,
- IN UINT32 CacheLevel,
- OUT EFI_CPUID_REGISTER *Regs
- )
-/*++
-Routine Description:
- When RegisterInEax != 4, the functionality is the same as EfiCpuid.
- When RegisterInEax == 4, the function return the deterministic cache
- parameters by excuting the CPUID instruction
-Arguments:
- RegisterInEax: - The input value to put into register EAX
- CacheLevel: - The deterministic cache level
- Regs: - The Output value
-Returns:
- None
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/ProcDep.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/ProcDep.h
deleted file mode 100644
index 3a19e52071..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/X64/ProcDep.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-
-Module Name:
-
- ProcDep.h
-
-Abstract:
-
- x64 specific Runtime Lib code. At this time there is non.
- IPF has different code due to extra API requirements.
-
---*/
-
-#ifndef _PROC_DEP_H_
-#define _PROC_DEP_H_
-
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/PrintWidth.h
deleted file mode 100644
index 91848e9157..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/PrintWidth.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Ascii
- STRING_W is ""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR8 CHAR_W;
-#define STRING_W(_s) _s
-
-#define ASPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define AvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-UINTN
-UvSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN StrLen,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- StartOfBuffer - Wide char buffer to print the results of the parsing of Format into.
- StrLen - Maximum number of characters to put into buffer.
- Format - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/SPrint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/SPrint.c
deleted file mode 100644
index d599f0f133..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Ascii/SPrint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-UvSPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR8 AsciiFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR8 AsciiResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- AsciiFormat[Index] = (CHAR8) FormatString[Index];
- }
-
- AsciiFormat[Index] = '\0';
-
- Index = VSPrint (AsciiResult, EFI_DRIVER_LIB_MAX_PRINT_BUFFER, AsciiFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && AsciiResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR16) AsciiResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/BoxDraw.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/BoxDraw.c
deleted file mode 100644
index 7a9cfa3a2c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/BoxDraw.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- BoxDraw.c
-
-Abstract:
- Lib functions to support Box Draw Unicode code pages.
-
-
-
-Revision History
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-
-
-typedef struct {
- CHAR16 Unicode;
- CHAR8 PcAnsi;
- CHAR8 Ascii;
-} UNICODE_TO_CHAR;
-
-
-//
-// This list is used to define the valid extend chars.
-// It also provides a mapping from Unicode to PCANSI or
-// ASCII. The ASCII mapping we just made up.
-//
-//
-
-static UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
- {BOXDRAW_HORIZONTAL, 0xc4, L'-'},
- {BOXDRAW_VERTICAL, 0xb3, L'|'},
- {BOXDRAW_DOWN_RIGHT, 0xda, L'/'},
- {BOXDRAW_DOWN_LEFT, 0xbf, L'\\'},
- {BOXDRAW_UP_RIGHT, 0xc0, L'\\'},
- {BOXDRAW_UP_LEFT, 0xd9, L'/'},
- {BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|'},
- {BOXDRAW_VERTICAL_LEFT, 0xb4, L'|'},
- {BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+'},
- {BOXDRAW_UP_HORIZONTAL, 0xc1, L'+'},
- {BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+'},
- {BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-'},
- {BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|'},
- {BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/'},
- {BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/'},
- {BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/'},
- {BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\'},
- {BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\'},
- {BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\'},
- {BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\'},
- {BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\'},
- {BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\'},
- {BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/'},
- {BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/'},
- {BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/'},
- {BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|'},
- {BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|'},
- {BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|'},
- {BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|'},
- {BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|'},
- {BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|'},
- {BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+'},
- {BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+'},
- {BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+'},
- {BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+'},
- {BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+'},
- {BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+'},
- {BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+'},
- {BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+'},
- {BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+'},
-
- {BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*'},
- {BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+'},
-
- {GEOMETRICSHAPE_UP_TRIANGLE, 0x1e, L'^'},
- {GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x10, L'>'},
- {GEOMETRICSHAPE_DOWN_TRIANGLE, 0x1f, L'v'},
- {GEOMETRICSHAPE_LEFT_TRIANGLE, 0x11, L'<'},
-
- {ARROW_LEFT, 0x3c, L'<'},
-
- {ARROW_UP, 0x18, L'^'},
-
- {ARROW_RIGHT, 0x3e, L'>'},
-
- {ARROW_DOWN, 0x19, L'v'},
-
- {0x0000, 0x00, L'\0'},
-};
-
-
-BOOLEAN
-LibIsValidTextGraphics (
- IN CHAR16 Graphic,
- OUT CHAR8 *PcAnsi, OPTIONAL
- OUT CHAR8 *Ascii OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Detects if a Unicode char is for Box Drawing text graphics.
-
-Arguments:
-
- Grphic - Unicode char to test.
-
- PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
-
- Asci - Optional pointer to return Ascii equivalent of Graphic.
-
-Returns:
-
- TRUE if Gpaphic is a supported Unicode Box Drawing character.
-
---*/
-{
- UNICODE_TO_CHAR *Table;
-
- if ((((Graphic & 0xff00) != 0x2500) && ((Graphic & 0xff00) != 0x2100))) {
-
- //
- // Unicode drawing code charts are all in the 0x25xx range,
- // arrows are 0x21xx
- //
- return FALSE;
- }
-
- for (Table = UnicodeToPcAnsiOrAscii; Table->Unicode != 0x0000; Table++) {
- if (Graphic == Table->Unicode) {
- if (PcAnsi != NULL) {
- *PcAnsi = Table->PcAnsi;
- }
- if (Ascii != NULL) {
- *Ascii = Table->Ascii;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-BOOLEAN
-IsValidAscii (
- IN CHAR16 Ascii
- )
-/*++
-
-Routine Description:
-
- Is it valid ascii char?
-
-Arguments:
-
- Ascii - The char to check
-
-Returns:
-
- TRUE - Is a ascii char
- FALSE - Not a ascii char
-
---*/
-{
- if ((Ascii >= 0x20) && (Ascii <= 0x7f)) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-BOOLEAN
-IsValidEfiCntlChar (
- IN CHAR16 CharC
- )
-/*++
-
-Routine Description:
-
- Is it valid EFI control char?
-
-Arguments:
-
- Ascii - The char to check
-
-Returns:
-
- TRUE - Is a valid EFI control char
- FALSE - Not a valid EFI control char
-
---*/
-{
- if (CharC == CHAR_NULL || CharC == CHAR_BACKSPACE || CharC == CHAR_LINEFEED || CharC == CHAR_CARRIAGE_RETURN) {
- return TRUE;
- }
- return FALSE;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.c
deleted file mode 100644
index 6585726d27..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.c
+++ /dev/null
@@ -1,559 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Print.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'p' - arugment is VOID *; printed as hex number
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- IN OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- );
-
-UINTN
-SPrint (
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- SPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-EFIAPI
-VSPrint (
- OUT CHAR_W *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Unicode format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR_W *Buffer;
- CHAR8 *AsciiStr;
- CHAR16 *UnicodeStr;
- CHAR_W *Format;
- UINTN Index;
- UINTN Flags;
- UINTN Width;
- UINTN Count;
- UINTN NumberOfCharacters;
- UINTN BufferLeft;
- UINT64 Value;
- EFI_GUID *TmpGUID;
- BOOLEAN Done;
-
- //
- // Process the format string. Stop if Buffer is over run.
- //
-
- Buffer = StartOfBuffer;
- Format = (CHAR_W *)FormatString;
- NumberOfCharacters = BufferSize/sizeof(CHAR_W);
- BufferLeft = BufferSize;
- for (Index = 0; (*Format != '\0') && (Index < NumberOfCharacters - 1); Format++) {
- if (*Format != '%') {
- if ((*Format == '\n') && (Index < NumberOfCharacters - 2)) {
- //
- // If carage return add line feed
- //
- Buffer[Index++] = '\r';
- BufferLeft -= sizeof(CHAR_W);
- }
- Buffer[Index++] = *Format;
- BufferLeft -= sizeof(CHAR_W);
- } else {
-
- //
- // Now it's time to parse what follows after %
- //
- Flags = 0;
- Width = 0;
- for (Done = FALSE; !Done; ) {
- Format++;
-
- switch (*Format) {
-
- case '-': Flags |= LEFT_JUSTIFY; break;
- case '+': Flags |= PREFIX_SIGN; break;
- case ' ': Flags |= PREFIX_BLANK; break;
- case ',': Flags |= COMMA_TYPE; break;
- case 'L':
- case 'l': Flags |= LONG_TYPE; break;
-
- case '*':
- Width = VA_ARG (Marker, UINTN);
- break;
-
- case '0':
- Flags |= PREFIX_ZERO;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- Count = 0;
- do {
- Count = (Count * 10) + *Format - '0';
- Format++;
- } while ((*Format >= '0') && (*Format <= '9'));
- Format--;
- Width = Count;
- break;
-
- default:
- Done = TRUE;
- }
- }
-
- switch (*Format) {
- case 'p':
- //
- // Flag space, +, 0, L & l are invalid for type p.
- //
- Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);
- if (sizeof (VOID *) > 4) {
- Flags |= LONG_TYPE;
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
- Flags |= PREFIX_ZERO;
-
- EfiValueToHexStr (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 'X':
- Flags |= PREFIX_ZERO;
- Width = sizeof (UINT64) * 2;
- //
- // break skiped on purpose
- //
- case 'x':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
-
- EfiValueToHexStr (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 'd':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = (UINTN)VA_ARG (Marker, UINTN);
- }
-
- EfiValueToString (TempBuffer, Value, Flags, Width);
- UnicodeStr = TempBuffer;
-
- for ( ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++) {
- Buffer[Index++] = *UnicodeStr;
- }
- break;
-
- case 's':
- case 'S':
- UnicodeStr = (CHAR16 *)VA_ARG (Marker, CHAR_W *);
- if (UnicodeStr == NULL) {
- UnicodeStr = L"<null string>";
- }
- for (Count = 0 ;(*UnicodeStr != '\0') && (Index < NumberOfCharacters - 1); UnicodeStr++, Count++) {
- Buffer[Index++] = *UnicodeStr;
- }
- //
- // Add padding if needed
- //
- for (; (Count < Width) && (Index < NumberOfCharacters - 1); Count++) {
- Buffer[Index++] = ' ';
- }
-
- break;
-
- case 'a':
- AsciiStr = (CHAR8 *)VA_ARG (Marker, CHAR8 *);
- if (AsciiStr == NULL) {
- AsciiStr = (CHAR8 *) "<null string>";
- }
- for (Count = 0 ;(*AsciiStr != '\0') && (Index < NumberOfCharacters - 1); AsciiStr++, Count++) {
- Buffer[Index++] = (CHAR_W)*AsciiStr;
- }
- //
- // Add padding if needed
- //
- for (;(Count < Width) && (Index < NumberOfCharacters - 1); Count++) {
- Buffer[Index++] = ' ';
- }
- break;
-
- case 'c':
- Buffer[Index++] = (CHAR_W)VA_ARG (Marker, UINTN);
- break;
-
- case 'g':
- TmpGUID = VA_ARG (Marker, EFI_GUID *);
- if (TmpGUID != NULL) {
- Index += GuidToString (
- TmpGUID,
- &Buffer[Index],
- BufferLeft
- );
- }
- break;
-
- case 't':
- Index += TimeToString (
- VA_ARG (Marker, EFI_TIME *),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case 'r':
- Index += EfiStatusToString (
- VA_ARG (Marker, EFI_STATUS),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case '%':
- Buffer[Index++] = *Format;
- break;
-
- default:
- //
- // if the type is unknown print it to the screen
- //
- Buffer[Index++] = *Format;
- }
- BufferLeft = BufferSize - Index * sizeof(CHAR_W) ;
- }
- }
- Buffer[Index++] = '\0';
-
- return &Buffer[Index] - StartOfBuffer;
-}
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints an EFI_GUID.
-
-Arguments:
-
- Guid - Pointer to GUID to print.
-
- Buffer - Buffe to print Guid into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = SPrint (
- Buffer,
- BufferSize,
- STRING_W ("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x"),
- (UINTN)Guid->Data1,
- (UINTN)Guid->Data2,
- (UINTN)Guid->Data3,
- (UINTN)Guid->Data4[0],
- (UINTN)Guid->Data4[1],
- (UINTN)Guid->Data4[2],
- (UINTN)Guid->Data4[3],
- (UINTN)Guid->Data4[4],
- (UINTN)Guid->Data4[5],
- (UINTN)Guid->Data4[6],
- (UINTN)Guid->Data4[7]
- );
-
- //
- // SPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints EFI_TIME.
-
-Arguments:
-
- Time - Pointer to EFI_TIME sturcture to print.
-
- Buffer - Buffer to print Time into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = SPrint (
- Buffer,
- BufferSize,
- STRING_W ("%02d/%02d/%04d %02d:%02d"),
- (UINTN)Time->Month,
- (UINTN)Time->Day,
- (UINTN)Time->Year,
- (UINTN)Time->Hour,
- (UINTN)Time->Minute
- );
-
- //
- // SPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints EFI_STATUS as a string. If string is
- not known a hex value will be printed.
-
-Arguments:
-
- Status - EFI_STATUS sturcture to print.
-
- Buffer - Buffer to print EFI_STATUS message string into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
- CHAR8 *Desc;
-
- Desc = NULL;
-
- //
- // Can't use global Status String Array as UINTN is not constant for EBC
- //
- if (Status == EFI_SUCCESS) { Desc = (CHAR8 *) "Success"; } else
- if (Status == EFI_LOAD_ERROR) { Desc = (CHAR8 *) "Load Error"; } else
- if (Status == EFI_INVALID_PARAMETER) { Desc = (CHAR8 *) "Invalid Parameter"; } else
- if (Status == EFI_UNSUPPORTED) { Desc = (CHAR8 *) "Unsupported"; } else
- if (Status == EFI_BAD_BUFFER_SIZE) { Desc = (CHAR8 *) "Bad Buffer Size"; } else
- if (Status == EFI_BUFFER_TOO_SMALL) { Desc = (CHAR8 *) "Buffer Too Small"; } else
- if (Status == EFI_NOT_READY) { Desc = (CHAR8 *) "Not Ready"; } else
- if (Status == EFI_DEVICE_ERROR) { Desc = (CHAR8 *) "Device Error"; } else
- if (Status == EFI_WRITE_PROTECTED) { Desc = (CHAR8 *) "Write Protected"; } else
- if (Status == EFI_OUT_OF_RESOURCES) { Desc = (CHAR8 *) "Out of Resources"; } else
- if (Status == EFI_VOLUME_CORRUPTED) { Desc = (CHAR8 *) "Volume Corrupt"; } else
- if (Status == EFI_VOLUME_FULL) { Desc = (CHAR8 *) "Volume Full"; } else
- if (Status == EFI_NO_MEDIA) { Desc = (CHAR8 *) "No Media"; } else
- if (Status == EFI_MEDIA_CHANGED) { Desc = (CHAR8 *) "Media changed"; } else
- if (Status == EFI_NOT_FOUND) { Desc = (CHAR8 *) "Not Found"; } else
- if (Status == EFI_ACCESS_DENIED) { Desc = (CHAR8 *) "Access Denied"; } else
- if (Status == EFI_NO_RESPONSE) { Desc = (CHAR8 *) "No Response"; } else
- if (Status == EFI_NO_MAPPING) { Desc = (CHAR8 *) "No mapping"; } else
- if (Status == EFI_TIMEOUT) { Desc = (CHAR8 *) "Time out"; } else
- if (Status == EFI_NOT_STARTED) { Desc = (CHAR8 *) "Not started"; } else
- if (Status == EFI_ALREADY_STARTED) { Desc = (CHAR8 *) "Already started"; } else
- if (Status == EFI_ABORTED) { Desc = (CHAR8 *) "Aborted"; } else
- if (Status == EFI_ICMP_ERROR) { Desc = (CHAR8 *) "ICMP Error"; } else
- if (Status == EFI_TFTP_ERROR) { Desc = (CHAR8 *) "TFTP Error"; } else
- if (Status == EFI_PROTOCOL_ERROR) { Desc = (CHAR8 *) "Protocol Error"; } else
- if (Status == EFI_WARN_UNKNOWN_GLYPH) { Desc = (CHAR8 *) "Warning Unknown Glyph"; } else
- if (Status == EFI_WARN_DELETE_FAILURE) { Desc = (CHAR8 *) "Warning Delete Failure"; } else
- if (Status == EFI_WARN_WRITE_FAILURE) { Desc = (CHAR8 *) "Warning Write Failure"; } else
- if (Status == EFI_WARN_BUFFER_TOO_SMALL) { Desc = (CHAR8 *) "Warning Buffer Too Small"; }
-
- //
- // If we found a match, copy the message to the user's buffer. Otherwise
- // sprint the hex status code to their buffer.
- //
- if (Desc != NULL) {
- Size = SPrint (Buffer, BufferSize, STRING_W ("%a"), Desc);
- } else {
- Size = SPrint (Buffer, BufferSize, STRING_W ("%X"), Status);
- }
- return Size - 1;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.h
deleted file mode 100644
index 52fbee566f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Print.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Print.h
-
-Abstract:
-
- Private data for Print.c
-
---*/
-
-#ifndef _PRINT_H_
-#define _PRINT_H_
-
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Largest number of characters that can be printed out.
-//
-#define EFI_DRIVER_LIB_MAX_PRINT_BUFFER (80 * 4)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/PrintLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/PrintLib.inf
deleted file mode 100644
index 5801602f65..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/PrintLib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# PrintLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = PrintLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- BoxDraw.c
- Print.c
- Print.h
- StdErr.c
- Unicode/PrintWidth.h
- Unicode/SPrint.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Print/Unicode
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/StdErr.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/StdErr.c
deleted file mode 100644
index e48cbe834d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/StdErr.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- StdErr.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "EfiCommonLib.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ErrorPrint (
- IN CONST CHAR16 *ErrorString,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- ErrorString - String of error infomation.
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- UINTN Index;
- UINTN MaxIndex;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- MaxIndex = EfiAsciiStrLen ((CHAR8 *) Format);
- if (MaxIndex >= EFI_DRIVER_LIB_MAX_PRINT_BUFFER) {
- //
- // Format string was too long for use to process.
- //
- return 0;
- }
-
- if (ErrorString != '\0') {
- if (gST->StdErr != NULL) {
- //
- // To be extra safe make sure StdErr has been initialized
- //
- gST->StdErr->SetAttribute (gST->StdErr, EFI_TEXT_ATTR (EFI_RED, EFI_BLACK));
- gST->StdErr->OutputString (gST->StdErr, (CHAR16 *) ErrorString);
- gST->StdErr->SetAttribute (gST->StdErr, EFI_TEXT_ATTR (EFI_WHITE, EFI_BLACK));
- }
- }
-
- for (Index = 0; Index < MaxIndex; Index++) {
- UnicodeFormat[Index] = (CHAR16) Format[Index];
- }
-
- UnicodeFormat[Index] = 0;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), UnicodeFormat, Marker);
- VA_END (Marker);
-
- //
- // Need to convert to Unicode to do an OutputString
- //
-
- if (gST->StdErr != NULL) {
- //
- // To be extra safe make sure StdErr has been initialized
- //
- gST->StdErr->OutputString (gST->StdErr, Buffer);
- }
-
- return Return;
-}
-
-
-UINTN
-Aprint (
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- UINTN Index;
- UINTN MaxIndex;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- MaxIndex = EfiAsciiStrLen ((CHAR8 *) Format);
- if (MaxIndex >= EFI_DRIVER_LIB_MAX_PRINT_BUFFER) {
- //
- // Format string was too long for use to process.
- //
- return 0;
- }
-
- for (Index = 0; Index <= MaxIndex; Index++) {
- UnicodeFormat[Index] = (CHAR16) Format[Index];
- }
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), UnicodeFormat, Marker);
- VA_END (Marker);
-
- //
- // Need to convert to Unicode to do an OutputString
- //
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
-
-
-UINTN
-Print (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), Format, Marker);
- VA_END (Marker);
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
-
-UINTN
-UPrint (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), Format, Marker);
- VA_END (Marker);
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/PrintWidth.h
deleted file mode 100644
index 7bc83283e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/PrintWidth.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Unicode
- STRING_W is L""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR16 CHAR_W;
-#define STRING_W(_s) L##_s
-
-#define USPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define UvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-#include "EfiCommonLib.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/SPrint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/SPrint.c
deleted file mode 100644
index de99ee07ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Print/Unicode/SPrint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = AvSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-AvSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of ASPrint.
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
- CHAR16 UnicodeResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- UnicodeFormat[Index] = (CHAR16) FormatString[Index];
- }
-
- UnicodeFormat[Index] = '\0';
-
- Index = VSPrint (UnicodeResult, sizeof (UnicodeResult), UnicodeFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && UnicodeResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR8) UnicodeResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/PrintWidth.h
deleted file mode 100644
index 91848e9157..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/PrintWidth.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Ascii
- STRING_W is ""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR8 CHAR_W;
-#define STRING_W(_s) _s
-
-#define ASPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define AvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-UINTN
-UvSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN StrLen,
- IN CONST CHAR16 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- StartOfBuffer - Wide char buffer to print the results of the parsing of Format into.
- StrLen - Maximum number of characters to put into buffer.
- Format - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/SPrint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/SPrint.c
deleted file mode 100644
index a8f69bf6e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Ascii/SPrint.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-UINTN
-USPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-UINTN
-UvSPrint (
- OUT CHAR16 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of USPrint.
- Process format and place the results in Buffer for wide chars.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR8 AsciiFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR8 AsciiResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- AsciiFormat[Index] = (CHAR8) FormatString[Index];
- }
-
- AsciiFormat[Index] = '\0';
-
- Index = VSPrint (AsciiResult, EFI_DRIVER_LIB_MAX_PRINT_BUFFER, AsciiFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && AsciiResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR16) AsciiResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/BoxDraw.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/BoxDraw.c
deleted file mode 100644
index 3d5390926b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/BoxDraw.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- BoxDraw.c
-
-Abstract:
- Lib functions to support Box Draw Unicode code pages.
-
-
-
-Revision History
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-
-
-typedef struct {
- CHAR16 Unicode;
- CHAR8 PcAnsi;
- CHAR8 Ascii;
-} UNICODE_TO_CHAR;
-
-
-//
-// This list is used to define the valid extend chars.
-// It also provides a mapping from Unicode to PCANSI or
-// ASCII. The ASCII mapping we just made up.
-//
-//
-
-static UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
- {BOXDRAW_HORIZONTAL, 0xc4, L'-'},
- {BOXDRAW_VERTICAL, 0xb3, L'|'},
- {BOXDRAW_DOWN_RIGHT, 0xda, L'/'},
- {BOXDRAW_DOWN_LEFT, 0xbf, L'\\'},
- {BOXDRAW_UP_RIGHT, 0xc0, L'\\'},
- {BOXDRAW_UP_LEFT, 0xd9, L'/'},
- {BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|'},
- {BOXDRAW_VERTICAL_LEFT, 0xb4, L'|'},
- {BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+'},
- {BOXDRAW_UP_HORIZONTAL, 0xc1, L'+'},
- {BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+'},
- {BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-'},
- {BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|'},
- {BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/'},
- {BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/'},
- {BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/'},
- {BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\'},
- {BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\'},
- {BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\'},
- {BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\'},
- {BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\'},
- {BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\'},
- {BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/'},
- {BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/'},
- {BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/'},
- {BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|'},
- {BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|'},
- {BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|'},
- {BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|'},
- {BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|'},
- {BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|'},
- {BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+'},
- {BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+'},
- {BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+'},
- {BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+'},
- {BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+'},
- {BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+'},
- {BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+'},
- {BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+'},
- {BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+'},
-
- {BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*'},
- {BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+'},
-
- {GEOMETRICSHAPE_UP_TRIANGLE, 0x1e, L'^'},
- {GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x10, L'>'},
- {GEOMETRICSHAPE_DOWN_TRIANGLE, 0x1f, L'v'},
- {GEOMETRICSHAPE_LEFT_TRIANGLE, 0x11, L'<'},
-
- {ARROW_LEFT, 0x3c, L'<'},
-
- {ARROW_UP, 0x18, L'^'},
-
- {ARROW_RIGHT, 0x3e, L'>'},
-
- {ARROW_DOWN, 0x19, L'v'},
-
- {0x0000, 0x00, L'\0'},
-};
-
-
-BOOLEAN
-LibIsValidTextGraphics (
- IN CHAR16 Graphic,
- OUT CHAR8 *PcAnsi, OPTIONAL
- OUT CHAR8 *Ascii OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Detects if a Unicode char is for Box Drawing text graphics.
-
-Arguments:
-
- Graphic - Unicode char to test.
-
- PcAnsi - Optional pointer to return PCANSI equivalent of Graphic.
-
- Asci - Optional pointer to return Ascii equivalent of Graphic.
-
-Returns:
-
- TRUE if Gpaphic is a supported Unicode Box Drawing character.
-
---*/
-{
- UNICODE_TO_CHAR *Table;
-
- if ((((Graphic & 0xff00) != 0x2500) && ((Graphic & 0xff00) != 0x2100))) {
-
- //
- // Unicode drawing code charts are all in the 0x25xx range,
- // arrows are 0x21xx
- //
- return FALSE;
- }
-
- for (Table = UnicodeToPcAnsiOrAscii; Table->Unicode != 0x0000; Table++) {
- if (Graphic == Table->Unicode) {
- if (PcAnsi != NULL) {
- *PcAnsi = Table->PcAnsi;
- }
- if (Ascii != NULL) {
- *Ascii = Table->Ascii;
- }
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-BOOLEAN
-IsValidAscii (
- IN CHAR16 Ascii
- )
-/*++
-
-Routine Description:
-
- Is it valid ascii char?
-
-Arguments:
-
- Ascii - The char to check
-
-Returns:
-
- TRUE - Is a ascii char
- FALSE - Not a ascii char
-
---*/
-{
- if ((Ascii >= 0x20) && (Ascii <= 0x7f)) {
- return TRUE;
- }
- return FALSE;
-}
-
-
-BOOLEAN
-IsValidEfiCntlChar (
- IN CHAR16 CharC
- )
-/*++
-
-Routine Description:
-
- Is it valid EFI control char?
-
-Arguments:
-
- CharC - The char to check
-
-Returns:
-
- TRUE - Is a valid EFI control char
- FALSE - Not a valid EFI control char
-
---*/
-{
- if (CharC == CHAR_NULL || CharC == CHAR_BACKSPACE || CharC == CHAR_LINEFEED || CharC == CHAR_CARRIAGE_RETURN) {
- return TRUE;
- }
- return FALSE;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.c
deleted file mode 100644
index a3afc4d05b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Print.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-UINTN
-SPrint (
- OUT CHAR_W *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- SPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Wide char buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-UINTN
-EFIAPI
-VSPrint (
- OUT CHAR_W *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR_W *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Unicode format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PRINT_PROTOCOL *PrintProtocol;
-
- Status = gBS->LocateProtocol (
- &gEfiPrintProtocolGuid,
- NULL,
- (VOID*)&PrintProtocol
- );
- if (EFI_ERROR (Status)) {
- return 0;
- } else {
- return PrintProtocol->VSPrint (
- StartOfBuffer,
- BufferSize,
- FormatString,
- Marker
- );
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.h
deleted file mode 100644
index 52fbee566f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Print.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Print.h
-
-Abstract:
-
- Private data for Print.c
-
---*/
-
-#ifndef _PRINT_H_
-#define _PRINT_H_
-
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Largest number of characters that can be printed out.
-//
-#define EFI_DRIVER_LIB_MAX_PRINT_BUFFER (80 * 4)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/PrintLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/PrintLib.inf
deleted file mode 100644
index bf5d747808..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/PrintLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# PrintLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = PrintLibLite
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- BoxDraw.c
- Print.c
- Print.h
- StdErr.c
- Unicode/PrintWidth.h
- Unicode/SPrint.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Print/Unicode
- $(EDK_SOURCE)/Foundation/Core/Dxe
-
-[libraries.common]
- EdkProtocolLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c
deleted file mode 100644
index e48cbe834d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/StdErr.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- StdErr.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "EfiCommonLib.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ErrorPrint (
- IN CONST CHAR16 *ErrorString,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- ErrorString - String of error infomation.
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- UINTN Index;
- UINTN MaxIndex;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- MaxIndex = EfiAsciiStrLen ((CHAR8 *) Format);
- if (MaxIndex >= EFI_DRIVER_LIB_MAX_PRINT_BUFFER) {
- //
- // Format string was too long for use to process.
- //
- return 0;
- }
-
- if (ErrorString != '\0') {
- if (gST->StdErr != NULL) {
- //
- // To be extra safe make sure StdErr has been initialized
- //
- gST->StdErr->SetAttribute (gST->StdErr, EFI_TEXT_ATTR (EFI_RED, EFI_BLACK));
- gST->StdErr->OutputString (gST->StdErr, (CHAR16 *) ErrorString);
- gST->StdErr->SetAttribute (gST->StdErr, EFI_TEXT_ATTR (EFI_WHITE, EFI_BLACK));
- }
- }
-
- for (Index = 0; Index < MaxIndex; Index++) {
- UnicodeFormat[Index] = (CHAR16) Format[Index];
- }
-
- UnicodeFormat[Index] = 0;
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), UnicodeFormat, Marker);
- VA_END (Marker);
-
- //
- // Need to convert to Unicode to do an OutputString
- //
-
- if (gST->StdErr != NULL) {
- //
- // To be extra safe make sure StdErr has been initialized
- //
- gST->StdErr->OutputString (gST->StdErr, Buffer);
- }
-
- return Return;
-}
-
-
-UINTN
-Aprint (
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- UINTN Index;
- UINTN MaxIndex;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- MaxIndex = EfiAsciiStrLen ((CHAR8 *) Format);
- if (MaxIndex >= EFI_DRIVER_LIB_MAX_PRINT_BUFFER) {
- //
- // Format string was too long for use to process.
- //
- return 0;
- }
-
- for (Index = 0; Index <= MaxIndex; Index++) {
- UnicodeFormat[Index] = (CHAR16) Format[Index];
- }
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), UnicodeFormat, Marker);
- VA_END (Marker);
-
- //
- // Need to convert to Unicode to do an OutputString
- //
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
-
-
-UINTN
-Print (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), Format, Marker);
- VA_END (Marker);
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
-
-UINTN
-UPrint (
- IN CONST CHAR16 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Print function for a maximum of EFI_DRIVER_LIB_MAX_PRINT_BUFFER ascii
- characters.
-
-Arguments:
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
- CHAR16 Buffer[EFI_DRIVER_LIB_MAX_PRINT_BUFFER];
-
- VA_START (Marker, Format);
- Return = VSPrint (Buffer, sizeof (Buffer), Format, Marker);
- VA_END (Marker);
-
- if (gST->ConOut != NULL) {
- //
- // To be extra safe make sure ConOut has been initialized
- //
- gST->ConOut->OutputString (gST->ConOut, Buffer);
- }
-
- return Return;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/PrintWidth.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/PrintWidth.h
deleted file mode 100644
index 7bc83283e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/PrintWidth.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PrintWidth.h
-
-Abstract:
-
- Unicde option for generic width.
- CHAR_W is Unicode
- STRING_W is L""
-
---*/
-
-#ifndef _PRINT_WIDTH_H_
-#define _PRINT_WIDTH_H_
-
-typedef CHAR16 CHAR_W;
-#define STRING_W(_s) L##_s
-
-#define USPrint(Buffer, BufferSize, Format) SPrint (Buffer, BufferSize, Format)
-#define UvSPrint(Buffer, BufferSize, Format, Marker) VSPrint (Buffer, BufferSize, Format, Marker)
-
-#include "EfiCommonLib.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/SPrint.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/SPrint.c
deleted file mode 100644
index de99ee07ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/PrintLite/Unicode/SPrint.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Sprint.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
- simple implemenation of SPrint() and Print() to support debug.
-
- You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- VSPrint, Print, SPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S','s' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "TianoCommon.h"
-#include "PrintWidth.h"
-#include "EfiPrintLib.h"
-#include "Print.h"
-
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- Format - Format string
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- Return = AvSPrint (Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-AvSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Internal implementation of ASPrint.
- Process format and place the results in Buffer for narrow chars.
-
-Arguments:
-
- Buffer - Narrow char buffer to print the results of the parsing of Format into.
- BufferSize - Maximum number of characters to put into buffer.
- FormatString - Format string
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Index;
- CHAR16 UnicodeFormat[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
- CHAR16 UnicodeResult[EFI_DRIVER_LIB_MAX_PRINT_BUFFER+1];
-
- for (Index = 0; Index < EFI_DRIVER_LIB_MAX_PRINT_BUFFER && FormatString[Index] != '\0'; Index++) {
- UnicodeFormat[Index] = (CHAR16) FormatString[Index];
- }
-
- UnicodeFormat[Index] = '\0';
-
- Index = VSPrint (UnicodeResult, sizeof (UnicodeResult), UnicodeFormat, Marker);
-
- for (Index = 0; (Index < (BufferSize - 1)) && UnicodeResult[Index] != '\0'; Index++) {
- Buffer[Index] = (CHAR8) UnicodeResult[Index];
- }
-
- Buffer[Index] = '\0';
-
- return Index++;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
deleted file mode 100644
index ae771b13a5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/*++
-#
-# Copyright (c) 2007 - 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.
-#
-# Module Name:
-#
-# UfiIfrSupportLib.inf
-#
-# Abstract:
-#
-# Component description file.
-#
-#--*/
-
-[defines]
-BASE_NAME = UefiEfiIfrSupportLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiIfrCommon.c
- UefiIfrForm.c
- UefiIfrString.c
- UefiIfrOpCodeCreation.c
- UefiIfrLibrary.h
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
- EfiGuidLib
- EdkFrameworkProtocolLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
deleted file mode 100644
index 3f5243387d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
+++ /dev/null
@@ -1,763 +0,0 @@
-/*++
-
-Copyright (c) 2007 - 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.
-
-Module Name:
-
- UefiIfrCommon.c
-
-Abstract:
-
- Common Library Routines to assist handle HII elements.
-
---*/
-
-#include "UefiIfrLibrary.h"
-
-//
-// Hii vendor device path template
-//
-HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = {
- {
- {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- {
- (UINT8) (sizeof (HII_VENDOR_DEVICE_PATH_NODE)),
- (UINT8) ((sizeof (HII_VENDOR_DEVICE_PATH_NODE)) >> 8)
- }
- },
- EFI_IFR_TIANO_GUID,
- },
- 0,
- 0
- },
- {
- END_DEVICE_PATH_TYPE,
- END_ENTIRE_DEVICE_PATH_SUBTYPE,
- {
- END_DEVICE_PATH_LENGTH
- }
- }
-};
-
-//
-// Hii relative protocols
-//
-BOOLEAN mHiiProtocolsInitialized = FALSE;
-
-EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
-EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
-
-VOID
-LocateHiiProtocols (
- VOID
- )
-/*++
-
-Routine Description:
- This function locate Hii relative protocols for later usage.
-
-Arguments:
- None.
-
-Returns:
- None.
-
---*/
-{
- EFI_STATUS Status;
-
- if (mHiiProtocolsInitialized) {
- return;
- }
-
- Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID **) &gIfrLibHiiDatabase);
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &gIfrLibHiiString);
- ASSERT_EFI_ERROR (Status);
-
- mHiiProtocolsInitialized = TRUE;
-}
-
-EFI_HII_PACKAGE_LIST_HEADER *
-PreparePackageList (
- IN UINTN NumberOfPackages,
- IN EFI_GUID *GuidId,
- ...
- )
-/*++
-
-Routine Description:
- Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
-
-Arguments:
- NumberOfPackages - Number of packages.
- GuidId - Package GUID.
-
-Returns:
- Pointer of EFI_HII_PACKAGE_LIST_HEADER.
-
---*/
-{
- VA_LIST Marker;
- EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader;
- UINT8 *PackageListData;
- UINT32 PackageListLength;
- UINT32 PackageLength;
- EFI_HII_PACKAGE_HEADER PackageHeader;
- UINT8 *PackageArray;
- UINTN Index;
-
- PackageListLength = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
-
- VA_START (Marker, GuidId);
- for (Index = 0; Index < NumberOfPackages; Index++) {
- EfiCopyMem (&PackageLength, VA_ARG (Marker, VOID *), sizeof (UINT32));
- PackageListLength += (PackageLength - sizeof (UINT32));
- }
- VA_END (Marker);
-
- //
- // Include the lenght of EFI_HII_PACKAGE_END
- //
- PackageListLength += sizeof (EFI_HII_PACKAGE_HEADER);
- PackageListHeader = EfiLibAllocateZeroPool (PackageListLength);
- ASSERT (PackageListHeader != NULL);
- EfiCopyMem (&PackageListHeader->PackageListGuid, GuidId, sizeof (EFI_GUID));
- PackageListHeader->PackageLength = PackageListLength;
-
- PackageListData = ((UINT8 *) PackageListHeader) + sizeof (EFI_HII_PACKAGE_LIST_HEADER);
-
- VA_START (Marker, GuidId);
- for (Index = 0; Index < NumberOfPackages; Index++) {
- PackageArray = (UINT8 *) VA_ARG (Marker, VOID *);
- EfiCopyMem (&PackageLength, PackageArray, sizeof (UINT32));
- PackageLength -= sizeof (UINT32);
- PackageArray += sizeof (UINT32);
- EfiCopyMem (PackageListData, PackageArray, PackageLength);
- PackageListData += PackageLength;
- }
- VA_END (Marker);
-
- //
- // Append EFI_HII_PACKAGE_END
- //
- PackageHeader.Type = EFI_HII_PACKAGE_END;
- PackageHeader.Length = sizeof (EFI_HII_PACKAGE_HEADER);
- EfiCopyMem (PackageListData, &PackageHeader, PackageHeader.Length);
-
- return PackageListHeader;
-}
-
-EFI_STATUS
-CreateHiiDriverHandle (
- OUT EFI_HANDLE *DriverHandle
- )
-/*++
-
-Routine Description:
- The HII driver handle passed in for HiiDatabase.NewPackageList() requires
- that there should be DevicePath Protocol installed on it.
- This routine create a virtual Driver Handle by installing a vendor device
- path on it, so as to use it to invoke HiiDatabase.NewPackageList().
-
-Arguments:
- DriverHandle - Handle to be returned
-
-Returns:
- EFI_SUCCESS - Handle destroy success.
- EFI_OUT_OF_RESOURCES - Not enough memory.
-
---*/
-{
- EFI_STATUS Status;
- HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath;
-
- VendorDevicePath = EfiLibAllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);
- if (VendorDevicePath == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Use memory address as unique ID to distinguish from different device paths
- //
- VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);
-
- *DriverHandle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
- DriverHandle,
- &gEfiDevicePathProtocolGuid,
- VendorDevicePath,
- NULL
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-DestroyHiiDriverHandle (
- IN EFI_HANDLE DriverHandle
- )
-/*++
-
-Routine Description:
- Destroy the Driver Handle created by CreateHiiDriverHandle().
-
-Arguments:
- DriverHandle - Handle returned by CreateHiiDriverHandle()
-
-Returns:
- EFI_SUCCESS - Handle destroy success.
- other - Handle destroy fail.
-
---*/
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- Status = gBS->HandleProtocol (
- DriverHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &DevicePath
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->UninstallProtocolInterface (
- DriverHandle,
- &gEfiDevicePathProtocolGuid,
- DevicePath
- );
- gBS->FreePool (DevicePath);
- return Status;
-}
-
-EFI_HII_HANDLE
-DevicePathToHiiHandle (
- IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Find HII Handle associated with given Device Path.
-
-Arguments:
- HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
- DevicePath - Device Path associated with the HII package list handle.
-
-Returns:
- Handle - HII package list Handle associated with the Device Path.
- NULL - Hii Package list handle is not found.
-
---*/
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *TmpDevicePath;
- UINTN BufferSize;
- UINTN HandleCount;
- UINTN Index;
- EFI_HANDLE *Handles;
- EFI_HANDLE Handle;
- UINTN Size;
- EFI_HANDLE DriverHandle;
- EFI_HII_HANDLE *HiiHandles;
- EFI_HII_HANDLE HiiHandle;
-
- //
- // Locate Device Path Protocol handle buffer
- //
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiDevicePathProtocolGuid,
- NULL,
- &HandleCount,
- &Handles
- );
- if (EFI_ERROR (Status)) {
- return NULL;
- }
-
- //
- // Search Driver Handle by Device Path
- //
- DriverHandle = NULL;
- BufferSize = EfiDevicePathSize (DevicePath);
- for(Index = 0; Index < HandleCount; Index++) {
- Handle = Handles[Index];
- gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **) &TmpDevicePath);
-
- //
- // Check whether DevicePath match
- //
- Size = EfiDevicePathSize (TmpDevicePath);
- if ((Size == BufferSize) && EfiCompareMem (DevicePath, TmpDevicePath, Size) == 0) {
- DriverHandle = Handle;
- break;
- }
- }
- gBS->FreePool (Handles);
-
- if (DriverHandle == NULL) {
- return NULL;
- }
-
- //
- // Retrieve all Hii Handles from HII database
- //
- BufferSize = 0x1000;
- HiiHandles = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiHandles != NULL);
- Status = HiiDatabase->ListPackageLists (
- HiiDatabase,
- EFI_HII_PACKAGE_TYPE_ALL,
- NULL,
- &BufferSize,
- HiiHandles
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- gBS->FreePool (HiiHandles);
- HiiHandles = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiHandles != NULL);
-
- Status = HiiDatabase->ListPackageLists (
- HiiDatabase,
- EFI_HII_PACKAGE_TYPE_ALL,
- NULL,
- &BufferSize,
- HiiHandles
- );
- }
-
- if (EFI_ERROR (Status)) {
- gBS->FreePool (HiiHandles);
- return NULL;
- }
-
- //
- // Search Hii Handle by Driver Handle
- //
- HiiHandle = NULL;
- HandleCount = BufferSize / sizeof (EFI_HII_HANDLE);
- for (Index = 0; Index < HandleCount; Index++) {
- Status = HiiDatabase->GetPackageListHandle (
- HiiDatabase,
- HiiHandles[Index],
- &Handle
- );
- if (!EFI_ERROR (Status) && (Handle == DriverHandle)) {
- HiiHandle = HiiHandles[Index];
- break;
- }
- }
-
- gBS->FreePool (HiiHandles);
- return HiiHandle;
-}
-
-EFI_STATUS
-GetHiiHandles (
- IN OUT UINTN *HandleBufferLength,
- OUT EFI_HII_HANDLE **HiiHandleBuffer
- )
-/*++
-
-Routine Description:
- Determines the handles that are currently active in the database.
- It's the caller's responsibility to free handle buffer.
-
-Arguments:
- HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
- HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
- the length of the handle buffer that is required for the handles found.
- HiiHandleBuffer - Pointer to an array of Hii Handles returned.
-
-Returns:
- EFI_SUCCESS - Get an array of Hii Handles successfully.
- EFI_INVALID_PARAMETER - Hii is NULL.
- EFI_NOT_FOUND - Database not found.
-
---*/
-{
- UINTN BufferLength;
- EFI_STATUS Status;
-
- BufferLength = 0;
-
- LocateHiiProtocols ();
-
- //
- // Try to find the actual buffer size for HiiHandle Buffer.
- //
- Status = gIfrLibHiiDatabase->ListPackageLists (
- gIfrLibHiiDatabase,
- EFI_HII_PACKAGE_TYPE_ALL,
- NULL,
- &BufferLength,
- *HiiHandleBuffer
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- *HiiHandleBuffer = EfiLibAllocateZeroPool (BufferLength);
- Status = gIfrLibHiiDatabase->ListPackageLists (
- gIfrLibHiiDatabase,
- EFI_HII_PACKAGE_TYPE_ALL,
- NULL,
- &BufferLength,
- *HiiHandleBuffer
- );
- //
- // we should not fail here.
- //
- ASSERT_EFI_ERROR (Status);
- }
-
- *HandleBufferLength = BufferLength;
-
- return Status;
-}
-
-EFI_STATUS
-ExtractGuidFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
- Extract Hii package list GUID for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- Guid - Package list GUID
-
-Returns:
- EFI_SUCCESS - Successfully extract GUID from Hii database.
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
-
- //
- // Locate HII Database protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Get HII PackageList
- //
- BufferSize = 0;
- HiiPackageList = NULL;
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HiiPackageList = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiPackageList != NULL);
-
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- }
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Extract GUID
- //
- EfiCopyMem (Guid, &HiiPackageList->PackageListGuid, sizeof (EFI_GUID));
-
- gBS->FreePool (HiiPackageList);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ExtractClassFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT UINT16 *Class,
- OUT EFI_STRING_ID *FormSetTitle,
- OUT EFI_STRING_ID *FormSetHelp
- )
-/*++
-
-Routine Description:
- Extract formset class for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- Class - Class of the formset
- FormSetTitle - Formset title string
- FormSetHelp - Formset help string
-
-Returns:
- EFI_SUCCESS - Successfully extract Class for specified Hii handle.
- EFI_NOT_FOUND - Class not found.
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
- UINT8 *Package;
- UINT8 *FormSet;
- UINT8 *OpCodeData;
- UINT32 Offset;
- UINT32 Offset2;
- UINT32 PackageListLength;
- EFI_HII_PACKAGE_HEADER PackageHeader;
- BOOLEAN ClassFound;
-
- *Class = EFI_NON_DEVICE_CLASS;
- *FormSetTitle = 0;
- *FormSetHelp = 0;
- ClassFound = FALSE;
-
- //
- // Locate HII Database protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Get HII PackageList
- //
- BufferSize = 0;
- HiiPackageList = NULL;
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HiiPackageList = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiPackageList != NULL);
-
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- }
- if (HiiPackageList == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- if (EFI_ERROR (Status)) {
- gBS->FreePool (HiiPackageList);
- return Status;
- }
-
- //
- // Get Form package from this HII package List
- //
- Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
- Offset2 = 0;
- FormSet = NULL;
- EfiCopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
-
- while (Offset < PackageListLength) {
- Package = ((UINT8 *) HiiPackageList) + Offset;
- EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
-
- if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
- //
- // Search Class Opcode in this Form Package
- //
- Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
- while (Offset2 < PackageHeader.Length) {
- OpCodeData = Package + Offset2;
-
- if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
- //
- // Find FormSet OpCode
- //
- EfiCopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
- EfiCopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
- }
-
- if ((((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_GUID_OP) &&
- (EfiCompareGuid (&mIfrVendorGuid, &((EFI_IFR_GUID *) OpCodeData)->Guid)) &&
- (((EFI_IFR_GUID_CLASS *) OpCodeData)->ExtendOpCode == EFI_IFR_EXTEND_OP_CLASS)
- ) {
- //
- // Find GUIDed Class OpCode
- //
- EfiCopyMem (Class, &((EFI_IFR_GUID_CLASS *) OpCodeData)->Class, sizeof (UINT16));
-
- //
- // Till now, we ought to have found the formset Opcode
- //
- ClassFound = TRUE;
- break;
- }
-
- Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
- }
-
- if (Offset2 < PackageHeader.Length) {
- //
- // Target formset found
- //
- break;
- }
- }
-
- Offset += PackageHeader.Length;
- }
-
- gBS->FreePool (HiiPackageList);
-
- return ClassFound ? EFI_SUCCESS : EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-ExtractClassGuidFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT UINT8 *NumberOfClassGuid,
- OUT EFI_GUID **ClassGuid,
- OUT EFI_STRING_ID *FormSetTitle,
- OUT EFI_STRING_ID *FormSetHelp
- )
-/*++
-
-Routine Description:
- Extract formset ClassGuid for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- NumberOfClassGuid - Number of ClassGuid
- ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid
- FormSetTitle - Formset title string
- FormSetHelp - Formset help string
-
-Returns:
- EFI_SUCCESS - Successfully extract Class for specified Hii handle.
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
- UINT8 *Package;
- UINT8 *FormSet;
- UINT8 *OpCodeData;
- UINT32 Offset;
- UINT32 Offset2;
- UINT32 PackageListLength;
- EFI_HII_PACKAGE_HEADER PackageHeader;
-
- if (NumberOfClassGuid == NULL || ClassGuid == NULL || FormSetTitle == NULL || FormSetHelp == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- *NumberOfClassGuid = 0;
- *ClassGuid = NULL;
- *FormSetTitle = 0;
- *FormSetHelp = 0;
-
- //
- // Locate HII Database protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Get HII PackageList
- //
- BufferSize = 0;
- HiiPackageList = NULL;
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HiiPackageList = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiPackageList != NULL);
-
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- }
- if (EFI_ERROR (Status) || (HiiPackageList == NULL)) {
- return Status;
- }
-
- //
- // Get Form package from this HII package List
- //
- Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
- Offset2 = 0;
- FormSet = NULL;
- EfiCopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
-
- while (Offset < PackageListLength) {
- Package = ((UINT8 *) HiiPackageList) + Offset;
- EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
-
- if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
- //
- // Search Class Opcode in this Form Package
- //
- Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
- while (Offset2 < PackageHeader.Length) {
- OpCodeData = Package + Offset2;
-
- if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
- //
- // Find FormSet OpCode
- //
- EfiCopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
- EfiCopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
- if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > ((UINTN) &((EFI_IFR_FORM_SET *) 0)->Flags)) {
- //
- // New version of formset OpCode
- //
- *NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
- *ClassGuid = EfiLibAllocateCopyPool (
- *NumberOfClassGuid * sizeof (EFI_GUID),
- ((EFI_IFR_FORM_SET *) OpCodeData)->ClassGuid
- );
- }
- break;
- }
-
- Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
- }
-
- if (Offset2 < PackageHeader.Length) {
- //
- // Target formset found
- //
- break;
- }
- }
-
- Offset += PackageHeader.Length;
- }
-
- gBS->FreePool (HiiPackageList);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
deleted file mode 100644
index 1452ef0035..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
+++ /dev/null
@@ -1,1828 +0,0 @@
-/*++
-
-Copyright (c) 2007 - 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.
-
-Module Name:
-
- UefiIfrForm.c
-
-Abstract:
-
- Common Library Routines to assist handle HII elements.
-
---*/
-
-#include "UefiIfrLibrary.h"
-
-//
-// Fake <ConfigHdr>
-//
-UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";
-
-EFI_STATUS
-GetPackageDataFromPackageList (
- IN EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList,
- IN UINT32 PackageIndex,
- OUT UINT32 *BufferLen,
- OUT EFI_HII_PACKAGE_HEADER **Buffer
- )
-{
- UINT32 Index;
- EFI_HII_PACKAGE_HEADER *Package;
- UINT32 Offset;
- UINT32 PackageListLength;
- EFI_HII_PACKAGE_HEADER PackageHeader = {0, 0};
-
- ASSERT(HiiPackageList != NULL);
-
- if ((BufferLen == NULL) || (Buffer == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Package = NULL;
- Index = 0;
- Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
- EfiCopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
- while (Offset < PackageListLength) {
- Package = (EFI_HII_PACKAGE_HEADER *) (((UINT8 *) HiiPackageList) + Offset);
- EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if (Index == PackageIndex) {
- break;
- }
- Offset += PackageHeader.Length;
- Index++;
- }
- if (Offset >= PackageListLength) {
- //
- // no package found in this Package List
- //
- return EFI_NOT_FOUND;
- }
-
- *BufferLen = PackageHeader.Length;
- *Buffer = Package;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UpdateFormPackageData (
- IN EFI_GUID *FormSetGuid,
- IN EFI_FORM_ID FormId,
- IN EFI_HII_PACKAGE_HEADER *Package,
- IN UINT32 PackageLength,
- IN UINT16 Label,
- IN BOOLEAN Insert,
- IN EFI_HII_UPDATE_DATA *Data,
- OUT UINT8 **TempBuffer,
- OUT UINT32 *TempBufferSize
- )
-{
- UINT8 *BufferPos;
- EFI_HII_PACKAGE_HEADER PackageHeader;
- UINT32 Offset;
- EFI_IFR_OP_HEADER *IfrOpHdr;
- BOOLEAN GetFormSet;
- BOOLEAN GetForm;
- UINT8 ExtendOpCode;
- UINT16 LabelNumber;
- BOOLEAN Updated;
-
- if ((TempBuffer == NULL) || (TempBufferSize == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- *TempBufferSize = PackageLength;
- if (Data != NULL) {
- *TempBufferSize += Data->Offset;
- }
- *TempBuffer = EfiLibAllocateZeroPool (*TempBufferSize);
- if (*TempBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- EfiCopyMem (*TempBuffer, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- *TempBufferSize = sizeof (EFI_HII_PACKAGE_HEADER);
- BufferPos = *TempBuffer + sizeof (EFI_HII_PACKAGE_HEADER);
-
- EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- IfrOpHdr = (EFI_IFR_OP_HEADER *)((UINT8 *) Package + sizeof (EFI_HII_PACKAGE_HEADER));
- Offset = sizeof (EFI_HII_PACKAGE_HEADER);
- GetFormSet = (BOOLEAN)((FormSetGuid == NULL) ? TRUE : FALSE);
- GetForm = FALSE;
- Updated = FALSE;
-
- while (!Updated && Offset < PackageHeader.Length) {
- EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);
- BufferPos += IfrOpHdr->Length;
- *TempBufferSize += IfrOpHdr->Length;
-
- switch (IfrOpHdr->OpCode) {
- case EFI_IFR_FORM_SET_OP :
- if (FormSetGuid != NULL) {
- if (EfiCompareMem (&((EFI_IFR_FORM_SET *) IfrOpHdr)->Guid, FormSetGuid, sizeof (EFI_GUID)) == 0) {
- GetFormSet = TRUE;
- } else {
- GetFormSet = FALSE;
- }
- }
- break;
-
- case EFI_IFR_FORM_OP:
- if (EfiCompareMem (&((EFI_IFR_FORM *) IfrOpHdr)->FormId, &FormId, sizeof (EFI_FORM_ID)) == 0) {
- GetForm = TRUE;
- } else {
- GetForm = FALSE;
- }
- break;
-
- case EFI_IFR_GUID_OP :
- if (!GetFormSet || !GetForm) {
- //
- // Go to the next Op-Code
- //
- break;
- }
-
- if (!EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid)) {
- //
- // GUID mismatch, skip this op-code
- //
- break;
- }
-
- ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
- EfiCopyMem (&LabelNumber, &((EFI_IFR_GUID_LABEL *)IfrOpHdr)->Number, sizeof (UINT16));
- if ((ExtendOpCode != EFI_IFR_EXTEND_OP_LABEL) || (LabelNumber != Label)) {
- //
- // Go to the next Op-Code
- //
- break;
- }
-
- if (Insert) {
- //
- // Insert data after current Label, skip myself
- //
- Offset += IfrOpHdr->Length;
- IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
- } else {
- //
- // Replace data between two paired Label, try to find the next Label.
- //
- while (TRUE) {
- Offset += IfrOpHdr->Length;
- //
- // Search the next label and Fail if not label found.
- //
- if (Offset >= PackageHeader.Length) {
- goto Fail;
- }
- IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
- if (IfrOpHdr->OpCode == EFI_IFR_GUID_OP) {
- ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
- if (EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid) && ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {
- break;
- }
- }
- }
- }
-
- //
- // Fill in the update data
- //
- if (Data != NULL) {
- EfiCopyMem (BufferPos, Data->Data, Data->Offset);
- BufferPos += Data->Offset;
- *TempBufferSize += Data->Offset;
- }
-
- //
- // Copy the reset data
- //
- EfiCopyMem (BufferPos, IfrOpHdr, PackageHeader.Length - Offset);
- *TempBufferSize += PackageHeader.Length - Offset;
-
- Updated = TRUE;
- break;
- default :
- break;
- }
-
- //
- // Go to the next Op-Code
- //
- Offset += IfrOpHdr->Length;
- IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
- }
-
- //
- // Update the package length.
- //
- PackageHeader.Length = *TempBufferSize;
- EfiCopyMem (*TempBuffer, &PackageHeader, sizeof (EFI_HII_PACKAGE_HEADER));
-
-Fail:
- if (!Updated) {
- gBS->FreePool (*TempBuffer);
- *TempBufferSize = 0;
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-IfrLibInitUpdateData (
- IN OUT EFI_HII_UPDATE_DATA *UpdateData,
- IN UINT32 BufferSize
- )
-/*++
-
-Routine Description:
- This function initialize the data structure for dynamic opcode.
-
-Arguments:
- UpdateData - The adding data;
- BufferSize - Length of the buffer to fill dynamic opcodes.
-
-Returns:
- EFI_SUCCESS - Update data is initialized.
- EFI_INVALID_PARAMETER - UpdateData is NULL.
- EFI_OUT_OF_RESOURCES - No enough memory to allocate.
-
---*/
-{
- if (UpdateData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- UpdateData->BufferSize = BufferSize;
- UpdateData->Offset = 0;
- UpdateData->Data = EfiLibAllocatePool (BufferSize);
-
- return (UpdateData->Data != NULL) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;
-}
-
-EFI_STATUS
-IfrLibFreeUpdateData (
- IN EFI_HII_UPDATE_DATA *UpdateData
- )
-/*++
-
-Routine Description:
- This function free the resource of update data.
-
-Arguments:
- UpdateData - The adding data;
-
-Returns:
- EFI_SUCCESS - Resource in UpdateData is released.
- EFI_INVALID_PARAMETER - UpdateData is NULL.
-
---*/
-{
- EFI_STATUS Status;
-
- if (UpdateData == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = gBS->FreePool (UpdateData->Data);
- UpdateData->Data = NULL;
-
- return Status;
-}
-
-EFI_STATUS
-IfrLibUpdateForm (
- IN EFI_HII_HANDLE Handle,
- IN EFI_GUID *FormSetGuid, OPTIONAL
- IN EFI_FORM_ID FormId,
- IN UINT16 Label,
- IN BOOLEAN Insert,
- IN EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- This function allows the caller to update a form that has
- previously been registered with the EFI HII database.
-
-Arguments:
- Handle - Hii Handle
- FormSetGuid - The formset should be updated.
- FormId - The form should be updated.
- Label - Update information starting immediately after this label in the IFR
- Insert - If TRUE and Data is not NULL, insert data after Label.
- If FALSE, replace opcodes between two labels with Data
- Data - The adding data; If NULL, remove opcodes between two Label.
-
-Returns:
- EFI_SUCCESS - Update success.
- Other - Update fail.
-
---*/
-{
- EFI_STATUS Status;
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
- EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
- UINT32 Index;
- EFI_HII_PACKAGE_LIST_HEADER *UpdateBuffer;
- UINTN BufferSize;
- UINT8 *UpdateBufferPos;
- EFI_HII_PACKAGE_HEADER PackageHeader;
- EFI_HII_PACKAGE_HEADER *Package;
- UINT32 PackageLength;
- EFI_HII_PACKAGE_HEADER *TempBuffer;
- UINT32 TempBufferSize;
- BOOLEAN Updated;
-
- if (Data == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- LocateHiiProtocols ();
- HiiDatabase = gIfrLibHiiDatabase;
-
- //
- // Get the orginal package list
- //
- BufferSize = 0;
- HiiPackageList = NULL;
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- HiiPackageList = EfiLibAllocatePool (BufferSize);
- ASSERT (HiiPackageList != NULL);
-
- Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
- if (EFI_ERROR (Status)) {
- gBS->FreePool (HiiPackageList);
- return Status;
- }
- }
-
- //
- // Calculate and allocate space for retrieval of IFR data
- //
- BufferSize += Data->Offset;
- UpdateBuffer = EfiLibAllocateZeroPool (BufferSize);
- if (UpdateBuffer == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- UpdateBufferPos = (UINT8 *) UpdateBuffer;
-
- //
- // copy the package list header
- //
- EfiCopyMem (UpdateBufferPos, HiiPackageList, sizeof (EFI_HII_PACKAGE_LIST_HEADER));
- UpdateBufferPos += sizeof (EFI_HII_PACKAGE_LIST_HEADER);
-
- Updated = FALSE;
- for (Index = 0; ; Index++) {
- Status = GetPackageDataFromPackageList (HiiPackageList, Index, &PackageLength, &Package);
- if (Status == EFI_SUCCESS) {
- EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if ((PackageHeader.Type == EFI_HII_PACKAGE_FORMS) && !Updated) {
- Status = UpdateFormPackageData (FormSetGuid, FormId, Package, PackageLength, Label, Insert, Data, (UINT8 **)&TempBuffer, &TempBufferSize);
- if (!EFI_ERROR(Status)) {
- if (FormSetGuid == NULL) {
- Updated = TRUE;
- }
- EfiCopyMem (UpdateBufferPos, TempBuffer, TempBufferSize);
- UpdateBufferPos += TempBufferSize;
- gBS->FreePool (TempBuffer);
- continue;
- }
- }
-
- EfiCopyMem (UpdateBufferPos, Package, PackageLength);
- UpdateBufferPos += PackageLength;
- } else if (Status == EFI_NOT_FOUND) {
- break;
- } else {
- gBS->FreePool (HiiPackageList);
- return Status;
- }
- }
-
- //
- // Update package list length
- //
- BufferSize = UpdateBufferPos - (UINT8 *) UpdateBuffer;
- EfiCopyMem (&UpdateBuffer->PackageLength, &BufferSize, sizeof (UINT32));
-
- gBS->FreePool (HiiPackageList);
-
- return HiiDatabase->UpdatePackageList (HiiDatabase, Handle, UpdateBuffer);
-}
-
-EFI_STATUS
-IfrLibCreatePopUp (
- IN UINTN NumberOfLines,
- OUT EFI_INPUT_KEY *KeyValue,
- IN CHAR16 *String,
- ...
- )
-/*++
-
-Routine Description:
- Draw a dialog and return the selected key.
-
-Arguments:
- NumberOfLines - The number of lines for the dialog box
- KeyValue - The EFI_KEY value returned if HotKey is TRUE..
- String - Pointer to the first string in the list
- ... - A series of (quantity == NumberOfLines) text strings which
- will be used to construct the dialog box
-
-Returns:
- EFI_SUCCESS - Displayed dialog and received user interaction
- EFI_INVALID_PARAMETER - One of the parameters was invalid.
-
---*/
-{
- UINTN Index;
- UINTN Count;
- UINTN Start;
- UINTN End;
- UINTN Top;
- UINTN Bottom;
- CHAR16 *StringPtr;
- UINTN LeftColumn;
- UINTN RightColumn;
- UINTN TopRow;
- UINTN BottomRow;
- UINTN DimensionsWidth;
- UINTN DimensionsHeight;
- VA_LIST Marker;
- EFI_INPUT_KEY Key;
- UINTN LargestString;
- CHAR16 *StackString;
- EFI_STATUS Status;
- UINTN StringLen;
- CHAR16 *LineBuffer;
- CHAR16 **StringArray;
- EFI_EVENT TimerEvent;
- EFI_EVENT WaitList[2];
- UINTN CurrentAttribute;
- EFI_SIMPLE_TEXT_OUT_PROTOCOL *ConOut;
-
- if ((KeyValue == NULL) || (String == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- TopRow = 0;
- BottomRow = 0;
- LeftColumn = 0;
- RightColumn = 0;
-
- ConOut = gST->ConOut;
- ConOut->QueryMode (ConOut, ConOut->Mode->Mode, &RightColumn, &BottomRow);
-
- DimensionsWidth = RightColumn - LeftColumn;
- DimensionsHeight = BottomRow - TopRow;
-
- CurrentAttribute = ConOut->Mode->Attribute;
-
- LineBuffer = EfiLibAllocateZeroPool (DimensionsWidth * sizeof (CHAR16));
- ASSERT (LineBuffer != NULL);
-
- //
- // Determine the largest string in the dialog box
- // Notice we are starting with 1 since String is the first string
- //
- StringArray = EfiLibAllocateZeroPool (NumberOfLines * sizeof (CHAR16 *));
- LargestString = EfiStrLen (String);
- StringArray[0] = String;
-
- VA_START (Marker, String);
- for (Index = 1; Index < NumberOfLines; Index++) {
- StackString = VA_ARG (Marker, CHAR16 *);
-
- if (StackString == NULL) {
- VA_END (Marker);
- return EFI_INVALID_PARAMETER;
- }
-
- StringArray[Index] = StackString;
- StringLen = EfiStrLen (StackString);
- if (StringLen > LargestString) {
- LargestString = StringLen;
- }
- }
- VA_END (Marker);
-
- if ((LargestString + 2) > DimensionsWidth) {
- LargestString = DimensionsWidth - 2;
- }
-
- //
- // Subtract the PopUp width from total Columns, allow for one space extra on
- // each end plus a border.
- //
- Start = (DimensionsWidth - LargestString - 2) / 2 + LeftColumn + 1;
- End = Start + LargestString + 1;
-
- Top = ((DimensionsHeight - NumberOfLines - 2) / 2) + TopRow - 1;
- Bottom = Top + NumberOfLines + 2;
-
- //
- // Disable cursor
- //
- ConOut->EnableCursor (ConOut, FALSE);
- ConOut->SetAttribute (ConOut, EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE);
-
- StringPtr = &LineBuffer[0];
- *StringPtr++ = BOXDRAW_DOWN_RIGHT;
- for (Index = 0; Index < LargestString; Index++) {
- *StringPtr++ = BOXDRAW_HORIZONTAL;
- }
- *StringPtr++ = BOXDRAW_DOWN_LEFT;
- *StringPtr = L'\0';
-
- ConOut->SetCursorPosition (ConOut, Start, Top);
- ConOut->OutputString (ConOut, LineBuffer);
-
- for (Index = 0; Index < NumberOfLines; Index++) {
- StringPtr = &LineBuffer[0];
- *StringPtr++ = BOXDRAW_VERTICAL;
-
- for (Count = 0; Count < LargestString; Count++) {
- StringPtr[Count] = L' ';
- }
-
- StringLen = EfiStrLen (StringArray[Index]);
- if (StringLen > LargestString) {
- StringLen = LargestString;
- }
- EfiCopyMem (
- StringPtr + ((LargestString - StringLen) / 2),
- StringArray[Index],
- StringLen * sizeof (CHAR16)
- );
- StringPtr += LargestString;
-
- *StringPtr++ = BOXDRAW_VERTICAL;
- *StringPtr = L'\0';
-
- ConOut->SetCursorPosition (ConOut, Start, Top + 1 + Index);
- ConOut->OutputString (ConOut, LineBuffer);
- }
-
- StringPtr = &LineBuffer[0];
- *StringPtr++ = BOXDRAW_UP_RIGHT;
- for (Index = 0; Index < LargestString; Index++) {
- *StringPtr++ = BOXDRAW_HORIZONTAL;
- }
- *StringPtr++ = BOXDRAW_UP_LEFT;
- *StringPtr = L'\0';
-
- ConOut->SetCursorPosition (ConOut, Start, Top + NumberOfLines + 1);
- ConOut->OutputString (ConOut, LineBuffer);
-
- do {
- Status = gBS->CreateEvent (EFI_EVENT_TIMER, 0, NULL, NULL, &TimerEvent);
-
- //
- // Set a timer event of 1 second expiration
- //
- gBS->SetTimer (
- TimerEvent,
- TimerRelative,
- 10000000
- );
-
- //
- // Wait for the keystroke event or the timer
- //
- WaitList[0] = gST->ConIn->WaitForKey;
- WaitList[1] = TimerEvent;
- Status = gBS->WaitForEvent (2, WaitList, &Index);
-
- //
- // Check for the timer expiration
- //
- if (!EFI_ERROR (Status) && Index == 1) {
- Status = EFI_TIMEOUT;
- }
-
- gBS->CloseEvent (TimerEvent);
- } while (Status == EFI_TIMEOUT);
-
- Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- EfiCopyMem (KeyValue, &Key, sizeof (EFI_INPUT_KEY));
-
- ConOut->SetAttribute (ConOut, CurrentAttribute);
- ConOut->EnableCursor (ConOut, TRUE);
-
- return Status;
-}
-
-EFI_STATUS
-ExtractDefault(
- IN VOID *Buffer,
- IN UINTN *BufferSize,
- UINTN Number,
- ...
- )
-/*++
-
- Routine Description:
-
- Configure the buffer accrording to ConfigBody strings.
-
- Arguments:
- DefaultId - the ID of default.
- Buffer - the start address of buffer.
- BufferSize - the size of buffer.
- Number - the number of the strings.
-
- Returns:
- EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
- EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
- EFI_SUCCESS - Operation successful.
-
---*/
-{
- VA_LIST Args;
- UINTN Index;
- UINT32 TotalLen;
- UINT8 *BufCfgArray;
- UINT8 *BufferPos;
- UINT16 Offset;
- UINT16 Width;
- UINT8 *Value;
-
- if ((Buffer == NULL) || (BufferSize == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Offset = 0;
- Width = 0;
- Value = NULL;
-
- VA_START (Args, Number);
- for (Index = 0; Index < Number; Index++) {
- BufCfgArray = (UINT8 *) VA_ARG (Args, VOID *);
- EfiCopyMem (&TotalLen, BufCfgArray, sizeof (UINT32));
- BufferPos = BufCfgArray + sizeof (UINT32);
-
- while ((UINT32)(BufferPos - BufCfgArray) < TotalLen) {
- EfiCopyMem (&Offset, BufferPos, sizeof (UINT16));
- BufferPos += sizeof (UINT16);
- EfiCopyMem (&Width, BufferPos, sizeof (UINT16));
- BufferPos += sizeof (UINT16);
- Value = BufferPos;
- BufferPos += Width;
-
- if ((UINTN)(Offset + Width) > *BufferSize) {
- VA_END (Args);
- return EFI_BUFFER_TOO_SMALL;
- }
-
- EfiCopyMem ((UINT8 *)Buffer + Offset, Value, Width);
- }
- }
- VA_END (Args);
-
- *BufferSize = (UINTN)Offset;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ExtractBlockName (
- IN UINT8 *Buffer,
- OUT CHAR16 **BlockName
- )
-/*++
-
- Routine Description:
-
- Extract block name from the array generated by VFR compiler. The name of
- this array is "Vfr + <StorageName> + BlockName", e.g. "VfrMyIfrNVDataBlockName".
- Format of this array is:
- Array length | 4-bytes
- Offset | 2-bytes
- Width | 2-bytes
- Offset | 2-bytes
- Width | 2-bytes
- ... ...
-
- Arguments:
- Buffer - Array generated by VFR compiler.
- BlockName - The returned <BlockName>
-
- Returns:
- EFI_OUT_OF_RESOURCES - Run out of memory resource.
- EFI_INVALID_PARAMETER - Buffer is NULL or BlockName is NULL.
- EFI_SUCCESS - Operation successful.
-
---*/
-{
- UINTN Index;
- UINT32 Length;
- UINT32 BlockNameNumber;
- UINTN HexStringBufferLen;
- CHAR16 *StringPtr;
-
- if ((Buffer == NULL) || (BlockName == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Calculate number of Offset/Width pair
- //
- EfiCopyMem (&Length, Buffer, sizeof (UINT32));
- BlockNameNumber = (Length - sizeof (UINT32)) / (sizeof (UINT16) * 2);
-
- //
- // <BlockName> ::= &OFFSET=1234&WIDTH=1234
- // | 8 | 4 | 7 | 4 |
- //
- StringPtr = EfiLibAllocateZeroPool ((BlockNameNumber * (8 + 4 + 7 + 4) + 1) * sizeof (CHAR16));
- *BlockName = StringPtr;
- if (StringPtr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Buffer += sizeof (UINT32);
- for (Index = 0; Index < BlockNameNumber; Index++) {
- EfiStrCpy (StringPtr, L"&OFFSET=");
- StringPtr += 8;
-
- HexStringBufferLen = 5;
- BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
- Buffer += sizeof (UINT16);
- StringPtr += 4;
-
- EfiStrCpy (StringPtr, L"&WIDTH=");
- StringPtr += 7;
-
- HexStringBufferLen = 5;
- BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
- Buffer += sizeof (UINT16);
- StringPtr += 4;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ExtractBlockConfig (
- IN UINT8 *Buffer,
- OUT CHAR16 **BlockConfig
- )
-/*++
-
- Routine Description:
-
- Extract block config from the array generated by VFR compiler. The name of
- this array is "Vfr + <StorageName> + Default<HexCh>4", e.g. "VfrMyIfrNVDataDefault0000".
-
- Arguments:
- Buffer - Array generated by VFR compiler.
- BlockConfig - The returned <BlockConfig>
-
- Returns:
- EFI_OUT_OF_RESOURCES - Run out of memory resource.
- EFI_INVALID_PARAMETER - Buffer is NULL or BlockConfig is NULL.
- EFI_SUCCESS - Operation successful.
-
---*/
-{
- UINT32 Length;
- UINT16 Width;
- UINTN HexStringBufferLen;
- CHAR16 *StringPtr;
- UINT8 *BufferEnd;
- CHAR16 *StringEnd;
- EFI_STATUS Status;
-
- if ((Buffer == NULL) || (BlockConfig == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Calculate length of AltResp string
- // Format of Default value array is:
- // Array length | 4-bytes
- // Offset | 2-bytes
- // Width | 2-bytes
- // Value | Variable length
- // Offset | 2-bytes
- // Width | 2-bytes
- // Value | Variable length
- // ... ...
- // When value is 1 byte in length, overhead of AltResp string will be maximum,
- // BlockConfig ::= <&OFFSET=1234&WIDTH=1234&VALUE=12>+
- // | 8 | 4 | 7 | 4 | 7 |2|
- // so the maximum length of BlockConfig could be calculated as:
- // (ArrayLength / 5) * (8 + 4 + 7 + 4 + 7 + 2) = ArrayLength * 6.4 < ArrayLength * 7
- //
- EfiCopyMem (&Length, Buffer, sizeof (UINT32));
- BufferEnd = Buffer + Length;
- StringPtr = EfiLibAllocatePool (Length * 7 * sizeof (CHAR16));
- *BlockConfig = StringPtr;
- if (StringPtr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- StringEnd = StringPtr + (Length * 7);
-
- Buffer += sizeof (UINT32);
- while (Buffer < BufferEnd) {
- EfiStrCpy (StringPtr, L"&OFFSET=");
- StringPtr += 8;
-
- HexStringBufferLen = 5;
- BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
- Buffer += sizeof (UINT16);
- StringPtr += 4;
-
- EfiStrCpy (StringPtr, L"&WIDTH=");
- StringPtr += 7;
-
- HexStringBufferLen = 5;
- BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
- EfiCopyMem (&Width, Buffer, sizeof (UINT16));
- Buffer += sizeof (UINT16);
- StringPtr += 4;
-
- EfiStrCpy (StringPtr, L"&VALUE=");
- StringPtr += 7;
-
- HexStringBufferLen = StringEnd - StringPtr;
- Status = BufToHexString (StringPtr, &HexStringBufferLen, Buffer, Width);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- Buffer += Width;
- StringPtr += (Width * 2);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ConstructConfigAltResp (
- IN EFI_STRING ConfigRequest, OPTIONAL
- OUT EFI_STRING *Progress,
- OUT EFI_STRING *ConfigAltResp,
- IN EFI_GUID *Guid,
- IN CHAR16 *Name,
- IN EFI_HANDLE *DriverHandle,
- IN VOID *BufferStorage,
- IN UINTN BufferStorageSize,
- IN VOID *BlockNameArray, OPTIONAL
- IN UINTN NumberAltCfg,
- ...
-//IN UINT16 AltCfgId,
-//IN VOID *DefaultValueArray,
- )
-/*++
-
- Routine Description:
-
- Construct <ConfigAltResp> for a buffer storage.
-
- Arguments:
- ConfigRequest - The Config request string. If set to NULL, all the
- configurable elements will be extracted from BlockNameArray.
- ConfigAltResp - The returned <ConfigAltResp>.
- Progress - On return, points to a character in the Request.
- Guid - GUID of the buffer storage.
- Name - Name of the buffer storage.
- DriverHandle - The DriverHandle which is used to invoke HiiDatabase
- protocol interface NewPackageList().
- BufferStorage - Content of the buffer storage.
- BufferStorageSize - Length in bytes of the buffer storage.
- BlockNameArray - Array generated by VFR compiler.
- NumberAltCfg - Number of Default value array generated by VFR compiler.
- The sequential input parameters will be number of
- AltCfgId and DefaultValueArray pairs. When set to 0,
- there will be no <AltResp>.
-
- Returns:
- EFI_OUT_OF_RESOURCES - Run out of memory resource.
- EFI_INVALID_PARAMETER - ConfigAltResp is NULL.
- EFI_SUCCESS - Operation successful.
-
---*/
-{
- EFI_STATUS Status;
- CHAR16 *ConfigHdr;
- CHAR16 *BlockName;
- CHAR16 *DescHdr;
- CHAR16 *StringPtr;
- CHAR16 **AltCfg;
- UINT16 AltCfgId;
- VOID *DefaultValueArray;
- UINTN StrBufferLen;
- EFI_STRING ConfigResp;
- EFI_STRING TempStr;
- VA_LIST Args;
- UINTN AltRespLen;
- UINTN Index;
- BOOLEAN NeedFreeConfigRequest;
- EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
-
- if (ConfigAltResp == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Construct <ConfigHdr> : "GUID=...&NAME=...&PATH=..."
- //
- ConfigHdr = NULL;
- StrBufferLen = 0;
- Status = ConstructConfigHdr (
- ConfigHdr,
- &StrBufferLen,
- Guid,
- Name,
- DriverHandle
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- ConfigHdr = EfiLibAllocateZeroPool (StrBufferLen);
- Status = ConstructConfigHdr (
- ConfigHdr,
- &StrBufferLen,
- Guid,
- Name,
- DriverHandle
- );
- }
-
- if (EFI_ERROR (Status) || (ConfigHdr == NULL)) {
- return Status;
- }
-
- //
- // Construct <ConfigResp>
- //
- NeedFreeConfigRequest = FALSE;
- if (ConfigRequest == NULL) {
- //
- // If ConfigRequest is set to NULL, export all configurable elements in BlockNameArray
- //
- Status = ExtractBlockName (BlockNameArray, &BlockName);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- StrBufferLen = EfiStrSize (ConfigHdr);
- StrBufferLen = StrBufferLen + EfiStrSize (BlockName) - sizeof (CHAR16);
- ConfigRequest = EfiLibAllocateZeroPool (StrBufferLen);
- EfiStrCpy (ConfigRequest, ConfigHdr);
- EfiStrCat (ConfigRequest, BlockName);
- NeedFreeConfigRequest = TRUE;
- }
-
- Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = HiiConfigRouting->BlockToConfig (
- HiiConfigRouting,
- ConfigRequest,
- BufferStorage,
- BufferStorageSize,
- &ConfigResp,
- (Progress == NULL) ? &TempStr : Progress
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Construct <AltResp>
- //
- DescHdr = EfiLibAllocateZeroPool (NumberAltCfg * 16 * sizeof (CHAR16));
- StringPtr = DescHdr;
- AltCfg = EfiLibAllocateZeroPool (NumberAltCfg * sizeof (CHAR16 *));
- AltRespLen = 0;
- VA_START (Args, NumberAltCfg);
- for (Index = 0; Index < NumberAltCfg; Index++) {
- AltCfgId = (UINT16) VA_ARG (Args, UINT16);
- DefaultValueArray = (UINT8 *) VA_ARG (Args, VOID *);
-
- //
- // '&' <ConfigHdr>
- //
- AltRespLen += (EfiStrLen (ConfigHdr) + 1);
-
- StringPtr = DescHdr + Index * 16;
- EfiStrCpy (StringPtr, L"&ALTCFG=");
- AltRespLen += (8 + sizeof (UINT16) * 2);
-
- StrBufferLen = 5;
- BufToHexString (StringPtr + 8, &StrBufferLen, (UINT8 *) &AltCfgId, sizeof (UINT16));
- Status = ExtractBlockConfig (DefaultValueArray, &AltCfg[Index]);
- if (EFI_ERROR (Status)) {
- VA_END (Args);
- return Status;
- }
- AltRespLen += EfiStrLen (AltCfg[Index]);
- }
- VA_END (Args);
-
- //
- // Generate the final <ConfigAltResp>
- //
- StrBufferLen = (EfiStrLen ((CHAR16 *) ConfigResp) + AltRespLen + 1) * sizeof (CHAR16);
- TempStr = EfiLibAllocateZeroPool (StrBufferLen);
- *ConfigAltResp = TempStr;
- if (TempStr == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // <ConfigAltResp> ::= <ConfigResp> ['&' <AltResp>]*
- //
- EfiStrCpy (TempStr, ConfigResp);
- for (Index = 0; Index < NumberAltCfg; Index++) {
- EfiStrCat (TempStr, L"&");
- EfiStrCat (TempStr, ConfigHdr);
- EfiStrCat (TempStr, DescHdr + Index * 16);
- EfiStrCat (TempStr, AltCfg[Index]);
-
- gBS->FreePool (AltCfg[Index]);
- }
-
- if (NeedFreeConfigRequest) {
- gBS->FreePool (ConfigRequest);
- }
- gBS->FreePool (ConfigHdr);
- gBS->FreePool (ConfigResp);
- gBS->FreePool (DescHdr);
- gBS->FreePool (AltCfg);
-
- return EFI_SUCCESS;
-}
-
-VOID
-SwapBuffer (
- IN OUT UINT8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
- Swap bytes in the buffer.
-
-Arguments:
- Buffer - Binary buffer.
- BufferSize - Size of the buffer in bytes.
-
-Returns:
- None.
-
---*/
-{
- UINTN Index;
- UINT8 Temp;
- UINTN SwapCount;
-
- SwapCount = BufferSize / 2;
- for (Index = 0; Index < SwapCount; Index++) {
- Temp = Buffer[Index];
- Buffer[Index] = Buffer[BufferSize - 1 - Index];
- Buffer[BufferSize - 1 - Index] = Temp;
- }
-}
-
-VOID
-ToLower (
- IN OUT CHAR16 *Str
- )
-/*++
-
-Routine Description:
- Converts the unicode character of the string from uppercase to lowercase.
-
-Arguments:
- Str - String to be converted
-
-Returns:
-
---*/
-{
- CHAR16 *Ptr;
-
- for (Ptr = Str; *Ptr != L'\0'; Ptr++) {
- if (*Ptr >= L'A' && *Ptr <= L'Z') {
- *Ptr = (CHAR16) (*Ptr - L'A' + L'a');
- }
- }
-}
-
-EFI_STATUS
-BufferToHexString (
- IN OUT CHAR16 *Str,
- IN UINT8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
- Converts binary buffer to Unicode string in reversed byte order from BufToHexString().
-
-Arguments:
- Str - String for output
- Buffer - Binary buffer.
- BufferSize - Size of the buffer in bytes.
-
-Returns:
- EFI_SUCCESS - The function completed successfully.
-
---*/
-{
- EFI_STATUS Status;
- UINT8 *NewBuffer;
- UINTN StrBufferLen;
-
- NewBuffer = EfiLibAllocateCopyPool (BufferSize, Buffer);
- SwapBuffer (NewBuffer, BufferSize);
-
- StrBufferLen = BufferSize * 2 + 1;
- Status = BufToHexString (Str, &StrBufferLen, NewBuffer, BufferSize);
-
- gBS->FreePool (NewBuffer);
- //
- // Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.
- //
- ToLower (Str);
-
- return Status;
-}
-
-EFI_STATUS
-HexStringToBuffer (
- IN OUT UINT8 *Buffer,
- IN OUT UINTN *BufferSize,
- IN CHAR16 *Str
- )
-/*++
-
-Routine Description:
- Converts Hex String to binary buffer in reversed byte order from HexStringToBuf().
-
-Arguments:
- Buffer - Pointer to buffer that receives the data.
- BufferSize - Length in bytes of the buffer to hold converted data.
- If routine return with EFI_SUCCESS, containing length of converted data.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Str - String to be converted from.
-
-Returns:
- EFI_SUCCESS - The function completed successfully.
-
---*/
-{
- EFI_STATUS Status;
- UINTN ConvertedStrLen;
-
- ConvertedStrLen = 0;
- Status = HexStringToBuf (Buffer, BufferSize, Str, &ConvertedStrLen);
- if (!EFI_ERROR (Status)) {
- SwapBuffer (Buffer, (ConvertedStrLen + 1) / 2);
- }
-
- return Status;
-}
-
-EFI_STATUS
-ConfigStringToUnicode (
- IN OUT CHAR16 *UnicodeString,
- IN OUT UINTN *StrBufferLen,
- IN CHAR16 *ConfigString
- )
-/*++
-
-Routine Description:
- Convert binary representation Config string (e.g. "0041004200430044") to the
- original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
-
-Arguments:
- UnicodeString - Original Unicode string.
- StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
- Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of Unicode string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The string buffer is too small.
-
---*/
-{
- UINTN Index;
- UINTN Len;
- UINTN BufferSize;
- CHAR16 BackupChar;
-
- Len = EfiStrLen (ConfigString) / 4;
- BufferSize = (Len + 1) * sizeof (CHAR16);
-
- if (*StrBufferLen < BufferSize) {
- *StrBufferLen = BufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- *StrBufferLen = BufferSize;
-
- for (Index = 0; Index < Len; Index++) {
- BackupChar = ConfigString[4];
- ConfigString[4] = L'\0';
-
- HexStringToBuf ((UINT8 *) UnicodeString, &BufferSize, ConfigString, NULL);
-
- ConfigString[4] = BackupChar;
-
- ConfigString += 4;
- UnicodeString += 1;
- }
-
- //
- // Add tailing '\0' character
- //
- *UnicodeString = L'\0';
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UnicodeToConfigString (
- IN OUT CHAR16 *ConfigString,
- IN OUT UINTN *StrBufferLen,
- IN CHAR16 *UnicodeString
- )
-/*++
-
-Routine Description:
- Convert Unicode string to binary representation Config string, e.g.
- "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
-
-Arguments:
- ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
- StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
- Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of Unicode string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- UnicodeString - Original Unicode string.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The string buffer is too small.
-
---*/
-{
- UINTN Index;
- UINTN Len;
- UINTN BufferSize;
- CHAR16 *String;
-
- Len = EfiStrLen (UnicodeString);
- BufferSize = (Len * 4 + 1) * sizeof (CHAR16);
-
- if (*StrBufferLen < BufferSize) {
- *StrBufferLen = BufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- *StrBufferLen = BufferSize;
- String = ConfigString;
-
- for (Index = 0; Index < Len; Index++) {
- BufToHexString (ConfigString, &BufferSize, (UINT8 *) UnicodeString, 2);
-
- ConfigString += 4;
- UnicodeString += 1;
- }
-
- //
- // Add tailing '\0' character
- //
- *ConfigString = L'\0';
-
- //
- // Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.
- //
- ToLower (String);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-ConstructConfigHdr (
- IN OUT CHAR16 *ConfigHdr,
- IN OUT UINTN *StrBufferLen,
- IN EFI_GUID *Guid,
- IN CHAR16 *Name, OPTIONAL
- IN EFI_HANDLE *DriverHandle
- )
-/*++
-
-Routine Description:
- Construct <ConfigHdr> using routing information GUID/NAME/PATH.
-
-Arguments:
- ConfigHdr - Pointer to the ConfigHdr string.
- StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string.
- Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- Guid - Routing information: GUID.
- Name - Routing information: NAME.
- DriverHandle - Driver handle which contains the routing information: PATH.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
-
---*/
-{
- EFI_STATUS Status;
- UINTN NameStrLen;
- UINTN DevicePathSize;
- UINTN BufferSize;
- CHAR16 *StrPtr;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- if (Name == NULL) {
- //
- // There will be no "NAME" in <ConfigHdr> for Name/Value storage
- //
- NameStrLen = 0;
- } else {
- //
- // For buffer storage
- //
- NameStrLen = EfiStrLen (Name);
- }
-
- //
- // Retrieve DevicePath Protocol associated with this HiiPackageList
- //
- Status = gBS->HandleProtocol (
- DriverHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &DevicePath
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- DevicePathSize = EfiDevicePathSize (DevicePath);
-
- //
- // GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
- // | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
- //
- BufferSize = (5 + 32 + 6 + NameStrLen * 4 + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
- if (*StrBufferLen < BufferSize) {
- *StrBufferLen = BufferSize;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- if (ConfigHdr == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- *StrBufferLen = BufferSize;
-
- StrPtr = ConfigHdr;
-
- EfiStrCpy (StrPtr, L"GUID=");
- StrPtr += 5;
- BufferToHexString (StrPtr, (UINT8 *) Guid, sizeof (EFI_GUID));
- StrPtr += 32;
-
- //
- // Convert name string, e.g. name "ABCD" => "&NAME=0041004200430044"
- //
- EfiStrCpy (StrPtr, L"&NAME=");
- StrPtr += 6;
- if (Name != NULL) {
- BufferSize = (NameStrLen * 4 + 1) * sizeof (CHAR16);
- UnicodeToConfigString (StrPtr, &BufferSize, Name);
- StrPtr += (NameStrLen * 4);
- }
-
- EfiStrCpy (StrPtr, L"&PATH=");
- StrPtr += 6;
- BufferToHexString (StrPtr, (UINT8 *) DevicePath, DevicePathSize);
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-IsConfigHdrMatch (
- IN EFI_STRING ConfigString,
- IN EFI_GUID *StorageGuid, OPTIONAL
- IN CHAR16 *StorageName OPTIONAL
- )
-/*++
-
-Routine Description:
- Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
-
-Arguments:
- ConfigString - Either <ConfigRequest> or <ConfigResp>.
- StorageGuid - GUID of the storage.
- StorageName - Name of the stoarge.
-
-Returns:
- TRUE - Routing information is correct in ConfigString.
- FALSE - Routing information is incorrect in ConfigString.
-
---*/
-{
- EFI_STATUS Status;
- BOOLEAN Match;
- EFI_GUID Guid;
- CHAR16 *Name;
- CHAR16 *StrPtr;
- UINTN BufferSize;
-
- //
- // <ConfigHdr> ::=
- // GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
- // | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
- //
- if (EfiStrLen (ConfigString) <= (5 + 32 + 6)) {
- return FALSE;
- }
-
- //
- // Compare GUID
- //
- if (StorageGuid != NULL) {
-
- StrPtr = ConfigString + 5 + 32;
- if (*StrPtr != L'&') {
- return FALSE;
- }
- *StrPtr = L'\0';
-
- BufferSize = sizeof (EFI_GUID);
- Status = HexStringToBuffer (
- (UINT8 *) &Guid,
- &BufferSize,
- ConfigString + 5
- );
- *StrPtr = L'&';
-
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
-
- if (!EfiCompareGuid (&Guid, StorageGuid)) {
- return FALSE;
- }
- }
-
- //
- // Compare Name
- //
- Match = TRUE;
- if (StorageName != NULL) {
- StrPtr = ConfigString + 5 + 32 + 6;
- while (*StrPtr != L'\0' && *StrPtr != L'&') {
- StrPtr++;
- }
- if (*StrPtr != L'&') {
- return FALSE;
- }
-
- *StrPtr = L'\0';
- BufferSize = (EfiStrLen (ConfigString + 5 + 32 + 6) + 1) * sizeof (CHAR16);
- Name = EfiLibAllocatePool (BufferSize);
- ASSERT (Name != NULL);
- Status = ConfigStringToUnicode (
- Name,
- &BufferSize,
- ConfigString + 5 + 32 + 6
- );
- *StrPtr = L'&';
-
- if (EFI_ERROR (Status) || (EfiStrCmp (Name, StorageName) != 0)) {
- Match = FALSE;
- }
- gBS->FreePool (Name);
- }
-
- return Match;
-}
-
-BOOLEAN
-FindBlockName (
- IN OUT CHAR16 *String,
- UINTN Offset,
- UINTN Width
- )
-/*++
-
-Routine Description:
- Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
-
-Arguments:
- String - The string to be searched in.
- Offset - Offset in BlockName.
- Width - Width in BlockName.
-
-Returns:
- TRUE - Block name found.
- FALSE - Block name not found.
-
---*/
-{
- EFI_STATUS Status;
- UINTN Data;
- UINTN BufferSize;
- UINTN ConvertedStrLen;
-
- while ((String = EfiStrStr (String, L"&OFFSET=")) != NULL) {
- //
- // Skip '&OFFSET='
- //
- String = String + 8;
-
- Data = 0;
- BufferSize = sizeof (UINTN);
- Status = HexStringToBuf ((UINT8 *) &Data, &BufferSize, String, &ConvertedStrLen);
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
- String = String + ConvertedStrLen;
-
- if (Data != Offset) {
- continue;
- }
-
- if (EfiStrnCmp (String, L"&WIDTH=", 7) != 0) {
- return FALSE;
- }
- String = String + 7;
-
- Data = 0;
- BufferSize = sizeof (UINTN);
- Status = HexStringToBuf ((UINT8 *) &Data, &BufferSize, String, &ConvertedStrLen);
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
- if (Data == Width) {
- return TRUE;
- }
-
- String = String + ConvertedStrLen;
- }
-
- return FALSE;
-}
-
-EFI_STATUS
-GetBrowserData (
- EFI_GUID *VariableGuid, OPTIONAL
- CHAR16 *VariableName, OPTIONAL
- UINTN *BufferSize,
- UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - On input: Length in bytes of buffer to hold retrived data.
- On output:
- If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Buffer - Buffer to hold retrived data.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
-
---*/
-{
- EFI_STATUS Status;
- CHAR16 *ConfigHdr;
- CHAR16 *ConfigResp;
- CHAR16 *StringPtr;
- UINTN HeaderLen;
- UINTN BufferLen;
- CHAR16 *Progress;
- EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
- EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
-
- //
- // Locate protocols for use
- //
- Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Retrive formset storage data from Form Browser
- //
- ConfigHdr = mFakeConfigHdr;
- HeaderLen = EfiStrLen (ConfigHdr);
-
- BufferLen = 0x4000;
- ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
-
- StringPtr = ConfigResp + HeaderLen;
- *StringPtr = L'&';
- StringPtr++;
-
- Status = FormBrowser2->BrowserCallback (
- FormBrowser2,
- &BufferLen,
- StringPtr,
- TRUE,
- VariableGuid,
- VariableName
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
- gBS->FreePool (ConfigResp);
- ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
-
- StringPtr = ConfigResp + HeaderLen;
- *StringPtr = L'&';
- StringPtr++;
-
- Status = FormBrowser2->BrowserCallback (
- FormBrowser2,
- &BufferLen,
- StringPtr,
- TRUE,
- VariableGuid,
- VariableName
- );
- }
- if (EFI_ERROR (Status)) {
- gBS->FreePool (ConfigResp);
- return Status;
- }
- EfiCopyMem (ConfigResp, ConfigHdr, HeaderLen * sizeof (UINT16));
-
- //
- // Convert <ConfigResp> to buffer data
- //
- Status = HiiConfigRouting->ConfigToBlock (
- HiiConfigRouting,
- ConfigResp,
- Buffer,
- BufferSize,
- &Progress
- );
- gBS->FreePool (ConfigResp);
-
- return Status;
-}
-
-EFI_STATUS
-SetBrowserData (
- EFI_GUID *VariableGuid, OPTIONAL
- CHAR16 *VariableName, OPTIONAL
- UINTN BufferSize,
- UINT8 *Buffer,
- CHAR16 *RequestElement OPTIONAL
- )
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - Length in bytes of buffer to hold retrived data.
- Buffer - Buffer to hold retrived data.
- RequestElement - An optional field to specify which part of the buffer data
- will be send back to Browser. If NULL, the whole buffer of
- data will be committed to Browser.
- <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
-
-Returns:
- EFI_SUCCESS - Routine success.
- Other - Updating Browser uncommitted data failed.
-
---*/
-{
- EFI_STATUS Status;
- CHAR16 *ConfigHdr;
- CHAR16 *ConfigResp;
- CHAR16 *StringPtr;
- UINTN HeaderLen;
- UINTN BufferLen;
- CHAR16 *Progress;
- EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
- EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
- CHAR16 BlockName[33];
- CHAR16 *ConfigRequest;
- CHAR16 *Request;
-
- //
- // Locate protocols for use
- //
- Status = gBS->LocateProtocol (&gEfiFormBrowser2ProtocolGuid, NULL, (VOID **) &FormBrowser2);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Prepare <ConfigRequest>
- //
- ConfigHdr = mFakeConfigHdr;
- HeaderLen = EfiStrLen (ConfigHdr);
-
- if (RequestElement == NULL) {
- //
- // RequestElement not specified, use "&OFFSET=0&WIDTH=<BufferSize>" as <BlockName>
- //
- BlockName[0] = L'\0';
- EfiStrCpy (BlockName, L"&OFFSET=0&WIDTH=");
-
- //
- // String lenghth of L"&OFFSET=0&WIDTH=" is 16
- //
- StringPtr = BlockName + 16;
- BufferLen = sizeof (BlockName) - (16 * sizeof (CHAR16));
- BufToHexString (StringPtr, &BufferLen, (UINT8 *) &BufferSize, sizeof (UINTN));
-
- Request = BlockName;
- } else {
- Request = RequestElement;
- }
-
- BufferLen = HeaderLen * sizeof (CHAR16) + EfiStrSize (Request);
- ConfigRequest = EfiLibAllocateZeroPool (BufferLen);
-
- EfiCopyMem (ConfigRequest, ConfigHdr, HeaderLen * sizeof (CHAR16));
- StringPtr = ConfigRequest + HeaderLen;
- EfiStrCpy (StringPtr, Request);
-
- //
- // Convert buffer to <ConfigResp>
- //
- Status = HiiConfigRouting->BlockToConfig (
- HiiConfigRouting,
- ConfigRequest,
- Buffer,
- BufferSize,
- &ConfigResp,
- &Progress
- );
- if (EFI_ERROR (Status)) {
- gBS->FreePool (ConfigRequest);
- return Status;
- }
-
- //
- // Skip <ConfigHdr> and '&'
- //
- StringPtr = ConfigResp + HeaderLen + 1;
-
- //
- // Change uncommitted data in Browser
- //
- Status = FormBrowser2->BrowserCallback (
- FormBrowser2,
- &BufferSize,
- StringPtr,
- FALSE,
- VariableGuid,
- VariableName
- );
- gBS->FreePool (ConfigResp);
- gBS->FreePool (ConfigRequest);
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
deleted file mode 100644
index 3de0efb651..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
+++ /dev/null
@@ -1,1342 +0,0 @@
-/*++
-
-Copyright (c) 2007 - 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.
-
-Module Name:
-
- UefiIfrLibrary.h
-
-Abstract:
-
- The file contain all library function for Ifr Operations.
-
---*/
-
-#ifndef _IFRLIBRARY_H
-#define _IFRLIBRARY_H
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "TianoHii.h"
-
-#include EFI_PROTOCOL_DEFINITION (HiiFont)
-#include EFI_PROTOCOL_DEFINITION (HiiImage)
-#include EFI_PROTOCOL_DEFINITION (HiiString)
-#include EFI_PROTOCOL_DEFINITION (HiiDatabase)
-#include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
-#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
-#include EFI_PROTOCOL_DEFINITION (FormBrowser2)
-#include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
-
-#include EFI_GUID_DEFINITION (GlobalVariable)
-
-#define IFR_LIB_DEFAULT_STRING_SIZE 0x200
-
-//
-// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI
-// specification. While, UEFI specification also states that these deprecated
-// variables may be provided for backwards compatibility.
-// If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced;
-// If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced.
-//
-#define LANG_SUPPORT
-
-#define EFI_LANGUAGE_VARIABLE L"Lang"
-#define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes"
-
-#define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
-#define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
-
-//
-// Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
-// (42 characters plus a NULL terminator)
-//
-#define RFC_3066_ENTRY_SIZE (42 + 1)
-#define ISO_639_2_ENTRY_SIZE 3
-
-#define INVALID_VARSTORE_ID 0
-
-#define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
-#define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
-
-extern EFI_GUID mIfrVendorGuid;
-extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
-extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
-
-#pragma pack(1)
-typedef struct {
- EFI_STRING_ID StringToken;
- EFI_IFR_TYPE_VALUE Value;
- UINT8 Flags;
-} IFR_OPTION;
-#pragma pack()
-
-#pragma pack(1)
-typedef struct {
- VENDOR_DEVICE_PATH VendorDevicePath;
- UINT32 Reserved;
- UINT64 UniqueId;
-} HII_VENDOR_DEVICE_PATH_NODE;
-#pragma pack()
-
-typedef struct {
- HII_VENDOR_DEVICE_PATH_NODE Node;
- EFI_DEVICE_PATH_PROTOCOL End;
-} HII_VENDOR_DEVICE_PATH;
-
-typedef struct {
- //
- // Buffer size allocated for Data.
- //
- UINT32 BufferSize;
-
- //
- // Offset in Data to append the newly created opcode binary.
- // It will be adjusted automatically in Create***OpCode(), and should be
- // initialized to 0 before invocation of a serial of Create***OpCode()
- //
- UINT32 Offset;
-
- //
- // The destination buffer for created op-codes
- //
- UINT8 *Data;
-} EFI_HII_UPDATE_DATA;
-
-VOID
-LocateHiiProtocols (
- VOID
- )
-/*++
-
-Routine Description:
- This function locate Hii relative protocols for later usage.
-
-Arguments:
- None.
-
-Returns:
- None.
-
---*/
-;
-
-//
-// Exported Library functions
-//
-EFI_STATUS
-CreateEndOpCode (
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_END_OP opcode.
-
-Arguments:
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateDefaultOpCode (
- IN EFI_IFR_TYPE_VALUE *Value,
- IN UINT8 Type,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_DEFAULT_OP opcode.
-
-Arguments:
- Value - Value for the default
- Type - Type for the default
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateActionOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN EFI_STRING_ID QuestionConfig,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_ACTION_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- QuestionConfig - String ID for configuration
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateSubTitleOpCode (
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 Flags,
- IN UINT8 Scope,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_SUBTITLE_OP opcode.
-
-Arguments:
- Prompt - String ID for Prompt
- Help - String ID for Help
- Flags - Subtitle opcode flags
- Scope - Subtitle Scope bit
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateTextOpCode (
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN EFI_STRING_ID TextTwo,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_TEXT_OP opcode.
-
-Arguments:
- Prompt - String ID for Prompt
- Help - String ID for Help
- TextTwo - String ID for text two
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateGotoOpCode (
- IN EFI_FORM_ID FormId,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN EFI_QUESTION_ID QuestionId,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_REF_OP opcode.
-
-Arguments:
- FormId - Destination Form ID
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- QuestionId - Question ID
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateOneOfOptionOpCode (
- IN UINTN OptionCount,
- IN IFR_OPTION *OptionsList,
- IN UINT8 Type,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-;
-
-EFI_STATUS
-CreateOneOfOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 OneOfFlags,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_ONE_OF_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- OneOfFlags - Flags for oneof opcode
- OptionsList - List of options
- OptionCount - Number of options in option list
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateOrderedListOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 Flags,
- IN UINT8 DataType,
- IN UINT8 MaxContainers,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_ORDERED_LIST_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- Flags - Flags for ordered list opcode
- DataType - Type for option value
- MaxContainers - Maximum count for options in this ordered list
- OptionsList - List of options
- OptionCount - Number of options in option list
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateCheckBoxOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 CheckBoxFlags,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_CHECKBOX_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- CheckBoxFlags - Flags for checkbox opcode
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateNumericOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 NumericFlags,
- IN UINT64 Minimum,
- IN UINT64 Maximum,
- IN UINT64 Step,
- IN UINT64 Default,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_NUMERIC_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- NumericFlags - Flags for numeric opcode
- Minimum - Numeric minimum value
- Maximum - Numeric maximum value
- Step - Numeric step for edit
- Default - Numeric default value
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateStringOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 StringFlags,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create EFI_IFR_STRING_OP opcode.
-
-Arguments:
- QuestionId - Question ID
- VarStoreId - Storage ID
- VarOffset - Offset in Storage
- Prompt - String ID for Prompt
- Help - String ID for Help
- QuestionFlags - Flags in Question Header
- StringFlags - Flags for string opcode
- MinSize - String minimum length
- MaxSize - String maximum length
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_STATUS
-CreateBannerOpCode (
- IN EFI_STRING_ID Title,
- IN UINT16 LineNumber,
- IN UINT8 Alignment,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- Create GUIDed opcode for banner.
-
-Arguments:
- Title - String ID for title
- LineNumber - Line number for this banner
- Alignment - Alignment for this banner, left, center or right
- Data - Destination for the created opcode binary
-
-Returns:
- EFI_SUCCESS - Opcode create success
-
---*/
-;
-
-EFI_HII_PACKAGE_LIST_HEADER *
-PreparePackageList (
- IN UINTN NumberOfPackages,
- IN EFI_GUID *GuidId,
- ...
- )
-/*++
-
-Routine Description:
- Assemble EFI_HII_PACKAGE_LIST according to the passed in packages.
-
-Arguments:
- NumberOfPackages - Number of packages.
- GuidId - Package GUID.
-
-Returns:
- Pointer of EFI_HII_PACKAGE_LIST_HEADER.
-
---*/
-;
-
-EFI_STATUS
-CreateHiiDriverHandle (
- OUT EFI_HANDLE *DriverHandle
- )
-/*++
-
-Routine Description:
- The HII driver handle passed in for HiiDatabase.NewPackageList() requires
- that there should be DevicePath Protocol installed on it.
- This routine create a virtual Driver Handle by installing a vendor device
- path on it, so as to use it to invoke HiiDatabase.NewPackageList().
-
-Arguments:
- DriverHandle - Handle to be returned
-
-Returns:
- EFI_SUCCESS - Handle destroy success.
- EFI_OUT_OF_RESOURCES - Not enough memory.
-
---*/
-;
-
-EFI_STATUS
-DestroyHiiDriverHandle (
- IN EFI_HANDLE DriverHandle
- )
-/*++
-
-Routine Description:
- Destroy the Driver Handle created by CreateHiiDriverHandle().
-
-Arguments:
- DriverHandle - Handle returned by CreateHiiDriverHandle()
-
-Returns:
- EFI_SUCCESS - Handle destroy success.
- other - Handle destroy fail.
-
---*/
-;
-
-EFI_HII_HANDLE
-DevicePathToHiiHandle (
- IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Find HII Handle associated with given Device Path.
-
-Arguments:
- HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance.
- DevicePath - Device Path associated with the HII package list handle.
-
-Returns:
- Handle - HII package list Handle associated with the Device Path.
- NULL - Hii Package list handle is not found.
-
---*/
-;
-
-EFI_STATUS
-ExtractDefault(
- IN VOID *Buffer,
- IN UINTN *BufferSize,
- UINTN Number,
- ...
- )
-/*++
-
- Routine Description:
- Configure the buffer accrording to ConfigBody strings.
-
- Arguments:
- DefaultId - the ID of default.
- Buffer - the start address of buffer.
- BufferSize - the size of buffer.
- Number - the number of the strings.
-
- Returns:
- EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate.
- EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0.
- EFI_SUCCESS - Operation successful.
-
---*/
-;
-
-EFI_STATUS
-ConstructConfigAltResp (
- IN EFI_STRING ConfigRequest, OPTIONAL
- OUT EFI_STRING *Progress,
- OUT EFI_STRING *ConfigAltResp,
- IN EFI_GUID *Guid,
- IN CHAR16 *Name,
- IN EFI_HANDLE *DriverHandle,
- IN VOID *BufferStorage,
- IN UINTN BufferStorageSize,
- IN VOID *BlockNameArray, OPTIONAL
- IN UINTN NumberAltCfg,
- ...
-//IN UINT16 AltCfgId,
-//IN VOID *DefaultValueArray,
- )
-/*++
-
- Routine Description:
-
- Construct <ConfigAltResp> for a buffer storage.
-
- Arguments:
- ConfigRequest - The Config request string. If set to NULL, all the
- configurable elements will be extracted from BlockNameArray.
- ConfigAltResp - The returned <ConfigAltResp>.
- Progress - On return, points to a character in the Request.
- Guid - GUID of the buffer storage.
- Name - Name of the buffer storage.
- DriverHandle - The DriverHandle which is used to invoke HiiDatabase
- protocol interface NewPackageList().
- BufferStorage - Content of the buffer storage.
- BufferStorageSize - Length in bytes of the buffer storage.
- BlockNameArray - Array generated by VFR compiler.
- NumberAltCfg - Number of Default value array generated by VFR compiler.
- The sequential input parameters will be number of
- AltCfgId and DefaultValueArray pairs. When set to 0,
- there will be no <AltResp>.
-
- Returns:
- EFI_OUT_OF_RESOURCES - Run out of memory resource.
- EFI_INVALID_PARAMETER - ConfigAltResp is NULL.
- EFI_SUCCESS - Operation successful.
-
---*/
-;
-
-EFI_STATUS
-ExtractGuidFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
- Extract Hii package list GUID for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- Guid - Package list GUID
-
-Returns:
- EFI_SUCCESS - Successfully extract GUID from Hii database.
-
---*/
-;
-
-EFI_STATUS
-ExtractClassFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT UINT16 *Class,
- OUT EFI_STRING_ID *FormSetTitle,
- OUT EFI_STRING_ID *FormSetHelp
- )
-/*++
-
-Routine Description:
- Extract formset class for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- Class - Class of the formset
- FormSetTitle - Formset title string
- FormSetHelp - Formset help string
-
-Returns:
- EFI_SUCCESS - Successfully extract Class for specified Hii handle.
-
---*/
-;
-
-EFI_STATUS
-ExtractClassGuidFromHiiHandle (
- IN EFI_HII_HANDLE Handle,
- OUT UINT8 *NumberOfClassGuid,
- OUT EFI_GUID **ClassGuid,
- OUT EFI_STRING_ID *FormSetTitle,
- OUT EFI_STRING_ID *FormSetHelp
- )
-/*++
-
-Routine Description:
- Extract formset ClassGuid for given HII handle.
-
-Arguments:
- HiiHandle - Hii handle
- NumberOfClassGuid - Number of ClassGuid
- ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid
- FormSetTitle - Formset title string
- FormSetHelp - Formset help string
-
-Returns:
- EFI_SUCCESS - Successfully extract Class for specified Hii handle.
-
---*/
-;
-
-VOID
-ToLower (
- IN OUT CHAR16 *Str
- )
-/*++
-
-Routine Description:
- Converts the unicode character from uppercase to lowercase.
-
-Arguments:
- Str - String to be converted
-
-Returns:
-
---*/
-;
-
-EFI_STATUS
-BufferToHexString (
- IN OUT CHAR16 *Str,
- IN UINT8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
- Converts binary buffer to Unicode string in reversed byte order to BufToHexString().
-
-Arguments:
- Str - String for output
- Buffer - Binary buffer.
- BufferSize - Size of the buffer in bytes.
-
-Returns:
- EFI_SUCCESS - The function completed successfully.
-
---*/
-;
-
-EFI_STATUS
-HexStringToBuffer (
- IN OUT UINT8 *Buffer,
- IN OUT UINTN *BufferSize,
- IN CHAR16 *Str
- )
-/*++
-
-Routine Description:
- Converts Hex String to binary buffer in reversed byte order to HexStringToBuf().
-
-Arguments:
- Buffer - Pointer to buffer that receives the data.
- BufferSize - Length in bytes of the buffer to hold converted data.
- If routine return with EFI_SUCCESS, containing length of converted data.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Str - String to be converted from.
-
-Returns:
- EFI_SUCCESS - The function completed successfully.
-
---*/
-;
-
-EFI_STATUS
-ConfigStringToUnicode (
- IN OUT CHAR16 *UnicodeString,
- IN OUT UINTN *StrBufferLen,
- IN CHAR16 *ConfigString
- )
-/*++
-
-Routine Description:
- Convert binary representation Config string (e.g. "0041004200430044") to the
- original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
-
-Arguments:
- UnicodeString - Original Unicode string.
- StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
- Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of Unicode string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The string buffer is too small.
-
---*/
-;
-
-EFI_STATUS
-UnicodeToConfigString (
- IN OUT CHAR16 *ConfigString,
- IN OUT UINTN *StrBufferLen,
- IN CHAR16 *UnicodeString
- )
-/*++
-
-Routine Description:
- Convert Unicode string to binary representation Config string, e.g.
- "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
- "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
-
-Arguments:
- ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
- StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
- Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of Unicode string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- UnicodeString - Original Unicode string.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The string buffer is too small.
-
---*/
-;
-
-EFI_STATUS
-ConstructConfigHdr (
- IN OUT CHAR16 *ConfigHdr,
- IN OUT UINTN *StrBufferLen,
- IN EFI_GUID *Guid,
- IN CHAR16 *Name, OPTIONAL
- IN EFI_HANDLE *DriverHandle
- )
-/*++
-
-Routine Description:
- Construct <ConfigHdr> using routing information GUID/NAME/PATH.
-
-Arguments:
- ConfigHdr - Pointer to the ConfigHdr string.
- StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character.
- On output:
- If return EFI_SUCCESS, containing length of ConfigHdr string buffer.
- If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
- Guid - Routing information: GUID.
- Name - Routing information: NAME.
- DriverHandle - Driver handle which contains the routing information: PATH.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small.
-
---*/
-;
-
-BOOLEAN
-IsConfigHdrMatch (
- IN EFI_STRING ConfigString,
- IN EFI_GUID *StorageGuid, OPTIONAL
- IN CHAR16 *StorageName OPTIONAL
- )
-/*++
-
-Routine Description:
- Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
-
-Arguments:
- ConfigString - Either <ConfigRequest> or <ConfigResp>.
- StorageGuid - GUID of the storage.
- StorageName - Name of the stoarge.
-
-Returns:
- TRUE - Routing information is correct in ConfigString.
- FALSE - Routing information is incorrect in ConfigString.
-
---*/
-;
-
-BOOLEAN
-FindBlockName (
- IN OUT CHAR16 *String,
- UINTN Offset,
- UINTN Width
- )
-/*++
-
-Routine Description:
- Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string.
-
-Arguments:
- String - The string to be searched in.
- Offset - Offset in BlockName.
- Width - Width in BlockName.
-
-Returns:
- TRUE - Block name found.
- FALSE - Block name not found.
-
---*/
-;
-
-EFI_STATUS
-GetBrowserData (
- EFI_GUID *VariableGuid, OPTIONAL
- CHAR16 *VariableName, OPTIONAL
- UINTN *BufferSize,
- UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - On input: Length in bytes of buffer to hold retrived data.
- On output:
- If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Buffer - Buffer to hold retrived data.
-
-Returns:
- EFI_SUCCESS - Routine success.
- EFI_BUFFER_TOO_SMALL - The intput buffer is too small.
-
---*/
-;
-
-EFI_STATUS
-GetHiiHandles (
- IN OUT UINTN *HandleBufferLength,
- OUT EFI_HII_HANDLE **HiiHandleBuffer
- )
-/*++
-
-Routine Description:
- Determines the handles that are currently active in the database.
- It's the caller's responsibility to free handle buffer.
-
-Arguments:
- HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance.
- HandleBufferLength - On input, a pointer to the length of the handle buffer. On output,
- the length of the handle buffer that is required for the handles found.
- HiiHandleBuffer - Pointer to an array of Hii Handles returned.
-
-Returns:
- EFI_SUCCESS - Get an array of Hii Handles successfully.
- EFI_INVALID_PARAMETER - Hii is NULL.
- EFI_NOT_FOUND - Database not found.
-
---*/
-;
-
-EFI_STATUS
-SetBrowserData (
- EFI_GUID *VariableGuid, OPTIONAL
- CHAR16 *VariableName, OPTIONAL
- UINTN BufferSize,
- UINT8 *Buffer,
- CHAR16 *RequestElement OPTIONAL
- )
-/*++
-
-Routine Description:
- This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser.
-
-Arguments:
- VariableGuid - An optional field to indicate the target variable GUID name to use.
- VariableName - An optional field to indicate the target human-readable variable name.
- BufferSize - Length in bytes of buffer to hold retrived data.
- Buffer - Buffer to hold retrived data.
- RequestElement - An optional field to specify which part of the buffer data
- will be send back to Browser. If NULL, the whole buffer of
- data will be committed to Browser.
- <RequestElement> ::= &OFFSET=<Number>&WIDTH=<Number>*
-
-Returns:
- EFI_SUCCESS - Routine success.
- Other - Updating Browser uncommitted data failed.
-
---*/
-;
-
-EFI_STATUS
-ConvertRfc3066LanguageToIso639Language (
- CHAR8 *LanguageRfc3066,
- CHAR8 *LanguageIso639
- )
-/*++
-
-Routine Description:
- Convert language code from RFC3066 to ISO639-2.
-
-Arguments:
- LanguageRfc3066 - RFC3066 language code.
- LanguageIso639 - ISO639-2 language code.
-
-Returns:
- EFI_SUCCESS - Language code converted.
- EFI_NOT_FOUND - Language code not found.
-
---*/
-;
-
-CHAR8 *
-Rfc3066ToIso639 (
- CHAR8 *SupportedLanguages
- )
-/*++
-
-Routine Description:
- Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
- be converted to "engfra".
-
-Arguments:
- SupportedLanguages - The RFC3066 language list.
-
-Returns:
- The ISO639-2 language list.
-
---*/
-;
-
-EFI_STATUS
-GetCurrentLanguage (
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Determine what is the current language setting
-
-Arguments:
- Lang - Pointer of system language
-
-Returns:
- Status code
-
---*/
-;
-
-VOID
-GetNextLanguage (
- IN OUT CHAR8 **LangCode,
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Get next language from language code list.
-
-Arguments:
- LangCode - The language code.
- Lang - Returned language.
-
-Returns:
- None.
-
---*/
-;
-
-CHAR8 *
-GetSupportedLanguages (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the list of supported languages, in the format specified
- in UEFI specification Appendix M.
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The supported languages.
-
---*/
-;
-
-UINT16
-GetSupportedLanguageNumber (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the number of supported languages
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The number of supported languages.
-
---*/
-;
-
-EFI_STATUS
-GetStringFromHandle (
- IN EFI_HII_HANDLE HiiHandle,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get string specified by StringId form the HiiHandle.
-
-Arguments:
- HiiHandle - The HII handle of package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
- EFI_INVALID_PARAMETER - The String is NULL.
-
---*/
-;
-
-EFI_STATUS
-GetStringFromToken (
- IN EFI_GUID *ProducerGuid,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get the string given the StringId and String package Producer's Guid.
-
-Arguments:
- ProducerGuid - The Guid of String package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
-
---*/
-;
-
-EFI_STATUS
-IfrLibNewString (
- IN EFI_HII_HANDLE PackageList,
- OUT EFI_STRING_ID *StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function adds the string into String Package of each language.
-
- Arguments:
- PackageList - Handle of the package list where this string will be added.
- StringId - On return, contains the new strings id, which is unique within PackageList.
- String - Points to the new null-terminated string.
-
- Returns:
- EFI_SUCCESS - The new string was added successfully.
- EFI_NOT_FOUND - The specified PackageList could not be found in database.
- EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
- EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
-
---*/
-;
-
-EFI_STATUS
-IfrLibGetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING String,
- IN OUT UINTN *StringSize
- )
-/*++
-
- Routine Description:
- This function try to retrieve string from String package of current language.
- If fail, it try to retrieve string from String package of first language it support.
-
- Arguments:
- PackageList - The package list in the HII database to search for the specified string.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
- StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
- points to the length of the string, in bytes.
-
- Returns:
- EFI_SUCCESS - The string was returned successfully.
- EFI_NOT_FOUND - The string specified by StringId is not available.
- EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
- EFI_INVALID_PARAMETER - The String or StringSize was NULL.
-
---*/
-;
-
-EFI_STATUS
-IfrLibSetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function updates the string in String package of current language.
-
- Arguments:
- PackageList - The package list containing the strings.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
-
- Returns:
- EFI_SUCCESS - The string was updated successfully.
- EFI_NOT_FOUND - The string specified by StringId is not in the database.
- EFI_INVALID_PARAMETER - The String was NULL.
- EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
-
---*/
-;
-
-EFI_STATUS
-IfrLibCreatePopUp (
- IN UINTN NumberOfLines,
- OUT EFI_INPUT_KEY *KeyValue,
- IN CHAR16 *String,
- ...
- )
-/*++
-
-Routine Description:
- Draw a dialog and return the selected key.
-
-Arguments:
- NumberOfLines - The number of lines for the dialog box
- KeyValue - The EFI_KEY value returned if HotKey is TRUE..
- String - Pointer to the first string in the list
- ... - A series of (quantity == NumberOfLines) text strings which
- will be used to construct the dialog box
-
-Returns:
- EFI_SUCCESS - Displayed dialog and received user interaction
- EFI_INVALID_PARAMETER - One of the parameters was invalid.
-
---*/
-;
-
-EFI_STATUS
-IfrLibInitUpdateData (
- IN OUT EFI_HII_UPDATE_DATA *UpdateData,
- IN UINT32 BufferSize
- )
-/*++
-
-Routine Description:
- This function initialize the data structure for dynamic opcode.
-
-Arguments:
- UpdateData - The adding data;
- BufferSize - Length of the buffer to fill dynamic opcodes.
-
-Returns:
- EFI_SUCCESS - Update data is initialized.
- EFI_INVALID_PARAMETER - UpdateData is NULL.
- EFI_OUT_OF_RESOURCES - No enough memory to allocate.
-
---*/
-;
-
-EFI_STATUS
-IfrLibFreeUpdateData (
- IN EFI_HII_UPDATE_DATA *UpdateData
- )
-/*++
-
-Routine Description:
- This function free the resource of update data.
-
-Arguments:
- UpdateData - The adding data;
-
-Returns:
- EFI_SUCCESS - Resource in UpdateData is released.
- EFI_INVALID_PARAMETER - UpdateData is NULL.
-
---*/
-;
-
-EFI_STATUS
-IfrLibUpdateForm (
- IN EFI_HII_HANDLE Handle,
- IN EFI_GUID *FormSetGuid, OPTIONAL
- IN EFI_FORM_ID FormId,
- IN UINT16 Label,
- IN BOOLEAN Insert,
- IN EFI_HII_UPDATE_DATA *Data
- )
-/*++
-
-Routine Description:
- This function allows the caller to update a form that has
- previously been registered with the EFI HII database.
-
-Arguments:
- Handle - Hii Handle
- FormSetGuid - The formset should be updated.
- FormId - The form should be updated.
- Label - Update information starting immediately after this label in the IFR
- Insert - If TRUE and Data is not NULL, insert data after Label.
- If FALSE, replace opcodes between two labels with Data.
- Data - The adding data; If NULL, remove opcodes between two Label.
-
-Returns:
- EFI_SUCCESS - Update success.
- Other - Update fail.
-
---*/
-;
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
deleted file mode 100644
index 2c454de951..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
+++ /dev/null
@@ -1,638 +0,0 @@
-/*++
-
-Copyright (c) 2007 - 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.
-
-Module Name:
-
- UefiIfrOpCodeCreation.c
-
-Abstract:
-
- Library Routines to create IFR independent of string data - assume tokens already exist
- Primarily to be used for exporting op-codes at a label in pre-defined forms.
-
-Revision History:
-
---*/
-
-#include "UefiIfrLibrary.h"
-
-EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID;
-
-STATIC
-BOOLEAN
-IsValidQuestionFlags (
- IN UINT8 Flags
- )
-{
- return (BOOLEAN)((Flags & (~QUESTION_FLAGS)) ? FALSE : TRUE);
-}
-
-STATIC
-BOOLEAN
-IsValidValueType (
- IN UINT8 Type
- )
-{
- return (BOOLEAN)((Type <= EFI_IFR_TYPE_OTHER) ? TRUE : FALSE);
-}
-
-STATIC
-BOOLEAN
-IsValidNumricFlags (
- IN UINT8 Flags
- )
-{
- if (Flags & ~(EFI_IFR_NUMERIC_SIZE | EFI_IFR_DISPLAY)) {
- return FALSE;
- }
-
- if ((Flags & EFI_IFR_DISPLAY) > EFI_IFR_DISPLAY_UINT_HEX) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-STATIC
-BOOLEAN
-IsValidCheckboxFlags (
- IN UINT8 Flags
- )
-{
- return (BOOLEAN)((Flags <= EFI_IFR_CHECKBOX_DEFAULT_MFG) ? TRUE : FALSE);
-}
-
-EFI_STATUS
-CreateEndOpCode (
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_END End;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (Data->Offset + sizeof (EFI_IFR_END) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- End.Header.Length = (UINT8) sizeof (EFI_IFR_END);
- End.Header.OpCode = EFI_IFR_END_OP;
- End.Header.Scope = 0;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &End, sizeof (EFI_IFR_END));
- Data->Offset += sizeof (EFI_IFR_END);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateDefaultOpCode (
- IN EFI_IFR_TYPE_VALUE *Value,
- IN UINT8 Type,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_DEFAULT Default;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if ((Value == NULL) || !IsValidValueType (Type)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + sizeof (EFI_IFR_DEFAULT) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Default.Header.OpCode = EFI_IFR_DEFAULT_OP;
- Default.Header.Length = (UINT8) sizeof (EFI_IFR_DEFAULT);
- Default.Header.Scope = 0;
- Default.Type = Type;
- Default.DefaultId = EFI_HII_DEFAULT_CLASS_STANDARD;
- EfiCopyMem (&Default.Value, Value, sizeof(EFI_IFR_TYPE_VALUE));
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Default, sizeof (EFI_IFR_DEFAULT));
- Data->Offset += sizeof (EFI_IFR_DEFAULT);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateActionOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN EFI_STRING_ID QuestionConfig,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_ACTION Action;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + sizeof (EFI_IFR_ACTION) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Action.Header.OpCode = EFI_IFR_ACTION_OP;
- Action.Header.Length = (UINT8) sizeof (EFI_IFR_ACTION);
- Action.Header.Scope = 0;
- Action.Question.QuestionId = QuestionId;
- Action.Question.Header.Prompt = Prompt;
- Action.Question.Header.Help = Help;
- Action.Question.VarStoreId = INVALID_VARSTORE_ID;
- Action.Question.Flags = QuestionFlags;
- Action.QuestionConfig = QuestionConfig;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Action, sizeof (EFI_IFR_ACTION));
- Data->Offset += sizeof (EFI_IFR_ACTION);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateSubTitleOpCode (
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 Flags,
- IN UINT8 Scope,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_SUBTITLE Subtitle;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (Data->Offset + sizeof (EFI_IFR_SUBTITLE) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Subtitle.Header.OpCode = EFI_IFR_SUBTITLE_OP;
- Subtitle.Header.Length = (UINT8) sizeof (EFI_IFR_SUBTITLE);
- Subtitle.Header.Scope = Scope;
- Subtitle.Statement.Prompt = Prompt;
- Subtitle.Statement.Help = Help;
- Subtitle.Flags = Flags;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Subtitle, sizeof (EFI_IFR_SUBTITLE));
- Data->Offset += sizeof (EFI_IFR_SUBTITLE);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-CreateTextOpCode (
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN EFI_STRING_ID TextTwo,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_TEXT Text;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (Data->Offset + sizeof (EFI_IFR_TEXT) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Text.Header.OpCode = EFI_IFR_TEXT_OP;
- Text.Header.Length = (UINT8) sizeof (EFI_IFR_TEXT);
- Text.Header.Scope = 0;
- Text.Statement.Prompt = Prompt;
- Text.Statement.Help = Help;
- Text.TextTwo = TextTwo;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Text, sizeof (EFI_IFR_TEXT));
- Data->Offset += sizeof (EFI_IFR_TEXT);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateGotoOpCode (
- IN EFI_FORM_ID FormId,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN EFI_QUESTION_ID QuestionId,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_REF Goto;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + sizeof (EFI_IFR_REF) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Goto.Header.OpCode = EFI_IFR_REF_OP;
- Goto.Header.Length = (UINT8) sizeof (EFI_IFR_REF);
- Goto.Header.Scope = 0;
- Goto.Question.Header.Prompt = Prompt;
- Goto.Question.Header.Help = Help;
- Goto.Question.VarStoreId = INVALID_VARSTORE_ID;
- Goto.Question.QuestionId = QuestionId;
- Goto.Question.Flags = QuestionFlags;
- Goto.FormId = FormId;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Goto, sizeof (EFI_IFR_REF));
- Data->Offset += sizeof (EFI_IFR_REF);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateOneOfOptionOpCode (
- IN UINTN OptionCount,
- IN IFR_OPTION *OptionsList,
- IN UINT8 Type,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- UINTN Index;
- UINT8 *LocalBuffer;
- EFI_IFR_ONE_OF_OPTION OneOfOption;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if ((OptionCount != 0) && (OptionsList == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + OptionCount * sizeof (EFI_IFR_ONE_OF_OPTION) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- for (Index = 0; Index < OptionCount; Index++) {
- OneOfOption.Header.OpCode = EFI_IFR_ONE_OF_OPTION_OP;
- OneOfOption.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF_OPTION);
- OneOfOption.Header.Scope = 0;
-
- OneOfOption.Option = OptionsList[Index].StringToken;
- OneOfOption.Value = OptionsList[Index].Value;
- OneOfOption.Flags = (UINT8)(OptionsList[Index].Flags & (EFI_IFR_OPTION_DEFAULT | EFI_IFR_OPTION_DEFAULT_MFG));
- OneOfOption.Type = Type;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &OneOfOption, sizeof (EFI_IFR_ONE_OF_OPTION));
- Data->Offset += sizeof (EFI_IFR_ONE_OF_OPTION);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateOneOfOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 OneOfFlags,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- UINTN Length;
- EFI_IFR_ONE_OF OneOf;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidNumricFlags (OneOfFlags) ||
- !IsValidQuestionFlags (QuestionFlags) ||
- ((OptionCount != 0) && (OptionsList == NULL))) {
- return EFI_INVALID_PARAMETER;
- }
-
- Length = sizeof (EFI_IFR_ONE_OF) + OptionCount * sizeof (EFI_IFR_ONE_OF_OPTION) + sizeof (EFI_IFR_END);
- if (Data->Offset + Length > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- OneOf.Header.OpCode = EFI_IFR_ONE_OF_OP;
- OneOf.Header.Length = (UINT8) sizeof (EFI_IFR_ONE_OF);
- OneOf.Header.Scope = 1;
- OneOf.Question.Header.Prompt = Prompt;
- OneOf.Question.Header.Help = Help;
- OneOf.Question.QuestionId = QuestionId;
- OneOf.Question.VarStoreId = VarStoreId;
- OneOf.Question.VarStoreInfo.VarOffset = VarOffset;
- OneOf.Question.Flags = QuestionFlags;
- OneOf.Flags = OneOfFlags;
- EfiZeroMem ((VOID *) &OneOf.data, sizeof (MINMAXSTEP_DATA));
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &OneOf, sizeof (EFI_IFR_ONE_OF));
- Data->Offset += sizeof (EFI_IFR_ONE_OF);
-
- CreateOneOfOptionOpCode (OptionCount, OptionsList, (UINT8)(OneOfFlags & EFI_IFR_NUMERIC_SIZE), Data);
-
- CreateEndOpCode (Data);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateOrderedListOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 OrderedListFlags,
- IN UINT8 DataType,
- IN UINT8 MaxContainers,
- IN IFR_OPTION *OptionsList,
- IN UINTN OptionCount,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- UINTN Length;
- EFI_IFR_ORDERED_LIST OrderedList;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags) ||
- ((OptionCount != 0) && (OptionsList == NULL))) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((OrderedListFlags & (~(EFI_IFR_UNIQUE_SET | EFI_IFR_NO_EMPTY_SET))) != 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- Length = sizeof (EFI_IFR_ORDERED_LIST) + OptionCount * sizeof (EFI_IFR_ONE_OF_OPTION) + sizeof (EFI_IFR_END);
- if (Data->Offset + Length > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- OrderedList.Header.OpCode = EFI_IFR_ORDERED_LIST_OP;
- OrderedList.Header.Length = (UINT8) sizeof (EFI_IFR_ORDERED_LIST);
- OrderedList.Header.Scope = 1;
- OrderedList.Question.Header.Prompt = Prompt;
- OrderedList.Question.Header.Help = Help;
- OrderedList.Question.QuestionId = QuestionId;
- OrderedList.Question.VarStoreId = VarStoreId;
- OrderedList.Question.VarStoreInfo.VarOffset = VarOffset;
- OrderedList.Question.Flags = QuestionFlags;
- OrderedList.MaxContainers = MaxContainers;
- OrderedList.Flags = OrderedListFlags;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &OrderedList, sizeof (EFI_IFR_ORDERED_LIST));
- Data->Offset += sizeof (EFI_IFR_ORDERED_LIST);
-
- CreateOneOfOptionOpCode (OptionCount, OptionsList, DataType, Data);
-
- CreateEndOpCode (Data);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateCheckBoxOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 CheckBoxFlags,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_CHECKBOX CheckBox;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags) || !IsValidCheckboxFlags (CheckBoxFlags)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + sizeof (EFI_IFR_CHECKBOX) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- CheckBox.Header.OpCode = EFI_IFR_CHECKBOX_OP;
- CheckBox.Header.Length = (UINT8) sizeof (EFI_IFR_CHECKBOX);
- CheckBox.Header.Scope = 0;
- CheckBox.Question.QuestionId = QuestionId;
- CheckBox.Question.VarStoreId = VarStoreId;
- CheckBox.Question.VarStoreInfo.VarOffset = VarOffset;
- CheckBox.Question.Header.Prompt = Prompt;
- CheckBox.Question.Header.Help = Help;
- CheckBox.Question.Flags = QuestionFlags;
- CheckBox.Flags = CheckBoxFlags;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &CheckBox, sizeof (EFI_IFR_CHECKBOX));
- Data->Offset += sizeof (EFI_IFR_CHECKBOX);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateNumericOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 NumericFlags,
- IN UINT64 Minimum,
- IN UINT64 Maximum,
- IN UINT64 Step,
- IN UINT64 Default,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- UINTN Length;
- EFI_STATUS Status;
- EFI_IFR_NUMERIC Numeric;
- MINMAXSTEP_DATA MinMaxStep;
- EFI_IFR_TYPE_VALUE DefaultValue;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags) || !IsValidNumricFlags (NumericFlags)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Length = sizeof (EFI_IFR_NUMERIC) + sizeof (EFI_IFR_DEFAULT) + sizeof (EFI_IFR_END);
- if (Data->Offset + sizeof (EFI_IFR_CHECKBOX) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Numeric.Header.OpCode = EFI_IFR_NUMERIC_OP;
- Numeric.Header.Length = (UINT8) sizeof (EFI_IFR_NUMERIC);
- Numeric.Header.Scope = 1;
- Numeric.Question.QuestionId = QuestionId;
- Numeric.Question.VarStoreId = VarStoreId;
- Numeric.Question.VarStoreInfo.VarOffset = VarOffset;
- Numeric.Question.Header.Prompt = Prompt;
- Numeric.Question.Header.Help = Help;
- Numeric.Question.Flags = QuestionFlags;
- Numeric.Flags = NumericFlags;
-
- switch (NumericFlags & EFI_IFR_NUMERIC_SIZE) {
- case EFI_IFR_NUMERIC_SIZE_1:
- MinMaxStep.u8.MinValue = (UINT8) Minimum;
- MinMaxStep.u8.MaxValue = (UINT8) Maximum;
- MinMaxStep.u8.Step = (UINT8) Step;
- break;
-
- case EFI_IFR_NUMERIC_SIZE_2:
- MinMaxStep.u16.MinValue = (UINT16) Minimum;
- MinMaxStep.u16.MaxValue = (UINT16) Maximum;
- MinMaxStep.u16.Step = (UINT16) Step;
- break;
-
- case EFI_IFR_NUMERIC_SIZE_4:
- MinMaxStep.u32.MinValue = (UINT32) Minimum;
- MinMaxStep.u32.MaxValue = (UINT32) Maximum;
- MinMaxStep.u32.Step = (UINT32) Step;
- break;
-
- case EFI_IFR_NUMERIC_SIZE_8:
- MinMaxStep.u64.MinValue = Minimum;
- MinMaxStep.u64.MaxValue = Maximum;
- MinMaxStep.u64.Step = Step;
- break;
- }
-
- EfiCopyMem (&Numeric.data, &MinMaxStep, sizeof (MINMAXSTEP_DATA));
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Numeric, sizeof (EFI_IFR_NUMERIC));
- Data->Offset += sizeof (EFI_IFR_NUMERIC);
-
- DefaultValue.u64 = Default;
- Status = CreateDefaultOpCode (&DefaultValue, (UINT8)(NumericFlags & EFI_IFR_NUMERIC_SIZE), Data);
- if (EFI_ERROR(Status)) {
- return Status;
- }
-
- CreateEndOpCode (Data);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateStringOpCode (
- IN EFI_QUESTION_ID QuestionId,
- IN EFI_VARSTORE_ID VarStoreId,
- IN UINT16 VarOffset,
- IN EFI_STRING_ID Prompt,
- IN EFI_STRING_ID Help,
- IN UINT8 QuestionFlags,
- IN UINT8 StringFlags,
- IN UINT8 MinSize,
- IN UINT8 MaxSize,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_STRING String;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (!IsValidQuestionFlags (QuestionFlags) || (StringFlags & (~EFI_IFR_STRING_MULTI_LINE))) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Data->Offset + sizeof (EFI_IFR_STRING) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- String.Header.OpCode = EFI_IFR_STRING_OP;
- String.Header.Length = (UINT8) sizeof (EFI_IFR_STRING);
- String.Header.Scope = 0;
- String.Question.Header.Prompt = Prompt;
- String.Question.Header.Help = Help;
- String.Question.QuestionId = QuestionId;
- String.Question.VarStoreId = VarStoreId;
- String.Question.VarStoreInfo.VarOffset = VarOffset;
- String.Question.Flags = QuestionFlags;
- String.MinSize = MinSize;
- String.MaxSize = MaxSize;
- String.Flags = StringFlags;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &String, sizeof (EFI_IFR_STRING));
- Data->Offset += sizeof (EFI_IFR_STRING);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-CreateBannerOpCode (
- IN EFI_STRING_ID Title,
- IN UINT16 LineNumber,
- IN UINT8 Alignment,
- IN OUT EFI_HII_UPDATE_DATA *Data
- )
-{
- EFI_IFR_GUID_BANNER Banner;
- UINT8 *LocalBuffer;
-
- ASSERT (Data != NULL && Data->Data != NULL);
-
- if (Data->Offset + sizeof (EFI_IFR_GUID_BANNER) > Data->BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- Banner.Header.OpCode = EFI_IFR_GUID_OP;
- Banner.Header.Length = (UINT8) sizeof (EFI_IFR_GUID_BANNER);
- Banner.Header.Scope = 0;
- EfiCopyMem (&Banner.Guid, &mIfrVendorGuid, sizeof (EFI_IFR_GUID));
- Banner.ExtendOpCode = EFI_IFR_EXTEND_OP_BANNER;
- Banner.Title = Title;
- Banner.LineNumber = LineNumber;
- Banner.Alignment = Alignment;
-
- LocalBuffer = (UINT8 *) Data->Data + Data->Offset;
- EfiCopyMem (LocalBuffer, &Banner, sizeof (EFI_IFR_GUID_BANNER));
- Data->Offset += sizeof (EFI_IFR_GUID_BANNER);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
deleted file mode 100644
index ece78bfb44..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
+++ /dev/null
@@ -1,726 +0,0 @@
-/*++
-
-Copyright (c) 2007 - 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.
-
-Module Name:
-
- UefiIfrString.c
-
-Abstract:
-
- Common Library Routines to assist to handle String and Language.
-
---*/
-
-#include "UefiIfrLibrary.h"
-
-//
-// Lookup table of ISO639-2 3 character language codes to ISO 639-1 2 character language codes
-// Each entry is 5 CHAR8 values long. The first 3 CHAR8 values are the ISO 639-2 code.
-// The last 2 CHAR8 values are the ISO 639-1 code.
-//
-CHAR8 Iso639ToRfc3066ConversionTable[] =
-"\
-aaraa\
-abkab\
-afraf\
-amham\
-araar\
-asmas\
-aymay\
-azeaz\
-bakba\
-belbe\
-benbn\
-bihbh\
-bisbi\
-bodbo\
-brebr\
-bulbg\
-catca\
-cescs\
-corkw\
-cosco\
-cymcy\
-danda\
-deude\
-dzodz\
-ellel\
-engen\
-epoeo\
-estet\
-euseu\
-faofo\
-fasfa\
-fijfj\
-finfi\
-frafr\
-fryfy\
-gaiga\
-gdhgd\
-glggl\
-grngn\
-gujgu\
-hauha\
-hebhe\
-hinhi\
-hrvhr\
-hunhu\
-hyehy\
-ikuiu\
-ileie\
-inaia\
-indid\
-ipkik\
-islis\
-itait\
-jawjw\
-jpnja\
-kalkl\
-kankn\
-kasks\
-katka\
-kazkk\
-khmkm\
-kinrw\
-kirky\
-korko\
-kurku\
-laolo\
-latla\
-lavlv\
-linln\
-litlt\
-ltzlb\
-malml\
-marmr\
-mkdmk\
-mlgmg\
-mltmt\
-molmo\
-monmn\
-mrimi\
-msams\
-myamy\
-nauna\
-nepne\
-nldnl\
-norno\
-ocioc\
-ormom\
-panpa\
-polpl\
-porpt\
-pusps\
-quequ\
-rohrm\
-ronro\
-runrn\
-rusru\
-sagsg\
-sansa\
-sinsi\
-slksk\
-slvsl\
-smise\
-smosm\
-snasn\
-sndsd\
-somso\
-sotst\
-spaes\
-sqisq\
-srpsr\
-sswss\
-sunsu\
-swasw\
-swesv\
-tamta\
-tattt\
-telte\
-tgktg\
-tgltl\
-thath\
-tsnts\
-tuktk\
-twitw\
-uigug\
-ukruk\
-urdur\
-uzbuz\
-vievi\
-volvo\
-wolwo\
-xhoxh\
-yidyi\
-zhaza\
-zhozh\
-zulzu\
-";
-
-EFI_STATUS
-ConvertRfc3066LanguageToIso639Language (
- CHAR8 *LanguageRfc3066,
- CHAR8 *LanguageIso639
- )
-/*++
-
-Routine Description:
- Convert language code from RFC3066 to ISO639-2.
-
-Arguments:
- LanguageRfc3066 - RFC3066 language code.
- LanguageIso639 - ISO639-2 language code.
-
-Returns:
- EFI_SUCCESS - Language code converted.
- EFI_NOT_FOUND - Language code not found.
-
---*/
-{
- UINTN Index;
-
- if ((LanguageRfc3066[2] != '-') && (LanguageRfc3066[2] != 0)) {
- EfiCopyMem (LanguageIso639, LanguageRfc3066, 3);
- return EFI_SUCCESS;
- }
-
- for (Index = 0; Iso639ToRfc3066ConversionTable[Index] != 0; Index += 5) {
- if (EfiCompareMem (LanguageRfc3066, &Iso639ToRfc3066ConversionTable[Index + 3], 2) == 0) {
- EfiCopyMem (LanguageIso639, &Iso639ToRfc3066ConversionTable[Index], 3);
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-CHAR8 *
-Rfc3066ToIso639 (
- CHAR8 *SupportedLanguages
- )
-/*++
-
-Routine Description:
- Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will
- be converted to "engfra".
-
-Arguments:
- SupportedLanguages - The RFC3066 language list.
-
-Returns:
- The ISO639-2 language list.
-
---*/
-{
- CHAR8 *Languages;
- CHAR8 *ReturnValue;
- CHAR8 *LangCodes;
- CHAR8 LangRfc3066[RFC_3066_ENTRY_SIZE];
- CHAR8 LangIso639[ISO_639_2_ENTRY_SIZE];
- EFI_STATUS Status;
-
- ReturnValue = EfiLibAllocateZeroPool (EfiAsciiStrSize (SupportedLanguages));
- if (ReturnValue == NULL) {
- return ReturnValue;
- }
-
- Languages = ReturnValue;
- LangCodes = SupportedLanguages;
- while (*LangCodes != 0) {
- GetNextLanguage (&LangCodes, LangRfc3066);
-
- Status = ConvertRfc3066LanguageToIso639Language (LangRfc3066, LangIso639);
- if (!EFI_ERROR (Status)) {
- EfiCopyMem (Languages, LangIso639, 3);
- Languages = Languages + 3;
- }
- }
-
- return ReturnValue;
-}
-
-EFI_STATUS
-GetCurrentLanguage (
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Determine what is the current language setting
-
-Arguments:
- Lang - Pointer of system language
-
-Returns:
- Status code
-
---*/
-{
- EFI_STATUS Status;
- UINTN Size;
-
- //
- // Get current language setting
- //
- Size = RFC_3066_ENTRY_SIZE;
- Status = gRT->GetVariable (
- L"PlatformLang",
- &gEfiGlobalVariableGuid,
- NULL,
- &Size,
- Lang
- );
-
- if (EFI_ERROR (Status)) {
- EfiAsciiStrCpy (Lang, (CHAR8 *) "en-US");
- }
-
- return Status;
-}
-
-VOID
-GetNextLanguage (
- IN OUT CHAR8 **LangCode,
- OUT CHAR8 *Lang
- )
-/*++
-
-Routine Description:
- Get next language from language code list (with separator ';').
-
-Arguments:
- LangCode - On input: point to first language in the list. On output: point to
- next language in the list, or NULL if no more language in the list.
- Lang - The first language in the list.
-
-Returns:
- None.
-
---*/
-{
- UINTN Index;
- CHAR8 *StringPtr;
-
- if (LangCode == NULL || *LangCode == NULL) {
- *Lang = 0;
- return;
- }
-
- Index = 0;
- StringPtr = *LangCode;
- while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
- Index++;
- }
-
- EfiCopyMem (Lang, StringPtr, Index);
- Lang[Index] = 0;
-
- if (StringPtr[Index] == ';') {
- Index++;
- }
- *LangCode = StringPtr + Index;
-}
-
-CHAR8 *
-GetSupportedLanguages (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the list of supported languages, in the format specified
- in UEFI specification Appendix M.
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The supported languages.
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- CHAR8 *LanguageString;
-
- LocateHiiProtocols ();
-
- //
- // Collect current supported Languages for given HII handle
- //
- BufferSize = 0x1000;
- LanguageString = EfiLibAllocatePool (BufferSize);
- Status = gIfrLibHiiString->GetLanguages (gIfrLibHiiString, HiiHandle, LanguageString, &BufferSize);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- gBS->FreePool (LanguageString);
- LanguageString = EfiLibAllocatePool (BufferSize);
- Status = gIfrLibHiiString->GetLanguages (gIfrLibHiiString, HiiHandle, LanguageString, &BufferSize);
- }
-
- if (EFI_ERROR (Status)) {
- LanguageString = NULL;
- }
-
- return LanguageString;
-}
-
-UINT16
-GetSupportedLanguageNumber (
- IN EFI_HII_HANDLE HiiHandle
- )
-/*++
-
-Routine Description:
- This function returns the number of supported languages
-
-Arguments:
- HiiHandle - The HII package list handle.
-
-Returns:
- The number of supported languages.
-
---*/
-{
- CHAR8 *Languages;
- CHAR8 *LanguageString;
- UINT16 LangNumber;
- CHAR8 Lang[RFC_3066_ENTRY_SIZE];
-
- Languages = GetSupportedLanguages (HiiHandle);
- if (Languages == NULL) {
- return 0;
- }
-
- LangNumber = 0;
- LanguageString = Languages;
- while (*LanguageString != 0) {
- GetNextLanguage (&LanguageString, Lang);
- LangNumber++;
- }
- gBS->FreePool (Languages);
-
- return LangNumber;
-}
-
-EFI_STATUS
-GetStringFromHandle (
- IN EFI_HII_HANDLE HiiHandle,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get string specified by StringId form the HiiHandle.
-
-Arguments:
- HiiHandle - The HII handle of package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
- EFI_INVALID_PARAMETER - The String is NULL.
-
---*/
-{
- EFI_STATUS Status;
- UINTN StringSize;
-
- if (String == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- StringSize = IFR_LIB_DEFAULT_STRING_SIZE;
- *String = EfiLibAllocateZeroPool (StringSize);
- if (*String == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = IfrLibGetString (HiiHandle, StringId, *String, &StringSize);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- gBS->FreePool (*String);
- *String = EfiLibAllocateZeroPool (StringSize);
- if (*String == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- Status = IfrLibGetString (HiiHandle, StringId, *String, &StringSize);
- }
-
- return Status;
-}
-
-EFI_STATUS
-GetStringFromToken (
- IN EFI_GUID *ProducerGuid,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING *String
- )
-/*++
-
-Routine Description:
- Get the string given the StringId and String package Producer's Guid.
-
-Arguments:
- ProducerGuid - The Guid of String package list.
- StringId - The String ID.
- String - The output string.
-
-Returns:
- EFI_NOT_FOUND - String is not found.
- EFI_SUCCESS - Operation is successful.
- EFI_OUT_OF_RESOURCES - There is not enought memory in the system.
-
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- UINTN HandleBufferLen;
- EFI_HII_HANDLE *HiiHandleBuffer;
- EFI_GUID Guid;
-
- HiiHandleBuffer = NULL;
- Status = GetHiiHandles (&HandleBufferLen, &HiiHandleBuffer);
- if (EFI_ERROR(Status)) {
- return Status;
- }
- for (Index = 0; Index < (HandleBufferLen / sizeof (EFI_HII_HANDLE)); Index++) {
- Status = ExtractGuidFromHiiHandle (HiiHandleBuffer[Index], &Guid);
- if (EFI_ERROR(Status)) {
- return Status;
- }
- if (EfiCompareGuid (&Guid, ProducerGuid) == TRUE) {
- break;
- }
- }
-
- if (Index >= (HandleBufferLen / sizeof (EFI_HII_HANDLE))) {
- Status = EFI_NOT_FOUND;
- goto Out;
- }
-
- Status = GetStringFromHandle (HiiHandleBuffer[Index], StringId, String);
-
-Out:
- if (HiiHandleBuffer != NULL) {
- gBS->FreePool (HiiHandleBuffer);
- }
- return Status;
-}
-
-EFI_STATUS
-IfrLibNewString (
- IN EFI_HII_HANDLE PackageList,
- OUT EFI_STRING_ID *StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function adds the string into String Package of each language.
-
- Arguments:
- PackageList - Handle of the package list where this string will be added.
- StringId - On return, contains the new strings id, which is unique within PackageList.
- String - Points to the new null-terminated string.
-
- Returns:
- EFI_SUCCESS - The new string was added successfully.
- EFI_NOT_FOUND - The specified PackageList could not be found in database.
- EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources.
- EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL.
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *Languages;
- CHAR8 *LangStrings;
- CHAR8 Lang[RFC_3066_ENTRY_SIZE];
-
- Status = EFI_SUCCESS;
-
- LocateHiiProtocols ();
-
- Languages = GetSupportedLanguages (PackageList);
- if (Languages == NULL) {
- return EFI_NOT_FOUND;
- }
-
- if (StringId == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- *StringId = 0;
-
- LangStrings = Languages;
- while (*LangStrings != 0) {
- GetNextLanguage (&LangStrings, Lang);
-
- if (*StringId == 0) {
- Status = gIfrLibHiiString->NewString (
- gIfrLibHiiString,
- PackageList,
- StringId,
- Lang,
- NULL,
- String,
- NULL
- );
- } else {
- Status = gIfrLibHiiString->SetString (
- gIfrLibHiiString,
- PackageList,
- *StringId,
- Lang,
- String,
- NULL
- );
- }
-
- if (EFI_ERROR (Status)) {
- break;
- }
- }
-
- gBS->FreePool (Languages);
-
- return Status;
-}
-
-EFI_STATUS
-IfrLibGetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- OUT EFI_STRING String,
- IN OUT UINTN *StringSize
- )
-/*++
-
- Routine Description:
- This function try to retrieve string from String package of current language.
- If fail, it try to retrieve string from String package of first language it support.
-
- Arguments:
- PackageList - The package list in the HII database to search for the specified string.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
- StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return,
- points to the length of the string, in bytes.
-
- Returns:
- EFI_SUCCESS - The string was returned successfully.
- EFI_NOT_FOUND - The string specified by StringId is not available.
- EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string.
- EFI_INVALID_PARAMETER - The String or StringSize was NULL.
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *Languages;
- CHAR8 *LangStrings;
- CHAR8 Lang[RFC_3066_ENTRY_SIZE];
- CHAR8 CurrentLang[RFC_3066_ENTRY_SIZE];
-
- LocateHiiProtocols ();
-
- GetCurrentLanguage (CurrentLang);
-
- Status = gIfrLibHiiString->GetString (
- gIfrLibHiiString,
- CurrentLang,
- PackageList,
- StringId,
- String,
- StringSize,
- NULL
- );
-
- if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
- Languages = GetSupportedLanguages (PackageList);
- LangStrings = Languages;
- GetNextLanguage (&LangStrings, Lang);
- gBS->FreePool (Languages);
-
- Status = gIfrLibHiiString->GetString (
- gIfrLibHiiString,
- Lang,
- PackageList,
- StringId,
- String,
- StringSize,
- NULL
- );
- }
-
- return Status;
-}
-
-EFI_STATUS
-IfrLibSetString (
- IN EFI_HII_HANDLE PackageList,
- IN EFI_STRING_ID StringId,
- IN CONST EFI_STRING String
- )
-/*++
-
- Routine Description:
- This function updates the string in String package of each language.
-
- Arguments:
- PackageList - The package list containing the strings.
- StringId - The string's id, which is unique within PackageList.
- String - Points to the new null-terminated string.
-
- Returns:
- EFI_SUCCESS - The string was updated successfully.
- EFI_NOT_FOUND - The string specified by StringId is not in the database.
- EFI_INVALID_PARAMETER - The String was NULL.
- EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
-
---*/
-{
- EFI_STATUS Status;
- CHAR8 *Languages;
- CHAR8 *LangStrings;
- CHAR8 Lang[RFC_3066_ENTRY_SIZE];
-
- Status = EFI_SUCCESS;
-
- LocateHiiProtocols ();
-
- Languages = GetSupportedLanguages (PackageList);
- if (Languages == NULL) {
- return EFI_NOT_FOUND;
- }
-
- LangStrings = Languages;
- while (*LangStrings != 0) {
- GetNextLanguage (&LangStrings, Lang);
-
- Status = gIfrLibHiiString->SetString (
- gIfrLibHiiString,
- PackageList,
- StringId,
- Lang,
- String,
- NULL
- );
- if (EFI_ERROR (Status)) {
- break;
- }
- }
-
- gBS->FreePool (Languages);
-
- return Status;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
deleted file mode 100644
index 58ee6e076a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
+++ /dev/null
@@ -1,751 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueDxeDriverEntryPoint.c
-
-Abstract:
-
- DXE Driver entry point template file
-
---*/
-
-#include "EdkIIGlueDxe.h"
-#include "Common/EdkIIGlueDependencies.h"
-
-//
-// Check definitions in .inf file to determine __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
-//
-// __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
-// 1: only install ComponentName, DriverConfiguration and DriverDiagnostics
-// 2: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2
-// 3: install all including ComponentName, DriverConfiguration, DriverDiagnostics AND
-// ComponentName2, DriverConfiguration2 and DriverDiagnostics2
-// 4: install automatically according to EFI_SPECIFICATION_VERSION:
-// if EFI_SPECIFICATION_VERSION < 0x00020000: only install ComponentName, DriverConfiguration and DriverDiagnostics
-// if EFI_SPECIFICATION_VERSION >= 0x00020000: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2
-//
-#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
-#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
-#endif
-
-#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
-#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
-#endif
-
-#ifdef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
-#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
-#endif
-
-#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)
-#define __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
-#endif
-
-#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)
-#define __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1
-#endif
-
-#if !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 3
-#endif
-
-//
-// To use Auto-Select, it must be:
-// 1. both Protocol and Protocol2 are defined
-// 2. The Protocol and Protocol2 must use same names, for example, gDriverControllerName as __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__ and __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__
-//
-#if defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
-#if !(defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__))
-#error "To use Auto-Select please define both Protocol and Protocol2 instances"
-#endif
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 4
-#endif
-
-#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 4)
-#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2
-#else
-#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1
-#endif
-#endif
-
-#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
-UINT8 _gEdkIIGlueDriverModelProtocolSelection = 1;
-#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
-UINT8 _gEdkIIGlueDriverModelProtocolSelection = 2;
-#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
-UINT8 _gEdkIIGlueDriverModelProtocolSelection = 3;
-#else
-UINT8 _gEdkIIGlueDriverModelProtocolSelection = 0;
-#endif
-
-STATIC EFI_EVENT _mDriverExitBootServicesNotifyEvent;
-
-//
-// Driver Model related definitions.
-// LIMITATION: only support one instance of Driver Model protocols per driver.
-// In case where multiple Driver Model protocols need to be installed in a single driver,
-// manually edit this file and compile/link the modified file with the driver.
-//
-#if defined(__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__)
-extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;
-#endif
-
-#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
-#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__)
-extern EFI_COMPONENT_NAME_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__)
-extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;
-#endif
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)
-extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__;
-#endif
-
-#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
-#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__)
-extern EFI_COMPONENT_NAME2_PROTOCOL __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__;
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__)
-extern EFI_DRIVER_CONFIGURATION2_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__;
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)
-extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__;
-#endif
-#endif
-
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {
- {
-#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
- &__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
- &__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
- &__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
- &__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
- &__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
- &__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
-
-#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
- &__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__,
-#else
- NULL,
-#endif
- }
-};
-
-//
-// NOTE: Limitation:
-// Only one handler for SetVirtualAddressMap Event and ExitBootServices Event each
-//
-
-/*
- * This is the WRONG macro and it's kept only for backward compatibility.
- */
-#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__
-VOID
-EFIAPI
-__EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__ (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-#endif
-
-/*
- * This is the CORRECT macro users should use.
- */
-#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__
-VOID
-EFIAPI
-__EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__ (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-#endif
-
-/*
- * Both __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__ and
- * __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__ are kept here although
- * the former is a WRONG macro. It's kept only for backward compatibility.
- * For a single module, it's not likely that both macros are defined.
- */
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {
-#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__
- __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT__HANDLER__,
-#endif
-
-#ifdef __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__
- __EDKII_GLUE_SET_VIRTUAL_ADDRESS_MAP_EVENT_HANDLER__,
-#endif
-
- NULL
-};
-
-/*
- * This is the WRONG macro and it's kept only for backward compatibility.
- */
-#ifdef __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__
-VOID
-__EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__ (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-#endif
-
-/*
- * This is the CORRECT macro users should use.
- */
-#ifdef __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__
-VOID
-__EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__ (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-#endif
-
-/**
- Set AtRuntime flag as TRUE after ExitBootServices
-
- @param[in] Event The Event that is being processed
- @param[in] Context Event Context
-**/
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-
-/*
- * Both __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__ and
- * __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__ are kept here although
- * the former is a WRONG macro. It's kept only for backward compatibility.
- * For a single module, it's not likely that both macros are defined.
- */
-GLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
- //
- // only Runtime drivers need to link EdkDxeRuntimeDriverLib
- //
- RuntimeDriverExitBootServices,
-#endif
-
-#ifdef __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__
- __EDKII_GLUE_EXTI_BOOT_SERVICES_EVENT__HANDLER__,
-#endif
-
-#ifdef __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__
- __EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__,
-#endif
-
- NULL
-};
-
-
-//
-// Module Unload Handler
-//
-
-#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
-EFI_STATUS
-EFIAPI
-__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (
- EFI_HANDLE ImageHandle
- );
-#endif
-
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- EFI_HANDLE ImageHandle
- )
-{
-#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
- return (__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (ImageHandle));
-#else
- return EFI_SUCCESS;
-#endif
-}
-
-#ifdef __EDKII_GLUE_EFI_CALLER_ID_GUID__
- GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = __EDKII_GLUE_EFI_CALLER_ID_GUID__;
-#endif
-
-//
-// Library constructors
-//
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-//
-// Declare "Status" if any of the following libraries are used
-//
-#if defined(__EDKII_GLUE_DXE_HOB_LIB__) \
- || defined(__EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \
- || defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) \
- || defined(__EDKII_GLUE_DXE_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_DXE_SMBUS_LIB__) \
- || defined(__EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_EDK_DXE_SAL_LIB__) \
- || defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__) \
- || defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- EFI_STATUS Status;
-#endif
-
-//
-// EdkII Glue Library Constructors:
-// NOTE: the constructors must be called according to dependency order
-//
-// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
-// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
-// DxeServicesTableLib DxeServicesTableLibConstructor()
-// DxeIoLibCpuIo IoLibConstructor()
-// DxeSalLib DxeSalLibConstructor(), IPF only
-// EdkDxeRuntimeDriverLib RuntimeDriverLibConstruct()
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
-// UefiDriverModelLib UefiDriverModelLibConstructor()
-// DxeHobLib HobLibConstructor()
-// DxeSmbusLib SmbusLibConstructor()
-//
-
-#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
- Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- Status = IoLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
- Status = DxeSalLibConstructor(ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
- Status = RuntimeDriverLibConstruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
- Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
- Status = UefiDriverModelLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_HOB_LIB__
- Status = HobLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
- Status = SmbusLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-}
-
-//
-// Library Destructors
-//
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-#if defined (__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \
- || defined (__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) \
- || defined (__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- EFI_STATUS Status;
-#endif
-
-//
-// NOTE: the destructors must be called according to dependency order
-//
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
- Status = UefiDriverModelLibDestructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
- Status = ReportStatusCodeLibDestruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
- Status = RuntimeDriverLibDeconstruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-}
-
-
-/**
- Unload function that is registered in the LoadImage protocol. It un-installs
- protocols produced and deallocates pool used by the driver. Called by the core
- when unloading the driver.
-
- @param ImageHandle
-
- @retval EFI_SUCCESS
-
-**/
-EFI_STATUS
-EFIAPI
-_DriverUnloadHandler (
- EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
-
- //
- // If an UnloadImage() handler is specified, then call it
- //
- Status = ProcessModuleUnloadList (ImageHandle);
-
- //
- // If the driver specific unload handler does not return an error, then call all of the
- // library destructors. If the unload handler returned an error, then the driver can not be
- // unloaded, and the library destructors should not be called
- //
- if (!EFI_ERROR (Status)) {
- //
- // Close our ExitBootServices () notify function
- //
-
-#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__
- if (_gDriverExitBootServicesEvent[0] != NULL) {
- ASSERT (gBS != NULL);
- Status = gBS->CloseEvent (_mDriverExitBootServicesNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-#endif
-
- ProcessLibraryDestructorList (ImageHandle, gST);
- }
-
- //
- // Return the status from the driver specific unload handler
- //
- return Status;
-}
-
-VOID
-EFIAPI
-_DriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Set AtRuntime flag as TRUE after ExitBootServices
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
-#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
- UINTN Index;
-
- for (Index = 0; _gDriverExitBootServicesEvent[Index] != NULL; Index++) {
- ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];
- ChildNotifyEventHandler (Event, NULL);
- }
-#endif
-}
-
-EFI_DRIVER_ENTRY_POINT (_ModuleEntryPoint);
-
-//
-// Module Entry Point
-//
-#ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
-EFI_STATUS
-EFIAPI
-__EDKII_GLUE_MODULE_ENTRY_POINT__ (
- EFI_HANDLE ImageHandle,
- EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-/**
- Enrty point to DXE Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
-// if (_gUefiDriverRevision != 0) {
-// //
-// // Make sure that the EFI/UEFI spec revision of the platform is >= EFI/UEFI spec revision of the driver
-// //
-// if (SystemTable->Hdr.Revision < _gUefiDriverRevision) {
-// return EFI_INCOMPATIBLE_VERSION;
-// }
-// }
-
-// DEBUG ((EFI_D_ERROR, "EdkII Glue Driver Entry - 0\n"));
-
- //
- // Call constructor for all libraries
- //
- ProcessLibraryConstructorList (ImageHandle, SystemTable);
-
- //
- // Register our ExitBootServices () notify function
- //
-#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__
- if (_gDriverExitBootServicesEvent[0] != NULL) {
- Status = SystemTable->BootServices->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- _DriverExitBootServices,
- NULL,
- &_mDriverExitBootServicesNotifyEvent
- );
-
- ASSERT_EFI_ERROR (Status);
- }
-#endif
-
- //
- // Install unload handler...
- //
- //
- // Add conditional macro to save size. The 4 macros check against
- // potential functions which may be invoked, if there is no function
- // to be called, we don't register Unload callback.
- //
-#if ( defined(__EDKII_GLUE_MODULE_UNLOAD_HANDLER__) \
- || defined(__EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__) \
- || defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) ) \
- || __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__
-
- do {
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
-
- Status = SystemTable->BootServices->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- LoadedImage->Unload = _DriverUnloadHandler;
- } while(0);
-
-#endif
-
- //
- // Call the driver entry point
- //
- #ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
- Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
- #else
- Status = EFI_SUCCESS;
- #endif
-
- //
- // If all of the drivers returned errors, then invoke all of the library destructors
- //
- if (EFI_ERROR (Status)) {
- //
- // Close our ExitBootServices () notify function
- //
-#if __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__
- if (_gDriverExitBootServicesEvent[0] != NULL) {
- EFI_STATUS CloseEventStatus;
- CloseEventStatus = SystemTable->BootServices->CloseEvent (_mDriverExitBootServicesNotifyEvent);
- ASSERT_EFI_ERROR (CloseEventStatus);
- }
-#endif
-
- ProcessLibraryDestructorList (ImageHandle, SystemTable);
- }
-
- //
- // Return the cummalative return status code from all of the driver entry points
- //
- return Status;
-}
-
-
-/**
- Enrty point wrapper of DXE Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
- EBC build envrionment has /D $(IMAGE_ENTRY_POINT)=EfiMain which overrides what GlueLib
- defines: /D IMAGE_ENTRY_POINT=_ModuleEntryPoint, so _ModuleEntryPoint will be replaced with
- EfiMain thus the function below isn't needed in EBC envrionment.
-
-**/
-#ifndef MDE_CPU_EBC
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return _ModuleEntryPoint (ImageHandle, SystemTable);
-}
-#endif
-
-//
-// Guids not present in EDK code base
-//
-
-//
-// Protocol/Arch Protocol GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverConfigurationProtocolGuid = { 0xbfd7dc1d, 0x24f1, 0x40d9, { 0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverDiagnosticsProtocolGuid = { 0x4d330321, 0x025f, 0x4aac, { 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpProtocolGuid = { 0xf4b427bb, 0xba21, 0x4f16, { 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpServiceBindingProtocolGuid = { 0xf44c00ee, 0x1f2c, 0x4a00, { 0xaa, 0x09, 0x1c, 0x9f, 0x3e, 0x08, 0x00, 0xa3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ProtocolGuid = { 0x8a219718, 0x4ef5, 0x4761, { 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid = { 0x9d9a39d8, 0xbd42, 0x4a73, { 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ProtocolGuid = { 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ServiceBindingProtocolGuid = { 0xc51711e7, 0xb4bf, 0x404a, { 0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ConfigProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid = { 0xf36ff770, 0xa7e1, 0x42cf, { 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid = { 0x2FE800BE, 0x8F01, 0x4aa6, { 0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ProtocolGuid = { 0x65530BC7, 0xA359, 0x410f, { 0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ServiceBindingProtocolGuid = { 0x00720665, 0x67EB, 0x4a99, { 0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ServiceBindingProtocolGuid = { 0x83f01464, 0x99bd, 0x45e5, { 0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationInfoProtocolGuid = { 0x7671d9d0, 0x53db, 0x4173, { 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathFromTextProtocolGuid = { 0x5c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathToTextProtocolGuid = { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x379be4e, 0xd706, 0x437d, { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashProtocolGuid = { 0xc5184932, 0xdba5, 0x46db, { 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashServiceBindingProtocolGuid = { 0x42881c98, 0xa4f3, 0x44b0, { 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIScsiInitiatorNameProtocolGuid = { 0xa6a72875, 0x2962, 0x4c18, { 0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe, 0x00 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiExtScsiPassThruProtocolGuid = { 0x1d3de7f0, 0x0807, 0x424f, { 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTapeIoProtocolGuid = { 0x1e93e633, 0xd65a, 0x459e, { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } };
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUsb2HcProtocolGuid = { 0x3e745226, 0x9818, 0x45b6, { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } };
-#endif
-
-//
-// PPI GUID globals
-//
-
-//
-// GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocBspStoreGuid = { 0x564b33cd, 0xc92a, 0x4593, { 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocStackGuid = { 0x4ed4bf27, 0x4092, 0x42e9, { 0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x00, 0xc9, 0xbd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocModuleGuid = { 0xf8e21975, 0x0899, 0x4f58, { 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapRadiusGuid = { 0xd6062b50, 0x15ca, 0x11da, { 0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapLocalGuid = { 0xc280c73e, 0x15ca, 0x11da, { 0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, { 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, { 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, { 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, { 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, { 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, { 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gBootObjectAuthorizationParmsetGuid = { 0xedd35e31, 0x7b9, 0x11d2, { 0x83, 0xa3, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gSmmCommunicateHeaderGuid = { 0xf328e36c, 0x23b6, 0x4a95, { 0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCapsuleGuid = { 0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiConfigFileNameGuid = { 0x98B8D59B, 0xE8BA, 0x48EE, { 0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } };
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGluePeimEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGluePeimEntryPoint.c
deleted file mode 100644
index 1144cc00cb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGluePeimEntryPoint.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGluePeimEntryPoint.c
-
-Abstract:
-
- PEIM entry point template file
-
---*/
-
-#include "EdkIIGluePeim.h"
-#include "Common/EdkIIGlueDependencies.h"
-
-
-#ifdef __EDKII_GLUE_EFI_CALLER_ID_GUID__
- GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = __EDKII_GLUE_EFI_CALLER_ID_GUID__;
-#endif
-
-//
-// Library constructors
-//
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
-//
-// EdkII Glue Library Constructors:
-// PeiServicesTablePointerLib PeiServicesTablePointerLibConstructor()
-// PeiServicesTablePointerLibMm7 PeiServicesTablePointerLibConstructor()
-// PeiServicesTablePointerLibKr1 PeiServicesTablePointerLibConstructor()
-//
-
-#if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__) \
- || defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__) \
- || defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__)
- EFI_STATUS Status;
-
- Status = PeiServicesTablePointerLibConstructor (FfsHeader, PeiServices);
- ASSERT_EFI_ERROR (Status);
-#endif
-}
-
-EFI_PEIM_ENTRY_POINT (_ModuleEntryPoint);
-
-EFI_STATUS
-EFIAPI
-__EDKII_GLUE_MODULE_ENTRY_POINT__ (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-/**
- Image entry point of Peim.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @return Status returned by entry points of Peims.
-
---*/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
-// if (_gPeimRevision != 0) {
-// //
-// // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver
-// //
-// ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision);
-// }
-
- //
- // Call constructor for all libraries
- //
- ProcessLibraryConstructorList (FfsHeader, PeiServices);
-
- //
- // Call the driver entry point
- //
- return __EDKII_GLUE_MODULE_ENTRY_POINT__ (FfsHeader, PeiServices);
-}
-
-
-/**
- Wrapper of Peim image entry point.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @return Status returned by entry points of Peims.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
- return _ModuleEntryPoint (FfsHeader, PeiServices);
-}
-
-//
-// Guids not present in EDK code base
-//
-
-//
-// Protocol/Arch Protocol GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverConfigurationProtocolGuid = { 0xbfd7dc1d, 0x24f1, 0x40d9, { 0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverDiagnosticsProtocolGuid = { 0x4d330321, 0x025f, 0x4aac, { 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpProtocolGuid = { 0xf4b427bb, 0xba21, 0x4f16, { 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpServiceBindingProtocolGuid = { 0xf44c00ee, 0x1f2c, 0x4a00, { 0xaa, 0x09, 0x1c, 0x9f, 0x3e, 0x08, 0x00, 0xa3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ProtocolGuid = { 0x8a219718, 0x4ef5, 0x4761, { 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid = { 0x9d9a39d8, 0xbd42, 0x4a73, { 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ProtocolGuid = { 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ServiceBindingProtocolGuid = { 0xc51711e7, 0xb4bf, 0x404a, { 0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ConfigProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid = { 0xf36ff770, 0xa7e1, 0x42cf, { 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid = { 0x2FE800BE, 0x8F01, 0x4aa6, { 0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ProtocolGuid = { 0x65530BC7, 0xA359, 0x410f, { 0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ServiceBindingProtocolGuid = { 0x00720665, 0x67EB, 0x4a99, { 0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ServiceBindingProtocolGuid = { 0x83f01464, 0x99bd, 0x45e5, { 0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationInfoProtocolGuid = { 0x7671d9d0, 0x53db, 0x4173, { 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathFromTextProtocolGuid = { 0x5c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathToTextProtocolGuid = { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x379be4e, 0xd706, 0x437d, { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashProtocolGuid = { 0xc5184932, 0xdba5, 0x46db, { 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashServiceBindingProtocolGuid = { 0x42881c98, 0xa4f3, 0x44b0, { 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIScsiInitiatorNameProtocolGuid = { 0xa6a72875, 0x2962, 0x4c18, { 0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe, 0x00 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiExtScsiPassThruProtocolGuid = { 0x1d3de7f0, 0x0807, 0x424f, { 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTapeIoProtocolGuid = { 0x1e93e633, 0xd65a, 0x459e, { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUsb2HcProtocolGuid = { 0x3e745226, 0x9818, 0x45b6, { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } };
-
-//
-// PPI GUID globals
-//
-
-//
-// GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocBspStoreGuid = { 0x564b33cd, 0xc92a, 0x4593, { 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocStackGuid = { 0x4ed4bf27, 0x4092, 0x42e9, { 0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x00, 0xc9, 0xbd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocModuleGuid = { 0xf8e21975, 0x0899, 0x4f58, { 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapRadiusGuid = { 0xd6062b50, 0x15ca, 0x11da, { 0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapLocalGuid = { 0xc280c73e, 0x15ca, 0x11da, { 0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, { 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, { 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, { 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, { 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, { 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, { 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gBootObjectAuthorizationParmsetGuid = { 0xedd35e31, 0x7b9, 0x11d2, { 0x83, 0xa3, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gSmmCommunicateHeaderGuid = { 0xf328e36c, 0x23b6, 0x4a95, { 0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCapsuleGuid = { 0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiConfigFileNameGuid = { 0x98B8D59B, 0xE8BA, 0x48EE, { 0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } };
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
deleted file mode 100644
index 781eb860f7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
+++ /dev/null
@@ -1,496 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueSmmDriverEntryPoint.c
-
-Abstract:
-
- Smm Driver entry point template file
-
---*/
-
-#include "EdkIIGlueDxe.h"
-#include "Common/EdkIIGlueDependencies.h"
-
-
-//
-// Module Unload Handler
-//
-#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
-EFI_STATUS
-EFIAPI
-__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (
- EFI_HANDLE ImageHandle
- );
-#endif
-
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- EFI_HANDLE ImageHandle
- )
-{
-#ifdef __EDKII_GLUE_MODULE_UNLOAD_HANDLER__
- return (__EDKII_GLUE_MODULE_UNLOAD_HANDLER__ (ImageHandle));
-#else
- return EFI_SUCCESS;
-#endif
-}
-
-#ifdef __EDKII_GLUE_EFI_CALLER_ID_GUID__
- GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = __EDKII_GLUE_EFI_CALLER_ID_GUID__;
-#endif
-
-//
-// Library constructors
-//
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-//
-// Declare "Status" if any of the following libraries are used
-//
-#if defined(__EDKII_GLUE_DXE_HOB_LIB__) \
- || defined(__EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_DXE_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_DXE_SMBUS_LIB__) \
- || defined(__EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__) \
- || defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__) \
- || defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- EFI_STATUS Status;
-#endif
-
-//
-// EdkII Glue Library Constructors:
-// NOTE: the constructors must be called according to dependency order
-// NOTE: compared with EdkIIGlueDxeDriverEntryPoint.c, the EdkDxeRuntimeDriverLib
-// and the UefiDriverModelLib are not applicable for SMM Drivers so not listed
-// here
-//
-// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
-// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
-// DxeServicesTableLib DxeServicesTableLibConstructor()
-// DxeIoLibCpuIo IoLibConstructor
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
-// DxeHobLib HobLibConstructor()
-// DxeSmbusLib SmbusLibConstructor()
-
-#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
- Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- Status = IoLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
- Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_HOB_LIB__
- Status = HobLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
- Status = SmbusLibConstructor (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-}
-
-//
-// Library destructors
-//
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
-#if defined (__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- EFI_STATUS Status;
-#endif
-
-//
-// NOTE: the destructors must be called according to dependency order
-//
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
- Status = ReportStatusCodeLibDestruct (ImageHandle, SystemTable);
- ASSERT_EFI_ERROR (Status);
-#endif
-}
-
-EFI_BOOT_SERVICES *mBS;
-
-/**
- This function returns the size, in bytes,
- of the device path data structure specified by DevicePath.
- If DevicePath is NULL, then 0 is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @return The size of a device path in bytes.
-
-**/
-STATIC
-UINTN
-EFIAPI
-SmmGetDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Start;
-
- if (DevicePath == NULL) {
- return 0;
- }
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Compute the size and add back in the size of the end device path structure
- //
- return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
-}
-
-/**
- This function appends the device path SecondDevicePath
- to every device path instance in FirstDevicePath.
-
- @param FirstDevicePath A pointer to a device path data structure.
-
- @param SecondDevicePath A pointer to a device path data structure.
-
- @return A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath
- if they are no longer needed.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-SmmAppendDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
- )
-{
- EFI_STATUS Status;
- UINTN Size;
- UINTN Size1;
- UINTN Size2;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath2;
-
- ASSERT (FirstDevicePath != NULL && SecondDevicePath != NULL);
-
- //
- // Allocate space for the combined device path. It only has one end node of
- // length EFI_DEVICE_PATH_PROTOCOL
- //
- Size1 = SmmGetDevicePathSize (FirstDevicePath);
- Size2 = SmmGetDevicePathSize (SecondDevicePath);
- Size = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL);
-
- Status = (mBS->AllocatePool) (EfiBootServicesData, Size, (VOID **) &NewDevicePath);
-
- if (EFI_SUCCESS == Status) {
- (mBS->CopyMem) ((VOID *) NewDevicePath, (VOID *) FirstDevicePath, Size1);
- //
- // Over write Src1 EndNode and do the copy
- //
- DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));
- (mBS->CopyMem) ((VOID *) DevicePath2, (VOID *) SecondDevicePath, Size2);
- }
-
- return NewDevicePath;
-}
-
-/**
- Unload function that is registered in the LoadImage protocol. It un-installs
- protocols produced and deallocates pool used by the driver. Called by the core
- when unloading the driver.
-
- @param ImageHandle ImageHandle of the unloaded driver
-
- @return Status of the ProcessModuleUnloadList.
-
-**/
-EFI_STATUS
-EFIAPI
-_DriverUnloadHandler (
- EFI_HANDLE ImageHandle
- )
-{
- EFI_STATUS Status;
-
- //
- // Call the unload handlers for all the modules
- //
- Status = ProcessModuleUnloadList (ImageHandle);
-
- //
- // If the driver specific unload handler does not return an error, then call all of the
- // library destructors. If the unload handler returned an error, then the driver can not be
- // unloaded, and the library destructors should not be called
- //
- if (!EFI_ERROR (Status)) {
- //
- // NOTE: To allow passing in gST here, any library instance having a destructor
- // must depend on EfiDriverLib
- //
- }
-
- //
- // Return the status from the driver specific unload handler
- //
- return Status;
-}
-
-EFI_DRIVER_ENTRY_POINT (_ModuleEntryPoint);
-
-//
-// Module Entry Point
-//
-#ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
-EFI_STATUS
-EFIAPI
-__EDKII_GLUE_MODULE_ENTRY_POINT__ (
- EFI_HANDLE ImageHandle,
- EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-/**
- Enrty point to DXE SMM Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_SMM_BASE_PROTOCOL *SmmBase;
- BOOLEAN InSmm;
- EFI_DEVICE_PATH_PROTOCOL *CompleteFilePath;
- EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
- EFI_HANDLE Handle;
-
- //
- // Cache a pointer to the Boot Services Table
- //
- mBS = SystemTable->BootServices;
-
- //
- // Initialize gBS as ASSERT needs it
- // Both DxeReportStatusCodeLib and SmmRuntimeDxeReportStatusCodeLib implementations
- // Can handle this cleanly before lib constructors are called.
- //
- gBS = mBS;
-
- //
- // Retrieve the Loaded Image Protocol
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID*)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Retrieve SMM Base Protocol
- //
- Status = mBS->LocateProtocol (
- &gEfiSmmBaseProtocolGuid,
- NULL,
- (VOID **) &SmmBase
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Check to see if we are already in SMM
- //
- SmmBase->InSmm (SmmBase, &InSmm);
-
- //
- //
- //
- if (!InSmm) {
- //
- // Retrieve the Device Path Protocol from the DeviceHandle tha this driver was loaded from
- //
- Status = mBS->HandleProtocol (
- LoadedImage->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
- (VOID*)&ImageDevicePath
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Build the full device path to the currently execuing image
- //
- CompleteFilePath = SmmAppendDevicePath (ImageDevicePath, LoadedImage->FilePath);
-
- //
- // Load the image in memory to SMRAM; it will automatically generate the
- // SMI.
- //
- Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
- ASSERT_EFI_ERROR (Status);
- return Status;
- }
-
- //
- // Call constructor for all libraries
- //
- ProcessLibraryConstructorList (ImageHandle, SystemTable);
-
- //
- // Install the unload handler
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- LoadedImage->Unload = _DriverUnloadHandler;
-
- //
- // Call the list of driver entry points
- //
- #ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
- Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
- #else
- Status = EFI_SUCCESS;
- #endif
-
- if (EFI_ERROR (Status)) {
- ProcessLibraryDestructorList (ImageHandle, SystemTable);
- }
-
- return Status;
-}
-
-/**
- Enrty point wrapper of DXE SMM Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return _ModuleEntryPoint (ImageHandle, SystemTable);
-}
-
-//
-// Guids not present in EDK code base
-//
-
-//
-// Protocol/Arch Protocol GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverConfigurationProtocolGuid = { 0xbfd7dc1d, 0x24f1, 0x40d9, { 0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gUefiDriverDiagnosticsProtocolGuid = { 0x4d330321, 0x025f, 0x4aac, { 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpProtocolGuid = { 0xf4b427bb, 0xba21, 0x4f16, { 0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiArpServiceBindingProtocolGuid = { 0xf44c00ee, 0x1f2c, 0x4a00, { 0xaa, 0x09, 0x1c, 0x9f, 0x3e, 0x08, 0x00, 0xa3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ProtocolGuid = { 0x8a219718, 0x4ef5, 0x4761, { 0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid = { 0x9d9a39d8, 0xbd42, 0x4a73, { 0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ProtocolGuid = { 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ServiceBindingProtocolGuid = { 0xc51711e7, 0xb4bf, 0x404a, { 0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIp4ConfigProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkProtocolGuid = { 0x3b95aa31, 0x3793, 0x434b, { 0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid = { 0xf36ff770, 0xa7e1, 0x42cf, { 0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid = { 0x2FE800BE, 0x8F01, 0x4aa6, { 0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ProtocolGuid = { 0x65530BC7, 0xA359, 0x410f, { 0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTcp4ServiceBindingProtocolGuid = { 0x00720665, 0x67EB, 0x4a99, { 0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ProtocolGuid = { 0x3ad9df29, 0x4501, 0x478d, { 0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUdp4ServiceBindingProtocolGuid = { 0x83f01464, 0x99bd, 0x45e5, { 0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationInfoProtocolGuid = { 0x7671d9d0, 0x53db, 0x4173, { 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathFromTextProtocolGuid = { 0x5c99a21, 0xc70f, 0x4ad2, { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathToTextProtocolGuid = { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x379be4e, 0xd706, 0x437d, { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashProtocolGuid = { 0xc5184932, 0xdba5, 0x46db, { 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashServiceBindingProtocolGuid = { 0x42881c98, 0xa4f3, 0x44b0, { 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiIScsiInitiatorNameProtocolGuid = { 0xa6a72875, 0x2962, 0x4c18, { 0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe, 0x00 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiExtScsiPassThruProtocolGuid = { 0x1d3de7f0, 0x0807, 0x424f, { 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiTapeIoProtocolGuid = { 0x1e93e633, 0xd65a, 0x459e, { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiUsb2HcProtocolGuid = { 0x3e745226, 0x9818, 0x45b6, { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } };
-
-//
-// PPI GUID globals
-//
-
-//
-// GUID globals
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocBspStoreGuid = { 0x564b33cd, 0xc92a, 0x4593, { 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocStackGuid = { 0x4ed4bf27, 0x4092, 0x42e9, { 0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x00, 0xc9, 0xbd } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHobMemoryAllocModuleGuid = { 0xf8e21975, 0x0899, 0x4f58, { 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapRadiusGuid = { 0xd6062b50, 0x15ca, 0x11da, { 0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiAuthenticationChapLocalGuid = { 0xc280c73e, 0x15ca, 0x11da, { 0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha1Guid = { 0x2ae9d80f, 0x3fb2, 0x4095, { 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha224Guid = { 0x8df01a06, 0x9bd5, 0x4bf7, { 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha256Guid = { 0x51aa59de, 0xfdf2, 0x4ea3, { 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha384Guid = { 0xefa96432, 0xde33, 0x4dd2, { 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmSha512Guid = { 0xcaa4381e, 0x750c, 0x4770, { 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiHashAlgorithmMD5Guid = { 0xaf7c79c, 0x65b5, 0x4319, { 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gBootObjectAuthorizationParmsetGuid = { 0xedd35e31, 0x7b9, 0x11d2, { 0x83, 0xa3, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gSmmCommunicateHeaderGuid = { 0xf328e36c, 0x23b6, 0x4a95, { 0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCapsuleGuid = { 0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } };
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiConfigFileNameGuid = { 0x98B8D59B, 0xE8BA, 0x48EE, { 0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } };
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/AutoGen.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/AutoGen.h
deleted file mode 100644
index 93dca90174..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/AutoGen.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- AutoGen.h
-
-Abstract:
-
- This file is supposed to be used by a .dxe file. To write common .dxs file for EDK
- and EDKII, a header file named AutoGen.h musted be present. In EDK-GlueLib code base,
- this AutoGen.h plays the role as the AutoGen.h in EDKII. Here the AutoGen.h isn't auto-generated
- by any tool.
-
---*/
-
-#ifndef __EDKII_GLUELIB_AUTOGEN_H__
-#define __EDKII_GLUELIB_AUTOGEN_H__
-
-
-//
-// Explanation:
-// BUILD_WITH_GLUELIB was used at the very beginning of EdkIIGlueLib development and
-// BUILD_WITH_EDKII_GLUE_LIB was introduced later with newer EDK. The old one, BUILD_WITH_GLUELIB,
-// is remained here only to keep source level compatibility with modules which already use it.
-//
-// Both macros are of same effect: to indicate a module it's using EdkIIGlueLib. For newly created
-// modules, BUILD_WITH_EDKII_GLUE_LIB is recommended to use.
-//
-// The macros can be used in .dxs files and source files.
-//
-
-#ifndef BUILD_WITH_EDKII_GLUE_LIB
- #define BUILD_WITH_EDKII_GLUE_LIB
-#endif
-
-#ifndef BUILD_WITH_GLUELIB
- #define BUILD_WITH_GLUELIB
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueBaseTypes.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueBaseTypes.h
deleted file mode 100644
index 32949bcdf1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueBaseTypes.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueBaseTypes.h
-
-Abstract:
-
- Defines additional data types for use by Base modules
-
---*/
-
-#ifndef __EDKII_GLUE_BASE_TYPES_H__
-#define __EDKII_GLUE_BASE_TYPES_H__
-
-#include "../EdkIIGlueConfig.h"
-
-#define BREAKPOINT EFI_BREAKPOINT
-#define DEADLOOP EFI_DEADLOOP
-
-#define MAX_BIT EFI_MAX_BIT
-#define MAX_ADDRESS EFI_MAX_ADDRESS
-
-#ifndef UINT8_MAX
- #define UINT8_MAX 0xff
-#endif
-
-//
-// EFI Error Codes common to all execution phases
-//
-
-typedef INTN RETURN_STATUS;
-
-///
-/// Set the upper bit to indicate EFI Error.
-///
-#define ENCODE_ERROR(a) (MAX_BIT | (a))
-
-#define ENCODE_WARNING(a) (a)
-#define RETURN_ERROR(a) ((a) < 0)
-
-#define RETURN_SUCCESS 0
-#define RETURN_LOAD_ERROR ENCODE_ERROR (1)
-#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2)
-#define RETURN_UNSUPPORTED ENCODE_ERROR (3)
-#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4)
-#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5)
-#define RETURN_NOT_READY ENCODE_ERROR (6)
-#define RETURN_DEVICE_ERROR ENCODE_ERROR (7)
-#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8)
-#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9)
-#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10)
-#define RETURN_VOLUME_FULL ENCODE_ERROR (11)
-#define RETURN_NO_MEDIA ENCODE_ERROR (12)
-#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13)
-#define RETURN_NOT_FOUND ENCODE_ERROR (14)
-#define RETURN_ACCESS_DENIED ENCODE_ERROR (15)
-#define RETURN_NO_RESPONSE ENCODE_ERROR (16)
-#define RETURN_NO_MAPPING ENCODE_ERROR (17)
-#define RETURN_TIMEOUT ENCODE_ERROR (18)
-#define RETURN_NOT_STARTED ENCODE_ERROR (19)
-#define RETURN_ALREADY_STARTED ENCODE_ERROR (20)
-#define RETURN_ABORTED ENCODE_ERROR (21)
-#define RETURN_ICMP_ERROR ENCODE_ERROR (22)
-#define RETURN_TFTP_ERROR ENCODE_ERROR (23)
-#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24)
-#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25)
-#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26)
-#define RETURN_CRC_ERROR ENCODE_ERROR (27)
-#define RETURN_END_OF_MEDIA ENCODE_ERROR (28)
-#define RETURN_END_OF_FILE ENCODE_ERROR (31)
-
-#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1)
-#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2)
-#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)
-#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
-
-typedef UINT64 PHYSICAL_ADDRESS;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h
deleted file mode 100644
index e303d5f4f9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesBase.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueDefinitionChangesBase.h
-
-Abstract:
-
- Data structure definition changes from EDK to EDKII
-
---*/
-
-#ifndef __EDKII_GLUE_DEFINITION_CHANGES_BASE_H__
-#define __EDKII_GLUE_DEFINITION_CHANGES_BASE_H__
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include "TianoHii.h"
-#else
-#include "EfiInternalFormRepresentation.h"
-#endif
-#include "EfiPxe.h"
-
-
-// ----------------------------------------------------------------------------------
-// Data Hub Record GUID Name changes
-// ----------------------------------------------------------------------------------
-#define gEfiProcessorSubClassGuid gProcessorSubClassName
-#define gEfiCacheSubClassGuid gCacheSubClassName
-#define gEfiMiscSubClassGuid gMiscSubClassName
-#define gEfiProcessorProducerGuid gProcessorProducerGuid
-#define gEfiMemoryProducerGuid gMemoryProducerGuid
-#define gEfiMiscProducerGuid gMiscProducerGuid
-
-
-// ----------------------------------------------------------------------------------
-// Hob.h: Get the data and data size field of GUID
-// ----------------------------------------------------------------------------------
-#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
-#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
-
-// ----------------------------------------------------------------------------------
-// InternalFormRepresentation.h:
-// ----------------------------------------------------------------------------------
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-typedef struct {
- EFI_IFR_OP_HEADER Header;
- UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
- UINT8 Width; // The Size of the Data being saved
- STRING_REF Prompt; // The String Token for the Prompt
- STRING_REF Help; // The string Token for the context-help
- UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely
- UINT16 Key; // Value to be passed to caller to identify this particular op-code
-} EFI_IFR_CHECKBOX;
-
-typedef struct {
- EFI_IFR_OP_HEADER Header;
- UINT8 Flags;
-} EFI_IFR_GRAY_OUT;
-
-typedef struct {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_END_EXPR;
-#endif
-
-// ------------------------
-// define GUID as EFI_GUID
-// ------------------------
-typedef EFI_GUID GUID;
-
-
-// -------------------
-// EdkII Names - Edk Names
-// -------------------
-#define EFI_GLOBAL_VARIABLE EFI_GLOBAL_VARIABLE_GUID
-#define MPS_TABLE_GUID EFI_MPS_TABLE_GUID
-#define SAL_SYSTEM_TABLE_GUID EFI_SAL_SYSTEM_TABLE_GUID
-#define SMBIOS_TABLE_GUID EFI_SMBIOS_TABLE_GUID
-#define EFI_OPTIONAL_PTR EFI_OPTIONAL_POINTER
-#define PXE_FRAME_TYPE_FILTERED_MULTICAST PXE_FRAME_TYPE_MULTICAST
-#define IMAGE_FILE_MACHINE_I386 EFI_IMAGE_MACHINE_IA32
-#define IMAGE_FILE_MACHINE_IA64 EFI_IMAGE_MACHINE_IA64
-#define IMAGE_FILE_MACHINE_EBC EFI_IMAGE_MACHINE_EBC
-#define IMAGE_FILE_MACHINE_X64 EFI_IMAGE_MACHINE_X64
-#define EVENT_TIMER EFI_EVENT_TIMER
-#define EVENT_RUNTIME EFI_EVENT_RUNTIME
-#define EVENT_RUNTIME_CONTEXT EFI_EVENT_RUNTIME_CONTEXT
-#define EVENT_NOTIFY_WAIT EFI_EVENT_NOTIFY_WAIT
-#define EVENT_NOTIFY_SIGNAL EFI_EVENT_NOTIFY_SIGNAL
-#define EVENT_SIGNAL_EXIT_BOOT_SERVICES EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES
-#define EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
-#define TPL_APPLICATION EFI_TPL_APPLICATION
-#define TPL_CALLBACK EFI_TPL_CALLBACK
-#define TPL_NOTIFY EFI_TPL_NOTIFY
-#define TPL_HIGH_LEVEL EFI_TPL_HIGH_LEVEL
-
-//
-// Typos in EDK
-//
-#define gEfiHobMemoryAllocModuleGuid gEfiHobMemeryAllocModuleGuid
-#define gEfiHobMemoryAllocStackGuid gEfiHobMemeryAllocStackGuid
-#define gEfiHobMemoryAllocBspStoreGuid gEfiHobMemeryAllocBspStoreGuid
-
-//
-// typedef Edk types - EdkII types
-//
-typedef PXE_CPB_START PXE_CPB_START_30;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h
deleted file mode 100644
index c90a075db2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesDxe.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDefinitionChangesDxe.h
-
-Abstract:
-
- Data structure definition changes from EDK to EDKII
-
---*/
-
-#ifndef __EDKII_GLUE_DEFINITION_CHANGES_DXE_H__
-#define __EDKII_GLUE_DEFINITION_CHANGES_DXE_H__
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include "TianoHii.h"
-#else
-#include "EfiInternalFormRepresentation.h"
-#endif
-
-#include "EdkIIGlueDefinitionChangesBase.h"
-
-#if (TIANO_RELEASE_VERSION <= 0x00080005)
- #define gEfiStatusCodeRuntimeProtocolGuid gEfiStatusCodeArchProtocolGuid
-#endif
-
-//
-// typedef Edk types - EdkII types
-//
-typedef EFI_MEMORY_ARRAY_START_ADDRESS EFI_MEMORY_ARRAY_START_ADDRESS_DATA;
-typedef EFI_MEMORY_DEVICE_START_ADDRESS EFI_MEMORY_DEVICE_START_ADDRESS_DATA;
-typedef EFI_MISC_LAST_PCI_BUS EFI_MISC_LAST_PCI_BUS_DATA;
-typedef EFI_MISC_BIOS_VENDOR EFI_MISC_BIOS_VENDOR_DATA;
-typedef EFI_MISC_SYSTEM_MANUFACTURER EFI_MISC_SYSTEM_MANUFACTURER_DATA;
-typedef EFI_MISC_BASE_BOARD_MANUFACTURER EFI_MISC_BASE_BOARD_MANUFACTURER_DATA;
-typedef EFI_MISC_CHASSIS_MANUFACTURER EFI_MISC_CHASSIS_MANUFACTURER_DATA;
-typedef EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA;
-typedef EFI_MISC_SYSTEM_SLOT_DESIGNATION EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA;
-typedef EFI_MISC_ONBOARD_DEVICE EFI_MISC_ONBOARD_DEVICE_DATA;
-typedef EFI_MISC_ONBOARD_DEVICE_TYPE_DATA EFI_MISC_PORTING_DEVICE_TYPE_DATA;
-typedef EFI_MISC_OEM_STRING EFI_MISC_OEM_STRING_DATA;
-typedef EFI_MISC_SYSTEM_OPTION_STRING EFI_MISC_SYSTEM_OPTION_STRING_DATA;
-typedef EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA;
-typedef EFI_MISC_SYSTEM_LANGUAGE_STRING EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA;
-typedef EFI_MISC_BIS_ENTRY_POINT EFI_MISC_BIS_ENTRY_POINT_DATA;
-typedef EFI_MISC_BOOT_INFORMATION_STATUS EFI_MISC_BOOT_INFORMATION_STATUS_DATA;
-typedef EFI_MISC_SYSTEM_POWER_SUPPLY EFI_MISC_SYSTEM_POWER_SUPPLY_DATA ;
-typedef EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA;
-
-// -------------------
-// EdkII Names - Edk Names
-// -------------------
-#define gEfiAcpiSupportProtocolGuid gEfiAcpiSupportGuid
-#define gEfiLoadPeImageProtocolGuid gEfiLoadPeImageGuid
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-#define EFI_GLYPH_NON_SPACING GLYPH_NON_SPACING
-#define EFI_GLYPH_WIDE GLYPH_NON_BREAKING
-#endif
-#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE
-#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID
-#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID
-#define EFI_LOADED_IMAGE_PROTOCOL_REVISION EFI_LOADED_IMAGE_INFORMATION_REVISION
-#define EFI_LOAD_FILE_PROTOCOL_GUID LOAD_FILE_PROTOCOL_GUID
-#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION EFI_PXE_BASE_CODE_INTERFACE_REVISION
-#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION
-#define EFI_SERIAL_IO_PROTOCOL_REVISION SERIAL_IO_INTERFACE_REVISION
-#define EFI_FILE_PROTOCOL_REVISION EFI_FILE_HANDLE_REVISION
-#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID
-
-
-//
-// typedef Edk types - EdkII types
-//
-typedef EFI_VOLUME_OPEN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME;
-typedef EFI_TEXT_OUTPUT_STRING EFI_TEXT_STRING;
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-typedef SCREEN_DESCRIPTOR EFI_SCREEN_DESCRIPTOR;
-#endif
-typedef EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
-typedef EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
-//typedef EFI_TO_LEGACY16_INIT_TABLE EFI_TO_COMPATIBILITY16_INIT_TABLE;
-//typedef DISPATCH_OPROM_TABLE EFI_DISPATCH_OPROM_TABLE;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h
deleted file mode 100644
index 092eb74207..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDefinitionChangesPeim.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDefinitionChangesPeim.h
-
-Abstract:
-
- Data structure definition changes from EDK to EDKII
-
---*/
-
-#ifndef __EDKII_GLUE_DEFINITION_CHANGES_PEIM_H__
-#define __EDKII_GLUE_DEFINITION_CHANGES_PEIM_H__
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include "TianoHii.h"
-#else
-#include "EfiInternalFormRepresentation.h"
-#endif
-
-#include "EdkIIGlueDefinitionChangesBase.h"
-
-#include "EfiPciCfg.h"
-
-//
-// typedef Edk types - EdkII types
-//
-typedef EFI_MEMORY_ARRAY_START_ADDRESS EFI_MEMORY_ARRAY_START_ADDRESS_DATA;
-typedef EFI_MEMORY_DEVICE_START_ADDRESS EFI_MEMORY_DEVICE_START_ADDRESS_DATA;
-typedef EFI_MISC_LAST_PCI_BUS EFI_MISC_LAST_PCI_BUS_DATA;
-typedef EFI_MISC_BIOS_VENDOR EFI_MISC_BIOS_VENDOR_DATA;
-typedef EFI_MISC_SYSTEM_MANUFACTURER EFI_MISC_SYSTEM_MANUFACTURER_DATA;
-typedef EFI_MISC_BASE_BOARD_MANUFACTURER EFI_MISC_BASE_BOARD_MANUFACTURER_DATA;
-typedef EFI_MISC_CHASSIS_MANUFACTURER EFI_MISC_CHASSIS_MANUFACTURER_DATA;
-typedef EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA;
-typedef EFI_MISC_SYSTEM_SLOT_DESIGNATION EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA;
-typedef EFI_MISC_ONBOARD_DEVICE EFI_MISC_ONBOARD_DEVICE_DATA;
-typedef EFI_MISC_ONBOARD_DEVICE_TYPE_DATA EFI_MISC_PORTING_DEVICE_TYPE_DATA;
-typedef EFI_MISC_OEM_STRING EFI_MISC_OEM_STRING_DATA;
-typedef EFI_MISC_SYSTEM_OPTION_STRING EFI_MISC_SYSTEM_OPTION_STRING_DATA;
-typedef EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA;
-typedef EFI_MISC_SYSTEM_LANGUAGE_STRING EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA;
-typedef EFI_MISC_BIS_ENTRY_POINT EFI_MISC_BIS_ENTRY_POINT_DATA;
-typedef EFI_MISC_BOOT_INFORMATION_STATUS EFI_MISC_BOOT_INFORMATION_STATUS_DATA;
-typedef EFI_MISC_SYSTEM_POWER_SUPPLY EFI_MISC_SYSTEM_POWER_SUPPLY_DATA ;
-typedef EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA;
-
-// -------------------
-// EdkII Names - Edk Names
-// -------------------
-#define gEfiPeiCpuIoPpiInServiceTableGuid gPeiCpuIoPpiInServiceTableGuid
-#define gEfiEndOfPeiSignalPpiGuid gEndOfPeiSignalPpiGuid
-#define gEfiPeiFvFileLoaderPpiGuid gPeiFvFileLoaderPpiGuid
-#define gEfiPeiMasterBootModePpiGuid gPeiMasterBootModePpiGuid
-#define gEfiPeiMemoryDiscoveredPpiGuid gPeiMemoryDiscoveredPpiGuid
-#define gEfiPciCfgPpiInServiceTableGuid gPeiPciCfgPpiInServiceTableGuid
-#define gEfiPeiReadOnlyVariablePpiGuid gPeiReadOnlyVariablePpiGuid
-#define gEfiPeiRecoveryModulePpiGuid gPeiRecoveryModulePpiGuid
-#define gEfiPeiResetPpiGuid gPeiResetPpiGuid
-#define gEfiPeiS3ResumePpiGuid gPeiS3ResumePpiGuid
-#define gEfiPeiSectionExtractionPpiGuid gPeiSectionExtractionPpiGuid
-#define gEfiPeiSecurityPpiGuid gPeiSecurityPpiGuid
-#define gEfiPeiStatusCodePpiGuid gPeiStatusCodePpiGuid
-#define gEfiPeiBootScriptExecuterPpiGuid gPeiBootScriptExecuterPpiGuid
-#define gEfiPeiSmbusPpiGuid gPeiSmbusPpiGuid
-#define gEfiPeiBlockIoPpiGuid gPeiBlockIoPpiGuid
-#define gEfiPeiDeviceRecoveryModulePpiGuid gPeiDeviceRecoveryModulePpiGuid
-#define gEfiPeiStallPpiGuid gPeiStallPpiGuid
-#define gEfiPeiPciCfgPpiInServiceTableGuid gPeiPciCfgPpiInServiceTableGuid
-#define gEfiPeiAtaControllerPpiGuid gPeiAtaControllerPpiGuid
-#define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID PEI_CPU_IO_PPI_GUID
-#define EFI_PEI_RESET_PPI_GUID PEI_RESET_PPI_GUID
-#define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID PEI_PCI_CFG_PPI_GUID
-#define EFI_PEI_REPORT_PROGRESS_CODE_PPI_GUID PEI_STATUS_CODE_PPI_GUID
-#define EFI_PEI_BOOT_IN_RECOVERY_MODE_PEIM_PPI PEI_BOOT_IN_RECOVERY_MODE_PEIM_PPI
-#define EFI_PEI_END_OF_PEI_PHASE_PPI_GUID PEI_END_OF_PEI_PHASE_PPI_GUID
-#define EFI_PEI_MASTER_BOOT_MODE_PEIM_PPI PEI_MASTER_BOOT_MODE_PEIM_PPI
-#define EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID
-#define EFI_PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID PEI_READ_ONLY_VARIABLE_ACCESS_PPI_GUID
-#define EFI_PEI_RECOVERY_MODULE_PPI_GUID PEI_RECOVERY_MODULE_INTERFACE_PPI
-#define EFI_PEI_S3_RESUME_PPI_GUID PEI_S3_RESUME_PPI_GUID
-#define EFI_PEI_SECURITY_PPI_GUID PEI_SECURITY_PPI_GUID
-#define EFI_PEI_STALL_PPI_GUID PEI_STALL_PPI_GUID
-#define EFI_PEI_SMBUS_PPI_GUID PEI_SMBUS_PPI_GUID
-#define EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID
-#define EFI_PEI_FIND_FV_PPI_GUID EFI_FIND_FV_PPI_GUID
-#define EFI_PEI_VIRTUAL_BLOCK_IO_PPI PEI_BLOCK_IO_PPI_GUID
-#define EFI_PEI_DEVICE_RECOVERY_MODULE_PPI_GUID PEI_DEVICE_RECOVERY_MODULE_INTERFACE_PPI
-
-
-//
-// typedef Edk types - EdkII types
-//
-typedef PEI_RECOVERY_MODULE_INTERFACE EFI_PEI_RECOVERY_MODULE_PPI;
-typedef PEI_STALL_PPI EFI_PEI_STALL_PPI;
-typedef PEI_SMBUS_PPI EFI_PEI_SMBUS_PPI;
-typedef PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI;
-typedef PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
-typedef PEI_STATUS_CODE_PPI EFI_PEI_PROGRESS_CODE_PPI;
-typedef PEI_CPU_IO_PPI_WIDTH EFI_PEI_CPU_IO_PPI_WIDTH;
-typedef PEI_CPU_IO_PPI_IO_MEM EFI_PEI_CPU_IO_PPI_IO_MEM;
-typedef PEI_CPU_IO_PPI_ACCESS EFI_PEI_CPU_IO_PPI_ACCESS;
-typedef PEI_CPU_IO_PPI_IO_READ8 EFI_PEI_CPU_IO_PPI_IO_READ8;
-typedef PEI_CPU_IO_PPI_IO_READ16 EFI_PEI_CPU_IO_PPI_IO_READ16;
-typedef PEI_CPU_IO_PPI_IO_READ32 EFI_PEI_CPU_IO_PPI_IO_READ32;
-typedef PEI_CPU_IO_PPI_IO_READ64 EFI_PEI_CPU_IO_PPI_IO_READ64;
-typedef PEI_CPU_IO_PPI_IO_WRITE8 EFI_PEI_CPU_IO_PPI_IO_WRITE8;
-typedef PEI_CPU_IO_PPI_IO_WRITE16 EFI_PEI_CPU_IO_PPI_IO_WRITE16;
-typedef PEI_CPU_IO_PPI_IO_WRITE32 EFI_PEI_CPU_IO_PPI_IO_WRITE32;
-typedef PEI_CPU_IO_PPI_IO_WRITE64 EFI_PEI_CPU_IO_PPI_IO_WRITE64;
-typedef PEI_CPU_IO_PPI_MEM_READ8 EFI_PEI_CPU_IO_PPI_MEM_READ8;
-typedef PEI_CPU_IO_PPI_MEM_READ16 EFI_PEI_CPU_IO_PPI_MEM_READ16;
-typedef PEI_CPU_IO_PPI_MEM_READ32 EFI_PEI_CPU_IO_PPI_MEM_READ32;
-typedef PEI_CPU_IO_PPI_MEM_READ64 EFI_PEI_CPU_IO_PPI_MEM_READ64;
-typedef PEI_CPU_IO_PPI_MEM_WRITE8 EFI_PEI_CPU_IO_PPI_MEM_WRITE8;
-typedef PEI_CPU_IO_PPI_MEM_WRITE16 EFI_PEI_CPU_IO_PPI_MEM_WRITE16;
-typedef PEI_CPU_IO_PPI_MEM_WRITE32 EFI_PEI_CPU_IO_PPI_MEM_WRITE32;
-typedef PEI_CPU_IO_PPI_MEM_WRITE64 EFI_PEI_CPU_IO_PPI_MEM_WRITE64;
-typedef PEI_GET_VARIABLE EFI_PEI_GET_VARIABLE;
-typedef PEI_GET_NEXT_VARIABLE_NAME EFI_PEI_GET_NEXT_VARIABLE_NAME;
-typedef PEI_LOAD_RECOVERY_CAPSULE EFI_PEI_LOAD_RECOVERY_CAPSULE;
-typedef PEI_RESET_PPI EFI_PEI_RESET_PPI;
-typedef PEI_S3_RESUME_PPI EFI_PEI_S3_RESUME_PPI;
-typedef PEI_S3_RESUME_PPI_RESTORE_CONFIG EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG;
-typedef SEC_PLATFORM_INFORMATION EFI_SEC_PLATFORM_INFORMATION;
-typedef PEI_SECURITY_PPI EFI_PEI_SECURITY_PPI;
-typedef PEI_SECURITY_AUTHENTICATION_STATE EFI_PEI_SECURITY_AUTHENTICATION_STATE;
-typedef PEI_STALL EFI_PEI_STALL;
-typedef PEI_SMBUS_PPI_EXECUTE_OPERATION EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION;
-typedef PEI_SMBUS_NOTIFY_FUNCTION EFI_PEI_SMBUS_NOTIFY_FUNCTION;
-typedef PEI_SMBUS_PPI_ARP_DEVICE EFI_PEI_SMBUS_PPI_ARP_DEVICE;
-typedef PEI_SMBUS_PPI_GET_ARP_MAP EFI_PEI_SMBUS_PPI_GET_ARP_MAP;
-typedef PEI_SMBUS_PPI_NOTIFY EFI_PEI_SMBUS_PPI_NOTIFY;
-typedef PEI_BOOT_SCRIPT_EXECUTE EFI_PEI_BOOT_SCRIPT_EXECUTE;
-typedef PEI_BOOT_SCRIPT_EXECUTER_PPI EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI;
-typedef EFI_FIND_FV_FINDFV EFI_PEI_FIND_FV_FINDFV;
-typedef EFI_FIND_FV_PPI EFI_PEI_FIND_FV_PPI;
-typedef PEI_RECOVERY_BLOCK_IO_INTERFACE EFI_PEI_RECOVERY_BLOCK_IO_PPI;
-typedef PEI_LBA EFI_PEI_LBA;
-typedef PEI_BLOCK_IO_MEDIA EFI_PEI_BLOCK_IO_MEDIA;
-typedef PEI_BLOCK_DEVICE_TYPE EFI_PEI_BLOCK_DEVICE_TYPE;
-typedef PEI_GET_NUMBER_BLOCK_DEVICES EFI_PEI_GET_NUMBER_BLOCK_DEVICES;
-typedef PEI_GET_DEVICE_MEDIA_INFORMATION EFI_PEI_GET_DEVICE_MEDIA_INFORMATION;
-typedef PEI_READ_BLOCKS EFI_PEI_READ_BLOCKS;
-typedef PEI_DEVICE_RECOVERY_MODULE_INTERFACE EFI_PEI_DEVICE_RECOVERY_MODULE_PPI;
-typedef PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE;
-typedef PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO;
-typedef PEI_DEVICE_LOAD_RECOVERY_CAPSULE EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE;
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
deleted file mode 100644
index b5f8230be9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
+++ /dev/null
@@ -1,885 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueDepedencies.h
-
-Abstract:
-
- Header file that lists dependency relations among library instances
-
---*/
-
-#ifndef __EDKII_GLUE_DEPENDENCIES_H__
-#define __EDKII_GLUE_DEPENDENCIES_H__
-
-#include "EdkIIGlueProcessorBind.h"
-
-//
-// Declarations of dependencies among EDKII Glue Library instances and EDK Libraries
-// Pay attention to the order of following #define structures
-//
-
-
-//
-// PeiDxeDebugLibReportStatusCode
-// Actually almost every module and GlueLib instance needs this library, but GlueLib
-// instances don't have to list this library in their own inf files. Module inf
-// does this.
-//
-#ifdef __EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#endif
-
-//
-// BaseDebugLibNull
-//
-#ifdef __EDKII_GLUE_BASE_DEBUG_LIB_NULL__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_PRINT_LIB__
- #define __EDKII_GLUE_BASE_PRINT_LIB__
- #endif
-#endif
-
-//
-// DxePerformanceLib
-//
-#ifdef __EDKII_GLUE_DXE_PERFORMANCE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #endif
- #ifndef __EDKII_GLUE_DXE_HOB_LIB__
- #define __EDKII_GLUE_DXE_HOB_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_LIB__
- #define __EDKII_GLUE_UEFI_LIB__
- #endif
-#endif
-
-//
-// PeiPerformanceLib
-//
-#ifdef __EDKII_GLUE_PEI_PERFORMANCE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
- #define __EDKII_GLUE_PEI_SERVICES_LIB__
- #endif
-#endif
-
-//
-// EdkDxeRuntimeDriverLib
-//
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
- #ifndef __EDKII_GLUE_UEFI_LIB__
- #define __EDKII_GLUE_UEFI_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#ifdef MDE_CPU_IPF // IPF
- #ifndef __EDKII_GLUE_EDK_DXE_SAL_LIB__
- #define __EDKII_GLUE_EDK_DXE_SAL_LIB__
- #endif
-#endif // IPF
-#endif
-
-//
-// EdkDxeSalLib
-//
-#ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// BasePciLibCf8
-//
-#ifdef __EDKII_GLUE_BASE_PCI_LIB_CF8__
- #ifndef __EDKII_GLUE_BASE_PCI_CF8_LIB__
- #define __EDKII_GLUE_BASE_PCI_CF8_LIB__
- #endif
-#endif
-
-//
-// BasePciLibPciExpress
-//
-#ifdef __EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__
- #ifndef __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
- #define __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
- #endif
-#endif
-
-//
-// BasePciCf8Lib
-//
-#ifdef __EDKII_GLUE_BASE_PCI_CF8_LIB__
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
-#endif
-
-//
-// BasePciExpressLib
-//
-#ifdef __EDKII_GLUE_BASE_PCI_EXPRESS_LIB__
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
-#endif
-
-//
-// BaseTimerLibLocalApic
-//
-#ifdef __EDKII_GLUE_BASE_TIMER_LIB_LOCAL_APIC__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
-#endif
-
-//
-// DxeReportStatusCodeLib
-//
-#ifdef __EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// SmmRuntimeDxeReportStatusCodeLib - typically used by SMM driver and Runtime driver
-//
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// PeiReportStatusCodeLib
-//
-#ifdef __EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
-#if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #endif
-#elif defined(MDE_CPU_IPF)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #endif
-#endif
- //
- // If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
- // __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
- // replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
- //
-#endif
-
-//
-// BasePeCoffLib
-//
-#ifdef __EDKII_GLUE_BASE_PE_COFF_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#endif
-
-//
-// BaseUefiDecompressLib
-//
-#ifdef __EDKII_GLUE_BASE_UEFI_DECOMPRESS_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#endif
-
-//
-// DxeHobLib
-//
-#ifdef __EDKII_GLUE_DXE_HOB_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_LIB__
- #define __EDKII_GLUE_UEFI_LIB__
- #endif
-#endif
-
-//
-// HiiLib
-//
-#ifdef __EDKII_GLUE_HII_LIB__
- #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #endif
-#endif
-
-//
-// UefiDevicePathLib
-//
-#ifdef __EDKII_GLUE_UEFI_DEVICE_PATH_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
- #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #endif
-#endif
-
-//
-// DxeServicesTableLib
-//
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
- #ifndef __EDKII_GLUE_UEFI_LIB__
- #define __EDKII_GLUE_UEFI_LIB__
- #endif
-#endif
-
-//
-// UefiLib
-//
-#ifdef __EDKII_GLUE_UEFI_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
- #ifndef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #define __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #endif
-#endif
-
-//
-// DxeMemoryAllocationLib
-//
-#ifdef __EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// DxeSmbusLib
-//
-#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// PeiHobLib
-//
-#ifdef __EDKII_GLUE_PEI_HOB_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
- #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
- #define __EDKII_GLUE_PEI_SERVICES_LIB__
- #endif
-#endif
-
-//
-// PeiMemoryAllocationLib
-//
-#ifdef __EDKII_GLUE_PEI_MEMORY_ALLOCATION_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #endif
-#elif defined(MDE_CPU_IPF)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #endif
-#endif
- //
- // If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
- // __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
- // replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
- //
-#endif
-
-//
-// PeiResourcePublicationLib
-//
-#ifdef __EDKII_GLUE_PEI_RESOURCE_PUBLICATION_LIB__
- #ifndef __EDKII_GLUE_PEI_SERVICES_LIB__
- #define __EDKII_GLUE_PEI_SERVICES_LIB__
- #endif
-#endif
-
-//
-// PeiServicesLib
-//
-#ifdef __EDKII_GLUE_PEI_SERVICES_LIB__
-#if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #endif
-#elif defined(MDE_CPU_IPF)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #endif
-#endif
- //
- // If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
- // __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
- // replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
- //
-#endif
-
-//
-// PeiSmbusLib
-//
-#ifdef __EDKII_GLUE_PEI_SMBUS_LIB__
- #ifndef __EDKII_GLUE_BASE_MEMORY_LIB__
- #define __EDKII_GLUE_BASE_MEMORY_LIB__
- #endif
-#if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #endif
-#elif defined(MDE_CPU_IPF)
- #ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #endif
-#endif
- //
- // If necessary, __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__ or
- // __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__ can be
- // replaced with __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
- //
-#endif
-
-//
-// PeiServicesTablePointerLibMm7
-//
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-//
-// PeiServicesTablePointerLibKr1
-//
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-
-//
-// UefiDriverModelLib
-//
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// BasePrintLib
-//
-#ifdef __EDKII_GLUE_BASE_PRINT_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-//
-// BaseMemoryLib
-//
-#ifdef __EDKII_GLUE_BASE_MEMORY_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-//
-// BasePostCodeLibPort80
-//
-#ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__
-#ifndef MDE_CPU_EBC
- #ifndef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #define __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #endif
-#else
- #ifndef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #define __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #endif
-#endif
-#endif
-
-//
-// BaseIoLibIntrinsic
-//
-#ifdef __EDKII_GLUE_BASE_IO_LIB_INTRINSIC__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-//
-// DxeIoLibCpuIo
-//
-#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
- #ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
- #endif
-#endif
-
-//
-// UefiBootServicesTableLib
-//
-#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
-#endif
-
-//
-// BaseCacheMaintenanceLib
-//
-#ifdef __EDKII_GLUE_BASE_CACHE_MAINTENANCE_LIB__
- #ifndef __EDKII_GLUE_BASE_LIB__
- #define __EDKII_GLUE_BASE_LIB__
- #endif
-#endif
-
-//
-// BaseLib
-//
-#ifdef __EDKII_GLUE_BASE_LIB__
-#endif
-
-//
-// UefiRuntimeServicesTableLib
-//
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
-#endif
-
-//
-// BasePeCoffGetEntryPointLib
-//
-#ifdef __EDKII_GLUE_BASE_PE_COFF_GET_ENTRY_POINT_LIB__
-#endif
-
-//
-// PeiServicesTablePointerLib
-//
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
-#endif
-
-//
-// BasePostCodeLibDebug
-//
-#ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__
- //
- // A DebugLib instance
- // Usually EdkIIGluePeiDxeDebugLibReportStatusCodeLib is listed in module inf
- //
-#endif
-
-//
-// PeiDxePostCodeLibReportStatusCode
-//
-#ifdef __EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__
- //
- // PEI or DXE ReportStatusCodeLib instance
- // Usually EdkIIGluePei/DxeReportStatusCodeLib is listed in module inf
- //
-#endif
-
-//
-// Whether _gDriverExitBootServicesEvent[] contains effective handler
-//
-#if defined(__EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__) || defined(__EDKII_GLUE_EXIT_BOOT_SERVICES_EVENT_HANDLER__)
- #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 1
-#else
- #define __EDKII_GLUE_HAVE_DRIVER_EXIT_BOOT_SERVICES_EVENT__ 0
-#endif
-
-//
-// Check against multiple instances of same library class being used
-//
-#if defined(__EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__) && defined(__EDKII_GLUE_BASE_DEBUG_LIB_NULL__)
- #error EdkIIGluePeiDxeDebugLibReportStatusCode and EdkIIGlueBaseDebugLibNull: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_BASE_PCI_LIB_PCI_EXPRESS__) && defined(__EDKII_GLUE_BASE_PCI_LIB_CF8__)
- #error EdkIIGluePciLibPciExpress and EdkIIGluePciLibCf8: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_DXE_HOB_LIB__) && defined(__EDKII_GLUE_PEI_HOB_LIB__)
- #error EdkIIGlueDxeHobLib and EdkIIGluePeiHobLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__) && defined(__EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__)
- #error EdkIIGlueBasePostCodeLibPort80 and EdkIIGlueBasePostCodeLibDebug: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_PORT_80__) && defined(__EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__)
- #error EdkIIGlueBasePostCodeLibPort80 and EdkIIGluePeiDxePostCodeLibReportStatusCode: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__) && defined(__EDKII_GLUE_PEI_DXE_POST_CODE_LIB_REPORT_STATUS_CODE__)
- #error EdkIIGlueBasePostCodeLibDebug and EdkIIGluePeiDxePostCodeLibReportStatusCode: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__)
- #error EdkIIGluePeiServicesTablePointerLib and EdkIIGluePeiServicesTablePointerLibMm7: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__)
- #error EdkIIGluePeiServicesTablePointerLib and EdkIIGluePeiServicesTablePointerLibKr1: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__) && defined(__EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__)
- #error EdkIIGluePeiServicesTablePointerLibMm7 and EdkIIGluePeiServicesTablePointerLibKr1: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__)
- #error EdkIIGlueDxeReportStatusCodeLib and EdkIIGluePeiReportStatusCodeLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__)
- #error EdkIIGlueSmmRuntimeDxeReportStatusCodeLib and EdkIIGluePeiReportStatusCodeLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) && defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- #error EdkIIGlueDxeReportStatusCodeLib and EdkIIGlueSmmRuntimeDxeReportStatusCodeLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_DXE_MEMORY_ALLOCATION_LIB__) && defined(__EDKII_GLUE_PEI_MEMORY_ALLOCATION_LIB__)
- #error EdkIIGlueDxeMemoryAllocationLib and EdkIIGluePeiMemoryAllocationLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_DXE_SMBUS_LIB__) && defined(__EDKII_GLUE_PEI_SMBUS_LIB__)
- #error EdkIIGlueDxeSmbusLib and EdkIIGluePeiSmbusLib: can only be mutual exclusively used.
-#endif
-
-#if defined(__EDKII_GLUE_BASE_IO_LIB_INTRINSIC__) && defined(__EDKII_GLUE_DXE_IO_LIB_CPU_IO__)
- #error EdkIIGlueBaseIoLibIntrinsic and EdkIIGlueDxeIoLibCpuIo: can only be mutual exclusively used.
-#endif
-
-//
-// Some instances must be supplied
-//
-#ifdef __EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__
- #if !defined(__EDKII_GLUE_DXE_REPORT_STATUS_CODE_LIB__) \
- && !defined(__EDKII_GLUE_PEI_REPORT_STATUS_CODE_LIB__) \
- && !defined(__EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__)
- #error You use EdkIIGluePeiDxeDebugLibReportStatusCode, \
- so either EdkIIGlueDxeReportStatusCodeLib, EdkIIGluePeiReportStatusCodeLib, \
- or EdkIIGlueSmmRuntimeDxeReportStatusCodeLib must be supplied
- #endif
-#endif
-
-#ifdef __EDKII_GLUE_BASE_POST_CODE_LIB_DEBUG__
- #if !defined(__EDKII_GLUE_PEI_DXE_DEBUG_LIB_REPORT_STATUS_CODE__) && !defined(__EDKII_GLUE_BASE_DEBUG_LIB_NULL__)
- #error You use EdkIIGlueBasePostCodeLibDebug, so either EdkIIGluePeiDxeDebugLibReportStatusCode or EdkIIGlueBaseDebugLibNull must be supplied
- #endif
-#endif
-
-//
-// EdkIIGlueUefiDriverModelLib used, but no Driver Binding Protocol defined
-//
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
- #ifndef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
- #error "EdkIIGlueUefiDriverModelLib used, but no Driver Binding Protocol defined. Please define __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__."
- #endif
-#endif
-
-//
-// EdkII Glue Library Constructors:
-// NOTE: the constructors must be called according to dependency order
-//
-// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
-// DxeIoLibCpuIo IoLibConstructor()
-// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
-// EdkDxeRuntimeDriverLib RuntimeDriverLibConstruct()
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
-// DxeHobLib HobLibConstructor()
-// UefiDriverModelLib UefiDriverModelLibConstructor()
-// PeiServicesTablePointerLib PeiServicesTablePointerLibConstructor()
-// PeiServicesTablePointerLibMm7 PeiServicesTablePointerLibConstructor()
-// PeiServicesTablePointerLibKr1 PeiServicesTablePointerLibConstructor()
-// DxeSmbusLib SmbusLibConstructor()
-// DxeServicesTableLib DxeServicesTableLibConstructor()
-// DxeSalLib DxeSalLibConstructor()
-//
-
-#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
-EFI_STATUS
-EFIAPI
-UefiBootServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
-EFI_STATUS
-EFIAPI
-IoLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
-EFI_STATUS
-EFIAPI
-UefiRuntimeServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibConstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
-EFI_STATUS
-EFIAPI
-ReportStatusCodeLibConstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_DXE_HOB_LIB__
-EFI_STATUS
-EFIAPI
-HobLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
-EFI_STATUS
-EFIAPI
-UefiDriverModelLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB__
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-#endif
-
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_MM7__
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-#endif
-
-#ifdef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_KR1__
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SMBUS_LIB__
-EFI_STATUS
-EFIAPI
-SmbusLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
-EFI_STATUS
-EFIAPI
-DxeServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_SAL_LIB__
-EFI_STATUS
-EFIAPI
-DxeSalLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-//
-// EdkII Glue Library Destructors:
-// NOTE: the destructors must be called according to dependency order
-//
-// UefiDriverModelLibDestructor UefiDriverModelLibDestructor()
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibDestruct()
-// EdkDxeRuntimeDriverLib RuntimeDriverLibDeconstruct()
-//
-#ifdef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB__
-EFI_STATUS
-EFIAPI
-UefiDriverModelLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
-EFI_STATUS
-EFIAPI
-ReportStatusCodeLibDestruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#ifdef __EDKII_GLUE_EDK_DXE_RUNTIME_DRIVER_LIB__
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibDeconstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/DxeDepex.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/DxeDepex.h
deleted file mode 100644
index 60c9325625..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/DxeDepex.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- DxeDepex.h
-
-Abstract:
-
- This file is used by .dxs file. To write common .dxs for EDK and EDKII, a
- header file named DxeDepex.h musted be present.
-
---*/
-
-
-#ifndef __EDKII_GLUELIB_DXEDEPEX_H__
-#define __EDKII_GLUELIB_DXEDEPEX_H__
-
-
-//
-// this file is used by .dxs file, just a place holder
-//
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ebc/EdkIIGlueProcessorBind.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ebc/EdkIIGlueProcessorBind.h
deleted file mode 100644
index ccc875bfe4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ebc/EdkIIGlueProcessorBind.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueProcessorBind.h
-
-Abstract:
-
- Processor specific definitions
-
---*/
-
-#ifndef __EDKII_GLUE_PROCESSOR_BIND_H__
-#define __EDKII_GLUE_PROCESSOR_BIND_H__
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if defined(_MSC_EXTENSIONS)
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#if !defined(MDE_CPU_EBC)
- #define MDE_CPU_EBC
-#endif
-
-///
-/// The stack alignment required for EBC
-///
-#define CPU_STACK_ALIGNMENT sizeof(UINTN)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h
deleted file mode 100644
index 696364a4d9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueBase.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueBase.h
-
-Abstract:
-
- Root include file for Base modules
-
---*/
-
-#ifndef __EDKII_GLUE_BASE_H__
-#define __EDKII_GLUE_BASE_H__
-
-//
-// Using this header means building with EdkIIGlueLib
-//
-#ifndef BUILD_WITH_EDKII_GLUE_LIB
- #define BUILD_WITH_EDKII_GLUE_LIB
-#endif
-
-#ifndef BUILD_WITH_GLUELIB
- #define BUILD_WITH_GLUELIB
-#endif
-
-//
-// General Type & API definitions
-//
-
-#include <EfiBind.h>
-#include "EfiTypes.h"
-#include "EfiError.h"
-#include "Common/EdkIIGlueBaseTypes.h"
-#include "EfiImage.h"
-#include "EfiPeOptionalHeader.h"
-#include "EfiStdArg.h"
-#include "EfiDebug.h"
-#include "EdkIIGlueProcessorBind.h"
-
-//
-// Some Status Code data type definitions are in TianoSpecTypes.h in EDK
-//
-#if (TIANO_RELEASE_VERSION <= 0x00080005)
-#include "TianoSpecTypes.h"
-#endif
-#include "EfiStatusCode.h"
-
-//
-// EDK Library headers used by EdkII Glue Libraries
-//
-#include "LinkedList.h"
-#include "EfiCommonLib.h"
-
-#include "Common/EdkIIGlueDefinitionChangesBase.h"
-
-//
-// EdkII Glue Library Class headers
-//
-
-#include "Library/EdkIIGlueBaseLib.h"
-#include "Library/EdkIIGlueBaseMemoryLib.h"
-#include "Library/EdkIIGlueCacheMaintenanceLib.h"
-#include "Library/EdkIIGlueIoLib.h"
-#include "Library/EdkIIGluePciCf8Lib.h"
-#include "Library/EdkIIGluePciExpressLib.h"
-#include "Library/EdkIIGluePciLib.h"
-#include "Library/EdkIIGluePeCoffGetEntryPointLib.h"
-#include "Library/EdkIIGluePeCoffLib.h"
-#include "Library/EdkIIGluePostCodeLib.h"
-#include "Library/EdkIIGluePrintLib.h"
-#include "Library/EdkIIGlueTimerLib.h"
-#include "Library/EdkIIGlueUefiDecompressLib.h"
-#include "Library/EdkIIGlueDebugLib.h"
-
-//
-// Publish MDE Library PCDs
-//
-#include "Pcd/EdkIIGluePcdBaseLib.h"
-#include "Pcd/EdkIIGluePcdDebugLib.h"
-#include "Pcd/EdkIIGluePcdIoLib.h"
-#include "Pcd/EdkIIGluePcdPciExpressLib.h"
-#include "Pcd/EdkIIGluePcdPostCodeLib.h"
-#include "Pcd/EdkIIGluePcdReportStatusCodeLib.h"
-#include "Pcd/EdkIIGluePcdTimerLib.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
deleted file mode 100644
index f81abace89..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueConfig.h
-
-Abstract:
-
- Configurable items provided by GlueLib
-
---*/
-
-#ifndef __EDKII_GLUE_CONFIG_H__
-#define __EDKII_GLUE_CONFIG_H__
-
-#include "EdkIIGlueProcessorBind.h"
-
-//
-// Glue Library version
-//
-// 0x3000 - the 3rd release
-// 0x5000 - support IPF. Jan, 2007
-// 0x6000 - support EBC. Feb, 2007
-// 0x7000 - size reduction, Jun, 2007
-// 0x7100 - backward compatibility supported, Jun, 2007
-// 0x8000 - Driver model protocols2 supported, May, 2008
-// 0x9000 - add SmmRuntimeDxeReportStatusCodeLib and OemHookStatusCodeLibNull, Feb, 2009
-// 0x9100 - change to use unique member RT variable names in various library instances, June, 2009
-// 0x9200 - Update LEGACY_BOOT and READY_TO_BOOT event handling in UefiLib, July, 2009
-// 0x9300 - Remove OemHookStatusCodeLibNull. SmmRuntimeDxeReportStatusCodeLib uses SMM StatusCode Protocol, Oct, 2009
-//
-// For reference only, don't change the value
-//
-#define EDKII_GLUE_LIBRARY_VERSION 0x9300
-
-
-//
-// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.
-//
-#if !defined(EFI_SPECIFICATION_VERSION)
- #error EFI_SPECIFICATION_VERSION not defined
-#elif !defined(TIANO_RELEASE_VERSION)
- #error TIANO_RELEASE_VERSION not defined
-#elif (TIANO_RELEASE_VERSION == 0)
- #error TIANO_RELEASE_VERSION can not be zero
-#endif
-
-
-//
-// Glue Library debug flag
-//
-// Controls debug ON/OFF of GlueLib itself, no
-// effect on any other libraries or modules
-//
-// Values:
-// FALSE : debug off
-// any TRUE value : debug on
-//
-#define EDKII_GLUE_LIBRARY_DEBUG_ENABLE 0
-
-
-//
-// max unicode string length
-//
-#define EDKII_GLUE_MaximumUnicodeStringLength 1000000
-
-//
-// max ascii string length
-//
-#define EDKII_GLUE_MaximumAsciiStringLength 1000000
-
-//
-// spin lock timeout
-//
-#define EDKII_GLUE_SpinLockTimeout 10000000
-
-//
-// max linked list length
-//
-#define EDKII_GLUE_MaximumLinkedListLength 1000000
-
-//
-// debug print level
-//
-#ifndef EDKII_GLUE_DebugPrintErrorLevel
-#define EDKII_GLUE_DebugPrintErrorLevel (EFI_D_ERROR|EFI_D_INFO)
-#endif
-
-//
-// debug propery mask
-//
-#ifndef EDKII_GLUE_DebugPropertyMask
-#define EDKII_GLUE_DebugPropertyMask ( DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \
- | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED \
- | DEBUG_PROPERTY_DEBUG_CODE_ENABLED \
- | DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED \
- | DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED \
- )
-#endif
-
-//
-// clear memory value
-//
-#define EDKII_GLUE_DebugClearMemoryValue 0xAF
-
-//
-// pci express base address.
-// "PCD_EDKII_GLUE_PciExpressBaseAddress" is required to be defined explicitly:
-// e.g. in EDK II DSC file to build EDK modules:
-// [BuildOptions]
-// *_*_*_CC_FLAGS = /D PCD_EDKII_GLUE_PciExpressBaseAddress=0xC0000000
-//
-#ifndef EDKII_GLUE_PciExpressBaseAddress
-#define EDKII_GLUE_PciExpressBaseAddress PCD_EDKII_GLUE_PciExpressBaseAddress
-#endif
-
-//
-//
-// This value is FSB Clock frequency. Its unit is Hz and its
-// default value is 200000000, that means FSB frequency is 200Mhz.
-//
-#ifndef EDKII_GLUE_FSBClock
-#define EDKII_GLUE_FSBClock 200000000
-#endif
-
-//
-// post code property mask
-//
-#define EDKII_GLUE_PostCodePropertyMask ( POST_CODE_PROPERTY_POST_CODE_ENABLED \
- | POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED \
- )
-
-//
-// status code property mask
-//
-#define EDKII_GLUE_ReportStatusCodePropertyMask ( REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED \
- | REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED \
- | REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED \
- )
-
-//
-// for IPF only
-// The base address of IPF IO Block
-//
-#ifdef MDE_CPU_IPF
-#ifndef EDKII_GLUE_IoBlockBaseAddressForIpf
-#define EDKII_GLUE_IoBlockBaseAddressForIpf 0x0ffffc000000
-#endif
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h
deleted file mode 100644
index 0e1e340ec9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueDxe.h
+++ /dev/null
@@ -1,272 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueDxe.h
-
-Abstract:
-
- Root include file for DXE modules
-
---*/
-
-#ifndef __EDKII_GLUE_DXE_H__
-#define __EDKII_GLUE_DXE_H__
-
-
-//
-// General Type & API definitions
-//
-
-#include "Tiano.h"
-#include "BootMode.h"
-#include "EfiBootScript.h"
-#include "EfiCapsule.h"
-#include "EfiDependency.h"
-#include "EfiImageFormat.h"
-#include "EfiImage.h"
-#include "EfiPeOptionalHeader.h"
-#include "EfiFirmwareVolumeHeader.h"
-#include "EfiFirmwareFileSystem.h"
-#include "PeiHob.h"
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include "TianoHii.h"
-#else
-#include "EfiInternalFormRepresentation.h"
-#endif
-#include "EfiStatusCode.h"
-#include "EfiPerf.h"
-
-//
-// IPF only
-//
-#ifdef MDE_CPU_IPF
-#include "SalApi.h"
-#endif
-
-//
-// GUID definitions
-//
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#include EFI_GUID_DEFINITION (EventGroup)
-#include EFI_GUID_DEFINITION (EventLegacyBios)
-#include EFI_GUID_DEFINITION (FrameworkDevicePath)
-
-#include EFI_PROTOCOL_DEFINITION (EdidActive)
-#include EFI_PROTOCOL_DEFINITION (EdidDiscovered)
-#include EFI_PROTOCOL_DEFINITION (EdidOverride)
-#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
-#include EFI_PROTOCOL_DEFINITION (Hash)
-#include EFI_PROTOCOL_DEFINITION (ScsiPassThruExt)
-#include EFI_PROTOCOL_DEFINITION (TapeIo)
-#endif
-
-#include EFI_GUID_DEFINITION (Acpi)
-#include EFI_GUID_DEFINITION (AcpiTableStorage)
-#include EFI_GUID_DEFINITION (Apriori)
-#include EFI_GUID_DEFINITION (Capsule)
-#include EFI_GUID_DEFINITION (DataHubRecords)
-#include EFI_GUID_DEFINITION (DebugImageInfoTable)
-#include EFI_GUID_DEFINITION (DxeServices)
-#include EFI_GUID_DEFINITION (FirmwareFileSystem)
-#include EFI_GUID_DEFINITION (GlobalVariable)
-#include EFI_GUID_DEFINITION (Gpt)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_GUID_DEFINITION (MemoryAllocationHob)
-#include EFI_GUID_DEFINITION (Mps)
-#include EFI_GUID_DEFINITION (PcAnsi)
-#include EFI_GUID_DEFINITION (SalSystemTable)
-#include EFI_GUID_DEFINITION (SmBios)
-//#include EFI_GUID_DEFINITION (SmmCommunicate)
-#include EFI_GUID_DEFINITION (SmramMemoryReserve)
-//
-// *** NOTE ***: StatusCodeDataTypeId definition differences need to be
-// resolved when porting a module to real EDK II
-//
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-#include EFI_GUID_DEFINITION (PeiPerformanceHob)
-
-//
-// Protocol definitions
-//
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-#include EFI_PROTOCOL_DEFINITION (FormBrowser2)
-#include EFI_PROTOCOL_DEFINITION (HiiConfigAccess)
-#include EFI_PROTOCOL_DEFINITION (HiiConfigRouting)
-#include EFI_PROTOCOL_DEFINITION (HiiDatabase)
-#include EFI_PROTOCOL_DEFINITION (HiiFont)
-#include EFI_PROTOCOL_DEFINITION (HiiImage)
-#include EFI_PROTOCOL_DEFINITION (HiiString)
-#endif
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
-#include EFI_PROTOCOL_DEFINITION (DevicePathToText)
-#include EFI_PROTOCOL_DEFINITION (DevicePathUtilities)
-#include EFI_PROTOCOL_DEFINITION (Dhcp4)
-#include EFI_PROTOCOL_DEFINITION (Ip4)
-#include EFI_PROTOCOL_DEFINITION (Ip4Config)
-#include EFI_PROTOCOL_DEFINITION (IScsiInitiatorName)
-#include EFI_PROTOCOL_DEFINITION (UsbHostController)
-#include EFI_PROTOCOL_DEFINITION (ManagedNetwork)
-#include EFI_PROTOCOL_DEFINITION (Mtftp4)
-#include EFI_PROTOCOL_DEFINITION (ServiceBinding)
-#include EFI_PROTOCOL_DEFINITION (Tcp4)
-#include EFI_PROTOCOL_DEFINITION (Udp4)
-#include EFI_PROTOCOL_DEFINITION (Arp)
-// check here: currently not implementated
-//#include EFI_PROTOCOL_DEFINITION (AuthenticationInfo)
-#endif
-
-#include EFI_PROTOCOL_DEFINITION (AcpiSupport)
-#include EFI_PROTOCOL_DEFINITION (Bis)
-#include EFI_PROTOCOL_DEFINITION (BlockIo)
-#include EFI_PROTOCOL_DEFINITION (BootScriptSave)
-#include EFI_PROTOCOL_DEFINITION (BusSpecificDriverOverride)
-#include EFI_PROTOCOL_DEFINITION (ComponentName)
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#include EFI_PROTOCOL_DEFINITION (ComponentName2)
-#endif
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-#include EFI_PROTOCOL_DEFINITION (DataHub)
-#include EFI_PROTOCOL_DEFINITION (DebugPort)
-#include EFI_PROTOCOL_DEFINITION (DebugSupport)
-#include EFI_PROTOCOL_DEFINITION (Decompress)
-#include EFI_PROTOCOL_DEFINITION (DeviceIo)
-#include EFI_PROTOCOL_DEFINITION (DevicePath)
-#include EFI_PROTOCOL_DEFINITION (DiskIo)
-#include EFI_PROTOCOL_DEFINITION (DriverBinding)
-#include EFI_PROTOCOL_DEFINITION (DriverConfiguration)
-#include EFI_PROTOCOL_DEFINITION (DriverDiagnostics)
-#include EFI_PROTOCOL_DEFINITION (Ebc)
-#include EFI_PROTOCOL_DEFINITION (EfiNetworkInterfaceIdentifier)
-#include EFI_PROTOCOL_DEFINITION (FileInfo)
-#include EFI_PROTOCOL_DEFINITION (FileSystemInfo)
-#include EFI_PROTOCOL_DEFINITION (FileSystemVolumeLabelInfo)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolume)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeDispatch)
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-#include EFI_PROTOCOL_DEFINITION (FormBrowser)
-#include EFI_PROTOCOL_DEFINITION (FormCallback)
-#endif
-#include EFI_PROTOCOL_DEFINITION (GuidedSectionExtraction)
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-#include EFI_PROTOCOL_DEFINITION (Hii)
-#endif
-#include EFI_PROTOCOL_DEFINITION (IdeControllerInit)
-#include EFI_PROTOCOL_DEFINITION (IncompatiblePciDeviceSupport)
-#include EFI_PROTOCOL_DEFINITION (Legacy8259)
-#include EFI_PROTOCOL_DEFINITION (LegacyBios)
-#include EFI_PROTOCOL_DEFINITION (LegacyBiosPlatform)
-#include EFI_PROTOCOL_DEFINITION (LegacyInterrupt)
-#include EFI_PROTOCOL_DEFINITION (LegacyRegion)
-#include EFI_PROTOCOL_DEFINITION (LoadedImage)
-#include EFI_PROTOCOL_DEFINITION (LoadFile)
-#include EFI_PROTOCOL_DEFINITION (PciHostBridgeResourceAllocation)
-#include EFI_PROTOCOL_DEFINITION (PciHotPlugInit)
-#include EFI_PROTOCOL_DEFINITION (PciIo)
-#include EFI_PROTOCOL_DEFINITION (PciPlatform)
-#include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
-#include EFI_PROTOCOL_DEFINITION (PlatformDriverOverride)
-#include EFI_PROTOCOL_DEFINITION (PxeBaseCode)
-#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallBack)
-#include EFI_PROTOCOL_DEFINITION (ScsiIo)
-#include EFI_PROTOCOL_DEFINITION (ScsiPassThru)
-#include EFI_PROTOCOL_DEFINITION (SectionExtraction)
-#include EFI_PROTOCOL_DEFINITION (SerialIo)
-#include EFI_PROTOCOL_DEFINITION (SimpleFileSystem)
-#include EFI_PROTOCOL_DEFINITION (SimpleNetwork)
-#include EFI_PROTOCOL_DEFINITION (SimplePointer)
-#include EFI_PROTOCOL_DEFINITION (SimpleTextIn)
-#include EFI_PROTOCOL_DEFINITION (SimpleTextOut)
-#include EFI_PROTOCOL_DEFINITION (Smbus)
-#include EFI_PROTOCOL_DEFINITION (SmmAccess)
-#include EFI_PROTOCOL_DEFINITION (SmmBase)
-#include EFI_PROTOCOL_DEFINITION (SmmControl)
-#include EFI_PROTOCOL_DEFINITION (SmmGpiDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmIchnDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmPeriodicTimerDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmPowerButtonDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmStandbyButtonDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
-#include EFI_PROTOCOL_DEFINITION (SmmSwDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmSxDispatch)
-#include EFI_PROTOCOL_DEFINITION (SmmUsbDispatch)
-#include EFI_PROTOCOL_DEFINITION (UgaDraw)
-#include EFI_PROTOCOL_DEFINITION (UnicodeCollation)
-#include EFI_PROTOCOL_DEFINITION (UsbHostController)
-#include EFI_PROTOCOL_DEFINITION (UsbIo)
-#include EFI_PROTOCOL_DEFINITION (SecurityPolicy)
-#include EFI_PROTOCOL_DEFINITION (LoadPe32Image)
-
-//
-// Arch Protocol definitions
-//
-
-#include EFI_ARCH_PROTOCOL_DEFINITION (Bds)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Metronome)
-#include EFI_ARCH_PROTOCOL_DEFINITION (MonotonicCounter)
-#include EFI_ARCH_PROTOCOL_DEFINITION (RealTimeClock)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Reset)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Runtime)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Security)
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Timer)
-#include EFI_ARCH_PROTOCOL_DEFINITION (Variable)
-#include EFI_ARCH_PROTOCOL_DEFINITION (VariableWrite)
-#include EFI_ARCH_PROTOCOL_DEFINITION (WatchdogTimer)
-
-//
-// IPF only
-//
-#ifdef MDE_CPU_IPF
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-#endif
-
-//
-// EDK Library headers used by EDKII Glue Libraries
-//
-#include "EfiDriverLib.h"
-#include "EfiCapsule.h"
-
-#include "Common/EdkIIGlueDefinitionChangesDxe.h"
-
-
-//
-// EdkII Glue Library Class headers
-//
-
-#include "EdkIIGlueBase.h"
-#include "Library/EdkIIGlueDebugLib.h"
-#include "Library/EdkIIGluePostCodeLib.h"
-#include "Library/EdkIIGlueReportStatusCodeLib.h"
-#include "Library/EdkIIGlueHiiLib.h"
-#include "Library/EdkIIGlueHobLib.h"
-#include "Library/EdkIIGlueMemoryAllocationLib.h"
-#include "Library/EdkIIGlueSmbusLib.h"
-#include "Library/EdkIIGlueDxeRuntimeDriverLib.h"
-#include "Library/EdkIIGlueDxeServicesTableLib.h"
-#include "Library/EdkIIGlueDxeSmmDriverEntryPoint.h"
-#include "Library/EdkIIGlueDevicePathLib.h"
-#include "Library/EdkIIGlueUefiLib.h"
-#include "Library/EdkIIGlueUefiDecompressLib.h"
-#include "Library/EdkIIGlueUefiDriverModelLib.h"
-#include "Library/EdkIIGlueUefiBootServicesTableLib.h"
-#include "Library/EdkIIGlueUefiDriverEntryPoint.h"
-#include "Library/EdkIIGlueUefiRuntimeServicesTableLib.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h
deleted file mode 100644
index 321599a76c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGluePeim.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeim.h
-
-Abstract:
-
- Root include file for PEI Modules
-
-**/
-
-
-#ifndef __EDKII_GLUE_PEIM_H__
-#define __EDKII_GLUE_PEIM_H__
-
-
-//
-// Check to make sure TIANO_RELEASE_VERSION is defined
-//
-#if !defined(TIANO_RELEASE_VERSION)
- #error TIANO_RELEASE_VERSION not defined
-#elif (TIANO_RELEASE_VERSION == 0)
- #error TIANO_RELEASE_VERSION can not be zero
-#endif
-
-//
-// General Type & API definitions
-//
-
-#include "Pei.h"
-#include "EfiBootScript.h"
-#include "EfiImage.h"
-#include "EfiPeOptionalHeader.h"
-#include "EfiCapsule.h"
-#include EFI_PROTOCOL_DEFINITION (DevicePath)
-#include "TianoDevicePath.h"
-#include "PeiPerf.h"
-
-//
-// GUID definitions
-//
-
-#include EFI_GUID_DEFINITION (Apriori)
-#include EFI_GUID_DEFINITION (Capsule)
-#include EFI_GUID_DEFINITION (DxeServices)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_GUID_DEFINITION (MemoryAllocationHob)
-#include EFI_GUID_DEFINITION (FirmwareFileSystem)
-#include EFI_GUID_DEFINITION (SmramMemoryReserve)
-#include EFI_GUID_DEFINITION (DataHubRecords)
-#include EFI_GUID_DEFINITION (PeiPerformanceHob)
-
-//
-// *** NOTE ***: StatusCodeDataTypeId definition differences need to be
-// resolved when porting a module to real EDK II
-//
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-//
-// Ppi definitions
-//
-
-#include EFI_PPI_DEFINITION (BlockIo)
-#include EFI_PPI_DEFINITION (BootInRecoveryMode)
-#include EFI_PPI_DEFINITION (BootScriptExecuter)
-#include EFI_PPI_DEFINITION (CpuIo)
-#include EFI_PPI_DEFINITION (DeviceRecoveryModule)
-#include EFI_PPI_DEFINITION (DxeIpl)
-#include EFI_PPI_DEFINITION (EndOfPeiSignal)
-#include EFI_PPI_DEFINITION (FindFv)
-#include EFI_PPI_DEFINITION (LoadFile)
-#include EFI_PPI_DEFINITION (BootMode)
-#include EFI_PPI_DEFINITION (MemoryDiscovered)
-#include EFI_PPI_DEFINITION (PciCfg)
-#include EFI_PPI_DEFINITION (Variable)
-#include EFI_PPI_DEFINITION (RecoveryModule)
-#include EFI_PPI_DEFINITION (Reset)
-#include EFI_PPI_DEFINITION (S3Resume)
-#include EFI_PPI_DEFINITION (SecPlatformInformation)
-#include EFI_PPI_DEFINITION (SectionExtraction)
-#include EFI_PPI_DEFINITION (Security)
-#include EFI_PPI_DEFINITION (Smbus)
-#include EFI_PPI_DEFINITION (Stall)
-#include EFI_PPI_DEFINITION (StatusCode)
-
-
-#include "Common/EdkIIGlueDefinitionChangesPeim.h"
-
-//
-// EdkII Glue Library Class headers
-//
-
-#include "EdkIIGlueBase.h"
-#include "Library/EdkIIGlueDebugLib.h"
-#include "Library/EdkIIGluePostCodeLib.h"
-#include "Library/EdkIIGlueReportStatusCodeLib.h"
-#include "Library/EdkIIGlueHobLib.h"
-#include "Library/EdkIIGlueMemoryAllocationLib.h"
-#include "Library/EdkIIGlueSmbusLib.h"
-#include "Library/EdkIIGluePeiServicesLib.h"
-#include "Library/EdkIIGluePeiServicesTablePointerLib.h"
-#include "Library/EdkIIGlueResourcePublicationLib.h"
-#include "Library/EdkIIGluePeimEntryPoint.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
deleted file mode 100644
index def6dd12b1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueUefi.h
-
-Abstract:
-
- Root include file for UEFI modules.
-
-**/
-
-
-#ifndef __EDKII_GLUE_UEFI_H__
-#define __EDKII_GLUE_UEFI_H__
-
-
-//
-// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.
-// also check for legal combinations
-//
-#if !defined(EFI_SPECIFICATION_VERSION)
- #error EFI_SPECIFICATION_VERSION not defined
-#elif !defined(TIANO_RELEASE_VERSION)
- #error TIANO_RELEASE_VERSION not defined
-#elif TIANO_RELEASE_VERSION == 0x00000000
-
-//
-// UEFI mode with no Tiano extensions is legal
-//
-#elif (TIANO_RELEASE_VERSION <= 0x00080005) && (EFI_SPECIFICATION_VERSION >= 0x00020000)
- #error Illegal combination of EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION versions
-#endif
-
-//
-// General Type & API definitions
-//
-
-#include "EfiSpec.h"
-#include "EfiPxe.h"
-
-
-//
-// Protocols from EFI 1.10 that got thier names fixed in UEFI 2.0
-//
-#include EFI_PROTOCOL_DEFINITION(LoadedImage)
-#include EFI_PROTOCOL_DEFINITION(SimpleTextIn)
-#include EFI_PROTOCOL_DEFINITION(SimpleTextOut)
-#include EFI_PROTOCOL_DEFINITION(SerialIo)
-#include EFI_PROTOCOL_DEFINITION(LoadFile)
-#include EFI_PROTOCOL_DEFINITION(SimpleFileSystem)
-#include EFI_PROTOCOL_DEFINITION(DiskIo)
-#include EFI_PROTOCOL_DEFINITION(BlockIo)
-#include EFI_PROTOCOL_DEFINITION(UnicodeCollation)
-#include EFI_PROTOCOL_DEFINITION(SimpleNetwork)
-#include EFI_PROTOCOL_DEFINITION(EfiNetworkInterfaceIdentifier)
-#include EFI_PROTOCOL_DEFINITION(PxeBaseCode)
-#include EFI_PROTOCOL_DEFINITION(PxeBaseCodeCallBack)
-
-//
-// EFI 1.10 Protocols
-//
-#include EFI_PROTOCOL_DEFINITION(Bis)
-#include EFI_PROTOCOL_DEFINITION(BusSpecificDriverOverride)
-#include EFI_PROTOCOL_DEFINITION(ComponentName)
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#include EFI_PROTOCOL_DEFINITION (ComponentName2)
-#endif
-#include EFI_PROTOCOL_DEFINITION(DebugPort)
-#include EFI_PROTOCOL_DEFINITION(DebugSupport)
-#include EFI_PROTOCOL_DEFINITION(Decompress)
-#include EFI_PROTOCOL_DEFINITION(DriverBinding)
-#include EFI_PROTOCOL_DEFINITION(DriverConfiguration)
-#include EFI_PROTOCOL_DEFINITION(DriverDiagnostics)
-#include EFI_PROTOCOL_DEFINITION(Ebc)
-#include EFI_PROTOCOL_DEFINITION(EfiNetworkInterfaceIdentifier)
-#include EFI_PROTOCOL_DEFINITION(FileInfo)
-#include EFI_PROTOCOL_DEFINITION(FileSystemInfo)
-#include EFI_PROTOCOL_DEFINITION(FileSystemVolumeLabelInfo)
-#include EFI_PROTOCOL_DEFINITION(PciIo)
-#include EFI_PROTOCOL_DEFINITION(PciRootBridgeIo)
-#include EFI_PROTOCOL_DEFINITION(PlatformDriverOverride)
-#include EFI_PROTOCOL_DEFINITION(SimplePointer)
-#include EFI_PROTOCOL_DEFINITION(ScsiPassThru)
-#include EFI_PROTOCOL_DEFINITION(UsbIo)
-#include EFI_PROTOCOL_DEFINITION(UsbHostController)
-#include EFI_PROTOCOL_DEFINITION(UgaDraw)
-
-//
-// EFI 1.10 GUIDs
-//
-#include EFI_GUID_DEFINITION(Acpi)
-#include EFI_GUID_DEFINITION(DebugImageInfoTable)
-#include EFI_GUID_DEFINITION(GlobalVariable)
-#include EFI_GUID_DEFINITION(Gpt)
-#include EFI_GUID_DEFINITION(PcAnsi)
-#include EFI_GUID_DEFINITION(SmBios)
-#include EFI_GUID_DEFINITION(SalSystemTable)
-
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-//
-// UEFI 2.0 Protocols and GUIDs
-//
-// check here: currently not implementated
-//#include EFI_PROTOCOL_DEFINITION(AuthenticationInfo)
-#include EFI_PROTOCOL_DEFINITION(DevicePathUtilities)
-#include EFI_PROTOCOL_DEFINITION(DevicePathToText)
-#include EFI_PROTOCOL_DEFINITION(DevicePathFromText)
-#include EFI_PROTOCOL_DEFINITION(GraphicsOutput)
-#include EFI_PROTOCOL_DEFINITION(EdidDiscovered)
-#include EFI_PROTOCOL_DEFINITION(EdidActive)
-#include EFI_PROTOCOL_DEFINITION(EdidOverride)
-#include EFI_PROTOCOL_DEFINITION(ScsiIo)
-#include EFI_PROTOCOL_DEFINITION(ScsiPassThruExt)
-#include EFI_PROTOCOL_DEFINITION(IScsiInitiatorName)
-#include EFI_PROTOCOL_DEFINITION(UsbHostController)
-#include EFI_PROTOCOL_DEFINITION(TapeIo)
-#include EFI_PROTOCOL_DEFINITION(ManagedNetwork)
-#include EFI_PROTOCOL_DEFINITION(Arp)
-#include EFI_PROTOCOL_DEFINITION(Dhcp4)
-#include EFI_PROTOCOL_DEFINITION(Ip4)
-#include EFI_PROTOCOL_DEFINITION(Ip4Config)
-#include EFI_PROTOCOL_DEFINITION(Tcp4)
-#include EFI_PROTOCOL_DEFINITION(Udp4)
-#include EFI_PROTOCOL_DEFINITION(Mtftp4)
-#include EFI_PROTOCOL_DEFINITION(ServiceBinding)
-#include EFI_PROTOCOL_DEFINITION(Hash)
-#include EFI_GUID_DEFINITION(EventGroup)
-//#include <Guid/WinCertificateUefi.h>
-#endif
-
-#if (TIANO_RELEASE_VERSION > 0x00080005)
-//
-// Need due to EDK Tiano contamination of UEFI enumes.
-// There is a UEFI library that does things the new way and the old way
-// This is why these definitions are need in Uefi.h
-//
-#include EFI_GUID_DEFINITION (EventLegacyBios)
-#include EFI_GUID_DEFINITION (FrameworkDevicePath)
-#endif
-
-//
-// EDK Library headers used by EdkII Glue Libraries
-//
-#include "TianoSpecTypes.h"
-#include "TianoSpecApi.h"
-#include "TianoSpecDevicePath.h"
-#include "EfiDriverLib.h"
-
-#include "Common/EdkIIGlueDefinitionChangesBase.h"
-
-//
-// EdkII Glue Library Class headers
-//
-
-#include "EdkIIGlueBase.h"
-#include "Library/EdkIIGlueUefiDecompressLib.h"
-#include "Library/EdkIIGlueDevicePathLib.h"
-#include "Library/EdkIIGlueUefiBootServicesTableLib.h"
-#include "Library/EdkIIGlueUefiDriverEntryPoint.h"
-#include "Library/EdkIIGlueUefiDriverModelLib.h"
-#include "Library/EdkIIGlueUefiLib.h"
-#include "Library/EdkIIGlueUefiRuntimeServicesTableLib.h"
-
-extern UINT8 _gEdkIIGlueDriverModelProtocolSelection;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ia32/EdkIIGlueProcessorBind.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ia32/EdkIIGlueProcessorBind.h
deleted file mode 100644
index 07c585d2a8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ia32/EdkIIGlueProcessorBind.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueProcessorBind.h
-
-Abstract:
-
- Processor specific definitions
-
---*/
-
-#ifndef __EDKII_GLUE_PROCESSOR_BIND_H__
-#define __EDKII_GLUE_PROCESSOR_BIND_H__
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#ifdef _MSC_EXTENSIONS
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#ifndef MDE_CPU_IA32
- #define MDE_CPU_IA32
-#endif
-
-///
-/// The stack alignment required for IA-32
-///
-#define CPU_STACK_ALIGNMENT sizeof(UINTN)
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
deleted file mode 100644
index 5fa054fc8b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Ipf/EdkIIGlueProcessorBind.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueProcessorBind.h
-
-Abstract:
-
- Processor specific definitions
-
---*/
-
-#ifndef __EDKII_GLUE_PROCESSOR_BIND_H__
-#define __EDKII_GLUE_PROCESSOR_BIND_H__
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if defined(_MSC_EXTENSIONS)
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#if !defined(MDE_CPU_IPF)
- #define MDE_CPU_IPF
-#endif
-
-//
-// IPF Specific Functions
-//
-typedef struct {
- UINT64 Status;
- UINT64 r9;
- UINT64 r10;
- UINT64 r11;
-} PAL_CALL_RETURN;
-
-
-#define EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_LO 0x4871260ec1a74056
-#define EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_HI 0x116e5ba645e631a0
-
-#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO 0x4d02efdb7e97a470
-#define EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI 0x96a27bd29061ce8f
-
-#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO 0x4370c6414ecb6c53
-#define EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI 0x78836e490e3bb28c
-
-#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_LO 0x408b75e8899afd18
-#define EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_HI 0x54f4cd7e2e6e1aa4
-
-#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_LO 0x46f58ce17d019990
-#define EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_HI 0xa06a6798513c76a7
-
-//
-// Per the Itanium Software Conventions and Runtime Architecture Guide,
-// section 3.3.4, IPF stack must always be 16-byte aligned.
-//
-#define CPU_STACK_ALIGNMENT 16
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h
deleted file mode 100644
index 8d4017a17e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseLib.h
+++ /dev/null
@@ -1,7206 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueBaseLib.h
-
-Abstract:
-
- Memory-only library functions with no library constructor/destructor
-
---*/
-
-#ifndef __EDKII_GLUE_BASE_LIB_H__
-#define __EDKII_GLUE_BASE_LIB_H__
-
-
-//
-// String Functions
-//
-#define StrCpy(_Dest, _Source) GlueStrCpy(_Dest, _Source)
-#define StrnCpy(_Dest, _Source, _Length) GlueStrnCpy(_Dest, _Source, _Length)
-#define StrLen(_String) GlueStrLen(_String)
-#define StrSize(_String) GlueStrSize(_String)
-#define StrCmp(_FristString, _SecondString) GlueStrCmp(_FristString, _SecondString)
-#define StrnCmp(_FirstString, _SecondString, _Length) GlueStrnCmp(_FirstString, _SecondString, _Length)
-#define StrCat(_Dest, _Source) GlueStrCat(_Dest, _Source)
-#define StrnCat(_Dest, _Source, _Length) GlueStrnCat(_Dest, _Source, _Length)
-
-//
-// Linked List
-//
-#define InitializeListHead(_ListHead) GlueInitializeListHead(_ListHead)
-#define InsertHeadList(_ListHead, _Entry ) GlueInsertHeadList(_ListHead, _Entry)
-#define InsertTailList(_ListHead, _Entry) GlueInsertTailList(_ListHead, _Entry)
-#define GetFirstNode(_List) GlueGetFirstNode(_List)
-#define GetNextNode(_List, _Node) GlueGetNextNode(_List, _Node)
-#define IsListEmpty(_ListHead) GlueIsListEmpty(_ListHead)
-#define IsNull(_List, _Node) GlueIsNull(_List, _Node)
-#define IsNodeAtEnd(_List, _Node) GlueIsNodeAtEnd(_List, _Node)
-#define SwapListEntries(_FirstEntry, _SecondEntry) GlueSwapListEntries(_FirstEntry, _SecondEntry)
-#define RemoveEntryList(_Entry) GlueRemoveEntryList(_Entry)
-
-//
-// Math Functions
-//
-#define LShiftU64(_Op, _Count) GlueLShiftU64(_Op, _Count)
-#define RShiftU64(_Op, _Count) GlueRShiftU64(_Op, _Count)
-#define MultU64x32(_Multiplicand, _Multiplier) GlueMultU64x32(_Multiplicand, _Multiplier)
-#define DivU64x32(_Dividend, _Divisor) GlueDivU64x32(_Dividend, _Divisor)
-
-//
-// Others
-//
-#define GetInterruptState() GlueGetInterruptState()
-
-
-//
-// Definitions for architecture specific types
-// These include SPIN_LOCK and BASE_LIBRARY_JUMP_BUFFER
-//
-
-//
-// SPIN_LOCK
-//
-typedef volatile UINTN SPIN_LOCK;
-
-#if defined (MDE_CPU_IA32)
-//
-// IA32 context buffer used by SetJump() and LongJump()
-//
-typedef struct {
- UINT32 Ebx;
- UINT32 Esi;
- UINT32 Edi;
- UINT32 Ebp;
- UINT32 Esp;
- UINT32 Eip;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#elif defined (MDE_CPU_IPF)
-//
-// IPF context buffer used by SetJump() and LongJump()
-//
-typedef struct {
- UINT64 F2[2];
- UINT64 F3[2];
- UINT64 F4[2];
- UINT64 F5[2];
- UINT64 F16[2];
- UINT64 F17[2];
- UINT64 F18[2];
- UINT64 F19[2];
- UINT64 F20[2];
- UINT64 F21[2];
- UINT64 F22[2];
- UINT64 F23[2];
- UINT64 F24[2];
- UINT64 F25[2];
- UINT64 F26[2];
- UINT64 F27[2];
- UINT64 F28[2];
- UINT64 F29[2];
- UINT64 F30[2];
- UINT64 F31[2];
- UINT64 R4;
- UINT64 R5;
- UINT64 R6;
- UINT64 R7;
- UINT64 SP;
- UINT64 BR0;
- UINT64 BR1;
- UINT64 BR2;
- UINT64 BR3;
- UINT64 BR4;
- UINT64 BR5;
- UINT64 InitialUNAT;
- UINT64 AfterSpillUNAT;
- UINT64 PFS;
- UINT64 BSP;
- UINT64 Predicates;
- UINT64 LoopCount;
- UINT64 FPSR;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 0x10
-
-#elif defined (MDE_CPU_X64)
-//
-// X64 context buffer used by SetJump() and LongJump()
-//
-typedef struct {
- UINT64 Rbx;
- UINT64 Rsp;
- UINT64 Rbp;
- UINT64 Rdi;
- UINT64 Rsi;
- UINT64 R12;
- UINT64 R13;
- UINT64 R14;
- UINT64 R15;
- UINT64 Rip;
- UINT64 MxCsr;
- UINT8 XmmBuffer[160]; ///< XMM6-XMM15.
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#elif defined (MDE_CPU_EBC)
-//
-// EBC context buffer used by SetJump() and LongJump()
-//
-typedef struct {
- UINT64 R0;
- UINT64 R1;
- UINT64 R2;
- UINT64 R3;
- UINT64 IP;
-} BASE_LIBRARY_JUMP_BUFFER;
-
-#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
-
-#else
-#error Unknown Processor Type
-#endif
-
-//
-// String Services
-//
-
-/**
- Copies one Null-terminated Unicode string to another Null-terminated Unicode
- string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
-
- @return Destiantion
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- );
-
-
-/**
- Copies one Null-terminated Unicode string with a maximum length to another
- Null-terminated Unicode string with a maximum length and returns the new
- Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. At most, Length Unicode
- characters are copied from Source to Destination. If Length is 0, then
- Destination is returned unmodified. If Length is greater that the number of
- Unicode characters in Source, then Destination is padded with Null Unicode
- characters. If Source and Destination overlap, then the results are
- undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit bounadry, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to copy.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrnCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-
-
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function returns the number of Unicode characters in the Null-terminated
- Unicode string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-GlueStrLen (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated Unicode
- string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-GlueStrSize (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Compares two Null-terminated Unicode strings, and returns the difference
- between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched Unicode character in SecondString subtracted from the first
- mismatched Unicode character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If SecondString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated Unicode string.
- @param SecondString Pointer to a Null-terminated Unicode string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-GlueStrCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString
- );
-
-
-/**
- Compares two Null-terminated Unicode strings with maximum lengths, and
- returns the difference between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. At most, Length Unicode
- characters will be compared. If Length is 0, then 0 is returned. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched Unicode character in SecondString
- subtracted from the first mismatched Unicode character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and FirstString is not aligned on a 16-bit bounadary, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If Length > 0 and SecondString is not aligned on a 16-bit bounadary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString Pointer to a Null-terminated Unicode string.
- @param SecondString Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to compare.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-GlueStrnCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString,
- IN UINTN Length
- );
-
-
-/**
- Concatenates one Null-terminated Unicode string to another Null-terminated
- Unicode string, and returns the concatenated Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination. The Null-terminated concatenated
- Unicode String is returned. If Source and Destination overlap, then the
- results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit bounadary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit bounadary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- );
-
-
-/**
- Concatenates one Null-terminated Unicode string with a maximum length to the
- end of another Null-terminated Unicode string, and returns the concatenated
- Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination, and Destination is returned. At
- most, Length Unicode characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength
- Unicode characters, not including the Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrnCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- );
-
-/**
- Returns the first occurance of a Null-terminated Unicode sub-string
- in a Null-terminated Unicode string.
-
- This function scans the contents of the Null-terminated Unicode string
- specified by String and returns the first occurrence of SearchString.
- If SearchString is not found in String, then NULL is returned. If
- the length of SearchString is zero, then String is
- returned.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If SearchString is NULL, then ASSERT().
- If SearchString is not aligned on a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and SearchString
- or String contains more than PcdMaximumUnicodeStringLength Unicode
- characters not including the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param SearchString Pointer to a Null-terminated Unicode string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval !NULL If there is a match.
-
-**/
-CHAR16 *
-EFIAPI
-StrStr (
- IN CONST CHAR16 *String,
- IN CONST CHAR16 *SearchString
- );
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINTN, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-StrDecimalToUintn (
- IN CONST CHAR16 *String
- );
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINT64, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-StrDecimalToUint64 (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-StrHexToUintn (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-StrHexToUint64 (
- IN CONST CHAR16 *String
- );
-
-
-/**
- Convert one Null-terminated Unicode string to a Null-terminated
- ASCII string and returns the ASCII string.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. It returns Destination.
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and Source contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and Source contains more
- than PcdMaximumAsciiStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Source Pointer to a Null-terminated Unicode string.
- @param Destination Pointer to a Null-terminated ASCII string.
-
- @reture Destination
-
-**/
-CHAR8 *
-EFIAPI
-UnicodeStrToAsciiStr (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination
- );
-
-
-/**
- Copies one Null-terminated ASCII string to another Null-terminated ASCII
- string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- );
-
-
-/**
- Copies one Null-terminated ASCII string with a maximum length to another
- Null-terminated ASCII string with a maximum length and returns the new ASCII
- string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. At most, Length ASCII characters
- are copied from Source to Destination. If Length is 0, then Destination is
- returned unmodified. If Length is greater that the number of ASCII characters
- in Source, then Destination is padded with Null ASCII characters. If Source
- and Destination overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
- @param Length Maximum number of ASCII characters to copy.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-
-
-/**
- Returns the length of a Null-terminated ASCII string.
-
- This function returns the number of ASCII characters in the Null-terminated
- ASCII string specified by String.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrLen (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Returns the size of a Null-terminated ASCII string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated ASCII string
- specified by String.
-
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrSize (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Compares two Null-terminated ASCII strings, and returns the difference
- between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched ASCII character in SecondString subtracted from the first
- mismatched ASCII character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- );
-
-
-/**
- Performs a case insensitive comparison of two Null-terminated ASCII strings,
- and returns the difference between the first mismatched ASCII characters.
-
- This function performs a case insensitive comparison of the Null-terminated
- ASCII string FirstString to the Null-terminated ASCII string SecondString. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched lower case ASCII character in
- SecondString subtracted from the first mismatched lower case ASCII character
- in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString using case insensitive
- comparisons.
- @retval !=0 FirstString is not identical to SecondString using case
- insensitive comparisons.
-
-**/
-INTN
-EFIAPI
-AsciiStriCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- );
-
-
-/**
- Compares two Null-terminated ASCII strings with maximum lengths, and returns
- the difference between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. At most, Length ASCII characters
- will be compared. If Length is 0, then 0 is returned. If FirstString is
- identical to SecondString, then 0 is returned. Otherwise, the value returned
- is the first mismatched ASCII character in SecondString subtracted from the
- first mismatched ASCII character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrnCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString,
- IN UINTN Length
- );
-
-
-/**
- Concatenates one Null-terminated ASCII string to another Null-terminated
- ASCII string, and returns the concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents of
- Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination. The Null-terminated concatenated ASCII
- String is returned.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- );
-
-
-/**
- Concatenates one Null-terminated ASCII string with a maximum length to the
- end of another Null-terminated ASCII string, and returns the concatenated
- ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents
- of Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination, and Destination is returned. At most,
- Length ASCII characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, not including the Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
- @param Length Maximum number of ASCII characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- );
-
-
-/**
- Returns the first occurance of a Null-terminated ASCII sub-string
- in a Null-terminated ASCII string.
-
- This function scans the contents of the ASCII string specified by String
- and returns the first occurrence of SearchString. If SearchString is not
- found in String, then NULL is returned. If the length of SearchString is zero,
- then String is returned.
-
- If String is NULL, then ASSERT().
- If SearchString is NULL, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and SearchString or
- String contains more than PcdMaximumAsciiStringLength Unicode characters
- not including the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
- @param SearchString Pointer to a Null-terminated ASCII string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval !NULL If there is a match.
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrStr (
- IN CONST CHAR8 *String,
- IN CONST CHAR8 *SearchString
- );
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-AsciiStrDecimalToUintn (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-AsciiStrDecimalToUint64 (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINTN,
- then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-AsciiStrHexToUintn (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINT64,
- then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-AsciiStrHexToUint64 (
- IN CONST CHAR8 *String
- );
-
-
-/**
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string and returns the Unicode string.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination, and returns Destination. The function terminates the
- Unicode string Destination by appending a Null-terminator character at the end.
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param Source Pointer to a Null-terminated ASCII string.
- @param Destination Pointer to a Null-terminated Unicode string.
-
- @reture Destination
-
-**/
-CHAR16 *
-EFIAPI
-AsciiStrToUnicodeStr (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination
- );
-
-
-/**
- Converts an 8-bit value to an 8-bit BCD value.
-
- Converts the 8-bit value specified by Value to BCD. The BCD value is
- returned.
-
- If Value >= 100, then ASSERT().
-
- @param Value The 8-bit value to convert to BCD. Range 0..99.
-
- @return The BCD value
-
-**/
-UINT8
-EFIAPI
-DecimalToBcd8 (
- IN UINT8 Value
- );
-
-
-/**
- Converts an 8-bit BCD value to an 8-bit value.
-
- Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit
- value is returned.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param Value The 8-bit BCD value to convert to an 8-bit value.
-
- @return The 8-bit value is returned.
-
-**/
-UINT8
-EFIAPI
-BcdToDecimal8 (
- IN UINT8 Value
- );
-
-//
-// LIST_ENTRY definition
-//
-typedef struct _LIST_ENTRY LIST_ENTRY;
-
-struct _LIST_ENTRY {
- LIST_ENTRY *ForwardLink;
- LIST_ENTRY *BackLink;
-};
-
-//
-// Linked List Functions and Macros
-//
-
-/**
- Initializes the head node of a doubly linked list that is declared as a
- global variable in a module.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this macro, the other linked list functions
- may be used to add and remove nodes from the linked list. This macro results
- in smaller executables by initializing the linked list in the data section,
- instead if calling the InitializeListHead() function to perform the
- equivalent operation.
-
- @param ListHead The head note of a list to initiailize.
-
-**/
-#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&ListHead, &ListHead}
-
-
-/**
- Initializes the head node of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this function, the other linked list
- functions may be used to add and remove nodes from the linked list. It is up
- to the caller of this function to allocate the memory for ListHead.
-
- If ListHead is NULL, then ASSERT().
-
- @param ListHead A pointer to the head node of a new doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInitializeListHead (
- IN LIST_ENTRY *ListHead
- );
-
-
-/**
- Adds a node to the beginning of a doubly linked list, and returns the pointer
- to the head node of the doubly linked list.
-
- Adds the node Entry at the beginning of the doubly linked list denoted by
- ListHead, and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be inserted at the beginning
- of a doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInsertHeadList (
- IN LIST_ENTRY *ListHead,
- IN LIST_ENTRY *Entry
- );
-
-
-/**
- Adds a node to the end of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Adds the node Entry to the end of the doubly linked list denoted by ListHead,
- and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be added at the end of the
- doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInsertTailList (
- IN LIST_ENTRY *ListHead,
- IN LIST_ENTRY *Entry
- );
-
-
-/**
- Retrieves the first node of a doubly linked list.
-
- Returns the first node of a doubly linked list. List must have been
- initialized with InitializeListHead(). If List is empty, then NULL is
- returned.
-
- If List is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
-
- @return The first node of a doubly linked list.
- @retval NULL The list is empty.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueGetFirstNode (
- IN CONST LIST_ENTRY *List
- );
-
-
-/**
- Retrieves the next node of a doubly linked list.
-
- Returns the node of a doubly linked list that follows Node. List must have
- been initialized with InitializeListHead(). If List is empty, then List is
- returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and List contains more than
- PcdMaximumLinkedListLenth nodes, then ASSERT().
- If Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @return Pointer to the next node if one exists. Otherwise a null value which
- is actually List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueGetNextNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Checks to see if a doubly linked list is empty or not.
-
- Checks to see if the doubly linked list is empty. If the linked list contains
- zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
-
- If ListHead is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
-
- @retval TRUE The linked list is empty.
- @retval FALSE The linked list is not empty.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsListEmpty (
- IN CONST LIST_ENTRY *ListHead
- );
-
-
-/**
- Determines if a node in a doubly linked list is null.
-
- Returns FALSE if Node is one of the nodes in the doubly linked list specified
- by List. Otherwise, TRUE is returned. List must have been initialized with
- InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If Node is not a node in List and Node is not equal to List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is one of the nodes in the doubly linked list.
- @retval FALSE Node is not one of the nodes in the doubly linked list.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsNull (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Determines if a node the last node in a doubly linked list.
-
- Returns TRUE if Node is the last node in the doubly linked list specified by
- List. Otherwise, FALSE is returned. List must have been initialized with
- InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is the last node in the linked list.
- @retval FALSE Node is not the last node in the linked list.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsNodeAtEnd (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Swaps the location of two nodes in a doubly linked list, and returns the
- first node after the swap.
-
- If FirstEntry is identical to SecondEntry, then SecondEntry is returned.
- Otherwise, the location of the FirstEntry node is swapped with the location
- of the SecondEntry node in a doubly linked list. SecondEntry must be in the
- same double linked list as FirstEntry and that double linked list must have
- been initialized with InitializeListHead(). SecondEntry is returned after the
- nodes are swapped.
-
- If FirstEntry is NULL, then ASSERT().
- If SecondEntry is NULL, then ASSERT().
- If SecondEntry and FirstEntry are not in the same linked list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing the FirstEntry and SecondEntry nodes, including
- the FirstEntry and SecondEntry nodes, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to another node in the same linked list.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueSwapListEntries (
- IN LIST_ENTRY *FirstEntry,
- IN LIST_ENTRY *SecondEntry
- );
-
-
-/**
- Removes a node from a doubly linked list, and returns the node that follows
- the removed node.
-
- Removes the node Entry from a doubly linked list. It is up to the caller of
- this function to release the memory used by this node if that is required. On
- exit, the node following Entry in the doubly linked list is returned. If
- Entry is the only node in the linked list, then the head node of the linked
- list is returned.
-
- If Entry is NULL, then ASSERT().
- If Entry is the head node of an empty list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing Entry, including the Entry node, is greater than
- or equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param Entry A pointer to a node in a linked list
-
- @return Entry
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueRemoveEntryList (
- IN CONST LIST_ENTRY *Entry
- );
-
-//
-// Math Services
-//
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
- with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-GlueLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
- filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-GlueRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
- with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-ARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 32-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT32
-EFIAPI
-LRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
- with the low bits that were rotated.
-
- This function rotates the 32-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT32
-EFIAPI
-RRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-LRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
- with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-RRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-
-/**
- Returns the bit position of the lowest bit set in a 32-bit value.
-
- This function computes the bit position of the lowest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return Position of the lowest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the bit position of the lowest bit set in a 64-bit value.
-
- This function computes the bit position of the lowest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return Position of the lowest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet64 (
- IN UINT64 Operand
- );
-
-
-/**
- Returns the bit position of the highest bit set in a 32-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the bit position of the highest bit set in a 64-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet64 (
- IN UINT64 Operand
- );
-
-
-/**
- Returns the value of the highest bit set in a 32-bit value. Equivalent to
- 1 << HighBitSet32(x).
-
- This function computes the value of the highest bit set in the 32-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return 1 << HighBitSet32(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT32
-EFIAPI
-GetPowerOfTwo32 (
- IN UINT32 Operand
- );
-
-
-/**
- Returns the value of the highest bit set in a 64-bit value. Equivalent to
- 1 << HighBitSet64(x).
-
- This function computes the value of the highest bit set in the 64-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return 1 << HighBitSet64(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT64
-EFIAPI
-GetPowerOfTwo64 (
- IN UINT64 Operand
- );
-
-
-/**
- Switches the endianess of a 16-bit integer.
-
- This function swaps the bytes in a 16-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 16-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT16
-EFIAPI
-SwapBytes16 (
- IN UINT16 Value
- );
-
-
-/**
- Switches the endianess of a 32-bit integer.
-
- This function swaps the bytes in a 32-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 32-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT32
-EFIAPI
-SwapBytes32 (
- IN UINT32 Value
- );
-
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT64
-EFIAPI
-SwapBytes64 (
- IN UINT64 Value
- );
-
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- If the result overflows, then ASSERT().
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-GlueMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- );
-
-
-/**
- Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- If the result overflows, then ASSERT().
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-MultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- );
-
-
-/**
- Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result.
-
- This function multiples the 64-bit signed value Multiplicand by the 64-bit
- signed value Multiplier and generates a 64-bit signed result. This 64-bit
- signed result is returned.
-
- If the result overflows, then ASSERT().
-
- @param Multiplicand A 64-bit signed value.
- @param Multiplier A 64-bit signed value.
-
- @return Multiplicand * Multiplier
-
-**/
-INT64
-EFIAPI
-MultS64x64 (
- IN INT64 Multiplicand,
- IN INT64 Multiplier
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-GlueDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-ModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x32Remainder (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- );
-
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x64Remainder (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- );
-
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit signed
- value Divisor and generates a 64-bit signed quotient. If Remainder is not
- NULL, then the 64-bit signed remainder is returned in Remainder. This
- function returns the 64-bit signed quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-EFIAPI
-DivS64x64Remainder (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- );
-
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
-
- @return *Uint16
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Uint16
- );
-
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Uint16,
- IN UINT16 Value
- );
-
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- );
-
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The value written.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
-
- @return *Uint32
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Uint32
- );
-
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
- @param Value 32-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Uint32,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
-
- @return *Uint64
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Uint64
- );
-
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
- @param Value 64-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Uint64,
- IN UINT64 Value
- );
-
-
-//
-// Bit Field Functions
-//
-
-/**
- Returns a bit field from an 8-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The bit field read.
-
-**/
-UINT8
-EFIAPI
-BitFieldRead8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an 8-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 8-bit value is
- returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldWrite8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the value
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAnd8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAndThenOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-
-/**
- Returns a bit field from a 16-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The bit field read.
-
-**/
-UINT16
-EFIAPI
-BitFieldRead16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 16-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 16-bit value is
- returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldWrite16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAnd16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAndThenOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-
-/**
- Returns a bit field from a 32-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read.
-
-**/
-UINT32
-EFIAPI
-BitFieldRead32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 32-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 32-bit value is
- returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldWrite32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the value
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAnd32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAndThenOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Returns a bit field from a 64-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The bit field read.
-
-**/
-UINT64
-EFIAPI
-BitFieldRead64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to a 64-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 64-bit value is
- returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldWrite64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAnd64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAndThenOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-
-//
-// Base Library Synchronization Functions
-//
-
-/**
- Retrieves the architecture specific spin lock alignment requirements for
- optimal spin lock performance.
-
- This function retrieves the spin lock alignment requirements for optimal
- performance on a given CPU architecture. The spin lock alignment must be a
- power of two and is returned by this function. If there are no alignment
- requirements, then 1 must be returned. The spin lock synchronization
- functions must function correctly if the spin lock size and alignment values
- returned by this function are not used at all. These values are hints to the
- consumers of the spin lock synchronization functions to obtain optimal spin
- lock performance.
-
- @return The architecture specific spin lock alignment.
-
-**/
-UINTN
-EFIAPI
-GetSpinLockProperties (
- VOID
- );
-
-
-/**
- Initializes a spin lock to the released state and returns the spin lock.
-
- This function initializes the spin lock specified by SpinLock to the released
- state, and returns SpinLock. Optimal performance can be achieved by calling
- GetSpinLockProperties() to determine the size and alignment requirements for
- SpinLock.
-
- If SpinLock is NULL, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to initialize to the released
- state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-InitializeSpinLock (
- IN SPIN_LOCK *SpinLock
- );
-
-
-/**
- Waits until a spin lock can be placed in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns SpinLock. Otherwise, this function waits
- indefinitely for the spin lock to be released, and then places it in the
- acquired state and returns SpinLock. All state transitions of SpinLock must
- be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
- If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in
- PcdSpinLockTimeout microseconds, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-AcquireSpinLock (
- IN SPIN_LOCK *SpinLock
- );
-
-
-/**
- Attempts to place a spin lock in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns TRUE. Otherwise, FALSE is returned. All state
- transitions of SpinLock must be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @retval TRUE SpinLock was placed in the acquired state.
- @retval FALSE SpinLock could not be acquired.
-
-**/
-BOOLEAN
-EFIAPI
-AcquireSpinLockOrFail (
- IN SPIN_LOCK *SpinLock
- );
-
-
-/**
- Releases a spin lock.
-
- This function places the spin lock specified by SpinLock in the release state
- and returns SpinLock.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to release.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-ReleaseSpinLock (
- IN SPIN_LOCK *SpinLock
- );
-
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedIncrement (
- IN UINT32 *Value
- );
-
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decremented value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedDecrement (
- IN UINT32 *Value
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InterlockedCompareExchange32 (
- IN OUT UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InterlockedCompareExchange64 (
- IN OUT UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- );
-
-
-/**
- Performs an atomic compare exchange operation on a pointer value.
-
- Performs an atomic compare exchange operation on the pointer value specified
- by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to
- CompareValue, then Value is returned. The compare exchange operation must be
- performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the pointer value for the compare exchange
- operation.
- @param CompareValue Pointer value used in compare operation.
- @param ExchangeValue Pointer value used in exchange operation.
-
-**/
-VOID *
-EFIAPI
-InterlockedCompareExchangePointer (
- IN OUT VOID **Value,
- IN VOID *CompareValue,
- IN VOID *ExchangeValue
- );
-
-
-//
-// Base Library Checksum Functions
-//
-
-/**
- Calculate the sum of all elements in a buffer in unit of UINT8.
- During calculation, the carry bits are dropped.
-
- This function calculates the sum of all elements in a buffer
- in unit of UINT8. The carry bits in result of addition are dropped.
- The result is returned as UINT8. If Length is Zero, then Zero is
- returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer .
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT8
-EFIAPI
-CalculateSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer
- of 8-bit values.
-
- This function first calculates the sum of the 8-bit values in the
- buffer specified by Buffer and Length. The carry bits in the result
- of addition are dropped. Then, the two's complement of the sum is
- returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT8
-EFIAPI
-CalculateCheckSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 16-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 16-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT16
-EFIAPI
-CalculateSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 16-bit values.
-
- This function first calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT16
-EFIAPI
-CalculateCheckSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 32-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 32-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT32
-EFIAPI
-CalculateSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 32-bit values.
-
- This function first calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT32
-EFIAPI
-CalculateCheckSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the sum of all elements in a buffer of 64-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 64-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT64
-EFIAPI
-CalculateSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- );
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 64-bit values.
-
- This function first calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT64
-EFIAPI
-CalculateCheckSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- );
-
-
-//
-// Base Library CPU Functions
-//
-typedef
-VOID
-(EFIAPI *SWITCH_STACK_ENTRY_POINT) (
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2 OPTIONAL
- );
-
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- );
-
-
-/**
- Saves the current CPU context that can be restored with a call to LongJump()
- and returns 0.
-
- Saves the current CPU context in the buffer specified by JumpBuffer and
- returns 0. The initial call to SetJump() must always return 0. Subsequent
- calls to LongJump() cause a non-zero value to be returned by SetJump().
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
- @retval 0 Indicates a return from SetJump().
-
-**/
-UINTN
-EFIAPI
-SetJump (
- OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer. This
- function never returns to the caller. Instead is resumes execution based on
- the state of JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
- If Value is 0, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is
- restored and must be non-zero.
-
-**/
-VOID
-EFIAPI
-LongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- );
-
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- );
-
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- );
-
-
-/**
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- @retval TRUE CPU interrupts were enabled on entry to this call.
- @retval FALSE CPU interrupts were disabled on entry to this call.
-
-**/
-BOOLEAN
-EFIAPI
-SaveAndDisableInterrupts (
- VOID
- );
-
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- );
-
-
-/**
- Retrieves the current CPU interrupt state.
-
- Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
- currently enabled. Otherwise returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GlueGetInterruptState (
- VOID
- );
-
-
-/**
- Set the current CPU interrupt state.
-
- Sets the current CPU interrupt state to the state specified by
- InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
- InterruptState is FALSE, then interrupts are disabled. InterruptState is
- returned.
-
- @param InterruptState TRUE if interrupts should enabled. FALSE if
- interrupts should be disabled.
-
- @return InterruptState
-
-**/
-BOOLEAN
-EFIAPI
-SetInterruptState (
- IN BOOLEAN InterruptState
- );
-
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- );
-
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- );
-
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- );
-
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return. This function
- supports a variable number of arguments following the NewStack parameter.
- These additional arguments are ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
-
-**/
-VOID
-EFIAPI
-SwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- ...
- );
-
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- );
-
-
-/**
- Executes an infinite loop.
-
- Forces the CPU to execute an infinite loop. A debugger may be used to skip
- past the loop and the code that follows the loop must execute properly. This
- implies that the infinite loop must not cause the code that follow it to be
- optimized away.
-
-**/
-VOID
-EFIAPI
-CpuDeadLoop (
- VOID
- );
-
-
-#if defined (MDE_CPU_IPF)
-
-/**
- Flush a range of cache lines in the cache coherency domain of the calling
- CPU.
-
- Invalidates the cache lines specified by Address and Length. If Address is
- not aligned on a cache line boundary, then entire cache line containing
- Address is invalidated. If Address + Length is not aligned on a cache line
- boundary, then the entire instruction cache line containing Address + Length
- -1 is invalidated. This function may choose to invalidate the entire
- instruction cache if that is more efficient than invalidating the specified
- range. If Length is 0, the no instruction cache lines are invalidated.
- Address is returned. This function is only available on IPF.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-AsmFlushCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-
-/**
- Executes a FC instruction
- Executes a FC instruction on the cache line specified by Address.
- The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
- An implementation may flush a larger region. This function is only available on IPF.
-
- @param Address The Address of cache line to be flushed.
-
- @return The address of FC instruction executed.
-
-**/
-UINT64
-EFIAPI
-AsmFc (
- IN UINT64 Address
- );
-
-
-/**
- Executes a FC.I instruction.
- Executes a FC.I instruction on the cache line specified by Address.
- The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary).
- An implementation may flush a larger region. This function is only available on IPF.
-
- @param Address The Address of cache line to be flushed.
-
- @return The address of FC.I instruction executed.
-
-**/
-UINT64
-EFIAPI
-AsmFci (
- IN UINT64 Address
- );
-
-
-/**
- Reads the current value of a Processor Identifier Register (CPUID).
- The Index of largest implemented CPUID (One less than the number of implemented CPUID
- registers) is determined by CPUID [3] bits {7:0}.
- No parameter checking is performed on Index. If the Index value is beyond the
- implemented CPUID register range, a Reserved Register/Field fault may occur. The caller
- must either guarantee that Index is valid, or the caller must set up fault handlers to
- catch the faults. This function is only available on IPF.
-
- @param Index The 8-bit Processor Identifier Register index to read.
-
- @return The current value of Processor Identifier Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadCpuid (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of 64-bit Processor Status Register (PSR).
- This function is only available on IPF.
-
- @return The current value of PSR.
-
-**/
-UINT64
-EFIAPI
-AsmReadPsr (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Processor Status Register (PSR).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of PSR must be 0 or a Reserved Register/Field fault may occur. The caller must either guarantee that Value is valid, or the caller must set up fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to PSR.
-
- @return The 64-bit value written to the PSR.
-
-**/
-UINT64
-EFIAPI
-AsmWritePsr (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #0 (KR0).
- This function is only available on IPF.
-
- @return The current value of KR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr0 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #1 (KR1).
- This function is only available on IPF.
-
- @return The current value of KR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr1 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #2 (KR2).
- This function is only available on IPF.
-
- @return The current value of KR2.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr2 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #3 (KR3).
- This function is only available on IPF.
-
- @return The current value of KR3.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr3 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #4 (KR4).
- This function is only available on IPF.
-
- @return The current value of KR4.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr4 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #5 (KR5).
- This function is only available on IPF.
-
- @return The current value of KR5.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr5 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #6 (KR6).
- This function is only available on IPF.
-
- @return The current value of KR6.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr6 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit Kernel Register #7 (KR7).
- This function is only available on IPF.
-
- @return The current value of KR7.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr7 (
- VOID
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #0 (KR0).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR0.
-
- @return The 64-bit value written to the KR0.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr0 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #1 (KR1).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR1.
-
- @return The 64-bit value written to the KR1.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr1 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #2 (KR2).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR2.
-
- @return The 64-bit value written to the KR2.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr2 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #3 (KR3).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR3.
-
- @return The 64-bit value written to the KR3.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr3 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #4 (KR4).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR4.
-
- @return The 64-bit value written to the KR4.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr4 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #5 (KR5).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR5.
-
- @return The 64-bit value written to the KR5.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr5 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #6 (KR6).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR6.
-
- @return The 64-bit value written to the KR6.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr6 (
- IN UINT64 Value
- );
-
-
-/**
- Write the current value of 64-bit Kernel Register #7 (KR7).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to KR7.
-
- @return The 64-bit value written to the KR7.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr7 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Interval Timer Counter Register (ITC).
- This function is only available on IPF.
-
- @return The current value of ITC.
-
-**/
-UINT64
-EFIAPI
-AsmReadItc (
- VOID
- );
-
-
-/**
- Reads the current value of Interval Timer Vector Register (ITV).
- This function is only available on IPF.
-
- @return The current value of ITV.
-
-**/
-UINT64
-EFIAPI
-AsmReadItv (
- VOID
- );
-
-
-/**
- Reads the current value of Interval Timer Match Register (ITM).
- This function is only available on IPF.
-
- @return The current value of ITM.
-**/
-UINT64
-EFIAPI
-AsmReadItm (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Counter Register (ITC).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to ITC.
-
- @return The 64-bit value written to the ITC.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItc (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Match Register (ITM).
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to ITM.
-
- @return The 64-bit value written to the ITM.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItm (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interval Timer Vector Register (ITV).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of ITV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to ITV.
-
- @return The 64-bit value written to the ITV.
-
-**/
-UINT64
-EFIAPI
-AsmWriteItv (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Default Control Register (DCR).
- This function is only available on IPF.
-
- @return The current value of DCR.
-
-**/
-UINT64
-EFIAPI
-AsmReadDcr (
- VOID
- );
-
-
-/**
- Reads the current value of Interruption Vector Address Register (IVA).
- This function is only available on IPF.
-
- @return The current value of IVA.
-**/
-UINT64
-EFIAPI
-AsmReadIva (
- VOID
- );
-
-
-/**
- Reads the current value of Page Table Address Register (PTA).
- This function is only available on IPF.
-
- @return The current value of PTA.
-
-**/
-UINT64
-EFIAPI
-AsmReadPta (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Default Control Register (DCR).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to DCR.
-
- @return The 64-bit value written to the DCR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteDcr (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Interruption Vector Address Register (IVA).
- The size of vector table is 32 K bytes and is 32 K bytes aligned
- the low 15 bits of Value is ignored when written.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to IVA.
-
- @return The 64-bit value written to the IVA.
-
-**/
-UINT64
-EFIAPI
-AsmWriteIva (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Page Table Address Register (PTA).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to PTA.
-
- @return The 64-bit value written to the PTA.
-**/
-UINT64
-EFIAPI
-AsmWritePta (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Local Interrupt ID Register (LID).
- This function is only available on IPF.
-
- @return The current value of LID.
-
-**/
-UINT64
-EFIAPI
-AsmReadLid (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Vector Register (IVR).
- This function is only available on IPF.
-
- @return The current value of IVR.
-
-**/
-UINT64
-EFIAPI
-AsmReadIvr (
- VOID
- );
-
-
-/**
- Reads the current value of Task Priority Register (TPR).
- This function is only available on IPF.
-
- @return The current value of TPR.
-
-**/
-UINT64
-EFIAPI
-AsmReadTpr (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #0 (IRR0).
- This function is only available on IPF.
-
- @return The current value of IRR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr0 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #1 (IRR1).
- This function is only available on IPF.
-
- @return The current value of IRR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr1 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #2 (IRR2).
- This function is only available on IPF.
-
- @return The current value of IRR2.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr2 (
- VOID
- );
-
-
-/**
- Reads the current value of External Interrupt Request Register #3 (IRR3).
- This function is only available on IPF.
-
- @return The current value of IRR3.
-
-**/
-UINT64
-EFIAPI
-AsmReadIrr3 (
- VOID
- );
-
-
-/**
- Reads the current value of Performance Monitor Vector Register (PMV).
- This function is only available on IPF.
-
- @return The current value of PMV.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmv (
- VOID
- );
-
-
-/**
- Reads the current value of Corrected Machine Check Vector Register (CMCV).
- This function is only available on IPF.
-
- @return The current value of CMCV.
-
-**/
-UINT64
-EFIAPI
-AsmReadCmcv (
- VOID
- );
-
-
-/**
- Reads the current value of Local Redirection Register #0 (LRR0).
- This function is only available on IPF.
-
- @return The current value of LRR0.
-
-**/
-UINT64
-EFIAPI
-AsmReadLrr0 (
- VOID
- );
-
-
-/**
- Reads the current value of Local Redirection Register #1 (LRR1).
- This function is only available on IPF.
-
- @return The current value of LRR1.
-
-**/
-UINT64
-EFIAPI
-AsmReadLrr1 (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Page Local Interrupt ID Register (LID).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of LID must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to LID.
-
- @return The 64-bit value written to the LID.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLid (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Task Priority Register (TPR).
- No parameter checking is performed on Value. All bits of Value corresponding to
- reserved fields of TPR must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to TPR.
-
- @return The 64-bit value written to the TPR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteTpr (
- IN UINT64 Value
- );
-
-
-/**
- Performs a write operation on End OF External Interrupt Register (EOI).
- Writes a value of 0 to the EOI Register. This function is only available on IPF.
-
-**/
-VOID
-EFIAPI
-AsmWriteEoi (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Vector Register (PMV).
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of PMV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to PMV.
-
- @return The 64-bit value written to the PMV.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmv (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Corrected Machine Check Vector Register (CMCV).
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of CMCV must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to CMCV.
-
- @return The 64-bit value written to the CMCV.
-
-**/
-UINT64
-EFIAPI
-AsmWriteCmcv (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Local Redirection Register #0 (LRR0).
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of LRR0 must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to LRR0.
-
- @return The 64-bit value written to the LRR0.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLrr0 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Local Redirection Register #1 (LRR1).
- No parameter checking is performed on Value. All bits of Value corresponding
- to reserved fields of LRR1 must be 0 or a Reserved Register/Field fault may occur.
- The caller must either guarantee that Value is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to LRR1.
-
- @return The 64-bit value written to the LRR1.
-
-**/
-UINT64
-EFIAPI
-AsmWriteLrr1 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Instruction Breakpoint Register (IBR).
-
- The Instruction Breakpoint Registers are used in pairs. The even numbered
- registers contain breakpoint addresses, and the odd numbered registers contain
- breakpoint mask conditions. At least 4 instruction registers pairs are implemented
- on all processor models. Implemented registers are contiguous starting with
- register 0. No parameter checking is performed on Index, and if the Index value
- is beyond the implemented IBR register range, a Reserved Register/Field fault may
- occur. The caller must either guarantee that Index is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Index The 8-bit Instruction Breakpoint Register index to read.
-
- @return The current value of Instruction Breakpoint Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadIbr (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Data Breakpoint Register (DBR).
-
- The Data Breakpoint Registers are used in pairs. The even numbered registers
- contain breakpoint addresses, and odd numbered registers contain breakpoint
- mask conditions. At least 4 data registers pairs are implemented on all processor
- models. Implemented registers are contiguous starting with register 0.
- No parameter checking is performed on Index. If the Index value is beyond
- the implemented DBR register range, a Reserved Register/Field fault may occur.
- The caller must either guarantee that Index is valid, or the caller must set up
- fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Index The 8-bit Data Breakpoint Register index to read.
-
- @return The current value of Data Breakpoint Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadDbr (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Performance Monitor Configuration Register (PMC).
-
- All processor implementations provide at least 4 performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow
- status registers (PMC [0]... PMC [3]). Processor implementations may provide
- additional implementation-dependent PMC and PMD to increase the number of
- 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD
- register set is implementation dependent. No parameter checking is performed
- on Index. If the Index value is beyond the implemented PMC register range,
- zero value will be returned.
- This function is only available on IPF.
-
- @param Index The 8-bit Performance Monitor Configuration Register index to read.
-
- @return The current value of Performance Monitor Configuration Register
- specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT8 Index
- );
-
-
-/**
- Reads the current value of Performance Monitor Data Register (PMD).
-
- All processor implementations provide at least 4 performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter
- overflow status registers (PMC [0]... PMC [3]). Processor implementations may
- provide additional implementation-dependent PMC and PMD to increase the number
- of 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD
- register set is implementation dependent. No parameter checking is performed
- on Index. If the Index value is beyond the implemented PMD register range,
- zero value will be returned.
- This function is only available on IPF.
-
- @param Index The 8-bit Performance Monitor Data Register index to read.
-
- @return The current value of Performance Monitor Data Register specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmd (
- IN UINT8 Index
- );
-
-
-/**
- Writes the current value of 64-bit Instruction Breakpoint Register (IBR).
-
- Writes current value of Instruction Breakpoint Register specified by Index.
- The Instruction Breakpoint Registers are used in pairs. The even numbered
- registers contain breakpoint addresses, and odd numbered registers contain
- breakpoint mask conditions. At least 4 instruction registers pairs are implemented
- on all processor models. Implemented registers are contiguous starting with
- register 0. No parameter checking is performed on Index. If the Index value
- is beyond the implemented IBR register range, a Reserved Register/Field fault may
- occur. The caller must either guarantee that Index is valid, or the caller must
- set up fault handlers to catch the faults.
- This function is only available on IPF.
-
- @param Index The 8-bit Instruction Breakpoint Register index to write.
- @param Value The 64-bit value to write to IBR.
-
- @return The 64-bit value written to the IBR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteIbr (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Data Breakpoint Register (DBR).
-
- Writes current value of Data Breakpoint Register specified by Index.
- The Data Breakpoint Registers are used in pairs. The even numbered registers
- contain breakpoint addresses, and odd numbered registers contain breakpoint
- mask conditions. At least 4 data registers pairs are implemented on all processor
- models. Implemented registers are contiguous starting with register 0. No parameter
- checking is performed on Index. If the Index value is beyond the implemented
- DBR register range, a Reserved Register/Field fault may occur. The caller must
- either guarantee that Index is valid, or the caller must set up fault handlers to
- catch the faults.
- This function is only available on IPF.
-
- @param Index The 8-bit Data Breakpoint Register index to write.
- @param Value The 64-bit value to write to DBR.
-
- @return The 64-bit value written to the DBR.
-
-**/
-UINT64
-EFIAPI
-AsmWriteDbr (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Configuration Register (PMC).
-
- Writes current value of Performance Monitor Configuration Register specified by Index.
- All processor implementations provide at least 4 performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow status
- registers (PMC [0]... PMC [3]). Processor implementations may provide additional
- implementation-dependent PMC and PMD to increase the number of 'generic' performance
- counters (PMC/PMD pairs). The remainder of PMC and PMD register set is implementation
- dependent. No parameter checking is performed on Index. If the Index value is
- beyond the implemented PMC register range, the write is ignored.
- This function is only available on IPF.
-
- @param Index The 8-bit Performance Monitor Configuration Register index to write.
- @param Value The 64-bit value to write to PMC.
-
- @return The 64-bit value written to the PMC.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmc (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit Performance Monitor Data Register (PMD).
-
- Writes current value of Performance Monitor Data Register specified by Index.
- All processor implementations provide at least 4 performance counters
- (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter overflow
- status registers (PMC [0]... PMC [3]). Processor implementations may provide
- additional implementation-dependent PMC and PMD to increase the number of 'generic'
- performance counters (PMC/PMD pairs). The remainder of PMC and PMD register set
- is implementation dependent. No parameter checking is performed on Index. If the
- Index value is beyond the implemented PMD register range, the write is ignored.
- This function is only available on IPF.
-
- @param Index The 8-bit Performance Monitor Data Register index to write.
- @param Value The 64-bit value to write to PMD.
-
- @return The 64-bit value written to the PMD.
-
-**/
-UINT64
-EFIAPI
-AsmWritePmd (
- IN UINT8 Index,
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Global Pointer (GP).
-
- Reads and returns the current value of GP.
- This function is only available on IPF.
-
- @return The current value of GP.
-
-**/
-UINT64
-EFIAPI
-AsmReadGp (
- VOID
- );
-
-
-/**
- Write the current value of 64-bit Global Pointer (GP).
-
- Writes the current value of GP. The 64-bit value written to the GP is returned.
- No parameter checking is performed on Value.
- This function is only available on IPF.
-
- @param Value The 64-bit value to write to GP.
-
- @return The 64-bit value written to the GP.
-
-**/
-UINT64
-EFIAPI
-AsmWriteGp (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of 64-bit Stack Pointer (SP).
-
- Reads and returns the current value of SP.
- This function is only available on IPF.
-
- @return The current value of SP.
-
-**/
-UINT64
-EFIAPI
-AsmReadSp (
- VOID
- );
-
-
-/**
- Determines if the CPU is currently executing in virtual, physical, or mixed mode.
-
- Determines the current execution mode of the CPU.
- If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned.
- If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned.
- If the CPU is not in physical mode or virtual mode, then it is in mixed mode,
- and -1 is returned.
- This function is only available on IPF.
-
- @return 1 The CPU is in virtual mode.
- @return 0 The CPU is in physical mode.
- @return -1 The CPU is in mixed mode.
-
-**/
-INT64
-EFIAPI
-AsmCpuVirtual (
- VOID
- );
-
-
-/**
- Makes a PAL procedure call.
-
- This is a wrapper function to make a PAL procedure call. Based on the Index
- value this API will make static or stacked PAL call. The following table
- describes the usage of PAL Procedure Index Assignment. Architected procedures
- may be designated as required or optional. If a PAL procedure is specified
- as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the
- Status field of the PAL_CALL_RETURN structure.
- This indicates that the procedure is not present in this PAL implementation.
- It is the caller's responsibility to check for this return code after calling
- any optional PAL procedure.
- No parameter checking is performed on the 5 input parameters, but there are
- some common rules that the caller should follow when making a PAL call. Any
- address passed to PAL as buffers for return parameters must be 8-byte aligned.
- Unaligned addresses may cause undefined results. For those parameters defined
- as reserved or some fields defined as reserved must be zero filled or the invalid
- argument return value may be returned or undefined result may occur during the
- execution of the procedure. If the PalEntryPoint does not point to a valid
- PAL entry point then the system behavior is undefined. This function is only
- available on IPF.
-
- @param PalEntryPoint The PAL procedure calls entry point.
- @param Index The PAL procedure Index number.
- @param Arg2 The 2nd parameter for PAL procedure calls.
- @param Arg3 The 3rd parameter for PAL procedure calls.
- @param Arg4 The 4th parameter for PAL procedure calls.
-
- @return structure returned from the PAL Call procedure, including the status and return value.
-
-**/
-PAL_CALL_RETURN
-EFIAPI
-AsmPalCall (
- IN UINT64 PalEntryPoint,
- IN UINT64 Index,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- );
-
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param NewBsp A pointer to the new memory location for RSE backing
- store.
-
-**/
-VOID
-EFIAPI
-AsmSwitchStackAndBackingStore (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VOID *NewBsp
- );
-
-
-//
-// Bugbug: This call should be removed after
-// the PalCall Instance issue has been fixed.
-//
-/**
- Performs a PAL call using static calling convention.
-
- An internal function to perform a PAL call using static calling convention.
-
- @param PalEntryPoint The entry point address of PAL. The address in ar.kr5
- would be used if this parameter were NULL on input.
- @param Arg1 The first argument of a PAL call.
- @param Arg1 The second argument of a PAL call.
- @param Arg1 The third argument of a PAL call.
- @param Arg1 The fourth argument of a PAL call.
-
- @return The values returned in r8, r9, r10 and r11.
-
-**/
-PAL_CALL_RETURN
-PalCallStatic (
- IN CONST VOID *PalEntryPoint,
- IN UINT64 Arg1,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4
- );
-
-
-#elif defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
-//
-// IA32 and X64 Specific Functions
-//
-//
-// Byte packed structure for 16-bit Real Mode EFLAGS
-//
-typedef union {
- struct {
- UINT32 CF:1; // Carry Flag
- UINT32 Reserved_0:1; // Reserved
- UINT32 PF:1; // Parity Flag
- UINT32 Reserved_1:1; // Reserved
- UINT32 AF:1; // Auxiliary Carry Flag
- UINT32 Reserved_2:1; // Reserved
- UINT32 ZF:1; // Zero Flag
- UINT32 SF:1; // Sign Flag
- UINT32 TF:1; // Trap Flag
- UINT32 IF:1; // Interrupt Enable Flag
- UINT32 DF:1; // Direction Flag
- UINT32 OF:1; // Overflow Flag
- UINT32 IOPL:2; // I/O Privilege Level
- UINT32 NT:1; // Nested Task
- UINT32 Reserved_3:1; // Reserved
- } Bits;
- UINT16 Uint16;
-} IA32_FLAGS16;
-
-//
-// Byte packed structure for EFLAGS/RFLAGS
-// 32-bits on IA-32
-// 64-bits on X64. The upper 32-bits on X64 are reserved
-//
-typedef union {
- struct {
- UINT32 CF:1; // Carry Flag
- UINT32 Reserved_0:1; // Reserved
- UINT32 PF:1; // Parity Flag
- UINT32 Reserved_1:1; // Reserved
- UINT32 AF:1; // Auxiliary Carry Flag
- UINT32 Reserved_2:1; // Reserved
- UINT32 ZF:1; // Zero Flag
- UINT32 SF:1; // Sign Flag
- UINT32 TF:1; // Trap Flag
- UINT32 IF:1; // Interrupt Enable Flag
- UINT32 DF:1; // Direction Flag
- UINT32 OF:1; // Overflow Flag
- UINT32 IOPL:2; // I/O Privilege Level
- UINT32 NT:1; // Nested Task
- UINT32 Reserved_3:1; // Reserved
- UINT32 RF:1; // Resume Flag
- UINT32 VM:1; // Virtual 8086 Mode
- UINT32 AC:1; // Alignment Check
- UINT32 VIF:1; // Virtual Interrupt Flag
- UINT32 VIP:1; // Virtual Interrupt Pending
- UINT32 ID:1; // ID Flag
- UINT32 Reserved_4:10; // Reserved
- } Bits;
- UINTN UintN;
-} IA32_EFLAGS32;
-
-//
-// Byte packed structure for Control Register 0 (CR0)
-// 32-bits on IA-32
-// 64-bits on X64. The upper 32-bits on X64 are reserved
-//
-typedef union {
- struct {
- UINT32 PE:1; // Protection Enable
- UINT32 MP:1; // Monitor Coprocessor
- UINT32 EM:1; // Emulation
- UINT32 TS:1; // Task Switched
- UINT32 ET:1; // Extension Type
- UINT32 NE:1; // Numeric Error
- UINT32 Reserved_0:10; // Reserved
- UINT32 WP:1; // Write Protect
- UINT32 Reserved_1:1; // Reserved
- UINT32 AM:1; // Alignment Mask
- UINT32 Reserved_2:10; // Reserved
- UINT32 NW:1; // Mot Write-through
- UINT32 CD:1; // Cache Disable
- UINT32 PG:1; // Paging
- } Bits;
- UINTN UintN;
-} IA32_CR0;
-
-//
-// Byte packed structure for Control Register 4 (CR4)
-// 32-bits on IA-32
-// 64-bits on X64. The upper 32-bits on X64 are reserved
-//
-typedef union {
- struct {
- UINT32 VME:1; // Virtual-8086 Mode Extensions
- UINT32 PVI:1; // Protected-Mode Virtual Interrupts
- UINT32 TSD:1; // Time Stamp Disable
- UINT32 DE:1; // Debugging Extensions
- UINT32 PSE:1; // Page Size Extensions
- UINT32 PAE:1; // Physical Address Extension
- UINT32 MCE:1; // Machine Check Enable
- UINT32 PGE:1; // Page Global Enable
- UINT32 PCE:1; // Performance Monitoring Counter
- // Enable
- UINT32 OSFXSR:1; // Operating System Support for
- // FXSAVE and FXRSTOR instructions
- UINT32 OSXMMEXCPT:1; // Operating System Support for
- // Unmasked SIMD Floating Point
- // Exceptions
- UINT32 Reserved_0:2; // Reserved
- UINT32 VMXE:1; // VMX Enable
- UINT32 Reserved_1:18; // Reseved
- } Bits;
- UINTN UintN;
-} IA32_CR4;
-
-//
-// Byte packed structure for an IDTR, GDTR, LDTR descriptor
-/// @bug How to make this structure byte-packed in a compiler independent way?
-//
-#pragma pack (1)
-typedef struct {
- UINT16 Limit;
- UINTN Base;
-} IA32_DESCRIPTOR;
-#pragma pack ()
-
-#define IA32_IDT_GATE_TYPE_TASK 0x85
-#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86
-#define IA32_IDT_GATE_TYPE_TRAP_16 0x87
-#define IA32_IDT_GATE_TYPE_INTERRUPT_32 0x8E
-#define IA32_IDT_GATE_TYPE_TRAP_32 0x8F
-
-//
-// Byte packed structure for an Interrupt Gate Descriptor
-//
-typedef union {
- struct {
- UINT32 OffsetLow:16; // Offset bits 15..0
- UINT32 Selector:16; // Selector
- UINT32 Reserved_0:8; // Reserved
- UINT32 GateType:8; // Gate Type. See #defines above
- UINT32 OffsetHigh:16; // Offset bits 31..16
- } Bits;
- UINT64 Uint64;
-} IA32_IDT_GATE_DESCRIPTOR;
-
-//
-// Byte packed structure for an FP/SSE/SSE2 context
-//
-typedef struct {
- UINT8 Buffer[512];
-} IA32_FX_BUFFER;
-
-//
-// Structures for the 16-bit real mode thunks
-//
-typedef struct {
- UINT32 Reserved1;
- UINT32 Reserved2;
- UINT32 Reserved3;
- UINT32 Reserved4;
- UINT8 BL;
- UINT8 BH;
- UINT16 Reserved5;
- UINT8 DL;
- UINT8 DH;
- UINT16 Reserved6;
- UINT8 CL;
- UINT8 CH;
- UINT16 Reserved7;
- UINT8 AL;
- UINT8 AH;
- UINT16 Reserved8;
-} IA32_BYTE_REGS;
-
-typedef struct {
- UINT16 DI;
- UINT16 Reserved1;
- UINT16 SI;
- UINT16 Reserved2;
- UINT16 BP;
- UINT16 Reserved3;
- UINT16 SP;
- UINT16 Reserved4;
- UINT16 BX;
- UINT16 Reserved5;
- UINT16 DX;
- UINT16 Reserved6;
- UINT16 CX;
- UINT16 Reserved7;
- UINT16 AX;
- UINT16 Reserved8;
-} IA32_WORD_REGS;
-
-typedef struct {
- UINT32 EDI;
- UINT32 ESI;
- UINT32 EBP;
- UINT32 ESP;
- UINT32 EBX;
- UINT32 EDX;
- UINT32 ECX;
- UINT32 EAX;
- UINT16 DS;
- UINT16 ES;
- UINT16 FS;
- UINT16 GS;
- IA32_EFLAGS32 EFLAGS;
- UINT32 Eip;
- UINT16 CS;
- UINT16 SS;
-} IA32_DWORD_REGS;
-
-typedef union {
- IA32_DWORD_REGS E;
- IA32_WORD_REGS X;
- IA32_BYTE_REGS H;
-} IA32_REGISTER_SET;
-
-//
-// Byte packed structure for an 16-bit real mode thunks
-//
-typedef struct {
- IA32_REGISTER_SET *RealModeState;
- VOID *RealModeBuffer;
- UINT32 RealModeBufferSize;
- UINT32 ThunkAttributes;
-} THUNK_CONTEXT;
-
-#define THUNK_ATTRIBUTE_BIG_REAL_MODE 0x00000001
-#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 0x00000002
-#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004
-
-/**
- Retrieves CPUID information.
-
- Executes the CPUID instruction with EAX set to the value specified by Index.
- This function always returns Index.
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
- This function is only available on IA-32 and X64.
-
- @param Index The 32-bit value to load into EAX prior to invoking the CPUID
- instruction.
- @param Eax Pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Ebx Pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Ecx Pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
- @param Edx Pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be NULL.
-
- @return Index
-
-**/
-UINT32
-EFIAPI
-AsmCpuid (
- IN UINT32 Index,
- OUT UINT32 *Eax, OPTIONAL
- OUT UINT32 *Ebx, OPTIONAL
- OUT UINT32 *Ecx, OPTIONAL
- OUT UINT32 *Edx OPTIONAL
- );
-
-
-/**
- Retrieves CPUID information using an extended leaf identifier.
-
- Executes the CPUID instruction with EAX set to the value specified by Index
- and ECX set to the value specified by SubIndex. This function always returns
- Index. This function is only available on IA-32 and x64.
-
- If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.
- If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.
- If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.
- If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.
-
- @param Index The 32-bit value to load into EAX prior to invoking the
- CPUID instruction.
- @param SubIndex The 32-bit value to load into ECX prior to invoking the
- CPUID instruction.
- @param Eax Pointer to the 32-bit EAX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Ebx Pointer to the 32-bit EBX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Ecx Pointer to the 32-bit ECX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
- @param Edx Pointer to the 32-bit EDX value returned by the CPUID
- instruction. This is an optional parameter that may be
- NULL.
-
- @return Index
-
-**/
-UINT32
-EFIAPI
-AsmCpuidEx (
- IN UINT32 Index,
- IN UINT32 SubIndex,
- OUT UINT32 *Eax, OPTIONAL
- OUT UINT32 *Ebx, OPTIONAL
- OUT UINT32 *Ecx, OPTIONAL
- OUT UINT32 *Edx OPTIONAL
- );
-
-
-/**
- Returns the lower 32-bits of a Machine Specific Register(MSR).
-
- Reads and returns the lower 32-bits of the MSR specified by Index.
- No parameter checking is performed on Index, and some Index values may cause
- CPU exceptions. The caller must either guarantee that Index is valid, or the
- caller must set up exception handlers to catch the exceptions. This function
- is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The lower 32 bits of the MSR identified by Index.
-
-**/
-UINT32
-EFIAPI
-AsmReadMsr32 (
- IN UINT32 Index
- );
-
-
-/**
- Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).
-
- Writes the 32-bit value specified by Value to the MSR specified by Index. The
- upper 32-bits of the MSR write are set to zero. The 32-bit value written to
- the MSR is returned. No parameter checking is performed on Index or Value,
- and some of these may cause CPU exceptions. The caller must either guarantee
- that Index and Value are valid, or the caller must establish proper exception
- handlers. This function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 32-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-AsmWriteMsr32 (
- IN UINT32 Index,
- IN UINT32 Value
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise inclusive OR on the lower 32-bits, and
- writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the lower 32-bits of the read result and the value specified by
- OrData, and writes the result to the 64-bit MSR specified by Index. The lower
- 32-bits of the value written to the MSR is returned. No parameter checking is
- performed on Index or OrData, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and OrData are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrOr32 (
- IN UINT32 Index,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
- the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData, and
- writes the result to the 64-bit MSR specified by Index. The lower 32-bits of
- the value written to the MSR is returned. No parameter checking is performed
- on Index or AndData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index and AndData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAnd32 (
- IN UINT32 Index,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive OR
- on the lower 32-bits, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData
- preserving the upper 32-bits, performs a bitwise inclusive OR between the
- result of the AND operation and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Address. The lower 32-bits of the value
- written to the MSR is returned. No parameter checking is performed on Index,
- AndData, or OrData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index, AndData, and OrData are valid, or the
- caller must establish proper exception handlers. This function is only
- available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAndThenOr32 (
- IN UINT32 Index,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned. The caller must either guarantee that Index is valid, or the caller
- must set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read from the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldRead32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination MSR are preserved. The lower 32-bits of the MSR written is
- returned. Extra left bits in Value are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldWrite32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The lower 32-bits of the value
- written to the MSR are returned. Extra left bits in OrData are stripped. The
- caller must either guarantee that Index and the data written is valid, or
- the caller must set up exception handlers to catch the exceptions. This
- function is only available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The lower 32-bits of the value written to the
- MSR are returned. Extra left bits in AndData are stripped. The caller must
- either guarantee that Index and the data written is valid, or the caller must
- set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAnd32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a
- bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- lower 32-bits of the value written to the MSR are returned. Extra left bits
- in both AndData and OrData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAndThenOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-
-/**
- Returns a 64-bit Machine Specific Register(MSR).
-
- Reads and returns the 64-bit MSR specified by Index. No parameter checking is
- performed on Index, and some Index values may cause CPU exceptions. The
- caller must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The value of the MSR identified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- );
-
-
-/**
- Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
- value.
-
- Writes the 64-bit value specified by Value to the MSR specified by Index. The
- 64-bit value written to the MSR is returned. No parameter checking is
- performed on Index or Value, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and Value are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 64-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise inclusive OR, and writes the result
- back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. No parameter checking is performed on Index or OrData, and some of
- these may cause CPU exceptions. The caller must either guarantee that Index
- and OrData are valid, or the caller must establish proper exception handlers.
- This function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrOr64 (
- IN UINT32 Index,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by OrData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned. No
- parameter checking is performed on Index or OrData, and some of these may
- cause CPU exceptions. The caller must either guarantee that Index and OrData
- are valid, or the caller must establish proper exception handlers. This
- function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAnd64 (
- IN UINT32 Index,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive
- OR, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between read
- result and the value specified by AndData, performs a bitwise inclusive OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit MSR specified by Index. The value written
- to the MSR is returned. No parameter checking is performed on Index, AndData,
- or OrData, and some of these may cause CPU exceptions. The caller must either
- guarantee that Index, AndData, and OrData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAndThenOr64 (
- IN UINT32 Index,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the 64-bit MSR. The bit field is specified by the
- StartBit and the EndBit. The value of the bit field is returned. The caller
- must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read from the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldRead64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in a 64-bit MSR. The bit field is specified by
- the StartBit and the EndBit. All other bits in the destination MSR are
- preserved. The MSR written is returned. Extra left bits in Value are
- stripped. The caller must either guarantee that Index and the data written is
- valid, or the caller must set up exception handlers to catch the exceptions.
- This function is only available on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldWrite64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise inclusive OR, and
- writes the result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. Extra left bits in OrData are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned.
- Extra left bits in AndData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAnd64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by
- a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- value written to the MSR is returned. Extra left bits in both AndData and
- OrData are stripped. The caller must either guarantee that Index and the data
- written is valid, or the caller must set up exception handlers to catch the
- exceptions. This function is only available on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAndThenOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-
-/**
- Reads the current value of the EFLAGS register.
-
- Reads and returns the current value of the EFLAGS register. This function is
- only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a
- 64-bit value on X64.
-
- @return EFLAGS on IA-32 or RFLAGS on X64.
-
-**/
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 0 (CR0).
-
- Reads and returns the current value of CR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 0 (CR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 2 (CR2).
-
- Reads and returns the current value of CR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 2 (CR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 3 (CR3).
-
- Reads and returns the current value of CR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 3 (CR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- );
-
-
-/**
- Reads the current value of the Control Register 4 (CR4).
-
- Reads and returns the current value of CR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of the Control Register 4 (CR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- );
-
-
-/**
- Writes a value to Control Register 0 (CR0).
-
- Writes and returns a new value to CR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr0 The value to write to CR0.
-
- @return The value written to CR0.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Cr0
- );
-
-
-/**
- Writes a value to Control Register 2 (CR2).
-
- Writes and returns a new value to CR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr2 The value to write to CR2.
-
- @return The value written to CR2.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Cr2
- );
-
-
-/**
- Writes a value to Control Register 3 (CR3).
-
- Writes and returns a new value to CR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr3 The value to write to CR3.
-
- @return The value written to CR3.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Cr3
- );
-
-
-/**
- Writes a value to Control Register 4 (CR4).
-
- Writes and returns a new value to CR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Cr4 The value to write to CR4.
-
- @return The value written to CR4.
-
-**/
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Cr4
- );
-
-
-/**
- Reads the current value of Debug Register 0 (DR0).
-
- Reads and returns the current value of DR0. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 1 (DR1).
-
- Reads and returns the current value of DR1. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 2 (DR2).
-
- Reads and returns the current value of DR2. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 3 (DR3).
-
- Reads and returns the current value of DR3. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 4 (DR4).
-
- Reads and returns the current value of DR4. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 5 (DR5).
-
- Reads and returns the current value of DR5. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 6 (DR6).
-
- Reads and returns the current value of DR6. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- );
-
-
-/**
- Reads the current value of Debug Register 7 (DR7).
-
- Reads and returns the current value of DR7. This function is only available
- on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on
- X64.
-
- @return The value of Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- );
-
-
-/**
- Writes a value to Debug Register 0 (DR0).
-
- Writes and returns a new value to DR0. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr0 The value to write to Dr0.
-
- @return The value written to Debug Register 0 (DR0).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr0 (
- UINTN Dr0
- );
-
-
-/**
- Writes a value to Debug Register 1 (DR1).
-
- Writes and returns a new value to DR1. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr1 The value to write to Dr1.
-
- @return The value written to Debug Register 1 (DR1).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr1 (
- UINTN Dr1
- );
-
-
-/**
- Writes a value to Debug Register 2 (DR2).
-
- Writes and returns a new value to DR2. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr2 The value to write to Dr2.
-
- @return The value written to Debug Register 2 (DR2).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr2 (
- UINTN Dr2
- );
-
-
-/**
- Writes a value to Debug Register 3 (DR3).
-
- Writes and returns a new value to DR3. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr3 The value to write to Dr3.
-
- @return The value written to Debug Register 3 (DR3).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr3 (
- UINTN Dr3
- );
-
-
-/**
- Writes a value to Debug Register 4 (DR4).
-
- Writes and returns a new value to DR4. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr4 The value to write to Dr4.
-
- @return The value written to Debug Register 4 (DR4).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr4 (
- UINTN Dr4
- );
-
-
-/**
- Writes a value to Debug Register 5 (DR5).
-
- Writes and returns a new value to DR5. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr5 The value to write to Dr5.
-
- @return The value written to Debug Register 5 (DR5).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr5 (
- UINTN Dr5
- );
-
-
-/**
- Writes a value to Debug Register 6 (DR6).
-
- Writes and returns a new value to DR6. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr6 The value to write to Dr6.
-
- @return The value written to Debug Register 6 (DR6).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr6 (
- UINTN Dr6
- );
-
-
-/**
- Writes a value to Debug Register 7 (DR7).
-
- Writes and returns a new value to DR7. This function is only available on
- IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.
-
- @param Dr7 The value to write to Dr7.
-
- @return The value written to Debug Register 7 (DR7).
-
-**/
-UINTN
-EFIAPI
-AsmWriteDr7 (
- UINTN Dr7
- );
-
-
-/**
- Reads the current value of Code Segment Register (CS).
-
- Reads and returns the current value of CS. This function is only available on
- IA-32 and X64.
-
- @return The current value of CS.
-
-**/
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- );
-
-
-/**
- Reads the current value of Data Segment Register (DS).
-
- Reads and returns the current value of DS. This function is only available on
- IA-32 and X64.
-
- @return The current value of DS.
-
-**/
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- );
-
-
-/**
- Reads the current value of Extra Segment Register (ES).
-
- Reads and returns the current value of ES. This function is only available on
- IA-32 and X64.
-
- @return The current value of ES.
-
-**/
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- );
-
-
-/**
- Reads the current value of FS Data Segment Register (FS).
-
- Reads and returns the current value of FS. This function is only available on
- IA-32 and X64.
-
- @return The current value of FS.
-
-**/
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- );
-
-
-/**
- Reads the current value of GS Data Segment Register (GS).
-
- Reads and returns the current value of GS. This function is only available on
- IA-32 and X64.
-
- @return The current value of GS.
-
-**/
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- );
-
-
-/**
- Reads the current value of Stack Segment Register (SS).
-
- Reads and returns the current value of SS. This function is only available on
- IA-32 and X64.
-
- @return The current value of SS.
-
-**/
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- );
-
-
-/**
- Reads the current value of Task Register (TR).
-
- Reads and returns the current value of TR. This function is only available on
- IA-32 and X64.
-
- @return The current value of TR.
-
-**/
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- );
-
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and X64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- );
-
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and X64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- );
-
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and X64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- );
-
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and X64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- );
-
-
-/**
- Reads the current Local Descriptor Table Register(LDTR) selector.
-
- Reads and returns the current 16-bit LDTR descriptor value. This function is
- only available on IA-32 and X64.
-
- @return The current selector of LDT.
-
-**/
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- );
-
-
-/**
- Writes the current Local Descriptor Table Register (GDTR) selector.
-
- Writes and the current LDTR descriptor specified by Ldtr. This function is
- only available on IA-32 and X64.
-
- @param Ldtr 16-bit LDTR selector value.
-
-**/
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- );
-
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and X64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxSave (
- OUT IA32_FX_BUFFER *Buffer
- );
-
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and X64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
- If Buffer was not saved with AsmFxSave(), then ASSERT().
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #0 (MM0).
-
- Reads and returns the current value of MM0. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM0.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #1 (MM1).
-
- Reads and returns the current value of MM1. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM1.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #2 (MM2).
-
- Reads and returns the current value of MM2. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM2.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #3 (MM3).
-
- Reads and returns the current value of MM3. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM3.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #4 (MM4).
-
- Reads and returns the current value of MM4. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM4.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #5 (MM5).
-
- Reads and returns the current value of MM5. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM5.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #6 (MM6).
-
- Reads and returns the current value of MM6. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM6.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- );
-
-
-/**
- Reads the current value of 64-bit MMX Register #7 (MM7).
-
- Reads and returns the current value of MM7. This function is only available
- on IA-32 and X64.
-
- @return The current value of MM7.
-
-**/
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #0 (MM0).
-
- Writes the current value of MM0. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM0.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #1 (MM1).
-
- Writes the current value of MM1. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM1.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #2 (MM2).
-
- Writes the current value of MM2. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM2.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #3 (MM3).
-
- Writes the current value of MM3. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM3.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #4 (MM4).
-
- Writes the current value of MM4. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM4.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #5 (MM5).
-
- Writes the current value of MM5. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM5.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #6 (MM6).
-
- Writes the current value of MM6. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM6.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- );
-
-
-/**
- Writes the current value of 64-bit MMX Register #7 (MM7).
-
- Writes the current value of MM7. This function is only available on IA32 and
- X64.
-
- @param Value The 64-bit value to write to MM7.
-
-**/
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- );
-
-
-/**
- Reads the current value of Time Stamp Counter (TSC).
-
- Reads and returns the current value of TSC. This function is only available
- on IA-32 and X64.
-
- @return The current value of TSC
-
-**/
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- );
-
-
-/**
- Reads the current value of a Performance Counter (PMC).
-
- Reads and returns the current value of performance counter specified by
- Index. This function is only available on IA-32 and X64.
-
- @param Index The 32-bit Performance Counter index to read.
-
- @return The value of the PMC specified by Index.
-
-**/
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 Index
- );
-
-
-/**
- Sets up a monitor buffer that is used by AsmMwait().
-
- Executes a MONITOR instruction with the register state specified by Eax, Ecx
- and Edx. Returns Eax. This function is only available on IA-32 and X64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
- @param Edx The value to load into EDX or RDX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMonitor (
- IN UINTN Eax,
- IN UINTN Ecx,
- IN UINTN Edx
- );
-
-
-/**
- Executes an MWAIT instruction.
-
- Executes an MWAIT instruction with the register state specified by Eax and
- Ecx. Returns Eax. This function is only available on IA-32 and X64.
-
- @param Eax The value to load into EAX or RAX before executing the MONITOR
- instruction.
- @param Ecx The value to load into ECX or RCX before executing the MONITOR
- instruction.
-
- @return Eax
-
-**/
-UINTN
-EFIAPI
-AsmMwait (
- IN UINTN Eax,
- IN UINTN Ecx
- );
-
-
-/**
- Executes a WBINVD instruction.
-
- Executes a WBINVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- );
-
-
-/**
- Executes a INVD instruction.
-
- Executes a INVD instruction. This function is only available on IA-32 and
- X64.
-
-**/
-VOID
-EFIAPI
-AsmInvd (
- VOID
- );
-
-
-/**
- Flushes a cache line from all the instruction and data caches within the
- coherency domain of the CPU.
-
- Flushed the cache line specified by LinearAddress, and returns LinearAddress.
- This function is only available on IA-32 and X64.
-
- @param LinearAddress The address of the cache line to flush. If the CPU is
- in a physical addressing mode, then LinearAddress is a
- physical address. If the CPU is in a virtual
- addressing mode, then LinearAddress is a virtual
- address.
-
- @return LinearAddress
-**/
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- );
-
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit paged mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode with flat
- descriptors, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging64 (
- IN UINT16 CodeSelector,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- );
-
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on X64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 64-bit paged mode, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging64 (
- IN UINT16 CodeSelector,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- );
-
-
-//
-// 16-bit thunking services
-//
-
-/**
- Retrieves the properties for 16-bit thunk functions.
-
- Computes the size of the buffer and stack below 1MB required to use the
- AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This
- buffer size is returned in RealModeBufferSize, and the stack size is returned
- in ExtraStackSize. If parameters are passed to the 16-bit real mode code,
- then the actual minimum stack size is ExtraStackSize plus the maximum number
- of bytes that need to be passed to the 16-bit real mode code.
-
- If RealModeBufferSize is NULL, then ASSERT().
- If ExtraStackSize is NULL, then ASSERT().
-
- @param RealModeBufferSize A pointer to the size of the buffer below 1MB
- required to use the 16-bit thunk functions.
- @param ExtraStackSize A pointer to the extra size of stack below 1MB
- that the 16-bit thunk functions require for
- temporary storage in the transition to and from
- 16-bit real mode.
-
-**/
-VOID
-EFIAPI
-AsmGetThunk16Properties (
- OUT UINT32 *RealModeBufferSize,
- OUT UINT32 *ExtraStackSize
- );
-
-
-/**
- Prepares all structures a code required to use AsmThunk16().
-
- Prepares all structures and code required to use AsmThunk16().
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareThunk16 (
- OUT THUNK_CONTEXT *ThunkContext
- );
-
-
-/**
- Transfers control to a 16-bit real mode entry point and returns the results.
-
- Transfers control to a 16-bit real mode entry point and returns the results.
- AsmPrepareThunk16() must be called with ThunkContext before this function is
- used.
-
- If ThunkContext is NULL, then ASSERT().
- If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- );
-
-
-/**
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results.
-
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results. If the
- caller only need to perform a single 16-bit real mode thunk, then this
- service should be used. If the caller intends to make more than one 16-bit
- real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
- once and AsmThunk16() can be called for each 16-bit real mode thunk.
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareAndThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- );
-
-#else
-
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseMemoryLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseMemoryLib.h
deleted file mode 100644
index c0edb32e15..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueBaseMemoryLib.h
+++ /dev/null
@@ -1,391 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueBaseMemoryLib.h
-
-Abstract:
-
- Memory-only library functions with no library constructor/destructor
-
---*/
-
-#ifndef __EDKII_GLUE_BASE_MEMORY_LIB_H__
-#define __EDKII_GLUE_BASE_MEMORY_LIB_H__
-
-
-#define CopyMem(_DESTINATIONBUFFER, _SOURCEBUFFER, _LENGTH) GlueCopyMem(_DESTINATIONBUFFER, _SOURCEBUFFER, _LENGTH)
-#define ZeroMem(_BUFFER, _LENGTH) GlueZeroMem(_BUFFER, _LENGTH)
-#define SetMem(_BUFFER, _LENGTH, _VALUE) GlueSetMem(_BUFFER, _LENGTH, _VALUE)
-#define CompareMem(_DESTINATIONBUFFER, _SOURCEBUFFER, _LENGTH) GlueCompareMem(_DESTINATIONBUFFER, _SOURCEBUFFER, _LENGTH)
-#define CompareGuid(_GUID1, _GUID2) GlueCompareGuid(_GUID1, _GUID2)
-#define ScanGuid(_BUFFER, _LENGTH, _GUID) GlueScanGuid(_BUFFER, _LENGTH, _GUID)
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer Pointer to the destination buffer of the memory copy.
- @param SourceBuffer Pointer to the source buffer of the memory copy.
- @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-GlueCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Memory to set.
- @param Length Number of bytes to set.
- @param Value Value of the set operation.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-GlueSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill with zeros.
- @param Length Number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-GlueZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
- If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT().
- If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer Pointer to the destination buffer to compare.
- @param SourceBuffer Pointer to the source buffer to compare.
- @param Length Number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-GlueCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- );
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- );
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Guid Value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueCacheMaintenanceLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueCacheMaintenanceLib.h
deleted file mode 100644
index 041589d04f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueCacheMaintenanceLib.h
+++ /dev/null
@@ -1,224 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueCacheMaintenanceLib.h
-
-Abstract:
-
- Cache Maintenance Functions
-
---*/
-
-#ifndef __EDKII_GLUE_CACHE_MAINTENANCE_LIB_H__
-#define __EDKII_GLUE_CACHE_MAINTENANCE_LIB_H__
-
-
-#define InvalidateInstructionCache() GlueInvalidateInstructionCache()
-
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-GlueInvalidateInstructionCache (
- VOID
- );
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- );
-
-/**
- Writes Back and Invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, the no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- );
-
-/**
- Writes Back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes Back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, the no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- );
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, the no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h
deleted file mode 100644
index 3c42a05f17..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDebugLib.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDebugLib.h
-
-Abstract:
-
- Public include file for the Debug Library
-
---*/
-
-#ifndef __EDKII_GLUE_DEBUG_LIB_H__
-#define __EDKII_GLUE_DEBUG_LIB_H__
-
-//
-// To use EDKII code, these EDK macros are undefined
-//
-#undef ASSERT
-#undef DEBUG
-#undef ASSERT_EFI_ERROR
-#undef ASSERT_PROTOCOL_ALREADY_INSTALLED
-#undef DEBUG_CODE
-#undef CR
-
-#undef EFI_D_INIT
-#undef EFI_D_WARN
-#undef EFI_D_LOAD
-#undef EFI_D_FS
-#undef EFI_D_POOL
-#undef EFI_D_PAGE
-#undef EFI_D_INFO
-#undef EFI_D_VARIABLE
-#undef EFI_D_BM
-#undef EFI_D_BLKIO
-#undef EFI_D_NET
-#undef EFI_D_UNDI
-#undef EFI_D_LOADFILE
-#undef EFI_D_EVENT
-#undef EFI_D_VERBOSE
-#undef EFI_D_ERROR
-
-//
-// Declare bits for PcdDebugPropertyMask
-//
-#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x01
-#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x02
-#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x04
-#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x08
-#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x10
-#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x20
-
-//
-// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
-//
-#define DEBUG_INIT 0x00000001 // Initialization
-#define DEBUG_WARN 0x00000002 // Warnings
-#define DEBUG_LOAD 0x00000004 // Load events
-#define DEBUG_FS 0x00000008 // EFI File system
-#define DEBUG_POOL 0x00000010 // Alloc & Free's
-#define DEBUG_PAGE 0x00000020 // Alloc & Free's
-#define DEBUG_INFO 0x00000040 // Informational debug messages
-#define DEBUG_VARIABLE 0x00000100 // Variable
-#define DEBUG_BM 0x00000400 // Boot Manager
-#define DEBUG_BLKIO 0x00001000 // BlkIo Driver
-#define DEBUG_NET 0x00004000 // SNI Driver
-#define DEBUG_UNDI 0x00010000 // UNDI Driver
-#define DEBUG_LOADFILE 0x00020000 // UNDI Driver
-#define DEBUG_EVENT 0x00080000 // Event messages
-#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may significantly impact boot performance
-#define DEBUG_ERROR 0x80000000 // Error
-
-//
-// Aliases of debug message mask bits
-//
-#define EFI_D_INIT DEBUG_INIT
-#define EFI_D_WARN DEBUG_WARN
-#define EFI_D_LOAD DEBUG_LOAD
-#define EFI_D_FS DEBUG_FS
-#define EFI_D_POOL DEBUG_POOL
-#define EFI_D_PAGE DEBUG_PAGE
-#define EFI_D_INFO DEBUG_INFO
-#define EFI_D_VARIABLE DEBUG_VARIABLE
-#define EFI_D_BM DEBUG_BM
-#define EFI_D_BLKIO DEBUG_BLKIO
-#define EFI_D_NET DEBUG_NET
-#define EFI_D_UNDI DEBUG_UNDI
-#define EFI_D_LOADFILE DEBUG_LOADFILE
-#define EFI_D_EVENT DEBUG_EVENT
-#define EFI_D_VERBOSE DEBUG_VERBOSE
-#define EFI_D_ERROR DEBUG_ERROR
-
-
-//
-// Use the following 4 macros to save size
-//
-#define DebugAssertEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0))
-
-#define DebugPrintEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0))
-
-#define DebugCodeEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0))
-
-#define DebugClearMemoryEnabled() ((BOOLEAN)((__EDKII_GLUE_PCD_PcdDebugPropertyMask__ & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0))
-
-
-/**
-
- Prints a debug message to the debug output device if the specified error level is enabled.
-
- If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
- the message specified by Format and the associated variable argument list to
- the debug output device.
-
- If Format is NULL, then ASSERT().
-
- @param ErrorLevel The error level of the debug message.
- @param Format Format string for the debug message to print.
-
-**/
-VOID
-EFIAPI
-DebugPrint (
- IN UINTN ErrorLevel,
- IN CONST CHAR8 *Format,
- ...
- );
-
-
-/**
-
- Prints an assert message containing a filename, line number, and description.
- This may be followed by a breakpoint or a dead loop.
-
- Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
- CpuDeadLoop() is called. If neither of these bits are set, then this function
- returns immediately after the message is printed to the debug output device.
- DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
- processing another DebugAssert(), then DebugAssert() must return immediately.
-
- If FileName is NULL, then a <FileName> string of ?NULL) Filename?is printed.
-
- If Description is NULL, then a <Description> string of ?NULL) Description?is printed.
-
- @param FileName Pointer to the name of the source file that generated the assert condition.
- @param LineNumber The line number in the source file that generated the assert condition
- @param Description Pointer to the description of the assert condition.
-
-**/
-VOID
-EFIAPI
-DebugAssert (
- IN CONST CHAR8 *FileName,
- IN UINTN LineNumber,
- IN CONST CHAR8 *Description
- );
-
-
-/**
-
- Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the value specified by
- PcdDebugClearMemoryValue, and returns Buffer.
-
- If Buffer is NULL, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS ?Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
- @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-DebugClearMemory (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-
-/**
-
- Internal worker macro that calls DebugAssert().
-
- This macro calls DebugAssert() passing in the filename, line number, and
- expression that evailated to FALSE.
-
- @param Expression Boolean expression that evailated to FALSE
-
-**/
-#ifdef EFI_DEBUG
-#define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression)
-#else
-#define _ASSERT(Expression)
-
-#endif
-
-/**
-
- Internal worker macro that calls DebugPrint().
-
- This macro calls DebugPrint() passing in the debug error level, a format
- string, and a variable argument list.
-
- @param Expression Expression containing an error level, a format string,
- and a variable argument list based on the format string.
-
-**/
-#ifdef EFI_DEBUG
-/*
- EdkCompatibilityPkg\Foundation\Include\EfiDebug.h
- //
- // DEBUG((DebugLevel, "format string", ...)) - if DebugLevel is active do
- // the a debug print.
- //
- #define DEBUG(arg) EfiDebugPrint arg
-
- To pass ICC build, undef the previously defined _DEBUG.
-*/
-#undef _DEBUG
-#define _DEBUG(Expression) DebugPrint Expression
-#else
-#define _DEBUG(Expression)
-
-#endif
-
-/**
-
- Macro that calls DebugAssert() if a expression evaluates to FALSE.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro evaluates the Boolean expression specified by Expression. If
- Expression evaluates to FALSE, then DebugAssert() is called passing in the
- source filename, source line number, and Expression.
-
- @param Expression Boolean expression
-
-**/
-#ifdef EDKII_GLUE_LIBRARY_IMPLEMENTATION
- // Glue Library internal
-
- #if EDKII_GLUE_LIBRARY_DEBUG_ENABLE
- #ifdef EFI_DEBUG
- #define ASSERT(Expression) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (!(Expression)) { \
- _ASSERT (Expression); \
- } \
- } \
- } while (FALSE)
- #endif
- #else
- #define ASSERT(Expression) do{} while(0)
- #endif
-
-#else
- // External usage
-
- #ifdef EFI_DEBUG
- #define ASSERT(Expression) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (!(Expression)) { \
- _ASSERT (Expression); \
- } \
- } \
- } while (FALSE)
- #else
- #define ASSERT(Expression) do{} while(0)
- #endif
-
-#endif
-
-/**
-
- Macro that calls DebugPrint().
-
- If the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro passes Expression to DebugPrint().
-
- @param Expression Expression containing an error level, a format string,
- and a variable argument list based on the format string.
-
-
-**/
-#ifdef EDKII_GLUE_LIBRARY_IMPLEMENTATION
- // Glue Library internal
-
- #if EDKII_GLUE_LIBRARY_DEBUG_ENABLE
- #ifdef EFI_DEBUG
- #define DEBUG(Expression) \
- do { \
- if (DebugPrintEnabled ()) { \
- _DEBUG (Expression); \
- } \
- } while (FALSE)
- #endif
- #else
- #define DEBUG(Expression) do{} while(0)
- #endif
-
-#else
- // External usage
-
- #ifdef EFI_DEBUG
- #define DEBUG(Expression) \
- do { \
- if (DebugPrintEnabled ()) { \
- _DEBUG (Expression); \
- } \
- } while (FALSE)
- #else
- #define DEBUG(Expression) do{} while(0)
- #endif
-
-#endif
-
-
-/**
-
- Macro that calls DebugAssert() if an EFI_STATUS evaluates to an error code.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro evaluates the EFI_STATUS value specified by StatusParameter.
- If StatusParameter is an error code, then DebugAssert() is called passing in
- the source filename, source line number, and StatusParameter.
-
- @param StatusParameter EFI_STATUS value to evaluate.
-
-**/
-#ifdef EDKII_GLUE_LIBRARY_IMPLEMENTATION
- // Glue Library internal
-
- #if EDKII_GLUE_LIBRARY_DEBUG_ENABLE
- #ifdef EFI_DEBUG
- #define ASSERT_EFI_ERROR(StatusParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (EFI_ERROR (StatusParameter)) { \
- DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
- _ASSERT (!EFI_ERROR (StatusParameter)); \
- } \
- } \
- } while (FALSE)
- #endif
- #else
- #define ASSERT_EFI_ERROR(Expression) do{} while(0)
- #endif
-
-#else
- // External usage
-
- #ifdef EFI_DEBUG
- #define ASSERT_EFI_ERROR(StatusParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- if (EFI_ERROR (StatusParameter)) { \
- DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
- _ASSERT (!EFI_ERROR (StatusParameter)); \
- } \
- } \
- } while (FALSE)
- #else
- #define ASSERT_EFI_ERROR(Expression) do{} while(0)
- #endif
-
-#endif
-
-
-/**
-
- Macro that calls DebugAssert() if a protocol is already installed in the
- handle database.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
- then return.
-
- If Handle is NULL, then a check is made to see if the protocol specified by Guid
- is present on any handle in the handle database. If Handle is not NULL, then
- a check is made to see if the protocol specified by Guid is present on the
- handle specified by Handle. If the check finds the protocol, then DebugAssert()
- is called passing in the source filename, source line number, and Guid.
-
- If Guid is NULL, then ASSERT().
-
- @param Handle The handle to check for the protocol. This is an optional
- parameter that may be NULL. If it is NULL, then the entire
- handle database is searched.
-
- @param Guid Pointer to a protocol GUID.
-
-**/
-#ifdef EFI_DEBUG
-#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
- do { \
- if (DebugAssertEnabled ()) { \
- VOID *Instance; \
- ASSERT (Guid != NULL); \
- if (Handle == NULL) { \
- if (!EFI_ERROR (gBS->LocateProtocol ((EFI_GUID *)Guid, NULL, &Instance))) { \
- _ASSERT (Guid already installed in database); \
- } \
- } else { \
- if (!EFI_ERROR (gBS->HandleProtocol (Handle, (EFI_GUID *)Guid, &Instance))) { \
- _ASSERT (Guid already installed on Handle); \
- } \
- } \
- } \
- } while (FALSE)
-#else
-#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
- do {} while(0);
-#endif
-
-
-/**
- Macro that marks the beginning of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then this macro marks the beginning of source code that is included in a module.
- Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
- are not included in a module.
-
-**/
-#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
-
-
-/**
-
- Macro that marks the end of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then this macro marks the end of source code that is included in a module.
- Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
- are not included in a module.
-
-**/
-#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)
-
-
-/**
-
- Macro that declares a section of debug source code.
-
- If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
- then the source code specified by Expression is included in a module.
- Otherwise, the source specified by Expression is not included in a module.
-
-**/
-#define DEBUG_CODE(Expression) \
- DEBUG_CODE_BEGIN (); \
- Expression \
- DEBUG_CODE_END ()
-
-
-/**
-
- Macro that calls DebugClearMemory() to clear a buffer to a default value.
-
- If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set,
- then this macro calls DebugClearMemory() passing in Address and Length.
-
- @param Address Pointer to a buffer.
- @param Length The number of bytes in the buffer to set.
-
-**/
-#define DEBUG_CLEAR_MEMORY(Address, Length) \
- do { \
- if (DebugClearMemoryEnabled ()) { \
- DebugClearMemory (Address, Length); \
- } \
- } while (FALSE)
-
-
-/**
-
- Macro that calls DebugAssert() if the containing record does not have a
- matching signature. If the signatures matches, then a pointer to the data
- structure that contains a specified field of that data structure is returned.
- This is a light weight method hide information by placing a public data
- structure inside a larger private data structure and using a pointer to the
- public data structure to retrieve a pointer to the private data structure.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
- then this macro computes the offset, in bytes, of field specified by Field
- from the beginning of the data structure specified by TYPE. This offset is
- subtracted from Record, and is used to return a pointer to a data structure
- of the type specified by TYPE.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro computes the offset, in bytes, of field specified by Field from
- the beginning of the data structure specified by TYPE. This offset is
- subtracted from Record, and is used to compute a pointer to a data structure of
- the type specified by TYPE. The Signature field of the data structure specified
- by TYPE is compared to TestSignature. If the signatures match, then a pointer
- to the pointer to a data structure of the type specified by TYPE is returned.
- If the signatures do not match, then DebugAssert() is called with a description
- of "CR has a bad signature" and Record is returned.
-
- If the data type specified by TYPE does not contain the field specified by Field,
- then the module will not compile.
-
- If TYPE does not contain a field called Signature, then the module will not
- compile.
-
- @param Record Pointer to the field specified by Field within a data
- structure of type TYPE.
-
- @param TYPE The name of the data structure type to return This
- data structure must contain the field specified by Field.
-
- @param Field The name of the field in the data structure specified
- by TYPE to which Record points.
-
- @param TestSignature The 32-bit signature value to match.
-
-**/
-#ifdef EFI_DEBUG
- #define CR(Record, TYPE, Field, TestSignature) \
- (DebugAssertEnabled () && (_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
- (TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
- _CR (Record, TYPE, Field)
-#else
- #define CR(Record, TYPE, Field, TestSignature) \
- _CR (Record, TYPE, Field)
-#endif
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDevicePathLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDevicePathLib.h
deleted file mode 100644
index 49d6f78957..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDevicePathLib.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDevicePathLib.h
-
-Abstract:
-
- Public header file for Device Path Lib
-
---*/
-
-#ifndef __EDKII_GLUE_DEVICE_PATH_LIB_H__
-#define __EDKII_GLUE_DEVICE_PATH_LIB_H__
-
-
-#define GetDevicePathSize(_DEVICEPATH) GlueGetDevicePathSize(_DEVICEPATH)
-#define DuplicateDevicePath(_DEVICEPATH) GlueDuplicateDevicePath(_DEVICEPATH)
-#define AppendDevicePath(_FIRSTPATH, _SECONDPATH) GlueAppendDevicePath(_FIRSTPATH, _SECONDPATH)
-#define AppendDevicePathNode(_DEVICEPATH, _DEVICEPATHNODE) GlueAppendDevicePathNode(_DEVICEPATH, _DEVICEPATHNODE)
-#define AppendDevicePathInstance(_SOURCE, _INSTANCE) GlueAppendDevicePathInstance(_SOURCE,_INSTANCE)
-#define GetNextDevicePathInstance(_DEVICEPATH, _SIZE) GlueGetNextDevicePathInstance(_DEVICEPATH, _SIZE)
-#define IsDevicePathMultiInstance(_DEVICEPATH) GlueIsDevicePathMultiInstance(_DEVICEPATH)
-#define DevicePathFromHandle(_HANDLE) GlueDevicePathFromHandle(_HANDLE)
-#define FileDevicePath(_DEVICE, _FILENAME) GlueFileDevicePath(_DEVICE, _FILENAME)
-
-
-/**
- Returns the size of a device path in bytes.
-
- This function returns the size, in bytes, of the device path data structure specified by
- DevicePath including the end of device path node. If DevicePath is NULL, then 0 is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @return The size of a device path in bytes.
-
-**/
-UINTN
-EFIAPI
-GlueGetDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Creates a new device path by appending a second device path to a first device path.
-
- This function allocates space for a new copy of the device path specified by DevicePath. If
- DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the
- contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer
- is returned. Otherwise, NULL is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @return A pointer to the duplicated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueDuplicateDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Creates a new device path by appending a second device path to a first device path.
-
- This function creates a new device path by appending a copy of SecondDevicePath to a copy of
- FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from
- SecondDevicePath is retained. The newly created device path is returned.
- If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.
- If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.
- If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.
- If there is not enough memory for the newly allocated buffer, then NULL is returned.
- The memory for the new device path is allocated from EFI boot services memory. It is the
- responsibility of the caller to free the memory allocated.
-
- @param FirstDevicePath A pointer to a device path data structure.
- @param SecondDevicePath A pointer to a device path data structure.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL
- );
-
-/**
- Creates a new path by appending the device node to the device path.
-
- This function creates a new device path by appending a copy of the device node specified by
- DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device node.
- If DevicePath is NULL, then NULL is returned.
- If DevicePathNode is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathNode A pointer to a single device path node.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePathNode (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL
- );
-
-/**
- Creates a new device path by appending the specified device path instance to the specified device
- path.
-
- This function creates a new device path by appending a copy of the device path instance specified
- by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device path instance
- and a new end-of-device-path-instance node is inserted between.
- If DevicePath is NULL, then a copy if DevicePathInstance is returned.
- If DevicePathInstance is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathInstance A pointer to a device path instance.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePathInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL
- );
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- This function creates a copy of the current device path instance. It also updates DevicePath to
- point to the next device path instance in the device path (or NULL if no more) and updates Size
- to hold the size of the device path instance copy.
- If DevicePath is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
- If Size is NULL, then ASSERT().
-
- @param DevicePath On input, this holds the pointer to the current device path
- instance. On output, this holds the pointer to the next device
- path instance or NULL if there are no more device path
- instances in the device path pointer to a device path data
- structure.
- @param Size On output, this holds the size of the device path instance, in
- bytes or zero, if DevicePath is NULL.
-
- @return A pointer to the current device path instance.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueGetNextDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- );
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- This function creates a new device node in a newly allocated buffer of size NodeLength and
- initializes the device path node header with NodeType and NodeSubType. The new device path node
- is returned.
- If NodeLength is smaller than a device path header, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param NodeType The device node type for the new device node.
- @param NodeSubType The device node sub-type for the new device node.
- @param NodeLength The length of the new device node.
-
- @return The new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-CreateDeviceNode (
- IN UINT8 NodeType,
- IN UINT8 NodeSubType,
- IN UINT16 NodeLength
- );
-
-/**
- Determines if a device path is single or multi-instance.
-
- This function returns TRUE if the device path specified by DevicePath is multi-instance.
- Otherwise, FALSE is returned. If DevicePath is NULL, then FALSE is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @retval TRUE DevicePath is multi-instance.
- @retval FALSE DevicePath is not multi-instance or DevicePath is NULL.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsDevicePathMultiInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Retrieves the device path protocol from a handle.
-
- This function returns the device path protocol from the handle specified by Handle. If Handle is
- NULL or Handle does not contain a device path protocol, then NULL is returned.
-
- @param Handle The handle from which to retrieve the device path protocol.
-
- @return The device path protocol from the handle specified by Handle.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueDevicePathFromHandle (
- IN EFI_HANDLE Handle
- );
-
-/**
- Allocates a device path for a file and appends it to an existing device path.
-
- If Device is a valid device handle that contains a device path protocol, then a device path for
- the file specified by FileName is allocated and appended to the device path associated with the
- handle Device. The allocated device path is returned. If Device is NULL or Device is a handle
- that does not support the device path protocol, then a device path containing a single device
- path node for the file specified by FileName is allocated and returned.
- If FileName is NULL, then ASSERT().
-
- @param Device A pointer to a device handle. This parameter is optional and
- may be NULL.
- @param FileName A pointer to a Null-terminated Unicode string.
-
- @return The allocated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueFileDevicePath (
- IN EFI_HANDLE Device, OPTIONAL
- IN CONST CHAR16 *FileName
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h
deleted file mode 100644
index 83bca6497e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeRuntimeDriverLib.h
+++ /dev/null
@@ -1,454 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDxeRuntimeDriverLib.h
-
-Abstract:
-
- Library that abstracts runtime services
-
---*/
-
-#ifndef __EDKII_GLUE_DXE_RUNTIME_DRIVER_LIB_H__
-#define __EDKII_GLUE_DXE_RUNTIME_DRIVER_LIB_H__
-
-#ifdef MDE_CPU_IPF
-#include "EdkIIGlueEdkDxeSalLib.h"
-#endif
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
-typedef struct {
- EFI_GUID CapsuleGuid;
- UINT32 HeaderSize;
- UINT32 Flags;
- UINT32 CapsuleImageSize;
-} UEFI_CAPSULE_HEADER;
-
-#else
-
-typedef EFI_CAPSULE_HEADER UEFI_CAPSULE_HEADER;
-
-#endif
-
-extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];
-
-extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];
-
-/**
- Check to see if the execute context is in Runtime phase or not.
-
- @param None.
-
- @retval TRUE The driver is in SMM.
- @retval FALSE The driver is not in SMM.
-
-**/
-BOOLEAN
-EFIAPI
-EfiAtRuntime (
- VOID
- );
-
-/**
- Check to see if the SetVirtualAddressMsp() is invoked or not.
-
- @retval TRUE SetVirtualAddressMsp() has been called.
- @retval FALSE SetVirtualAddressMsp() has not been called.
-
-**/
-BOOLEAN
-EFIAPI
-EfiGoneVirtual (
- VOID
- );
-
-/**
- Return current time and date information, and time-keeping
- capabilities of hardware platform.
-
- @param Time A pointer to storage to receive a snapshot of the current time.
- @param Capabilities An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- );
-
-/**
- Set current time and date information.
-
- @param Time A pointer to cache of time setting.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to execute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetTime (
- IN EFI_TIME *Time
- );
-
-/**
- Return current wakeup alarm clock setting.
-
- @param Enabled Indicate if the alarm clock is enabled or disabled.
- @param Pending Indicate if the alarm signal is pending and requires acknowledgement.
- @param Time Current alarm clock setting.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- );
-
-/**
- Set current wakeup alarm clock.
-
- @param Enable Enable or disable current alarm clock..
- @param Time Point to alarm clock setting.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- );
-
-/**
- Return value of variable.
-
- @param VariableName the name of the vendor's variable, it's a
- Null-Terminated Unicode String
- @param VendorGuid Unify identifier for vendor.
- @param Attributes Point to memory location to return the attributes of variable. If the point
- is NULL, the parameter would be ignored.
- @param DataSize As input, point to the maxinum size of return Data-Buffer.
- As output, point to the actual size of the returned Data-Buffer.
- @param Data Point to return Data-Buffer.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- OUT UINT32 *Attributes,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- );
-
-/**
- Enumerates variable's name.
-
- @param VariableNameSize As input, point to maxinum size of variable name.
- As output, point to actual size of varaible name.
- @param VariableName As input, supplies the last VariableName that was returned by
- GetNextVariableName().
- As output, returns the name of variable. The name
- string is Null-Terminated Unicode string.
- @param VendorGuid As input, supplies the last VendorGuid that was returned by
- GetNextVriableName().
- As output, returns the VendorGuid of the current variable.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- );
-
-/**
- Sets value of variable.
-
- @param VariableName the name of the vendor's variable, it's a
- Null-Terminated Unicode String
- @param VendorGuid Unify identifier for vendor.
- @param Attributes Point to memory location to return the attributes of variable. If the point
- is NULL, the parameter would be ignored.
- @param DataSize The size in bytes of Data-Buffer.
- @param Data Point to the content of the variable.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- );
-
-/**
- Returns the next high 32 bits of platform's monotonic counter.
-
- @param HighCount Pointer to returned value.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- );
-
-/**
- Resets the entire platform.
-
- @param ResetType The type of reset to perform.
- @param ResetStatus The status code for reset.
- @param DataSize The size in bytes of reset data.
- @param ResetData Pointer to data buffer that includes
- Null-Terminated Unicode string.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-VOID
-EFIAPI
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- );
-
-/**
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
- @param DebugDisposition Supplies type information for the pointer being converted.
- @param Address The pointer to a pointer that is to be fixed to be the
- value needed for the new virtual address mapping being
- applied.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID **Address
- );
-
-
-/**
- Change the runtime addressing mode of EFI firmware from physical to virtual.
-
- @param MemoryMapSize The size in bytes of VirtualMap.
- @param DescriptorSize The size in bytes of an entry in the VirtualMap.
- @param DescriptorVersion The version of the structure entries in VirtualMap.
- @param VirtualMap An array of memory descriptors which contain new virtual
- address mapping information for all runtime ranges. Type
- EFI_MEMORY_DESCRIPTOR is defined in the
- GetMemoryMap() function description.
-
- @retval EFI_SUCCESS The virtual address map has been applied.
- @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
- virtual address mapped mode.
- @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
- invalid.
- @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
- map that requires a mapping.
- @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
- in the memory map.
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVirtualAddressMap (
- IN UINTN MemoryMapSize,
- IN UINTN DescriptorSize,
- IN UINT32 DescriptorVersion,
- IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
- );
-
-
-/**
- Conver the standard Lib double linked list to a virtual mapping.
-
- @param DebugDisposition Supplies type information for the pointer being converted.
- @param ListHead Head of linked list to convert.
-
- @retval EFI_SUCCESS Success to execute the function.
- @retval !EFI_SUCCESS Failed to e3xecute the function.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT LIST_ENTRY *ListHead
- );
-
-/**
-
- Passes capsules to the firmware with both virtual and physical mapping.
- Depending on the intended consumption, the firmware may
- process the capsule immediately. If the payload should persist across a
- system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
- be passed into ResetSystem() and will cause the capsule to be processed by
- the firmware as part of the reset process.
-
- @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
- being passed into update capsule. Each capsules is assumed to
- stored in contiguous virtual memory. The capsules in the
- CapsuleHeaderArray must be the same capsules as the
- ScatterGatherList. The CapsuleHeaderArray must
- have the capsules in the same order as the ScatterGatherList.
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
- CaspuleHeaderArray.
- @param ScatterGatherList Physical pointer to a set of
- EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
- location in physical memory of a set of capsules. See Related
- Definitions for an explanation of how more than one capsule is
- passed via this interface. The capsules in the
- ScatterGatherList must be in the same order as the
- CapsuleHeaderArray. This parameter is only referenced if
- the capsules are defined to persist across system reset.
-
- @retval EFI_SUCCESS Valid capsule was passed. I Valid capsule was passed. If
- CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
- capsule has been successfully processed by the firmware.
- @retval EFI_INVALID_PARAMETER CapsuleSize is NULL or ResetTye is NULL.
- @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiUpdateCapsule (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList
- );
-
-
-/**
-
- The QueryCapsuleCapabilities() function allows a caller to test to see if a capsule or
- capsules can be updated via UpdateCapsule(). The Flags values in the capsule header and
- size of the entire capsule is checked.
- If the caller needs to query for generic capsule capability a fake EFI_CAPSULE_HEADER can be
- constructed where CapsuleImageSize is equal to HeaderSize that is equal to sizeof
- (EFI_CAPSULE_HEADER). To determine reset requirements,
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET should be set in the Flags field of the
- EFI_CAPSULE_HEADER.
- The firmware must support any capsule that has the
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set in EFI_CAPSULE_HEADER. The
- firmware sets the policy for what capsules are supported that do not have the
- CAPSULE_FLAGS_PERSIST_ACROSS_RESET flag set.
-
- @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
- being passed into update capsule. The capsules are assumed to
- stored in contiguous virtual memory.
- @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
- CaspuleHeaderArray.
- @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can
- support as an argument to UpdateCapsule() via
- CapsuleHeaderArray and ScatterGatherList.
- Undefined on input.
- @param ResetType Returns the type of reset required for the capsule update.
-
- @retval EFI_SUCCESS Valid answer returned..
- @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
- @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and
- MaximumCapsuleSize and ResetType are undefined.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiQueryCapsuleCapabilities (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- OUT UINT64 *MaximumCapsuleSize,
- OUT EFI_RESET_TYPE *ResetType
- );
-
-
-/**
-
- The QueryVariableInfo() function allows a caller to obtain the information about the
- maximum size of the storage space available for the EFI variables, the remaining size of the storage
- space available for the EFI variables and the maximum size of each individual EFI variable,
- associated with the attributes specified.
- The returned MaximumVariableStorageSize, RemainingVariableStorageSize,
- MaximumVariableSize information may change immediately after the call based on other
- runtime activities including asynchronous error events. Also, these values associated with different
- attributes are not additive in nature.
-
- @param Attributes Attributes bitmask to specify the type of variables on
- which to return information. Refer to the
- GetVariable() function description.
- @param MaximumVariableStorageSize
- On output the maximum size of the storage space
- available for the EFI variables associated with the
- attributes specified.
- @param RemainingVariableStorageSize
- Returns the remaining size of the storage space
- available for the EFI variables associated with the
- attributes specified..
- @param MaximumVariableSize Returns the maximum size of the individual EFI
- variables associated with the attributes specified.
-
- @retval EFI_SUCCESS Valid answer returned.
- @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied.
- @retval EFI_UNSUPPORTED EFI_UNSUPPORTED The attribute is not supported on this platform, and the
- MaximumVariableStorageSize,
- RemainingVariableStorageSize, MaximumVariableSize
- are undefined.
-**/
-EFI_STATUS
-EFIAPI
-EfiQueryVariableInfo (
- IN UINT32 Attrubutes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- );
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeServicesTableLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeServicesTableLib.h
deleted file mode 100644
index 56c9cd5a5e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeServicesTableLib.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDxeServicesTableLib.h
-
-Abstract:
-
- Library that provides a global pointer to the DXE Services Table
-
---*/
-
-#ifndef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB_H__
-#define __EDKII_GLUE_DXE_SERVICES_TABLE_LIB_H__
-
-//
-// Cache copy of the DXE Services Table
-//
-extern EFI_DXE_SERVICES *gDS;
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeSmmDriverEntryPoint.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeSmmDriverEntryPoint.h
deleted file mode 100644
index 4a04b99098..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueDxeSmmDriverEntryPoint.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EdkIIGlueDxeSmmDriverEntryPoint.h
-
-Abstract:
-
- Public header file for DXE SMM Driver Entry Point Lib
-
---*/
-
-#ifndef __EDKII_GLUE_MODULE_ENTRY_POINT_H__
-#define __EDKII_GLUE_MODULE_ENTRY_POINT_H__
-
-//
-// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-//
-extern const UINT32 _gUefiDriverRevision;
-
-//
-// Declare the number of entry points in the image.
-//
-extern const UINT8 _gDriverEntryPointCount;
-
-//
-// Declare the number of unload handler in the image.
-//
-extern const UINT8 _gDriverUnloadImageCount;
-
-/**
- Enrty point to DXE SMM Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Enrty point wrapper of DXE SMM Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Computes the cummulative return status for the driver entry point and perform
- a long jump back into DriverEntryPoint().
-
- @param Status Status returned by the driver that is exiting.
-
-**/
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- );
-
-/**
- Call constructs for all libraries. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Call destructors for all libraries. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Call the list of driver entry points. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @return Status returned by entry points of drivers.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Call the unload handlers for all the modules. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
-
- @return Status returned by unload handlers of drivers.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueEdkDxeSalLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueEdkDxeSalLib.h
deleted file mode 100644
index 9590f7fab7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueEdkDxeSalLib.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueEdkDxeSalLib.h
-
-Abstract:
-
---*/
-
-
-#ifndef __EDKII_GLUE_ESAL_SERVICE_LIB_H__
-#define __EDKII_GLUE_ESAL_SERVICE_LIB_H__
-
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-
-EFI_STATUS
-EFIAPI
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class Function and it's asociated global.
- This function is boot service only!
-
-Arguments:
- FunctionId - ID of function to register
- ClassGuid - GUID of function class
- Function - Function to register under ClassGuid/FunctionId pair
- ModuleGlobal - Module global for Function.
-
-Returns:
- EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-RegisterEsalClass (
- IN EFI_GUID *ClassGuid,
- IN VOID *ModuleGlobal,
- ...
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class and it's asociated global.
- This function is boot service only!
-
-Arguments:
- ClassGuid - GUID of function class
- ModuleGlobal - Module global for Function.
- .. - SAL_INTERNAL_EXTENDED_SAL_PROC and FunctionId pairs. NULL
- indicates the end of the list.
-
-Returns:
- EFI_SUCCESS - All members of ClassGuid registered
-
---*/
-;
-
-SAL_RETURN_REGS
-EFIAPI
-EfiCallEsalService (
- IN EFI_GUID *ClassGuid,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- )
-/*++
-
-Routine Description:
-
- Call module that is not linked direclty to this module. This code is IP
- relative and hides the binding issues of virtual or physical calling. The
- function that gets dispatched has extra arguments that include the registered
- module global and a boolean flag to indicate if the system is in virutal mode.
-
-Arguments:
- ClassGuid - GUID of function
- FunctionId - Function in ClassGuid to call
- Arg2 - Argument 2 ClassGuid/FunctionId defined
- Arg3 - Argument 3 ClassGuid/FunctionId defined
- Arg4 - Argument 4 ClassGuid/FunctionId defined
- Arg5 - Argument 5 ClassGuid/FunctionId defined
- Arg6 - Argument 6 ClassGuid/FunctionId defined
- Arg7 - Argument 7 ClassGuid/FunctionId defined
- Arg8 - Argument 8 ClassGuid/FunctionId defined
-
-Returns:
- Status of ClassGuid/FuncitonId
-
---*/
-;
-
-SAL_RETURN_REGS
-EFIAPI
-SetEsalVirtualEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- );
-
-SAL_RETURN_REGS
-EFIAPI
-SetEsalPhysicalEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- );
-
-SAL_RETURN_REGS
-EFIAPI
-GetEsalEntryPoint (
- VOID
- );
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h
deleted file mode 100644
index 8b192fd196..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHiiLib.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueHiiLib.h
-
-Abstract:
-
- Public header file for Hii Lib
-
---*/
-
-#ifndef __EDKII_GLUE_HII_LIB_H__
-#define __EDKII_GLUE_HII_LIB_H__
-
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-
-#define PreparePackages GluePreparePackages
-
-
-/**
- This function allocates pool for an EFI_HII_PACKAGES structure
- with enough space for the variable argument list of package pointers.
- The allocated structure is initialized using NumberOfPackages, Guid,
- and the variable length argument list of package pointers.
-
- @param NumberOfPackages The number of HII packages to prepare.
- @param Guid Package GUID.
-
- @return
- The allocated and initialized packages.
-
-**/
-EFI_HII_PACKAGES *
-EFIAPI
-GluePreparePackages (
- IN UINTN NumberOfPackages,
- IN CONST EFI_GUID *Guid OPTIONAL,
- ...
- );
-
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHobLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHobLib.h
deleted file mode 100644
index fdb3790211..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueHobLib.h
+++ /dev/null
@@ -1,371 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- EdkIIGlueHobLib.h
-
-Abstract:
-
- Public header file for Hob Lib
-
---*/
-
-#ifndef __EDKII_GLUE_HOB_LIB_H__
-#define __EDKII_GLUE_HOB_LIB_H__
-
-
-#define GetFirstGuidHob(_GUID) GlueGetFirstGuidHob(_GUID)
-#define GetNextGuidHob(_GUID, _HobStart) GlueGetNextGuidHob(_GUID, _HobStart)
-#define BuildFvHob(_BASEADDRESS, _LENGTH) GlueBuildFvHob(_BASEADDRESS, _LENGTH)
-#define BuildModuleHob(_MODULENAME, _MEMORYALLOCATIONMODULE, _MODULELENGTH, _ENTRYPOINT) GlueBuildModuleHob(_MODULENAME, _MEMORYALLOCATIONMODULE, _MODULELENGTH, _ENTRYPOINT)
-#define BuildMemoryAllocationHob(_BASEADDRESS, _LENGTH, _MEMORYTYPE) GlueBuildMemoryAllocationHob(_BASEADDRESS, _LENGTH, _MEMORYTYPE)
-
-
-/**
- Returns the pointer to the HOB list.
-
- This function returns the pointer to first HOB in the list.
-
- @return The pointer to the HOB list.
-
-**/
-VOID *
-EFIAPI
-GetHobList (
- VOID
- );
-
-/**
- Returns the next instance of a HOB type from the starting HOB.
-
- This function searches the first instance of a HOB type from the starting HOB pointer.
- If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If HobStart is NULL, then ASSERT().
-
- @param Type The HOB type to return.
- @param HobStart The starting HOB pointer to search from.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetNextHob (
- IN UINT16 Type,
- IN CONST VOID *HobStart
- );
-
-/**
- Returns the first instance of a HOB type among the whole HOB list.
-
- This function searches the first instance of a HOB type among the whole HOB list.
- If there does not exist such HOB type in the HOB list, it will return NULL.
-
- @param Type The HOB type to return.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetFirstHob (
- IN UINT16 Type
- );
-
-/**
- This function searches the first instance of a HOB from the starting HOB pointer.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If Guid is NULL, then ASSERT().
- If HobStart is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
- @param HobStart A pointer to a Guid.
-
- @return The next instance of the matched GUID HOB from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GlueGetNextGuidHob (
- IN CONST EFI_GUID *Guid,
- IN CONST VOID *HobStart
- );
-
-/**
- This function searches the first instance of a HOB among the whole HOB list.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- If Guid is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
-
- @return The first instance of the matched GUID HOB among the whole HOB list.
-
-**/
-VOID *
-EFIAPI
-GlueGetFirstGuidHob (
- IN CONST EFI_GUID *Guid
- );
-
-/**
- Get the Boot Mode from the HOB list.
-
- This function returns the system boot mode information from the
- PHIT HOB in HOB list.
-
- @param VOID
-
- @return The Boot Mode.
-
-**/
-EFI_BOOT_MODE
-EFIAPI
-GetBootModeHob (
- VOID
- );
-
-/**
- Builds a HOB for a loaded PE32 module.
-
- This function builds a HOB for a loaded PE32 module.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If ModuleName is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ModuleName The GUID File Name of the module.
- @param MemoryAllocationModule The 64 bit physical address of the module.
- @param ModuleLength The length of the module in bytes.
- @param EntryPoint The 64 bit physical address of the module entry point.
-
-**/
-VOID
-EFIAPI
-GlueBuildModuleHob (
- IN CONST EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- );
-
-/**
- Builds a HOB that describes a chunk of system memory.
-
- This function builds a HOB that describes a chunk of system memory.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ResourceType The type of resource described by this HOB.
- @param ResourceAttribute The resource attributes of the memory described by this HOB.
- @param PhysicalStart The 64 bit physical address of memory described by this HOB.
- @param NumberOfBytes The length of the memory described by this HOB in bytes.
-
-**/
-VOID
-EFIAPI
-BuildResourceDescriptorHob (
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- );
-
-/**
- Builds a GUID HOB with a certain data length.
-
- This function builds a customized HOB tagged with a GUID for identification
- and returns the start address of GUID HOB data so that caller can fill the customized data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidHob (
- IN CONST EFI_GUID *Guid,
- IN UINTN DataLength
- );
-
-/**
- Copies a data buffer to a newly-built HOB.
-
- This function builds a customized HOB tagged with a GUID for identification,
- copies the input data to the HOB data field and returns the start address of the GUID HOB data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If Data is NULL and DataLength > 0, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param Data The data to be copied into the data field of the GUID HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidDataHob (
- IN CONST EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- );
-
-/**
- Builds a Firmware Volume HOB.
-
- This function builds a Firmware Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Firmware Volume.
- @param Length The size of the Firmware Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a Capsule Volume HOB.
-
- This function builds a Capsule Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Capsule Volume.
- @param Length The size of the Capsule Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildCvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a HOB for the CPU.
-
- This function builds a HOB for the CPU.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
- @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
-
-**/
-VOID
-EFIAPI
-BuildCpuHob (
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- );
-
-/**
- Builds a HOB for the Stack.
-
- This function builds a HOB for the stack.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the Stack.
- @param Length The length of the stack in bytes.
-
-**/
-VOID
-EFIAPI
-BuildStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- );
-
-/**
- Builds a HOB for the BSP store.
-
- This function builds a HOB for BSP store.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the BSP.
- @param Length The length of the BSP store in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-BuildBspStoreHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- );
-
-/**
- Builds a HOB for the memory allocation.
-
- This function builds a HOB for the memory allocation.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the memory.
- @param Length The length of the memory allocation in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-GlueBuildMemoryAllocationHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueIoLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueIoLib.h
deleted file mode 100644
index 64be881164..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueIoLib.h
+++ /dev/null
@@ -1,2563 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueIoLib.h
-
-Abstract:
-
- Public header file for IO Lib
-
---*/
-
-#ifndef __EDKII_GLUE_IO_LIB_H__
-#define __EDKII_GLUE_IO_LIB_H__
-
-
-#define IoRead8(_PORT) GlueIoRead8(_PORT)
-#define IoWrite8(_PORT,_VALUE) GlueIoWrite8(_PORT,_VALUE)
-#define IoRead16(_PORT) GlueIoRead16(_PORT)
-#define IoWrite16(_PORT,_VALUE) GlueIoWrite16(_PORT,_VALUE)
-#define IoRead32(_PORT) GlueIoRead32(_PORT)
-#define IoWrite32(_PORT,_VALUE) GlueIoWrite32(_PORT,_VALUE)
-
-
-#define IO_LIB_ADDRESS(Segment,Port) \
- ( ((Port) & 0xffff) | (((Segment) & 0xffff) << 16) )
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-GlueIoRead8 (
- IN UINTN Port
- );
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-GlueIoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
- to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-GlueIoRead16 (
- IN UINTN Port
- );
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-GlueIoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
- to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-GlueIoRead32 (
- IN UINTN Port
- );
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-GlueIoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
- to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- );
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
- to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- );
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- );
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- );
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- );
-
-/**
- Copy data from MMIO region to system memory by using 8-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 8-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT8 *
-EFIAPI
-MmioReadBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT8 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 16-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 16-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT16 *
-EFIAPI
-MmioReadBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT16 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 32-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 32-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT32 *
-EFIAPI
-MmioReadBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT32 *Buffer
- );
-
-/**
- Copy data from MMIO region to system memory by using 64-bit access.
-
- Copy data from MMIO region specified by starting address StartAddress
- to system memory specified by Buffer by using 64-bit access. The total
- number of byte to be copied is specified by Length. Buffer is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied from.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer receiving the data read.
-
- @return Buffer
-
-**/
-UINT64 *
-EFIAPI
-MmioReadBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- OUT UINT64 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 8-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 8-bit access. The total number
- of byte to be copied is specified by Length. Buffer is returned.
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Size in bytes of the copy.
-
-**/
-UINT8 *
-EFIAPI
-MmioWriteBuffer8 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT8 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 16-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 16-bit access. The total number
- of byte to be copied is specified by Length. Length is returned.
-
- If StartAddress is not aligned on a 16-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Size in bytes of the copy.
-
-**/
-UINT16 *
-EFIAPI
-MmioWriteBuffer16 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT16 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 32-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 32-bit access. The total number
- of byte to be copied is specified by Length. Length is returned.
-
- If StartAddress is not aligned on a 32-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Size in bytes of the copy.
-
-**/
-UINT32 *
-EFIAPI
-MmioWriteBuffer32 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT32 *Buffer
- );
-
-/**
- Copy data from system memory to MMIO region by using 64-bit access.
-
- Copy data from system memory specified by Buffer to MMIO region specified
- by starting address StartAddress by using 64-bit access. The total number
- of byte to be copied is specified by Length. Length is returned.
-
- If StartAddress is not aligned on a 64-bit boundary, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().
-
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
-
- @param StartAddress Starting address for the MMIO region to be copied to.
- @param Length Size in bytes of the copy.
- @param Buffer Pointer to a system memory buffer containing the data to write.
-
- @return Size in bytes of the copy.
-
-**/
-UINT64 *
-EFIAPI
-MmioWriteBuffer64 (
- IN UINTN StartAddress,
- IN UINTN Length,
- IN CONST UINT64 *Buffer
- );
-
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueMemoryAllocationLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueMemoryAllocationLib.h
deleted file mode 100644
index 7286aa387d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueMemoryAllocationLib.h
+++ /dev/null
@@ -1,637 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueMemoryAllocationLib.h
-
-Abstract:
-
- Public header file for Memory Allocation Lib
-
---*/
-
-#ifndef __EDKII_GLUE_MEMORY_ALLOCATION_LIB_H__
-#define __EDKII_GLUE_MEMORY_ALLOCATION_LIB_H__
-
-
-#define AllocatePages(_PAGES) GlueAllocatePages(_PAGES)
-#define FreePages(_BUFFER, _PAGES) GlueFreePages(_BUFFER, _PAGES)
-#define AllocatePool(_SIZE) GlueAllocatePool(_SIZE)
-#define AllocateZeroPool(_ALLOCATIONSIZE) GlueAllocateZeroPool(_ALLOCATIONSIZE)
-#define AllocateCopyPool(_ALLOCATIONSIZE, _BUFFER) GlueAllocateCopyPool(_ALLOCATIONSIZE, _BUFFER)
-#define FreePool(_BUFFER) GlueFreePool(_BUFFER)
-
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData.
-
- Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePages (
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData.
-
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePages (
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType.
-
- Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPages (
- IN UINTN Pages
- );
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the page allocation
- functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
- then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePages (
- IN VOID *Buffer,
- IN UINTN Pages
- );
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- );
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the aligned page
- allocation functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the aligned page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
- Library, then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPages (
- IN VOID *Buffer,
- IN UINTN Pages
- );
-
-/**
- Allocates a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates a buffer of type EfieservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Allocates and zeros a buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedZeroPool (
- IN UINTN AllocationSize
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- );
-
-/**
- Frees a buffer that was previously allocated with one of the pool allocation functions in the
- Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
- then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePool (
- IN VOID *Buffer
- );
-
-/**
- Allocates a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Allocates a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Allocates and zeros a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- );
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- );
-
-/**
- Frees a buffer that was previously allocated with one of the aligned pool allocation functions
- in the Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- aligned pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with an aligned pool allocation function in the Memory Allocation
- Library, then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPool (
- IN VOID *Buffer
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciCf8Lib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciCf8Lib.h
deleted file mode 100644
index bb07fd221b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciCf8Lib.h
+++ /dev/null
@@ -1,1055 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePciCf8Lib.h
-
-Abstract:
-
- Public header file for Pci Cf8 Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PCI_CF8_LIB_H__
-#define __EDKII_GLUE_PCI_CF8_LIB_H__
-
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- Computes an address that is compatible with the PCI Library functions. The
- unused upper bits of Bus, Device, Function and Register are stripped prior to
- the generation of the address.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255.
-
- @return The encode PCI address.
-
-**/
-#define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
- (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Read8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Write8 (
- IN UINTN Address,
- IN UINT8 Data
- );
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Or8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8And8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8AndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Read16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Write16 (
- IN UINTN Address,
- IN UINT16 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Or16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8And16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8AndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Read32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Write32 (
- IN UINTN Address,
- IN UINT32 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Or32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8And32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8AndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciCf8ReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciCf8WriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciExpressLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciExpressLib.h
deleted file mode 100644
index 7288eeb14a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciExpressLib.h
+++ /dev/null
@@ -1,1023 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePciExpressLib.h
-
-Abstract:
-
- Public header file for Pci Express Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PCI_EXPRESS_LIB_H__
-#define __EDKII_GLUE_PCI_EXPRESS_LIB_H__
-
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- Computes an address that is compatible with the PCI Library functions. The
- unused upper bits of Bus, Device, Function and Register are stripped prior to
- the generation of the address.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..4095.
-
- @return The encode PCI address.
-
-**/
-#define PCI_EXPRESS_LIB_ADDRESS(Bus,Device,Function,Offset) \
- (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressWrite8 (
- IN UINTN Address,
- IN UINT8 Data
- );
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressWrite16 (
- IN UINTN Address,
- IN UINT16 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressWrite32 (
- IN UINTN Address,
- IN UINT32 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciExpressReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciExpressWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciLib.h
deleted file mode 100644
index f047321379..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePciLib.h
+++ /dev/null
@@ -1,1019 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePciLib.h
-
-Abstract:
-
- Public header file for Pci Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PCI_LIB_H__
-#define __EDKII_GLUE_PCI_LIB_H__
-
-/**
- Macro that converts PCI Bus, PCI Device, PCI Function and PCI Register to an
- address that can be passed to the PCI Library functions.
-
- @param Bus PCI Bus number. Range 0..255.
- @param Device PCI Device number. Range 0..31.
- @param Function PCI Function number. Range 0..7.
- @param Register PCI Register number. Range 0..255 for PCI. Range 0..4095
- for PCI Express.
-
- @return The encoded PCI address.
-
-**/
-#define PCI_LIB_ADDRESS(Bus,Device,Function,Offset) \
- (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 15) | (((Bus) & 0xff) << 20))
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciRead8 (
- IN UINTN Address
- );
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciWrite8 (
- IN UINTN Address,
- IN UINT8 Data
- );
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- );
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- );
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- );
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- );
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciRead16 (
- IN UINTN Address
- );
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciWrite16 (
- IN UINTN Address,
- IN UINT16 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- );
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- );
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- );
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- );
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciRead32 (
- IN UINTN Address
- );
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciWrite32 (
- IN UINTN Address,
- IN UINT32 Data
- );
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- );
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- );
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- );
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- );
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- );
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffGetEntryPointLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffGetEntryPointLib.h
deleted file mode 100644
index e6a4769f54..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffGetEntryPointLib.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeCoffGetEntryPointLib.h
-
-Abstract:
-
- Public header file for PeCoff Get Entry Point Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PE_COFF_GET_ENTRY_POINT_LIB_H__
-#define __EDKII_GLUE_PE_COFF_GET_ENTRY_POINT_LIB_H__
-
-/**
- Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded
- into system memory with the PE/COFF Loader Library functions.
-
- Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry
- point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then
- return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.
- If Pe32Data is NULL, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system memory.
- @param EntryPoint Pointer to entry point to the PE/COFF image to return.
-
- @retval RETURN_SUCCESS EntryPoint was returned.
- @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- OUT VOID **EntryPoint
- );
-
-/**
- Returns the machine type of a PE/COFF image.
-
- Returns the machine type from the PE/COFF image specified by Pe32Data.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return Machine type or zero if not a valid iamge.
-
-**/
-UINT16
-EFIAPI
-PeCoffLoaderGetMachineType (
- IN VOID *Pe32Data
- );
-
-/**
- Returns a pointer to the PDB file name for a PE/COFF image that has been
- loaded into system memory with the PE/COFF Loader Library functions.
-
- Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
- the PE/COFF image specified by Pe32Data is not a valid, then NULL is
- returned. If the PE/COFF image specified by Pe32Data does not contain a
- debug directory entry, then NULL is returned. If the debug directory entry
- in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
- then NULL is returned.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL
- if it cannot be retrieved.
-
-**/
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffLib.h
deleted file mode 100644
index 02a1d12bac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeCoffLib.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeCoffLib.h
-
-Abstract:
-
- Public header file for PeCoff Lib
-
---*/
-
-#ifndef __EDKII_GLUE_BASE_PE_COFF_LIB_H__
-#define __EDKII_GLUE_BASE_PE_COFF_LIB_H__
-
-
-#define PeCoffLoaderGetImageInfo(_IMAGECONTEXT) GluePeCoffLoaderGetImageInfo(_IMAGECONTEXT)
-#define PeCoffLoaderRelocateImage(_IMAGECONTEXT) GluePeCoffLoaderRelocateImage(_IMAGECONTEXT)
-#define PeCoffLoaderLoadImage(_IMAGECONTEXT) GluePeCoffLoaderLoadImage(_IMAGECONTEXT)
-#define PeCoffLoaderGetPeHeader(_IMAGECONTEXT, _HDR) GluePeCoffLoaderGetPeHeader(_IMAGECONTEXT, _HDR)
-#define PeCoffLoaderImageAddress(_IMAGECONTEXT, _ADR) GluePeCoffLoaderImageAddress(_IMAGECONTEXT, _ADR)
-#define PeCoffLoaderRelocateImage(_IMAGECONTEXT) GluePeCoffLoaderRelocateImage(_IMAGECONTEXT)
-#define PeCoffLoaderRelocateImageEx(_RELOC, _FIXUP, _FIXUPDATA, _ADJUST) \
- GluePeCoffLoaderRelocateImageEx(_RELOC, _FIXUP, _FIXUPDATA, _ADJUST)
-#define PeHotRelocateImageEx(_RELOC, _FIXUP, _FIXUPDATA, _ADJUST) \
- GluePeHotRelocateImageEx(_RELOC, _FIXUP, _FIXUPDATA, _ADJUST)
-
-
-//
-// Return status codes from the PE/COFF Loader services
-// BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes
-//
-#define IMAGE_ERROR_SUCCESS 0
-#define IMAGE_ERROR_IMAGE_READ 1
-#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE 2
-#define IMAGE_ERROR_INVALID_MACHINE_TYPE 3
-#define IMAGE_ERROR_INVALID_SUBSYSTEM 4
-#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS 5
-#define IMAGE_ERROR_INVALID_IMAGE_SIZE 6
-#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT 7
-#define IMAGE_ERROR_SECTION_NOT_LOADED 8
-#define IMAGE_ERROR_FAILED_RELOCATION 9
-#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10
-
-//
-// PE/COFF Loader Read Function passed in by caller
-//
-typedef
-RETURN_STATUS
-(EFIAPI *PE_COFF_LOADER_READ_FILE) (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-//
-// Context structure used while PE/COFF image is being loaded and relocated
-//
-typedef struct {
- PHYSICAL_ADDRESS ImageAddress;
- UINT64 ImageSize;
- PHYSICAL_ADDRESS DestinationAddress;
- PHYSICAL_ADDRESS EntryPoint;
- PE_COFF_LOADER_READ_FILE ImageRead;
- VOID *Handle;
- VOID *FixupData;
- UINT32 SectionAlignment;
- UINT32 PeCoffHeaderOffset;
- UINT32 DebugDirectoryEntryRva;
- VOID *CodeView;
- CHAR8 *PdbPointer;
- UINTN SizeOfHeaders;
- UINT32 ImageCodeMemoryType;
- UINT32 ImageDataMemoryType;
- UINT32 ImageError;
- UINTN FixupDataSize;
- UINT16 Machine;
- UINT16 ImageType;
- BOOLEAN RelocationsStripped;
- BOOLEAN IsTeImage;
-} PE_COFF_LOADER_IMAGE_CONTEXT;
-
-/**
- Retrieves information about a PE/COFF image.
-
- Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, CodeView,
- PdbPointer, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva
- fields of the ImageContext structure. If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.
- If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not
- a supported PE/COFF image type, then return RETURN_UNSUPPORTED. If any errors occur while
- computing the fields of ImageContext, then the error status is returned in the ImageError field of
- ImageContext.
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that needs to be examined by this function.
-
- @retval RETURN_SUCCESS The information on the PE/COFF image was collected.
- @retval RETURN_INVALID_PARAMETER ImageContext is NULL.
- @retval RETURN_UNSUPPORTED The PE/COFF image is not supported.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-/**
- Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage().
-
- If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of
- ImageContext as the relocation base address. Otherwise, use the DestinationAddress field
- of ImageContext as the relocation base address. The caller must allocate the relocation
- fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being relocated.
-
- @retval RETURN_SUCCESS The PE/COFF image was relocated.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The image in not a valid PE/COFF image.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_UNSUPPORTED A relocation record type is not supported.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-/**
- Loads a PE/COFF image into memory.
-
- Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer
- specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate
- the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.
- The EntryPoint, FixupDataSize, CodeView, and PdbPointer fields of ImageContext are computed.
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being loaded.
-
- @retval RETURN_SUCCESS The PE/COFF image was loaded into the buffer specified by
- the ImageAddress and ImageSize fields of ImageContext.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_BUFFER_TOO_SMALL The caller did not provide a large enough buffer.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The PE/COFF image is an EFI Runtime image with no relocations.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_INVALID_PARAMETER The image address is invalid.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderLoadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-
-/**
- ImageRead function that operates on a memory buffer whos base is passed into
- FileHandle.
-
- @param FileHandle Ponter to baes of the input stream
- @param FileOffset Offset to the start of the buffer
- @param ReadSize Number of bytes to copy into the buffer
- @param Buffer Location to place results of read
-
- @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into
- the buffer.
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderImageReadFromMemory (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- );
-
-
-/**
- Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI
- runtime.
-
- PE_COFF_LOADER_IMAGE_CONTEXT.FixupData stores information needed to reapply
- the fixups with a virtual mapping.
-
-
- @param ImageBase Base address of relocated image
- @param VirtImageBase Virtual mapping for ImageBase
- @param ImageSize Size of the image to relocate
- @param RelocationData Location to place results of read
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageForRuntime (
- IN PHYSICAL_ADDRESS ImageBase,
- IN PHYSICAL_ADDRESS VirtImageBase,
- IN UINTN ImageSize,
- IN VOID *RelocationData
- );
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesLib.h
deleted file mode 100644
index c3ff557828..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesLib.h
+++ /dev/null
@@ -1,365 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeiServicesLib.h
-
-Abstract:
-
- Public header file for PEI Services Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PEI_SERVICES_LIB_H__
-#define __EDKII_GLUE_PEI_SERVICES_LIB_H__
-
-//
-// To avoid macro expansion issue when the parameter list has #if #endif.
-//
-#define PeiServicesLocatePpi GluePeiServicesLocatePpi
-
-/**
- This service enables a given PEIM to register an interface into the PEI Foundation.
-
- @param PpiList A pointer to the list of interfaces that the caller shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPpi (
- IN EFI_PEI_PPI_DESCRIPTOR *PpiList
- );
-
-/**
- This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
-
- @param OldPpi Pointer to the old PEI PPI Descriptors.
- @param NewPpi Pointer to the new PEI PPI Descriptors.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
- @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
- installed.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesReInstallPpi (
- IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
- IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
- );
-
-/**
- This service enables PEIMs to discover a given instance of an interface.
-
- @param Guid A pointer to the GUID whose corresponding interface needs to be
- found.
- @param Instance The N-th instance of the interface that is required.
- @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
- @param Ppi A pointer to the instance of the interface.
-
- @retval EFI_SUCCESS The interface was successfully returned.
- @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesLocatePpi (
- IN EFI_GUID *Guid,
- IN UINTN Instance,
- IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
- IN OUT VOID **Ppi
- );
-
-/**
- This service enables PEIMs to register a given service to be invoked when another service is
- installed or reinstalled.
-
- @param NotifyList A pointer to the list of notification interfaces that the caller
- shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesNotifyPpi (
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
- );
-
-/**
- This service enables PEIMs to ascertain the present value of the boot mode.
-
- @param BootMode A pointer to contain the value of the boot mode.
-
- @retval EFI_SUCCESS The boot mode was returned successfully.
- @retval EFI_INVALID_PARAMETER BootMode is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetBootMode (
- IN OUT EFI_BOOT_MODE *BootMode
- );
-
-/**
- This service enables PEIMs to update the boot mode variable.
-
- @param BootMode The value of the boot mode to set.
-
- @retval EFI_SUCCESS The value was successfully updated
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesSetBootMode (
- IN EFI_BOOT_MODE BootMode
- );
-
-/**
- This service enables a PEIM to ascertain the address of the list of HOBs in memory.
-
- @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
-
- @retval EFI_SUCCESS The list was successfully returned.
- @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetHobList (
- IN OUT VOID **HobList
- );
-
-/**
- This service enables PEIMs to create various types of HOBs.
-
- @param Type The type of HOB to be installed.
- @param Length The length of the HOB to be added.
- @param Hob The address of a pointer that will contain the HOB header.
-
- @retval EFI_SUCCESS The HOB was successfully created.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesCreateHob (
- IN UINT16 Type,
- IN UINT16 Length,
- IN OUT VOID **Hob
- );
-
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
-/**
- This service enables PEIMs to discover additional firmware volumes.
-
- @param Instance This instance of the firmware volume to find. The value 0 is the
- Boot Firmware Volume (BFV).
- @param FwVolHeader Pointer to the firmware volume header of the volume to return.
-
- @retval EFI_SUCCESS The volume was found.
- @retval EFI_NOT_FOUND The volume was not found.
- @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
- );
-
-/**
- This service enables PEIMs to discover additional firmware files.
-
- @param SearchType A filter to find files only of this type.
- @param FwVolHeader Pointer to the firmware volume header of the volume to search.
- This parameter must point to a valid FFS volume.
- @param FileHeader Pointer to the current file from which to begin searching.
-
- @retval EFI_SUCCESS The file was found.
- @retval EFI_NOT_FOUND The file was not found.
- @retval EFI_NOT_FOUND The header checksum was not zero.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- IN OUT EFI_FFS_FILE_HEADER **FileHeader
- );
-
-/**
- This service enables PEIMs to discover sections of a given type within a valid FFS file.
-
- @param SearchType The value of the section type to find.
- @param FfsFileHeader A pointer to the file header that contains the set of sections to
- be searched.
- @param SectionData A pointer to the discovered section, if successful.
-
- @retval EFI_SUCCESS The section was found.
- @retval EFI_NOT_FOUND The section was not found.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- );
-#endif
-
-/**
- This service enables PEIMs to register the permanent memory configuration
- that has been initialized with the PEI Foundation.
-
- @param MemoryBegin The value of a region of installed memory.
- @param MemoryLength The corresponding length of a region of installed memory.
-
- @retval EFI_SUCCESS The region was successfully installed in a HOB.
- @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPeiMemory (
- IN EFI_PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- );
-
-/**
- This service enables PEIMs to allocate memory after the permanent memory has been installed by a
- PEIM.
-
- @param MemoryType Type of memory to allocate.
- @param Pages Number of pages to allocate.
- @param Memory Pointer of memory allocated.
-
- @retval EFI_SUCCESS The memory range was successfully allocated.
- @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
- @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
- @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN OUT EFI_PHYSICAL_ADDRESS *Memory
- );
-
-/**
- This service allocates memory from the Hand-Off Block (HOB) heap.
-
- @param Size The number of bytes to allocate from the pool.
- @param Buffer If the call succeeds, a pointer to a pointer to the allocate
- buffer; undefined otherwise.
-
- @retval EFI_SUCCESS The allocation was successful
- @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePool (
- IN UINTN Size,
- OUT VOID **Buffer
- );
-
-/**
- This service resets the entire platform, including all processors and devices, and reboots the
- system.
-
- @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesResetSystem (
- VOID
- );
-
-/**
- PCI read-modify-write operations.
-
- PIWG's PI specification replaces Inte's EFI Specification 1.10.
- EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by
- EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function in these two PPI are not
- compatibile with each other.
-
- For Framework code that make the following call:
- PciCfg->Modify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
- it will be updated to the following code which call this library API:
- PeiLibPciCfgModify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
-
- @param PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param PciCfg A pointer to the this pointer of EFI_PEI_PCI_CFG_PPI.
- This parameter is unused as a place holder to make
- the parameter list identical to PEI_PCI_CFG_PPI_RW.
- @param Width The width of the access. Enumerated in bytes. Type
- EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
- @param Address The physical address of the access.
- @param SetBits Points to value to bitwise-OR with the read configuration value.
- The size of the value is determined by Width.
- @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
- The size of the value is determined by Width.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_DEVICE_ERROR There was a problem with the transaction.
-**/
-EFI_STATUS
-EFIAPI
-PeiLibPciCfgModify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_PCI_CFG_PPI *PciCfg,
- IN PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN UINTN SetBits,
- IN UINTN ClearBits
- )
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesTablePointerLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesTablePointerLib.h
deleted file mode 100644
index 1358860c2c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeiServicesTablePointerLib.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeiServicesTablePointerLib.h
-
-Abstract:
-
- Public header file for PEI Services Table Pointer Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_H__
-#define __EDKII_GLUE_PEI_SERVICES_TABLE_POINTER_LIB_H__
-
-/**
- The function returns the pointer to PEI services.
-
- The function returns the pointer to PEI services.
- It will ASSERT() if the pointer to PEI services is NULL.
-
- @retval The pointer to PeiServices.
-
-**/
-EFI_PEI_SERVICES **
-EFIAPI
-GetPeiServicesTablePointer (
- VOID
- );
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeimEntryPoint.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeimEntryPoint.h
deleted file mode 100644
index 537d3951e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePeimEntryPoint.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePeimEntryPoint.h
-
-Abstract:
-
- Public header file for PEIM Entry Point Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PEIM_ENTRY_POINT_H__
-#define __EDKII_GLUE_PEIM_ENTRY_POINT_H__
-
-//
-// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-//
-extern const UINT32 _gPeimRevision;
-
-/**
- Image entry point of Peim.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @return Status returned by entry points of Peims.
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Wrapper of Peim image entry point.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @return Status returned by entry points of Peims.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Call constructs for all libraries. Automatics Generated by tool.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Call destructors for all libraries. Automatics Generated by tool.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-
-/**
- Call the list of driver entry points. Automatics Generated by tool.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @return Status returned by entry points of drivers.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePostCodeLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePostCodeLib.h
deleted file mode 100644
index f2dcb791a4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePostCodeLib.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePostCodeLib.h
-
-Abstract:
-
- Public header file for Post Code Lib
-
---*/
-
-#ifndef __EDKII_GLUE_POST_CODE_LIB_H__
-#define __EDKII_GLUE_POST_CODE_LIB_H__
-
-
-#define PostCode(_VALUE) GluePostCode(_VALUE)
-#define PostCodeWithDescription(_VALUE, _DESC) GluePostCodeWithDescription(_VALUE, _DESC)
-#define PostCodeEnabled() GluePostCodeEnabled()
-#define PostCodeDescriptionEnabled() GluePostCodeDescriptionEnabled()
-
-
-#define POST_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
-#define POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
-
-/**
- Sends an 32-bit value to a POST card.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- Some implementations of this library function may perform I/O operations
- directly to a POST card device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
- display the 32-bit value on the status reporting device.
-
- PostCode() must actively prevent recursion. If PostCode() is called while
- processing another any other Report Status Code Library function, then
- PostCode() must return Value immediately.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCode (
- IN UINT32 Value
- );
-
-
-/**
- Sends an 32-bit value to a POST and associated ASCII string.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- If Description is not NULL, then the ASCII string specified by Description is
- also passed to the handler that displays the POST card value. Some
- implementations of this library function may perform I/O operations directly
- to a POST card device. Other implementations may send Value to ReportStatusCode(),
- and the status code reporting mechanism will eventually display the 32-bit
- value on the status reporting device.
-
- PostCodeWithDescription()must actively prevent recursion. If
- PostCodeWithDescription() is called while processing another any other Report
- Status Code Library function, then PostCodeWithDescription() must return Value
- immediately.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value. This is an optional parameter that may
- be NULL.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCodeWithDescription (
- IN UINT32 Value,
- IN CONST CHAR8 *Description OPTIONAL
- );
-
-
-/**
- Returns TRUE if POST Codes are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if POST code descriptions are enabled.
-
- This function returns TRUE if the
- POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeDescriptionEnabled (
- VOID
- );
-
-
-/**
- Sends an 32-bit value to a POST card.
-
- If POST codes are enabled in PcdPostCodeProperyMask, then call PostCode()
- passing in Value. Value is returned.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value
-
-**/
-#define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value
-
-/**
- Sends an 32-bit value to a POST and associated ASCII string.
-
- If POST codes and POST code descriptions are enabled in
- PcdPostCodeProperyMask, then call PostCodeWithDescription() passing in
- Value and Description. If only POST codes are enabled, then call PostCode()
- passing in Value. Value is returned.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value.
-
-**/
-#define POST_CODE_WITH_DESCRIPTION(Value,Description) \
- PostCodeEnabled() ? \
- (PostCodeDescriptionEnabled() ? \
- PostCodeWithDescription(Value,Description) : \
- PostCode(Value)) : \
- Value
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePrintLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePrintLib.h
deleted file mode 100644
index 86bd1728fb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGluePrintLib.h
+++ /dev/null
@@ -1,481 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePrintLib.h
-
-Abstract:
-
- Public header file Print Lib
-
---*/
-
-#ifndef __EDKII_GLUE_PRINT_LIB_H__
-#define __EDKII_GLUE_PRINT_LIB_H__
-
-///
-/// Define the maximum number of characters that are required to
-/// encode a decimal, hexidecimal, GUID, or TIME value with a NULL
-/// terminator.
-///
-/// Maximum Length Decimal String = 28
-/// "-9,223,372,036,854,775,808"
-/// Maximum Length Hexidecimal String = 17
-/// "FFFFFFFFFFFFFFFF"
-/// Maximum Length GUID = 37
-/// "00000000-0000-0000-0000-000000000000"
-/// Maximum Length TIME = 18
-/// "12/12/2006 12:12"
-///
-#define MAXIMUM_VALUE_CHARACTERS 38
-
-///
-/// Flags bitmask values use in UnicodeValueToString() and
-/// AsciiValueToString()
-///
-#define LEFT_JUSTIFY 0x01
-#define COMMA_TYPE 0x08
-#define PREFIX_ZERO 0x20
-#define RADIX_HEX 0x80
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on
- a Null-terminated Unicode format string and a VA_LIST argument list
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- Unicode format string and variable argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- );
-
-/**
- Converts a decimal value to a Null-terminated Unicode string.
-
- Converts the decimal number specified by Value to a Null-terminated Unicode
- string specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of Unicode characters in Buffer is returned not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
- required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
-
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of Unicode characters in Buffer not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeValueToString (
- IN OUT CHAR16 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- );
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- );
-
-/**
- Converts a decimal value to a Null-terminated ASCII string.
-
- Converts the decimal number specified by Value to a Null-terminated ASCII string
- specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed.
- If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of ASCII characters in Buffer is returned not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first Width
- characters are returned, and the total number of characters required to perform
- the conversion is returned.
- Additional conversion parameters are specified in Flags.
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
-
- If Buffer is NULL, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of ASCII characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of ASCII characters in Buffer not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiValueToString (
- IN OUT CHAR8 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueReportStatusCodeLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueReportStatusCodeLib.h
deleted file mode 100644
index 230c0655d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueReportStatusCodeLib.h
+++ /dev/null
@@ -1,659 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueReportStatusCodeLib.h
-
-Abstract:
-
- Public header file for Report Status Code Lib
-
---*/
-
-#ifndef __EDKII_GLUE_REPORT_STATUS_CODE_LIB_H__
-#define __EDKII_GLUE_REPORT_STATUS_CODE_LIB_H__
-
-
-
-#define CodeTypeToPostCode(_CODETYPE, _VALUE, _POSTCODE) GlueCodeTypeToPostCode(_CODETYPE, _VALUE, _POSTCODE)
-#define ReportStatusCodeExtractAssertInfo(_CODETYPE, _VALUE, _DATA, _FILENAME, _DESC, _LINENUMBER) \
- GlueReportStatusCodeExtractAssertInfo(_CODETYPE, _VALUE, _DATA, _FILENAME, _DESC, _LINENUMBER)
-#define ReportStatusCodeExtractDebugInfo(_DATA, _ERRORLEVEL, _MARKER, _FORMAT) \
- GlueReportStatusCodeExtractDebugInfo(_DATA, _ERRORLEVEL, _MARKER, _FORMAT)
-#define ReportStatusCode(_TYPE, _VALUE) GlueReportStatusCode(_TYPE, _VALUE)
-#define ReportStatusCodeWithDevicePath(_TYPE, _VALUE, _DEVICEPATH) \
- GlueReportStatusCodeWithDevicePath(_TYPE, _VALUE, _DEVICEPATH)
-#define ReportStatusCodeWithExtendedData(_TYPE, _VALUE, _EXDATA, _EXDATASIZE) \
- GlueReportStatusCodeWithExtendedData(_TYPE, _VALUE, _EXDATA, _EXDATASIZE)
-#define ReportStatusCodeEx(_TYPE, _VALUE, _INSTANCE, _CALLERID, _EXDATAGUID, _EXDATA, _EXDATASIZE) \
- GlueReportStatusCodeEx(_TYPE, _VALUE, _INSTANCE, _CALLERID, _EXDATAGUID, _EXDATA, _EXDATASIZE)
-#define ReportProgressCodeEnabled() GlueReportProgressCodeEnabled()
-#define ReportErrorCodeEnabled() GlueReportErrorCodeEnabled()
-#define ReportDebugCodeEnabled() GlueReportDebugCodeEnabled()
-
-
-//
-// Declare bits for PcdReportStatusCodePropertyMask
-//
-#define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001
-#define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002
-#define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004
-
-//
-// Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed
-//
-
-///
-/// Voltage Extended Error Data
-///
-typedef struct {
- EFI_EXP_BASE10_DATA Voltage;
- EFI_EXP_BASE10_DATA Threshold;
-} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
-
-///
-/// Microcode Update Extended Error Data
-///
-typedef struct {
- UINT32 Version;
-} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
-
-///
-/// Asynchronous Timer Extended Error Data
-///
-typedef struct {
- EFI_EXP_BASE10_DATA TimerLimit;
-} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
-
-///
-/// Host Processor Mismatch Extended Error Data
-///
-typedef struct {
- UINT32 Instance;
- UINT16 Attributes;
-} REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
-
-///
-/// Thermal Extended Error Data
-///
-typedef struct {
- EFI_EXP_BASE10_DATA Temperature;
- EFI_EXP_BASE10_DATA Threshold;
-} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA;
-
-///
-/// Processor Disabled Extended Error Data
-///
-typedef struct {
- UINT32 Cause;
- BOOLEAN SoftwareDisabled;
-} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
-
-///
-/// Embedded cache init extended data
-///
-typedef struct {
- UINT32 Level;
- EFI_INIT_CACHE_TYPE Type;
-} REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA;
-
-///
-/// Memory Extended Error Data
-///
-typedef struct {
- EFI_MEMORY_ERROR_GRANULARITY Granularity;
- EFI_MEMORY_ERROR_OPERATION Operation;
- UINTN Syndrome;
- EFI_PHYSICAL_ADDRESS Address;
- UINTN Resolution;
-} REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA;
-
-///
-/// DIMM number
-///
-typedef struct {
- UINT16 Array;
- UINT16 Device;
-} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER;
-
-///
-/// Memory Module Mismatch Extended Error Data
-///
-typedef struct {
- EFI_STATUS_CODE_DIMM_NUMBER Instance;
-} REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA;
-
-///
-/// Memory Range Extended Data
-///
-typedef struct {
- EFI_PHYSICAL_ADDRESS Start;
- EFI_PHYSICAL_ADDRESS Length;
-} REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA;
-
-///
-/// Device handle Extended Data. Used for many
-/// errors and progress codes to point to the device.
-///
-typedef struct {
- EFI_HANDLE Handle;
-} REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA;
-
-typedef struct {
- UINT8 *DevicePath;
-} REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA;
-
-typedef struct {
- EFI_HANDLE ControllerHandle;
- EFI_HANDLE DriverBindingHandle;
- UINT16 DevicePathSize;
- UINT8 *RemainingDevicePath;
-} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA;
-
-///
-/// Resource Allocation Failure Extended Error Data
-///
-typedef struct {
- UINT32 Bar;
- UINT16 DevicePathSize;
- UINT16 ReqResSize;
- UINT16 AllocResSize;
- UINT8 *DevicePath;
- UINT8 *ReqRes;
- UINT8 *AllocRes;
-} REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
-
-///
-/// Extended Error Data for Assert
-///
-typedef struct {
- UINT32 LineNumber;
- UINT32 FileNameSize;
- EFI_STATUS_CODE_STRING_DATA *FileName;
-} REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA;
-
-///
-/// System Context Data EBC/IA32/IPF
-///
-typedef struct {
- EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
-} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA;
-
-///
-/// Legacy Oprom extended data
-///
-typedef struct {
- EFI_HANDLE DeviceHandle;
- EFI_PHYSICAL_ADDRESS RomImageBase;
-} REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA;
-
-//
-// Extern for the modules Caller ID GUID
-//
-extern EFI_GUID gEfiCallerIdGuid;
-
-/**
- Converts a status code to an 8-bit POST code value.
-
- Converts the status code specified by CodeType and Value to an 8-bit POST code
- and returns the 8-bit POST code in PostCode. If CodeType is an
- EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
- are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
- 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
-
- If PostCode is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param PostCode A pointer to the 8-bit POST code value to return.
-
- @retval TRUE The status code specified by CodeType and Value was converted
- to an 8-bit POST code and returned in PostCode.
- @retval FALSE The status code specified by CodeType and Value could not be
- converted to an 8-bit POST code value.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- );
-
-
-/**
- Extracts ASSERT() information from a status code structure.
-
- Converts the status code specified by CodeType, Value, and Data to the ASSERT()
- arguments specified by Filename, Description, and LineNumber. If CodeType is
- an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
- Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
- Filename, Description, and LineNumber from the optional data area of the
- status code buffer specified by Data. The optional data area of Data contains
- a Null-terminated ASCII string for the FileName, followed by a Null-terminated
- ASCII string for the Description, followed by a 32-bit LineNumber. If the
- ASSERT() information could be extracted from Data, then return TRUE.
- Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If Filename is NULL, then ASSERT().
- If Description is NULL, then ASSERT().
- If LineNumber is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param Data Pointer to status code data buffer.
- @param Filename Pointer to the source file name that generated the ASSERT().
- @param Description Pointer to the description of the ASSERT().
- @param LineNumber Pointer to source line number that generated the ASSERT().
-
- @retval TRUE The status code specified by CodeType, Value, and Data was
- converted ASSERT() arguments specified by Filename, Description,
- and LineNumber.
- @retval FALSE The status code specified by CodeType, Value, and Data could
- not be converted to ASSERT() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- );
-
-
-/**
- Extracts DEBUG() information from a status code structure.
-
- Converts the status code specified by Data to the DEBUG() arguments specified
- by ErrorLevel, Marker, and Format. If type GUID in Data is
- EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
- Format from the optional data area of the status code buffer specified by Data.
- The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
- which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
- the Format. If the DEBUG() information could be extracted from Data, then
- return TRUE. Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If ErrorLevel is NULL, then ASSERT().
- If Marker is NULL, then ASSERT().
- If Format is NULL, then ASSERT().
-
- @param Data Pointer to status code data buffer.
- @param ErrorLevel Pointer to error level mask for a debug message.
- @param Marker Pointer to the variable argument list associated with Format.
- @param Format Pointer to a Null-terminated ASCII format string of a
- debug message.
-
- @retval TRUE The status code specified by Data was converted DEBUG() arguments
- specified by ErrorLevel, Marker, and Format.
- @retval FALSE The status code specified by Data could not be converted to
- DEBUG() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractDebugInfo (
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- );
-
-
-/**
- Reports a status code.
-
- Reports the status code specified by the parameters Type and Value. Status
- code also require an instance, caller ID, and extended data. This function
- passed in a zero instance, NULL extended data, and a caller ID of
- gEfiCallerIdGuid, which is the GUID for the module.
-
- ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCode() must return immediately.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a
- device error.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value
- );
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data.
-
- Allocates and fills in the extended data section of a status code with the
- Device Path Protocol specified by DevicePath. This function is responsible
- for allocating a buffer large enough for the standard header and the device
- path. The standard header is filled in with a GUID of
- gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
- instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithDevicePath()must actively prevent recursion. If
- ReportStatusCodeWithDevicePath() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithDevicePath()
- must return EFI_DEVICE_ERROR immediately.
-
- If DevicePath is NULL, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-
-/**
- Reports a status code with an extended data buffer.
-
- Allocates and fills in the extended data section of a status code with the
- extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
- is assumed to be one of the data structures specified in Related Definitions.
- These data structure do not have the standard header, so this function is
- responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled
- in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
- with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithExtendedData()must actively prevent recursion. If
- ReportStatusCodeWithExtendedData() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithExtendedData()
- must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL, then ASSERT().
- If ExtendedDataSize is 0, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param ExtendedData Pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithExtendedData (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST VOID *ExtendedData,
- IN UINTN ExtendedDataSize
- );
-
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportProgressCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportErrorCodeEnabled (
- VOID
- );
-
-
-/**
- Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportDebugCodeEnabled (
- VOID
- );
-
-
-/**
- Reports a status code with minimal parameters if the status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
- and Value.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-#define REPORT_STATUS_CODE(Type,Value) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCode(Type,Value) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCode(Type,Value) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCode(Type,Value) : \
- EFI_UNSUPPORTED
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data if the
- status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
- passing in Type, Value, and DevicePath.
-
- @param Type Status code type.
- @param Value Status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
- EFI_UNSUPPORTED
-
-
-/**
- Reports a status code with an extended data buffer if the status code type
- is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()
- passing in Type, Value, ExtendedData, and ExtendedDataSize.
-
- @param Type Status code type.
- @param Value Status code value.
- @param ExtendedData Pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
- EFI_UNSUPPORTED
-
-/**
- Reports a status code specifying all parameters if the status code type is enabled.
-
- If the status code type specified by Type is enabled in
- PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,
- Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-#define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \
- (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
- ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
- EFI_UNSUPPORTED
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueResourcePublicationLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueResourcePublicationLib.h
deleted file mode 100644
index 89f3d66fc1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueResourcePublicationLib.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueResourcePublicationLib.h
-
-Abstract:
-
- Public header file for Resource Publication Lib
-
---*/
-
-#ifndef __EDKII_GLUE_RESOURCE_PUBLICATION_LIB_H__
-#define __EDKII_GLUE_RESOURCE_PUBLICATION_LIB_H__
-
-/**
-
- Declares the presence of permanent system memory in the platform.
-
- Declares that the system memory buffer specified by MemoryBegin and MemoryLength
- as permanent memory that may be used for general purpose use by software.
- The amount of memory available to software may be less than MemoryLength
- if published memory has alignment restrictions.
-
- @param MemoryBegin The start address of the memory being declared.
- @param MemoryLength The number of bytes of memory being declared.
-
- @retval RETURN_SUCCESS The memory buffer was published.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer
-
-**/
-RETURN_STATUS
-EFIAPI
-PublishSystemMemory (
- IN PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueSmbusLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueSmbusLib.h
deleted file mode 100644
index 899a0fb4ad..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueSmbusLib.h
+++ /dev/null
@@ -1,382 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueSmbusLib.h
-
-Abstract:
-
- Public header file for Smbus Lib
-
---*/
-
-#ifndef __EDKII_GLUE_SMBUS_LIB_H__
-#define __EDKII_GLUE_SMBUS_LIB_H__
-
-//
-// PEC BIT is bit 22 in SMBUS address
-//
-#define SMBUS_LIB_PEC_BIT (1 << 22)
-
-/**
- Macro that converts SMBUS slave address, SMBUS command, SMBUS data length,
- and PEC to a value that can be passed to the SMBUS Library functions.
-
- Computes an address that is compatible with the SMBUS Library functions.
- The unused upper bits of SlaveAddress, Command, and Length are stripped
- prior to the generation of the address.
-
- @param SlaveAddress SMBUS Slave Address. Range 0..127.
- @param Command SMBUS Command. Range 0..255.
- @param Length SMBUS Data Length. Range 0..32.
- @param Pec TRUE if Packet Error Checking is enabled. Otherwise FALSE.
-
-**/
-#define SMBUS_LIB_ADDRESS(SlaveAddress,Command,Length,Pec) \
- ( ((Pec) ? SMBUS_LIB_PEC_BIT: 0) | \
- (((SlaveAddress) & 0x7f) << 1) | \
- (((Command) & 0xff) << 8) | \
- (((Length) & 0x3f) << 16) \
- )
-
-/**
- Executes an SMBUS quick read command.
-
- Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickRead (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS quick write command.
-
- Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickWrite (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS receive byte command.
-
- Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- The byte received from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte received from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReceiveByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS send byte command.
-
- Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.
- The byte specified by Value is sent.
- Only the SMBUS slave address field of SmBusAddress is required. Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to send.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusSendByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data byte command.
-
- Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 8-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReadDataByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data byte command.
-
- Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.
- The 8-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusWriteDataByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read data word command.
-
- Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT16
-EFIAPI
-SmBusReadDataWord (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write data word command.
-
- Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-SmBusWriteDataWord (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS process call command.
-
- Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value returned by the process call command is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The 16-bit value returned by the process call command.
-
-**/
-UINT16
-EFIAPI
-SmBusProcessCall (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS read block command.
-
- Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Bytes are read from the SMBUS and stored in Buffer.
- The number of bytes read is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is not zero, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes read.
-
-**/
-UINTN
-EFIAPI
-SmBusReadBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS write block command.
-
- Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from Buffer.
- The number of bytes written is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusWriteBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-/**
- Executes an SMBUS block process call command.
-
- Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If WriteBuffer is NULL, then ASSERT().
- If ReadBuffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS.
- @param ReadBuffer Pointer to the buffer of bytes to read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusBlockProcessCall (
- IN UINTN SmBusAddress,
- IN VOID *WriteBuffer,
- OUT VOID *ReadBuffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueTimerLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueTimerLib.h
deleted file mode 100644
index 6f97614524..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueTimerLib.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueTimerLib.h
-
-Abstract:
-
- Public header file for Timer Lib
-
---*/
-
-#ifndef __EDKII_GLUE_TIMER_LIB_H__
-#define __EDKII_GLUE_TIMER_LIB_H__
-
-/**
- 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 MicroSeconds
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN 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 NanoSeconds
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- );
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- 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
- );
-
-/**
- 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
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiBootServicesTableLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiBootServicesTableLib.h
deleted file mode 100644
index 2a7bd785d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiBootServicesTableLib.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiBootServicesTableLib.h
-
-Abstract:
-
- Public header file for UEFI Boot Services Table Lib
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB_H__
-#define __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB_H__
-
-//
-// Cache the Image Handle
-//
-extern EFI_HANDLE gImageHandle;
-
-//
-// Cache pointer to the EFI System Table
-//
-extern EFI_SYSTEM_TABLE *gST;
-
-//
-// Cache pointer to the EFI Boot Services Table
-//
-extern EFI_BOOT_SERVICES *gBS;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDecompressLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDecompressLib.h
deleted file mode 100644
index 01a3bdf957..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDecompressLib.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiDecompressLib.h
-
-Abstract:
-
- Public header file for UEFI Decompress Lib
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_DECPOMPRESS_LIB_H__
-#define __EDKII_GLUE_UEFI_DECPOMPRESS_LIB_H__
-
-#define FillBuf(_SD, _NUMOFBITS) GlueFillBuf(_SD, _NUMOFBITS)
-#define GetBits(_SD, _NUMOFBITS) GlueGetBits(_SD, _NUMOFBITS)
-#define MakeTable(_SD, _NUMOFCHAR, _BITLEN, _TABLEBITS, _TABLE) GlueMakeTable(_SD, _NUMOFCHAR, _BITLEN, _TABLEBITS, _TABLE)
-#define DecodeP(_SD) GlueDecodeP(_SD)
-#define ReadPTLen( _SD, _NN, _NBIT, _SPECIAL) GlueReadPTLen( _SD, _NN, _NBIT, _SPECIAL)
-#define ReadCLen(_SD) GlueReadCLen(_SD)
-#define DecodeC(_SD) GlueDecodeC(_SD)
-#define Decode(_SD) GlueDecode(_SD)
-
-
-
-/**
- Retrieves the size of the uncompressed buffer and the size of the scratch buffer.
-
- Retrieves the size of the uncompressed buffer and the temporary scratch buffer
- required to decompress the buffer specified by Source and SourceSize.
- If the size of the uncompressed buffer or the size of the scratch buffer cannot
- be determined from the compressed data specified by Source and SourceData,
- then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
- buffer is returned in DestinationSize, the size of the scratch buffer is returned
- in ScratchSize, and RETURN_SUCCESS is returned.
- This function does not have scratch buffer available to perform a thorough
- checking of the validity of the source data. It just retrieves the "Original Size"
- field from the beginning bytes of the source data and output it as DestinationSize.
- And ScratchSize is specific to the decompression implementation.
-
- If Source is NULL, then ASSERT().
- If DestinationSize is NULL, then ASSERT().
- If ScratchSize is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param SourceSize The size, in bytes, of the source buffer.
- @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer
- that will be generated when the compressed buffer specified
- by Source and SourceSize is decompressed..
- @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that
- is required to decompress the compressed buffer specified
- by Source and SourceSize.
-
- @retval RETURN_SUCCESS The size of destination buffer and the size of scratch
- buffer are successull retrieved.
- @retval RETURN_INVALID_PARAMETER The source data is corrupted
-
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompressGetInfo (
- IN CONST VOID *Source,
- IN UINT32 SourceSize,
- OUT UINT32 *DestinationSize,
- OUT UINT32 *ScratchSize
- );
-
-/**
- Decompresses a compressed source buffer.
-
- This function is designed so that the decompression algorithm can be implemented
- without using any memory services. As a result, this function is not allowed to
- call any memory allocation services in its implementation. It is the caller's r
- esponsibility to allocate and free the Destination and Scratch buffers.
- If the compressed source data specified by Source is sucessfully decompressed
- into Destination, then RETURN_SUCCESS is returned. If the compressed source data
- specified by Source is not in a valid compressed data format,
- then RETURN_INVALID_PARAMETER is returned.
-
- If Source is NULL, then ASSERT().
- If Destination is NULL, then ASSERT().
- If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param Destination The destination buffer to store the decompressed data
- @param Scratch A temporary scratch buffer that is used to perform the decompression.
- This is an optional parameter that may be NULL if the
- required scratch buffer size is 0.
-
- @retval RETURN_SUCCESS Decompression is successfull
- @retval RETURN_INVALID_PARAMETER The source data is corrupted
-
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompress (
- IN CONST VOID *Source,
- IN OUT VOID *Destination,
- IN OUT VOID *Scratch
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverEntryPoint.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverEntryPoint.h
deleted file mode 100644
index 07a7775abc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverEntryPoint.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiDriverEntryPoint.h
-
-Abstract:
-
- Public header file for UEFI Driver Entry Point Lib
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_DRIVER_ENTRY_POINT_H__
-#define __EDKII_GLUE_UEFI_DRIVER_ENTRY_POINT_H__
-
-//
-// Declare the EFI/UEFI Specification Revision to which this driver is implemented
-//
-extern const UINT32 _gUefiDriverRevision;
-
-//
-// Declare the number of entry points in the image.
-//
-extern const UINT8 _gDriverEntryPointCount;
-
-//
-// Declare the number of unload handler in the image.
-//
-extern const UINT8 _gDriverUnloadImageCount;
-
-//
-// Declare the arrary of Boot Sevice Exit Event callbacks .
-//
-extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];
-
-//
-// Declare the arrary of Virtual Address Change Event callbacks .
-//
-extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];
-
-/**
- Enrty point to DXE SMM Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-_ModuleEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Enrty point wrapper of DXE Driver.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS One or more of the drivers returned a success code.
- @retval !EFI_SUCESS The return status from the last driver entry point in the list.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiMain (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Computes the cummulative return status for the driver entry point and perform
- a long jump back into DriverEntryPoint().
-
- @param Status Status returned by the driver that is exiting.
-
-**/
-VOID
-EFIAPI
-ExitDriver (
- IN EFI_STATUS Status
- );
-
-
-/**
- Call constructs for all libraries. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryConstructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Call destructors for all libraries. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
-**/
-VOID
-EFIAPI
-ProcessLibraryDestructorList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
- Call the list of driver entry points. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @return Status returned by entry points of drivers.
-
-**/
-
-EFI_STATUS
-EFIAPI
-ProcessModuleEntryPointList (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-
-/**
- Call the unload handlers for all the modules. Automatics Generated by tool.
-
- @param ImageHandle ImageHandle of the loaded driver.
-
- @return Status returned by unload handlers of drivers.
-
-**/
-EFI_STATUS
-EFIAPI
-ProcessModuleUnloadList (
- IN EFI_HANDLE ImageHandle
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
deleted file mode 100644
index ef947fa7eb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiDriverModelLib.h
-
-Abstract:
-
- Public header file for UEFI Driver Model Lib
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB_H__
-#define __EDKII_GLUE_UEFI_DRIVER_MODEL_LIB_H__
-
-//
-// Declare bitmask values for the protocols that are enabled
-//
-#define UEFI_DRIVER_MODEL_LIBRARY_COMPONENT_NAME_PROTOCOL_ENABLED 0x01
-#define UEFI_DRIVER_MODEL_LIBRARY_DRIVER_DIAGNOSTICS_PROTOCOL_ENABLED 0x02
-#define UEFI_DRIVER_MODEL_LIBRARY_DRIVER_CONFIGURATION_PROTOCOL_ENABLED 0x04
-
-//
-// Data structure that declares pointers to the Driver Model
-// Protocols.
-//
-typedef struct {
- const EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
- const EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
- const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration;
- const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics;
- const EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
- const EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2;
- const EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2;
-} EFI_DRIVER_MODEL_PROTOCOL_LIST;
-
-//
-// UEFI Driver Model Protocols arrary
-//
-extern const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[];
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
deleted file mode 100644
index 48c8f5e8be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
+++ /dev/null
@@ -1,706 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiLib.h
-
-Abstract:
-
- Public header file for UEFI Lib
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_LIB_H__
-#define __EDKII_GLUE_UEFI_LIB_H__
-
-
-#define EfiInitializeLock(_LOCK, _PRIORITY) GlueEfiInitializeLock(_LOCK, _PRIORITY)
-#define EfiAcquireLock(_LOCK) GlueEfiAcquireLock(_LOCK)
-#define EfiAcquireLockOrFail(_LOCK) GlueEfiAcquireLockOrFail(_LOCK)
-#define EfiReleaseLock(_LOCK) GlueEfiReleaseLock(_LOCK)
-#define GetGlyphWidth(_UNICODECHAR) GlueGetGlyphWidth(_UNICODECHAR)
-#define EfiCreateEventLegacyBoot(_LEGACYBOOT) GlueEfiCreateEventLegacyBoot(_LEGACYBOOT)
-#define EfiCreateEventReadyToBoot(_READYTOBOOTEVENT) GlueEfiCreateEventReadyToBoot(_READYTOBOOTEVENT)
-#define EfiGetNameGuidFromFwVolDevicePathNode(_FVDEVICEPATHNODE) GlueEfiGetNameGuidFromFwVolDevicePathNode(_FVDEVICEPATHNODE)
-#define EfiInitializeFwVolDevicepathNode(_FVDEVICEPATHNODE, _NAMEGUID) GlueEfiInitializeFwVolDevicepathNode(_FVDEVICEPATHNODE, _NAMEGUID)
-
-
-//
-// EFI Lock Status
-//
-typedef enum {
- EfiLockUninitialized = 0,
- EfiLockReleased = 1,
- EfiLockAcquired = 2
-} EFI_LOCK_STATE;
-
-
-/**
- This function searches the list of configuration tables stored in the EFI System
- Table for a table with a GUID that matches TableGuid. If a match is found,
- then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
- is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
-
- @param TableGuid Pointer to table's GUID type..
- @param Table Pointer to the table associated with TableGuid in the EFI System Table.
-
- @retval EFI_SUCCESS A configuration table matching TableGuid was found.
- @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- OUT VOID **Table
- );
-
-/**
- This function causes the notification function to be executed for every protocol
- of type ProtocolGuid instance that exists in the system when this function is
- invoked. In addition, every time a protocol of type ProtocolGuid instance is
- installed or reinstalled, the notification function is also executed.
-
- @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
-
- @return The notification event that was created.
-
-**/
-EFI_EVENT
-EFIAPI
-EfiCreateProtocolNotifyEvent(
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext, OPTIONAL
- OUT VOID **Registration
- );
-
-/**
- This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
- This event is signaled with EfiNamedEventSignal(). This provide the ability for
- one or more listeners on the same event named by the GUID specified by Name.
-
- @param Name Supplies GUID name of the event.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
-
- @retval EFI_SUCCESS A named event was created.
- @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventListen (
- IN CONST EFI_GUID *Name,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN CONST VOID *NotifyContext, OPTIONAL
- OUT VOID *Registration OPTIONAL
- );
-
-/**
- This function signals the named event specified by Name. The named event must
- have been created with EfiNamedEventListen().
-
- @param Name Supplies GUID name of the event.
-
- @retval EFI_SUCCESS A named event was signaled.
- @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventSignal (
- IN CONST EFI_GUID *Name
- );
-
-/**
- Returns the current TPL.
-
- This function returns the current TPL. There is no EFI service to directly
- retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
- the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
- can then immediately be restored back to the current TPL level with a call
- to RestoreTPL().
-
- @param VOID
-
- @retvale EFI_TPL The current TPL.
-
-**/
-EFI_TPL
-EFIAPI
-EfiGetCurrentTpl (
- VOID
- );
-
-/**
- This function initializes a basic mutual exclusion lock to the released state
- and returns the lock. Each lock provides mutual exclusion access at its task
- priority level. Since there is no preemption or multiprocessor support in EFI,
- acquiring the lock only consists of raising to the locks TPL.
-
- @param Lock A pointer to the lock data structure to initialize.
- @param Priority EFI TPL associated with the lock.
-
- @return The lock.
-
-**/
-EFI_LOCK *
-EFIAPI
-GlueEfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- );
-
-/**
- This macro initializes the contents of a basic mutual exclusion lock to the
- released state. Each lock provides mutual exclusion access at its task
- priority level. Since there is no preemption or multiprocessor support in EFI,
- acquiring the lock only consists of raising to the locks TPL.
-
- @param Lock A pointer to the lock data structure to initialize.
- @param Priority The task priority level of the lock.
-
- @return The lock.
-
-**/
-#ifdef EFI_INITIALIZE_LOCK_VARIABLE
-#undef EFI_INITIALIZE_LOCK_VARIABLE
-#endif
-
-#define EFI_INITIALIZE_LOCK_VARIABLE(Priority) \
- {Priority, EFI_TPL_APPLICATION, EfiLockReleased }
-
-
-/**
-
- Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
-
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
- is not in the locked state, then DebugAssert() is called passing in the source
- filename, source line number, and Lock.
-
- If Lock is NULL, then ASSERT().
-
- @param LockParameter A pointer to the lock to acquire.
-
-**/
-#ifdef ASSERT_LOCKED
-#undef ASSERT_LOCKED
-#endif
-
-#define ASSERT_LOCKED(LockParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- ASSERT (LockParameter != NULL); \
- if ((LockParameter)->Lock != EfiLockAcquired) { \
- _ASSERT (LockParameter not locked); \
- } \
- } \
- } while (FALSE)
-
-
-/**
- This function raises the system's current task priority level to the task
- priority level of the mutual exclusion lock. Then, it places the lock in the
- acquired state.
-
- @param Priority The task priority level of the lock.
-
-**/
-VOID
-EFIAPI
-GlueEfiAcquireLock (
- IN EFI_LOCK *Lock
- );
-
-/**
- This function raises the system's current task priority level to the task
- priority level of the mutual exclusion lock. Then, it attempts to place the
- lock in the acquired state.
-
- @param Lock A pointer to the lock to acquire.
-
- @retval EFI_SUCCESS The lock was acquired.
- @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- );
-
-/**
- This function transitions a mutual exclusion lock from the acquired state to
- the released state, and restores the system's task priority level to its
- previous level.
-
- @param Lock A pointer to the lock to release.
-
-**/
-VOID
-EFIAPI
-GlueEfiReleaseLock (
- IN EFI_LOCK *Lock
- );
-
-/**
- Tests whether a controller handle is being managed by a specific 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 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
- specifed by DriverBindingHandle.
- @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
- specifed by DriverBindingHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestManagedDevice (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_GUID *ProtocolGuid
- );
-
-/**
- Tests whether a child handle is a child device of the controller.
-
- This function tests whether ChildHandle is one of the children of
- ControllerHandle. This test is performed by checking to see if the protocol
- specified by ProtocolGuid is present on ControllerHandle and opened by
- ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
- If ProtocolGuid is NULL, then ASSERT().
-
- @param ControllerHandle A handle for a (parent) controller to test.
- @param ChildHandle A child handle to test.
- @param ConsumsedGuid Supplies the protocol that the child controller
- opens on its parent controller.
-
- @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
- @retval EFI_UNSUPPORTED ChildHandle is not a child of the
- ControllerHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestChildHandle (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE ChildHandle,
- IN CONST EFI_GUID *ProtocolGuid
- );
-
-/**
- This function looks up a Unicode string in UnicodeStringTable. If Language is
- a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
- that matches the language code specified by Language, then it is returned in
- UnicodeString.
-
- @param Language A pointer to the ISO 639-2 language code for the
- Unicode string to look up and return.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports. Language
- must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
- that matches the language specified by Language.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found
- in the table of Unicoide strings UnicodeStringTable,
- and it was returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
- @retval EFI_UNSUPPORTED The language specified by Language is not
- supported by UnicodeStringTable.
-
-**/
-EFI_STATUS
-EFIAPI
-LookupUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- OUT CHAR16 **UnicodeString
- );
-
-/**
- This function adds a Unicode string to UnicodeStringTable.
- If Language is a member of SupportedLanguages then UnicodeString is added to
- UnicodeStringTable. New buffers are allocated for both Language and
- UnicodeString. The contents of Language and UnicodeString are copied into
- these new buffers. These buffers are automatically freed when
- FreeUnicodeStringTable() is called.
-
- @param Language A pointer to the ISO 639-2 language code for the Unicode
- string to add.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports.
- Language must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string to add.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found in the table of
- Unicode strings UnicodeStringTable, and it was
- returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_ALREADY_STARTED A Unicode string with language Language is
- already present in UnicodeStringTable.
- @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
- Unicode string to UnicodeStringTable.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
-
-**/
-EFI_STATUS
-EFIAPI
-AddUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- IN CONST CHAR16 *UnicodeString
- );
-
-/**
- This function frees the table of Unicode strings in UnicodeStringTable.
- If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
- Otherwise, each language code, and each Unicode string in the Unicode string
- table are freed, and EFI_SUCCESS is returned.
-
- @param UnicodeStringTable A pointer to the table of Unicode strings.
-
- @retval EFI_SUCCESS The Unicode string table was freed.
-
-**/
-EFI_STATUS
-EFIAPI
-FreeUnicodeStringTable (
- IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
- );
-
-/**
- This function computes and returns the width of the Unicode character
- specified by UnicodeChar.
-
- @param UnicodeChar A Unicode character.
-
- @retval 0 The width if UnicodeChar could not be determined.
- @retval 1 UnicodeChar is a narrow glyph.
- @retval 2 UnicodeChar is a wide glyph.
-
-**/
-UINTN
-EFIAPI
-GlueGetGlyphWidth (
- IN CHAR16 UnicodeChar
- );
-
-/**
- This function computes and returns the display length of
- the Null-terminated Unicode string specified by String.
- If String is NULL, then 0 is returned.
- If any of the widths of the Unicode characters in String
- can not be determined, then 0 is returned.
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The display length of the Null-terminated Unicode string specified by String.
-
-**/
-UINTN
-EFIAPI
-UnicodeStringDisplayLength (
- IN CONST CHAR16 *String
- );
-
-//
-// Functions that abstract early Framework contamination of UEFI.
-//
-/**
- Signal a Ready to Boot Event.
-
- Create a Ready to Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventReadyToBoot (
- VOID
- );
-
-/**
- Signal a Legacy Boot Event.
-
- Create a legacy Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventLegacyBoot (
- VOID
- );
-
-/**
- Create a Legacy Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
- work both ways.
-
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiCreateEventLegacyBoot (
- OUT EFI_EVENT *LegacyBootEvent
- );
-
-/**
- Create an EFI event in the Legacy Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Legacy Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If LegacyBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *LegacyBootEvent
- );
-
-/**
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EDK/EFI 1.10 form and EDKII/UEFI 2.0 form and allows common code to
- work both ways.
-
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiCreateEventReadyToBoot (
- OUT EFI_EVENT *ReadyToBootEvent
- );
-
-/**
- Create an EFI event in the Ready To Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Ready to Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If ReadyToBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *ReadyToBootEvent
- );
-
-/**
- Initialize a Firmware Volume (FV) Media Device Path node.
-
- @param FvDevicePathNode Pointer to a FV device path node to initialize
- @param NameGuid FV file name to use in FvDevicePathNode
-
-**/
-VOID
-EFIAPI
-GlueEfiInitializeFwVolDevicepathNode (
- IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN CONST EFI_GUID *NameGuid
- );
-
-/**
- Check to see if the Firmware Volume (FV) Media Device Path is valid
-
- @param FvDevicePathNode Pointer to FV device path to check.
-
- @retval NULL FvDevicePathNode is not valid.
- @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
-
-**/
-EFI_GUID *
-EFIAPI
-GlueEfiGetNameGuidFromFwVolDevicePathNode (
- IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- );
-
-/**
- Prints a formatted Unicode string to the console output device specified by
- ConOut defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted Unicode string to the console output device
- specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode
- characters that printed to ConOut. If the length of the formatted Unicode
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
-
- @param Format Null-terminated Unicode format string.
- @param ... VARARG list consumed to process Format.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
-
-**/
-UINTN
-EFIAPI
-Print (
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Prints a formatted Unicode string to the console output device specified by
- StdErr defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted Unicode string to the console output device
- specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode
- characters that printed to StdErr. If the length of the formatted Unicode
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
-
- @param Format Null-terminated Unicode format string.
- @param ... VARARG list consumed to process Format.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
-
-**/
-UINTN
-EFIAPI
-ErrorPrint (
- IN CONST CHAR16 *Format,
- ...
- );
-
-/**
- Prints a formatted ASCII string to the console output device specified by
- ConOut defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted ASCII string to the console output device
- specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII
- characters that printed to ConOut. If the length of the formatted ASCII
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.
-
- @param Format Null-terminated ASCII format string.
- @param ... VARARG list consumed to process Format.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
-
-**/
-UINTN
-EFIAPI
-AsciiPrint (
- IN CONST CHAR8 *Format,
- ...
- );
-
-/**
- Prints a formatted ASCII string to the console output device specified by
- StdErr defined in the EFI_SYSTEM_TABLE.
-
- This function prints a formatted ASCII string to the console output device
- specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII
- characters that printed to StdErr. If the length of the formatted ASCII
- string is greater than PcdUefiLibMaxPrintBufferSize, then only the first
- PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.
-
- @param Format Null-terminated ASCII format string.
- @param ... VARARG list consumed to process Format.
- If Format is NULL, then ASSERT().
- If Format is not aligned on a 16-bit boundary, then ASSERT().
-
-**/
-UINTN
-EFIAPI
-AsciiErrorPrint (
- IN CONST CHAR8 *Format,
- ...
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiRuntimeServicesTableLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiRuntimeServicesTableLib.h
deleted file mode 100644
index 6a5011abda..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiRuntimeServicesTableLib.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueUefiRuntimeServicesTableLib.h
-
-Abstract:
-
- Library that provides a global pointer to the UEFI Runtime Services Tables
-
---*/
-
-#ifndef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB_H__
-#define __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB_H__
-
-//
-// To avoid symbol collision with gRT in EfiDriverLib
-//
-#define gRT gGlueRT
-
-//
-// Cached copy of the EFI Runtime Services Table
-//
-extern EFI_RUNTIME_SERVICES *gRT;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcd.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcd.h
deleted file mode 100644
index 7b84152148..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcd.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcd.h
-
-Abstract:
-
- Fixed-at-build PCD macro expansion definitions
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_H__
-#define __EDKII_GLUE_PCD_H__
-
-//
-// Redefine Pcd functions into compile time hardcoded values
-//
-#define FixedPcdGet8(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define FixedPcdGet16(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define FixedPcdGet32(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define FixedPcdGet64(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define FixedPcdGetBool(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-
-#define PcdGet8(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define PcdGet16(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define PcdGet32(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define PcdGet64(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define PcdGetPtr(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-#define PcdGetBool(TokenName) __EDKII_GLUE_PCD_##TokenName##__
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdBaseLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdBaseLib.h
deleted file mode 100644
index 5860eae124..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdBaseLib.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdBaseLib.h
-
-Abstract:
-
- PCD vadues for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_BASE_LIB_H__
-#define __EDKII_GLUE_PCD_BASE_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-#ifndef __EDKII_GLUE_PCD_PcdMaximumUnicodeStringLength__
-#define __EDKII_GLUE_PCD_PcdMaximumUnicodeStringLength__ EDKII_GLUE_MaximumUnicodeStringLength
-#endif
-
-#ifndef __EDKII_GLUE_PCD_PcdMaximumAsciiStringLength__
-#define __EDKII_GLUE_PCD_PcdMaximumAsciiStringLength__ EDKII_GLUE_MaximumAsciiStringLength
-#endif
-
-//
-// SpinLock Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdSpinLockTimeout__
-#define __EDKII_GLUE_PCD_PcdSpinLockTimeout__ EDKII_GLUE_SpinLockTimeout
-#endif
-
-// Linked List
-#ifndef __EDKII_GLUE_PCD_PcdMaximumLinkedListLength__
-#define __EDKII_GLUE_PCD_PcdMaximumLinkedListLength__ EDKII_GLUE_MaximumLinkedListLength
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdDebugLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdDebugLib.h
deleted file mode 100644
index 46b957dc85..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdDebugLib.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdDebugLib.h
-
-Abstract:
-
- PCD values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_DEBUG_LIB_H__
-#define __EDKII_GLUE_PCD_DEBUG_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-
-//
-// Debug Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdDebugPrintErrorLevel__
-#define __EDKII_GLUE_PCD_PcdDebugPrintErrorLevel__ EDKII_GLUE_DebugPrintErrorLevel
-#endif
-
-
-#ifndef __EDKII_GLUE_PCD_PcdDebugPropertyMask__
-#define __EDKII_GLUE_PCD_PcdDebugPropertyMask__ EDKII_GLUE_DebugPropertyMask
-#endif
-
-
-#ifndef __EDKII_GLUE_PCD_PcdDebugClearMemoryValue__
-#define __EDKII_GLUE_PCD_PcdDebugClearMemoryValue__ EDKII_GLUE_DebugClearMemoryValue
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdIoLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdIoLib.h
deleted file mode 100644
index 2c29c54ce3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdIoLib.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdIoLib.h
-
-Abstract:
-
- PCD values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_IO_LIB_H__
-#define __EDKII_GLUE_PCD_IO_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-
-//
-// IoBlockBaseAddressForIpf Pcd
-//
-#ifdef MDE_CPU_IPF
-#ifndef __EDKII_GLUE_PCD_PcdIoBlockBaseAddressForIpf__
-#define __EDKII_GLUE_PCD_PcdIoBlockBaseAddressForIpf__ EDKII_GLUE_IoBlockBaseAddressForIpf
-#endif
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPciExpressLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPciExpressLib.h
deleted file mode 100644
index 5c9450ad8d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPciExpressLib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdPciExpressLib.h
-
-Abstract:
-
- PCD values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_PCI_EXPRESS_LIB_H__
-#define __EDKII_GLUE_PCD_PCI_EXPRESS_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-
-//
-// PciExpress Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdPciExpressBaseAddress__
-#define __EDKII_GLUE_PCD_PcdPciExpressBaseAddress__ EDKII_GLUE_PciExpressBaseAddress
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPostCodeLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPostCodeLib.h
deleted file mode 100644
index 49b587cf7a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdPostCodeLib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdPostCodeLib.h
-
-Abstract:
-
- PCD values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_POST_CODE_LIB_H__
-#define __EDKII_GLUE_PCD_POST_CODE_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-//
-// PostCode Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdPostCodePropertyMask__
-#define __EDKII_GLUE_PCD_PcdPostCodePropertyMask__ EDKII_GLUE_PostCodePropertyMask
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdReportStatusCodeLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdReportStatusCodeLib.h
deleted file mode 100644
index fa369b78e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdReportStatusCodeLib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdReportStatusCodeLib.h
-
-Abstract:
-
- Pcd values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_REPORT_STATUS_CODE_LIB_H__
-#define __EDKII_GLUE_PCD_REPORT_STATUS_CODE_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-//
-// ReportStatusCode Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdReportStatusCodePropertyMask__
-#define __EDKII_GLUE_PCD_PcdReportStatusCodePropertyMask__ EDKII_GLUE_ReportStatusCodePropertyMask
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdTimerLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdTimerLib.h
deleted file mode 100644
index 0960c99bb7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Pcd/EdkIIGluePcdTimerLib.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGluePcdTimerLib.h
-
-Abstract:
-
- PCD values for library customization
-
---*/
-
-#ifndef __EDKII_GLUE_PCD_TIMER_LIB_H__
-#define __EDKII_GLUE_PCD_TIMER_LIB_H__
-
-//
-// Following Pcd values are hard coded at compile time.
-// Override these through compiler option "/D" in PlatformTools.env if needed
-//
-
-
-//
-// Timer Lib Pcds
-//
-#ifndef __EDKII_GLUE_PCD_PcdFSBClock__
-#define __EDKII_GLUE_PCD_PcdFSBClock__ EDKII_GLUE_FSBClock
-#endif
-
-#include "Pcd/EdkIIGluePcd.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/PeimDepex.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/PeimDepex.h
deleted file mode 100644
index c87fa4b9c6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/PeimDepex.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- PeimDepex.h
-
-Abstract:
-
- This file is used by .dxs file. To write common .dxs for EDK and EDKII, a
- header file named PeimDepex.h musted be present.
-
---*/
-
-
-#ifndef __EDKII_GLUELIB_PEIMDEPEX_H__
-#define __EDKII_GLUELIB_PEIMDEPEX_H__
-
-
-//
-// this file is used by .dxs file, just a place holder
-//
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/X64/EdkIIGlueProcessorBind.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/X64/EdkIIGlueProcessorBind.h
deleted file mode 100644
index e146e5a969..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/X64/EdkIIGlueProcessorBind.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueProcessorBind.h
-
-Abstract:
-
- Processor specific definitions
-
---*/
-
-#ifndef __EDKII_GLUE_PROCESSOR_BIND_H__
-#define __EDKII_GLUE_PROCESSOR_BIND_H__
-
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-// if the /OPT:REF linker option is used. We defined a macro as this is a
-// a non standard extension
-//
-#if defined(_MSC_EXTENSIONS)
- #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
- #define GLOBAL_REMOVE_IF_UNREFERENCED
-#endif
-
-#if !defined(MDE_CPU_X64)
- #define MDE_CPU_X64
-#endif
-
-//
-// The stack alignment required for X64
-//
-#define CPU_STACK_ALIGNMENT 16
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
deleted file mode 100644
index 13494492e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseCacheMaintenanceLib.inf
-#
-# Abstract:
-#
-# Component description file for BaseCacheMaintenanceLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseCacheMaintenanceLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ia32]
- X86Cache.c
-
-[sources.x64]
- X86Cache.c
-
-[sources.ipf]
- IpfCache.c
-
-[sources.ebc]
- EbcCache.c
-
-[includes.common]
- .
- ../../Include
- ../../Include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
- \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/EbcCache.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/EbcCache.c
deleted file mode 100644
index 085faf96dd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/EbcCache.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86Cache.c
-
-Abstract:
-
- Cache Maintenance Functions.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-GlueInvalidateInstructionCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
-}
-
-/**
- Writes Back and Invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, the no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
-}
-
-/**
- Writes Back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes Back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, the no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, the no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/IpfCache.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/IpfCache.c
deleted file mode 100644
index c872ce7c0e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/IpfCache.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86Cache.c
-
-Abstract:
-
- Cache Maintenance Functions.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-GlueInvalidateInstructionCache (
- VOID
- )
-{
- PalCallStatic (NULL, 1, 1, 1, 0);
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- return AsmFlushCacheRange (Address, Length);
-}
-
-/**
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
- PalCallStatic (NULL, 1, 2, 1, 0);
-}
-
-/**
- Writes Back and Invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, the no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
-
- return AsmFlushCacheRange (Address, Length);
-}
-
-/**
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
- PalCallStatic (NULL, 1, 2, 0, 0);
-}
-
-/**
- Writes Back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes Back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, the no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
-
- return AsmFlushCacheRange (Address, Length);
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
- WriteBackInvalidateDataCache ();
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, the no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- return AsmFlushCacheRange (Address, Length);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/X86Cache.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/X86Cache.c
deleted file mode 100644
index 9a51df8e34..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseCacheMaintenanceLib/X86Cache.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86Cache.c
-
-Abstract:
-
- Cache Maintenance Functions.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-//
-// This size must be at or below the smallest cache size possible among all
-// supported processors
-//
-#define CACHE_LINE_SIZE 0x20
-
-/**
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
- Invalidates the entire instruction cache in cache coherency domain of the
- calling CPU.
-
-**/
-VOID
-EFIAPI
-GlueInvalidateInstructionCache (
- VOID
- )
-{
-}
-
-/**
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- @param Length The number of bytes to invalidate from the instruction cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
- return Address;
-}
-
-/**
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU.
-
- Writes Back and Invalidates the entire data cache in cache coherency domain
- of the calling CPU. This function guarantees that all dirty cache lines are
- written back to system memory, and also invalidates all the data cache lines
- in the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackInvalidateDataCache (
- VOID
- )
-{
- AsmWbinvd ();
-}
-
-/**
- Writes Back and Invalidates a range of data cache lines in the cache
- coherency domain of the calling CPU.
-
- Writes Back and Invalidate the data cache lines specified by Address and
- Length. If Address is not aligned on a cache line boundary, then entire data
- cache line containing Address is written back and invalidated. If Address +
- Length is not aligned on a cache line boundary, then the entire data cache
- line containing Address + Length -1 is written back and invalidated. This
- function may choose to write back and invalidate the entire data cache if
- that is more efficient than writing back and invalidating the specified
- range. If Length is 0, the no data cache lines are written back and
- invalidated. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back and
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
- @param Length The number of bytes to write back and invalidate from the
- data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackInvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- UINTN Start, End;
-
- ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
-
- if (Length == 0) {
- return Address;
- }
-
- Start = (UINTN)Address;
- End = (Start + Length + (CACHE_LINE_SIZE - 1)) & ~(CACHE_LINE_SIZE - 1);
- Start &= ~(CACHE_LINE_SIZE - 1);
-
- do {
- Start = (UINTN)AsmFlushCacheLine ((VOID*)Start) + CACHE_LINE_SIZE;
- } while (Start != End);
- return Address;
-}
-
-/**
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU.
-
- Writes Back the entire data cache in cache coherency domain of the calling
- CPU. This function guarantees that all dirty cache lines are written back to
- system memory. This function may also invalidate all the data cache lines in
- the cache coherency domain of the calling CPU.
-
-**/
-VOID
-EFIAPI
-WriteBackDataCache (
- VOID
- )
-{
- WriteBackInvalidateDataCache ();
-}
-
-/**
- Writes Back a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Writes Back the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is written back. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is written back. This function may choose to write back the entire
- data cache if that is more efficient than writing back the specified range.
- If Length is 0, the no data cache lines are written back. This function may
- also invalidate all the data cache lines in the specified range of the cache
- coherency domain of the calling CPU. Address is returned.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to write back. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing
- mode, then Address is a virtual address.
- @param Length The number of bytes to write back from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-WriteBackDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- return WriteBackInvalidateDataCacheRange (Address, Length);
-}
-
-/**
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU.
-
- Invalidates the entire data cache in cache coherency domain of the calling
- CPU. This function must be used with care because dirty cache lines are not
- written back to system memory. It is typically used for cache diagnostics. If
- the CPU does not support invalidation of the entire data cache, then a write
- back and invalidate operation should be performed on the entire data cache.
-
-**/
-VOID
-EFIAPI
-InvalidateDataCache (
- VOID
- )
-{
- AsmInvd ();
-}
-
-/**
- Invalidates a range of data cache lines in the cache coherency domain of the
- calling CPU.
-
- Invalidates the data cache lines specified by Address and Length. If Address
- is not aligned on a cache line boundary, then entire data cache line
- containing Address is invalidated. If Address + Length is not aligned on a
- cache line boundary, then the entire data cache line containing Address +
- Length -1 is invalidated. This function must never invalidate any cache lines
- outside the specified range. If Length is 0, the no data cache lines are
- invalidated. Address is returned. This function must be used with care
- because dirty cache lines are not written back to system memory. It is
- typically used for cache diagnostics. If the CPU does not support
- invalidation of a data cache range, then a write back and invalidate
- operation should be performed on the data cache range.
-
- If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-
- @param Address The base address of the data cache lines to invalidate. If
- the CPU is in a physical addressing mode, then Address is a
- physical address. If the CPU is in a virtual addressing mode,
- then Address is a virtual address.
- @param Length The number of bytes to invalidate from the data cache.
-
- @return Address
-
-**/
-VOID *
-EFIAPI
-InvalidateDataCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-{
- return WriteBackInvalidateDataCacheRange (Address, Length);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/BaseDebugLibNull.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/BaseDebugLibNull.inf
deleted file mode 100644
index 5ed0563f15..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+++ /dev/null
@@ -1,79 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseDebugLibNull.inf
-#
-# Abstract:
-#
-# Component description file for BaseDebugLibNull.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseDebugLibNull
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- DebugLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-[includes.common]
- .
- ../../Include
- ../../Include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueBasePrintLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/DebugLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/DebugLib.c
deleted file mode 100644
index cc754d4af8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseDebugLibNull/DebugLib.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DebugLib.c
-
-Abstract:
-
- Base Debug Library that uses PrintLib to print messages to a memory buffer.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
-
- Prints a debug message to the debug output device if the specified error level is enabled.
-
- If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
- the message specified by Format and the associated variable argument list to
- the debug output device.
-
- If Format is NULL, then ASSERT().
-
- @param ErrorLevel The error level of the debug message.
- @param Format Format string for the debug message to print.
-
-**/
-VOID
-EFIAPI
-DebugPrint (
- IN UINTN ErrorLevel,
- IN CONST CHAR8 *Format,
- ...
- )
-{
-}
-
-
-/**
-
- Prints an assert message containing a filename, line number, and description.
- This may be followed by a breakpoint or a dead loop.
-
- Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
- CpuDeadLoop() is called. If neither of these bits are set, then this function
- returns immediately after the message is printed to the debug output device.
- DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
- processing another DebugAssert(), then DebugAssert() must return immediately.
-
- If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
-
- If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
-
- @param FileName Pointer to the name of the source file that generated the assert condition.
- @param LineNumber The line number in the source file that generated the assert condition
- @param Description Pointer to the description of the assert condition.
-
-**/
-VOID
-EFIAPI
-DebugAssert (
- IN CONST CHAR8 *FileName,
- IN UINTN LineNumber,
- IN CONST CHAR8 *Description
- )
-{
-}
-
-
-/**
-
- Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the value specified by
- PcdDebugClearMemoryValue, and returns Buffer.
-
- If Buffer is NULL, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
- @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-DebugClearMemory (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- return Buffer;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
deleted file mode 100644
index ef93846589..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+++ /dev/null
@@ -1,89 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseIoLibIntrinsic.inf
-#
-# Abstract:
-#
-# Component description file for BaseIoLibIntrinsic.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseIoLibIntrinsic
-COMPONENT_TYPE = LIBRARY
-
-[Sources.common]
-
-[Sources.Ia32]
- IoHighLevel.c
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
-
-[Sources.X64]
- IoHighLevel.c
- IoLibGcc.c | GCC
- IoLibMsc.c | MSFT
- IoLibIcc.c | INTEL
- IoLib.c
-
-[sources.ipf]
- IoLibIpf.c
- IoHighLevel.c
-
-[sources.ebc]
-# doesn't support EBC
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
deleted file mode 100644
index 72c741a098..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/**@file
- Common header file shared by all source files.
-
- This file includes package header files, library classes and protocol, PPI & GUID definitions.
-
- 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.
-**/
-
-#ifndef __COMMON_HEADER_H_
-#define __COMMON_HEADER_H_
-
-
-
-#include <EdkIIGlueBase.h>
-
-
-#include <Library/EdkIIGlueIoLib.h>
-#include <Library/EdkIIGlueBaseLib.h>
-#include <Library/EdkIIGlueDebugLib.h>
-#include <Pcd/EdkIIGluePcd.h>
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoHighLevel.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoHighLevel.c
deleted file mode 100644
index 3d3719b81a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoHighLevel.c
+++ /dev/null
@@ -1,2280 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoHighLevel.c
-
-Abstract:
-
- High-level Io/Mmio functions.
-
- All assertions for bit field operations are handled bit field functions in the
- Base Library.
-
- The following IoLib instances share the same version of this file:
-
- BaseIoLibIntrinsic
- DxeIoLibCpuIo
- PeiIoLibCpuIo
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
- to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (IoRead8 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return IoWrite8 (
- Port,
- BitFieldWrite8 (IoRead8 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldOr8 (IoRead8 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAnd8 (IoRead8 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAndThenOr8 (IoRead8 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
- to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (IoRead16 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return IoWrite16 (
- Port,
- BitFieldWrite16 (IoRead16 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldOr16 (IoRead16 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAnd16 (IoRead16 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAndThenOr16 (IoRead16 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) | OrData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
- to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) & AndData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, (IoRead32 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (IoRead32 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return IoWrite32 (
- Port,
- BitFieldWrite32 (IoRead32 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldOr32 (IoRead32 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAnd32 (IoRead32 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAndThenOr32 (IoRead32 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) | OrData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
- to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) & AndData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (IoRead64 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return IoWrite64 (
- Port,
- BitFieldWrite64 (IoRead64 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldOr64 (IoRead64 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAnd64 (IoRead64 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAndThenOr64 (IoRead64 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (MmioRead8 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldWrite8 (MmioRead8 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldOr8 (MmioRead8 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAnd8 (MmioRead8 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAndThenOr8 (MmioRead8 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (MmioRead16 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldWrite16 (MmioRead16 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldOr16 (MmioRead16 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAnd16 (MmioRead16 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAndThenOr16 (MmioRead16 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) | OrData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) & AndData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, (MmioRead32 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (MmioRead32 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldWrite32 (MmioRead32 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldOr32 (MmioRead32 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAnd32 (MmioRead32 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAndThenOr32 (MmioRead32 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) | OrData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) & AndData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, (MmioRead64 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (MmioRead64 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldWrite64 (MmioRead64 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldOr64 (MmioRead64 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAnd64 (MmioRead64 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAndThenOr64 (MmioRead64 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLib.c
deleted file mode 100644
index 332857ef54..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLib.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoLib.c
-
-Abstract:
-
- Common I/O Library routines.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibGcc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibGcc.c
deleted file mode 100644
index 0e22d10d33..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibGcc.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/** @file
- I/O Library. This file has compiler specifics for GCC as there is no
- ANSI C standard for doing IO.
-
- GCC - uses EFIAPI assembler. __asm__ calls GAS. __volatile__ makes sure the
- compiler puts the assembler in this exact location. The complex GNUC
- operations are not optimzed. It would be possible to also write these
- with EFIAPI assembler.
-
- We don't advocate putting compiler specifics in libraries or drivers but there
- is no other way to make this work.
-
- Copyright (c) 2006 - 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.
-
-**/
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- return *(volatile UINT8*)Address;
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- return *(volatile UINT8*)Address = Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 1) == 0);
- return *(volatile UINT16*)Address;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
- return *(volatile UINT16*)Address = Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 3) == 0);
- return *(volatile UINT32*)Address;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
- return *(volatile UINT32*)Address = Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 7) == 0);
- return *(volatile UINT64*)Address;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
- return *(volatile UINT64*)Address = Value;
-}
-
-
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Data;
-
- __asm__ __volatile__ ("inb %w1,%b0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- __asm__ __volatile__ ("outb %b0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Data;
-
- ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("outw %w0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-__inline__
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Data;
-
- ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("inl %w1,%0" : "=a" (Data) : "d" ((UINT16)Port));
- return Data;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-__inline__
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("outl %0,%w1" : : "a" (Value), "d" ((UINT16)Port));
- return Value;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIcc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIcc.c
deleted file mode 100644
index 7bf8e44ccc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIcc.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/** @file
- I/O Library. This file has compiler specifics for ICC as there
- is no ANSI C standard for doing IO.
-
- Copyright (c) 2006 - 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.
-
-**/
-#include "BaseIoLibIntrinsicInternal.h"
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- return *(volatile UINT8*)Address;
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- return *(volatile UINT8*)Address = Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 1) == 0);
- return *(volatile UINT16*)Address;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
- return *(volatile UINT16*)Address = Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 3) == 0);
- return *(volatile UINT32*)Address;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
- return *(volatile UINT32*)Address = Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- ASSERT ((Address & 7) == 0);
- return *(volatile UINT64*)Address;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
- return *(volatile UINT64*)Address = Value;
-}
-
-
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Data;
-
- __asm {
- mov dx, word ptr [Port]
- in al, dx
-
- mov Data, al
- }
- return Data;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- __asm {
- mov al, byte ptr [Value]
- mov dx, word ptr [Port]
- out dx, al
- }
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Data;
-
- ASSERT ((Port & 1) == 0);
-
- __asm {
- mov dx, word ptr [Port]
- in ax, dx
- mov word ptr [Data], ax
- }
-
- return Data;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
-
- __asm {
- mov ax, word ptr [Value]
- mov dx, word ptr [Port]
- out dx, ax
- }
-
- //
- // Never reached return statement.
- //
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Data;
-
- ASSERT ((Port & 3) == 0);
-
- __asm {
- mov dx, word ptr [Port]
- in eax, dx
- mov dword ptr [Data], eax
- }
-
- return Data;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
-
- __asm {
- mov eax, dword ptr [Value]
- mov dx, word ptr [Port]
- out dx, eax
- }
-
- return Value;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIpf.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIpf.c
deleted file mode 100644
index d52781a633..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibIpf.c
+++ /dev/null
@@ -1,490 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoLibIpf.c
-
-Abstract:
-
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-#define BIT63 0x8000000000000000UL
-
-#define MAP_PORT_BASE_TO_MEM(_Port) \
- ((((_Port) & 0xfffc) << 10) | ((_Port) & 0x0fff))
-
-/**
- Reads a 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINT64 Port
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioRead8 (Address);
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINT64 Port
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioRead16 (Address);
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINT64 Port
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioRead32 (Address);
-}
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Writes a 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINT64 Port,
- IN UINT8 Data
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioWrite8 (Address, Data);
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINT64 Port,
- IN UINT16 Data
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioWrite16 (Address, Data);
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINT64 Port,
- IN UINT32 Data
- )
-{
- UINT64 Address;
-
- //
- // Add the 64MB aligned IO Port space to the IO address
- //
- Address = MAP_PORT_BASE_TO_MEM (Port);
- Address += PcdGet64(PcdIoBlockBaseAddressForIpf);
-
- return MmioWrite32 (Address, Data);
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- Reads a 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINT64 Address
- )
-{
- UINT8 Data;
-
- Address |= BIT63;
-
- MemoryFence ();
- Data = *((volatile UINT8 *) Address);
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINT64 Address
- )
-{
- UINT16 Data;
-
- Address |= BIT63;
-
- MemoryFence ();
- Data = *((volatile UINT16 *) Address);
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINT64 Address
- )
-{
- UINT32 Data;
-
- Address |= BIT63;
-
- MemoryFence ();
- Data = *((volatile UINT32 *) Address);
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINT64 Address
- )
-{
- UINT64 Data;
-
- Address |= BIT63;
-
- MemoryFence ();
- Data = *((volatile UINT64 *) Address);
- MemoryFence ();
-
- return Data;
-
-}
-
-/**
- Writes a 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Data The value to write to the MMIO register.
-
- @return The value written the memory address.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINT64 Address,
- IN UINT8 Data
- )
-{
- Address |= BIT63;
-
- MemoryFence ();
- *((volatile UINT8 *) Address) = Data;
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Data The value to write to the MMIO register.
-
- @return The value written the memory address.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINT64 Address,
- IN UINT16 Data
- )
-{
- Address |= BIT63;
-
- MemoryFence ();
- *((volatile UINT16 *) Address) = Data;
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Data The value to write to the MMIO register.
-
- @return The value written the memory address.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINT64 Address,
- IN UINT32 Data
- )
-{
- Address |= BIT63;
-
- MemoryFence ();
- *((volatile UINT32 *) Address) = Data;
- MemoryFence ();
-
- return Data;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- @param Address The MMIO register to write.
- @param Data The value to write to the MMIO register.
-
- @return The value written the memory address.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINT64 Address,
- IN UINT64 Data
- )
-{
- Address |= BIT63;
-
- MemoryFence ();
- *((volatile UINT64 *) Address) = Data;
- MemoryFence ();
-
- return Data;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibMsc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibMsc.c
deleted file mode 100644
index 5abbe8ed18..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseIoLibIntrinsic/IoLibMsc.c
+++ /dev/null
@@ -1,436 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoLibMsc.c
-
-Abstract:
-
- I/O Library. This file has compiler specifics for Microsft C as there is no
- ANSI C standard for doing IO.
-
- MSC - uses intrinsic functions and the optimize will remove the function call
- overhead.
-
- We don't advocate putting compiler specifics in libraries or drivers but there
- is no other way to make this work.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-#if _MSC_EXTENSIONS
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-int _inp (unsigned short port);
-unsigned short _inpw (unsigned short port);
-unsigned long _inpd (unsigned short port);
-int _outp (unsigned short port, int databyte );
-unsigned short _outpw (unsigned short port, unsigned short dataword );
-unsigned long _outpd (unsigned short port, unsigned long dataword );
-void _ReadWriteBarrier (void);
-
-#pragma intrinsic(_inp)
-#pragma intrinsic(_inpw)
-#pragma intrinsic(_inpd)
-#pragma intrinsic(_outp)
-#pragma intrinsic(_outpw)
-#pragma intrinsic(_outpd)
-#pragma intrinsic(_ReadWriteBarrier)
-
-//
-// _ReadWriteBarrier() forces memory reads and writes to complete at the point
-// in the call. This is only a hint to the compiler and does emit code.
-// In past versions of the compiler, _ReadWriteBarrier was enforced only
-// locally and did not affect functions up the call tree. In Visual C++
-// 2005, _ReadWriteBarrier is enforced all the way up the call tree.
-//
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-GlueIoRead8 (
- IN UINTN Port
- )
-{
- UINT8 Value;
-
- _ReadWriteBarrier ();
- Value = (UINT8)_inp ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-GlueIoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- _ReadWriteBarrier ();
- (UINT8)_outp ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-GlueIoRead16 (
- IN UINTN Port
- )
-{
- UINT16 Value;
-
- ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- Value = _inpw ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-GlueIoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- _outpw ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-GlueIoRead32 (
- IN UINTN Port
- )
-{
- UINT32 Value;
-
- ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- Value = _inpd ((UINT16)Port);
- _ReadWriteBarrier ();
- return Value;
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-GlueIoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- _outpd ((UINT16)Port, Value);
- _ReadWriteBarrier ();
- return Value;
-}
-
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- UINT8 Value;
-
- Value = *(volatile UINT8*)Address;
- return Value;
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- return *(volatile UINT8*)Address = Value;
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- UINT16 Value;
-
- ASSERT ((Address & 1) == 0);
- Value = *(volatile UINT16*)Address;
- return Value;
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT ((Address & 1) == 0);
- return *(volatile UINT16*)Address = Value;
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- UINT32 Value;
-
- ASSERT ((Address & 3) == 0);
- Value = *(volatile UINT32*)Address;
- return Value;
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT ((Address & 3) == 0);
- return *(volatile UINT32*)Address = Value;
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- UINT64 Value;
-
- ASSERT ((Address & 7) == 0);
- Value = *(volatile UINT64*)Address;
- return Value;
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- ASSERT ((Address & 7) == 0);
- return *(volatile UINT64*)Address = Value;
-}
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ARShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ARShiftU64.c
deleted file mode 100644
index e8e8a24eb2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ARShiftU64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ARShiftU64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled
- with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count
-
-**/
-UINT64
-EFIAPI
-ARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return InternalMathARShiftU64 (Operand, Count);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLib.inf
deleted file mode 100644
index c7a4b718e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLib.inf
+++ /dev/null
@@ -1,658 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# BaseLib.inf
-#
-# Abstract:
-#
-# Component description file for BaseLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseLib
-COMPONENT_TYPE = LIBRARY
-
-[Sources.common]
- CheckSum.c
- SwitchStack.c
- SwapBytes64.c
- SwapBytes32.c
- SwapBytes16.c
- LongJump.c
- SetJump.c
- RShiftU64.c
- RRotU64.c
- RRotU32.c
- MultU64x64.c
- MultU64x32.c
- MultS64x64.c
- ModU64x32.c
- LShiftU64.c
- LRotU64.c
- LRotU32.c
- LowBitSet64.c
- LowBitSet32.c
- HighBitSet64.c
- HighBitSet32.c
- GetPowerOfTwo64.c
- GetPowerOfTwo32.c
- DivU64x64Remainder.c
- DivU64x32Remainder.c
- DivU64x32.c
- DivS64x64Remainder.c
- ARShiftU64.c
- BitField.c
- CpuDeadLoop.c
- Cpu.c
- LinkedList.c
- String.c
-
-[Sources.Ia32]
- Ia32/Wbinvd.c | MSFT
- Ia32/WriteMm7.c | MSFT
- Ia32/WriteMm6.c | MSFT
- Ia32/WriteMm5.c | MSFT
- Ia32/WriteMm4.c | MSFT
- Ia32/WriteMm3.c | MSFT
- Ia32/WriteMm2.c | MSFT
- Ia32/WriteMm1.c | MSFT
- Ia32/WriteMm0.c | MSFT
- Ia32/WriteLdtr.c | MSFT
- Ia32/WriteIdtr.c | MSFT
- Ia32/WriteGdtr.c | MSFT
- Ia32/WriteDr7.c | MSFT
- Ia32/WriteDr6.c | MSFT
- Ia32/WriteDr5.c | MSFT
- Ia32/WriteDr4.c | MSFT
- Ia32/WriteDr3.c | MSFT
- Ia32/WriteDr2.c | MSFT
- Ia32/WriteDr1.c | MSFT
- Ia32/WriteDr0.c | MSFT
- Ia32/WriteCr4.c | MSFT
- Ia32/WriteCr3.c | MSFT
- Ia32/WriteCr2.c | MSFT
- Ia32/WriteCr0.c | MSFT
- Ia32/WriteMsr64.c | MSFT
- Ia32/SwapBytes64.c | MSFT
- Ia32/SetJump.c | MSFT
- Ia32/RRotU64.c | MSFT
- Ia32/RShiftU64.c | MSFT
- Ia32/ReadPmc.c | MSFT
- Ia32/ReadTsc.c | MSFT
- Ia32/ReadLdtr.c | MSFT
- Ia32/ReadIdtr.c | MSFT
- Ia32/ReadGdtr.c | MSFT
- Ia32/ReadTr.c | MSFT
- Ia32/ReadSs.c | MSFT
- Ia32/ReadGs.c | MSFT
- Ia32/ReadFs.c | MSFT
- Ia32/ReadEs.c | MSFT
- Ia32/ReadDs.c | MSFT
- Ia32/ReadCs.c | MSFT
- Ia32/ReadMsr64.c | MSFT
- Ia32/ReadMm7.c | MSFT
- Ia32/ReadMm6.c | MSFT
- Ia32/ReadMm5.c | MSFT
- Ia32/ReadMm4.c | MSFT
- Ia32/ReadMm3.c | MSFT
- Ia32/ReadMm2.c | MSFT
- Ia32/ReadMm1.c | MSFT
- Ia32/ReadMm0.c | MSFT
- Ia32/ReadEflags.c | MSFT
- Ia32/ReadDr7.c | MSFT
- Ia32/ReadDr6.c | MSFT
- Ia32/ReadDr5.c | MSFT
- Ia32/ReadDr4.c | MSFT
- Ia32/ReadDr3.c | MSFT
- Ia32/ReadDr2.c | MSFT
- Ia32/ReadDr1.c | MSFT
- Ia32/ReadDr0.c | MSFT
- Ia32/ReadCr4.c | MSFT
- Ia32/ReadCr3.c | MSFT
- Ia32/ReadCr2.c | MSFT
- Ia32/ReadCr0.c | MSFT
- Ia32/Mwait.c | MSFT
- Ia32/Monitor.c | MSFT
- Ia32/ModU64x32.c | MSFT
- Ia32/MultU64x64.c | MSFT
- Ia32/MultU64x32.c | MSFT
- Ia32/LShiftU64.c | MSFT
- Ia32/LRotU64.c | MSFT
- Ia32/LongJump.c | MSFT
- Ia32/Invd.c | MSFT
- Ia32/InterlockedCompareExchange64.c | MSFT
- Ia32/InterlockedCompareExchange32.c | MSFT
- Ia32/InterlockedDecrement.c | MSFT
- Ia32/InterlockedIncrement.c | MSFT
- Ia32/FxRestore.c | MSFT
- Ia32/FxSave.c | MSFT
- Ia32/FlushCacheLine.c | MSFT
- Ia32/EnablePaging32.c | MSFT
- Ia32/EnableInterrupts.c | MSFT
- Ia32/EnableDisableInterrupts.c | MSFT
- Ia32/DivU64x64Remainder.asm | MSFT
- Ia32/DivU64x32Remainder.c | MSFT
- Ia32/DivU64x32.c | MSFT
- Ia32/DisablePaging32.c | MSFT
- Ia32/DisableInterrupts.c | MSFT
- Ia32/CpuPause.c | MSFT
- Ia32/CpuIdEx.c | MSFT
- Ia32/CpuId.c | MSFT
- Ia32/CpuBreakpoint.c | MSFT
- Ia32/ARShiftU64.c | MSFT
- SynchronizationMsc.c | MSFT
-
- Ia32/Wbinvd.asm | INTEL
- Ia32/WriteMm7.asm | INTEL
- Ia32/WriteMm6.asm | INTEL
- Ia32/WriteMm5.asm | INTEL
- Ia32/WriteMm4.asm | INTEL
- Ia32/WriteMm3.asm | INTEL
- Ia32/WriteMm2.asm | INTEL
- Ia32/WriteMm1.asm | INTEL
- Ia32/WriteMm0.asm | INTEL
- Ia32/WriteLdtr.asm | INTEL
- Ia32/WriteIdtr.asm | INTEL
- Ia32/WriteGdtr.asm | INTEL
- Ia32/WriteDr7.asm | INTEL
- Ia32/WriteDr6.asm | INTEL
- Ia32/WriteDr5.asm | INTEL
- Ia32/WriteDr4.asm | INTEL
- Ia32/WriteDr3.asm | INTEL
- Ia32/WriteDr2.asm | INTEL
- Ia32/WriteDr1.asm | INTEL
- Ia32/WriteDr0.asm | INTEL
- Ia32/WriteCr4.asm | INTEL
- Ia32/WriteCr3.asm | INTEL
- Ia32/WriteCr2.asm | INTEL
- Ia32/WriteCr0.asm | INTEL
- Ia32/WriteMsr64.asm | INTEL
- Ia32/SwapBytes64.asm | INTEL
- Ia32/SetJump.asm | INTEL
- Ia32/RRotU64.asm | INTEL
- Ia32/RShiftU64.asm | INTEL
- Ia32/ReadPmc.asm | INTEL
- Ia32/ReadTsc.asm | INTEL
- Ia32/ReadLdtr.asm | INTEL
- Ia32/ReadIdtr.asm | INTEL
- Ia32/ReadGdtr.asm | INTEL
- Ia32/ReadTr.asm | INTEL
- Ia32/ReadSs.asm | INTEL
- Ia32/ReadGs.asm | INTEL
- Ia32/ReadFs.asm | INTEL
- Ia32/ReadEs.asm | INTEL
- Ia32/ReadDs.asm | INTEL
- Ia32/ReadCs.asm | INTEL
- Ia32/ReadMsr64.asm | INTEL
- Ia32/ReadMm7.asm | INTEL
- Ia32/ReadMm6.asm | INTEL
- Ia32/ReadMm5.asm | INTEL
- Ia32/ReadMm4.asm | INTEL
- Ia32/ReadMm3.asm | INTEL
- Ia32/ReadMm2.asm | INTEL
- Ia32/ReadMm1.asm | INTEL
- Ia32/ReadMm0.asm | INTEL
- Ia32/ReadEflags.asm | INTEL
- Ia32/ReadDr7.asm | INTEL
- Ia32/ReadDr6.asm | INTEL
- Ia32/ReadDr5.asm | INTEL
- Ia32/ReadDr4.asm | INTEL
- Ia32/ReadDr3.asm | INTEL
- Ia32/ReadDr2.asm | INTEL
- Ia32/ReadDr1.asm | INTEL
- Ia32/ReadDr0.asm | INTEL
- Ia32/ReadCr4.asm | INTEL
- Ia32/ReadCr3.asm | INTEL
- Ia32/ReadCr2.asm | INTEL
- Ia32/ReadCr0.asm | INTEL
- Ia32/Mwait.asm | INTEL
- Ia32/Monitor.asm | INTEL
- Ia32/ModU64x32.asm | INTEL
- Ia32/MultU64x64.asm | INTEL
- Ia32/MultU64x32.asm | INTEL
- Ia32/LShiftU64.asm | INTEL
- Ia32/LRotU64.asm | INTEL
- Ia32/LongJump.asm | INTEL
- Ia32/Invd.asm | INTEL
- Ia32/InterlockedCompareExchange64.asm | INTEL
- Ia32/InterlockedCompareExchange32.asm | INTEL
- Ia32/InterlockedDecrement.asm | INTEL
- Ia32/InterlockedIncrement.asm | INTEL
- Ia32/FxRestore.asm | INTEL
- Ia32/FxSave.asm | INTEL
- Ia32/FlushCacheLine.asm | INTEL
- Ia32/EnablePaging32.asm | INTEL
- Ia32/EnableInterrupts.asm | INTEL
- Ia32/EnableDisableInterrupts.asm | INTEL
- Ia32/DivU64x64Remainder.asm | INTEL
- Ia32/DivU64x32Remainder.asm | INTEL
- Ia32/DivU64x32.asm | INTEL
- Ia32/DisablePaging32.asm | INTEL
- Ia32/DisableInterrupts.asm | INTEL
- Ia32/CpuPause.asm | INTEL
- Ia32/CpuIdEx.asm | INTEL
- Ia32/CpuId.asm | INTEL
- Ia32/CpuBreakpoint.asm | INTEL
- Ia32/ARShiftU64.asm | INTEL
- Synchronization.c | INTEL
-
- Ia32/Thunk16.asm
- Ia32/EnablePaging64.asm
-
- Ia32/Thunk16.S | GCC
- Ia32/CpuBreakpoint.S | GCC
- Ia32/CpuPause.S | GCC
- Ia32/EnableDisableInterrupts.S | GCC
- Ia32/DisableInterrupts.S | GCC
- Ia32/EnableInterrupts.S | GCC
- Ia32/InterlockedCompareExchange64.S | GCC
- Ia32/InterlockedCompareExchange32.S | GCC
- Ia32/InterlockedDecrement.S | GCC
- Ia32/InterlockedIncrement.S | GCC
- Ia32/FlushCacheLine.S | GCC
- Ia32/Invd.S | GCC
- Ia32/Wbinvd.S | GCC
- Ia32/EnablePaging64.S | GCC
- Ia32/DisablePaging32.S | GCC
- Ia32/EnablePaging32.S | GCC
- Ia32/Mwait.S | GCC
- Ia32/Monitor.S | GCC
- Ia32/ReadPmc.S | GCC
- Ia32/ReadTsc.S | GCC
- Ia32/WriteMm7.S | GCC
- Ia32/WriteMm6.S | GCC
- Ia32/WriteMm5.S | GCC
- Ia32/WriteMm4.S | GCC
- Ia32/WriteMm3.S | GCC
- Ia32/WriteMm2.S | GCC
- Ia32/WriteMm1.S | GCC
- Ia32/WriteMm0.S | GCC
- Ia32/ReadMm7.S | GCC
- Ia32/ReadMm6.S | GCC
- Ia32/ReadMm5.S | GCC
- Ia32/ReadMm4.S | GCC
- Ia32/ReadMm3.S | GCC
- Ia32/ReadMm2.S | GCC
- Ia32/ReadMm1.S | GCC
- Ia32/ReadMm0.S | GCC
- Ia32/FxRestore.S | GCC
- Ia32/FxSave.S | GCC
- Ia32/WriteLdtr.S | GCC
- Ia32/ReadLdtr.S | GCC
- Ia32/WriteIdtr.S | GCC
- Ia32/ReadIdtr.S | GCC
- Ia32/WriteGdtr.S | GCC
- Ia32/ReadGdtr.S | GCC
- Ia32/ReadTr.S | GCC
- Ia32/ReadSs.S | GCC
- Ia32/ReadGs.S | GCC
- Ia32/ReadFs.S | GCC
- Ia32/ReadEs.S | GCC
- Ia32/ReadDs.S | GCC
- Ia32/ReadCs.S | GCC
- Ia32/WriteDr7.S | GCC
- Ia32/WriteDr6.S | GCC
- Ia32/WriteDr5.S | GCC
- Ia32/WriteDr4.S | GCC
- Ia32/WriteDr3.S | GCC
- Ia32/WriteDr2.S | GCC
- Ia32/WriteDr1.S | GCC
- Ia32/WriteDr0.S | GCC
- Ia32/ReadDr7.S | GCC
- Ia32/ReadDr6.S | GCC
- Ia32/ReadDr5.S | GCC
- Ia32/ReadDr4.S | GCC
- Ia32/ReadDr3.S | GCC
- Ia32/ReadDr2.S | GCC
- Ia32/ReadDr1.S | GCC
- Ia32/ReadDr0.S | GCC
- Ia32/WriteCr4.S | GCC
- Ia32/WriteCr3.S | GCC
- Ia32/WriteCr2.S | GCC
- Ia32/WriteCr0.S | GCC
- Ia32/ReadCr4.S | GCC
- Ia32/ReadCr3.S | GCC
- Ia32/ReadCr2.S | GCC
- Ia32/ReadCr0.S | GCC
- Ia32/WriteMsr64.S | GCC
- Ia32/ReadMsr64.S | GCC
- Ia32/ReadEflags.S | GCC
- Ia32/CpuIdEx.S | GCC
- Ia32/CpuId.S | GCC
- Ia32/LongJump.S | GCC
- Ia32/SetJump.S | GCC
- Ia32/SwapBytes64.S | GCC
- Ia32/DivU64x64Remainder.S | GCC
- Ia32/DivU64x32Remainder.S | GCC
- Ia32/ModU64x32.S | GCC
- Ia32/DivU64x32.S | GCC
- Ia32/MultU64x64.S | GCC
- Ia32/MultU64x32.S | GCC
- Ia32/RRotU64.S | GCC
- Ia32/LRotU64.S | GCC
- Ia32/ARShiftU64.S | GCC
- Ia32/RShiftU64.S | GCC
- Ia32/LShiftU64.S | GCC
- SynchronizationGcc.c | GCC
-
- Ia32/DivS64x64Remainder.c
- Ia32/InternalSwitchStack.c
- Ia32/Non-existing.c
- Unaligned.c
- X86WriteIdtr.c
- X86WriteGdtr.c
- X86Thunk.c
- X86ReadIdtr.c
- X86ReadGdtr.c
- X86Msr.c
- X86MemoryFence.c
- X86GetInterruptState.c
- X86FxSave.c
- X86FxRestore.c
- X86EnablePaging64.c
- X86EnablePaging32.c
- X86DisablePaging64.c
- X86DisablePaging32.c
-
-[Sources.X64]
- X64/Thunk16.asm
- X64/CpuPause.asm
- X64/EnableDisableInterrupts.asm
- X64/DisableInterrupts.asm
- X64/EnableInterrupts.asm
- X64/FlushCacheLine.asm
- X64/Invd.asm
- X64/Wbinvd.asm
- X64/DisablePaging64.asm
- X64/EnablePaging64.asm
- X64/Mwait.asm
- X64/Monitor.asm
- X64/ReadPmc.asm
- X64/ReadTsc.asm
- X64/WriteMm7.asm
- X64/WriteMm6.asm
- X64/WriteMm5.asm
- X64/WriteMm4.asm
- X64/WriteMm3.asm
- X64/WriteMm2.asm
- X64/WriteMm1.asm
- X64/WriteMm0.asm
- X64/ReadMm7.asm
- X64/ReadMm6.asm
- X64/ReadMm5.asm
- X64/ReadMm4.asm
- X64/ReadMm3.asm
- X64/ReadMm2.asm
- X64/ReadMm1.asm
- X64/ReadMm0.asm
- X64/FxRestore.asm
- X64/FxSave.asm
- X64/WriteLdtr.asm
- X64/ReadLdtr.asm
- X64/WriteIdtr.asm
- X64/ReadIdtr.asm
- X64/WriteGdtr.asm
- X64/ReadGdtr.asm
- X64/ReadTr.asm
- X64/ReadSs.asm
- X64/ReadGs.asm
- X64/ReadFs.asm
- X64/ReadEs.asm
- X64/ReadDs.asm
- X64/ReadCs.asm
- X64/WriteDr7.asm
- X64/WriteDr6.asm
- X64/WriteDr5.asm
- X64/WriteDr4.asm
- X64/WriteDr3.asm
- X64/WriteDr2.asm
- X64/WriteDr1.asm
- X64/WriteDr0.asm
- X64/ReadDr7.asm
- X64/ReadDr6.asm
- X64/ReadDr5.asm
- X64/ReadDr4.asm
- X64/ReadDr3.asm
- X64/ReadDr2.asm
- X64/ReadDr1.asm
- X64/ReadDr0.asm
- X64/WriteCr4.asm
- X64/WriteCr3.asm
- X64/WriteCr2.asm
- X64/WriteCr0.asm
- X64/ReadCr4.asm
- X64/ReadCr3.asm
- X64/ReadCr2.asm
- X64/ReadCr0.asm
- X64/ReadEflags.asm
- X64/CpuIdEx.asm
- X64/CpuId.asm
- X64/LongJump.asm
- X64/SetJump.asm
- X64/SwitchStack.asm
- X64/InterlockedCompareExchange64.asm
- X64/InterlockedCompareExchange32.asm
-
- X64/InterlockedDecrement.c | MSFT
- X64/InterlockedIncrement.c | MSFT
- X64/CpuBreakpoint.c | MSFT
- X64/WriteMsr64.c | MSFT
- X64/ReadMsr64.c | MSFT
- SynchronizationMsc.c | MSFT
-
- X64/InterlockedDecrement.asm | INTEL
- X64/InterlockedIncrement.asm | INTEL
- X64/CpuBreakpoint.asm | INTEL
- X64/WriteMsr64.asm | INTEL
- X64/ReadMsr64.asm | INTEL
- Synchronization.c | INTEL
-
- X64/Non-existing.c
- Math64.c
- Unaligned.c
- X86WriteIdtr.c
- X86WriteGdtr.c
- X86Thunk.c
- X86ReadIdtr.c
- X86ReadGdtr.c
- X86Msr.c
- X86MemoryFence.c
- X86GetInterruptState.c
- X86FxSave.c
- X86FxRestore.c
- X86EnablePaging64.c
- X86EnablePaging32.c
- X86DisablePaging64.c
- X86DisablePaging32.c
- X64/WriteMsr64.S | GCC
- X64/WriteMm7.S | GCC
- X64/WriteMm6.S | GCC
- X64/WriteMm5.S | GCC
- X64/WriteMm4.S | GCC
- X64/WriteMm3.S | GCC
- X64/WriteMm2.S | GCC
- X64/WriteMm1.S | GCC
- X64/WriteMm0.S | GCC
- X64/WriteLdtr.S | GCC
- X64/WriteIdtr.S | GCC
- X64/WriteGdtr.S | GCC
- X64/WriteDr7.S | GCC
- X64/WriteDr6.S | GCC
- X64/WriteDr5.S | GCC
- X64/WriteDr4.S | GCC
- X64/WriteDr3.S | GCC
- X64/WriteDr2.S | GCC
- X64/WriteDr1.S | GCC
- X64/WriteDr0.S | GCC
- X64/WriteCr4.S | GCC
- X64/WriteCr3.S | GCC
- X64/WriteCr2.S | GCC
- X64/WriteCr0.S | GCC
- X64/Wbinvd.S | GCC
- X64/Thunk16.S | GCC
- X64/SwitchStack.S | GCC
- X64/SetJump.S | GCC
- X64/ReadTsc.S | GCC
- X64/ReadTr.S | GCC
- X64/ReadSs.S | GCC
- X64/ReadPmc.S | GCC
- X64/ReadMsr64.S | GCC
- X64/ReadMm7.S | GCC
- X64/ReadMm6.S | GCC
- X64/ReadMm5.S | GCC
- X64/ReadMm4.S | GCC
- X64/ReadMm3.S | GCC
- X64/ReadMm2.S | GCC
- X64/ReadMm1.S | GCC
- X64/ReadMm0.S | GCC
- X64/ReadLdtr.S | GCC
- X64/ReadIdtr.S | GCC
- X64/ReadGs.S | GCC
- X64/ReadGdtr.S | GCC
- X64/ReadFs.S | GCC
- X64/ReadEs.S | GCC
- X64/ReadEflags.S | GCC
- X64/ReadDs.S | GCC
- X64/ReadDr7.S | GCC
- X64/ReadDr6.S | GCC
- X64/ReadDr5.S | GCC
- X64/ReadDr4.S | GCC
- X64/ReadDr3.S | GCC
- X64/ReadDr2.S | GCC
- X64/ReadDr1.S | GCC
- X64/ReadDr0.S | GCC
- X64/ReadCs.S | GCC
- X64/ReadCr4.S | GCC
- X64/ReadCr3.S | GCC
- X64/ReadCr2.S | GCC
- X64/ReadCr0.S | GCC
- X64/Mwait.S | GCC
- X64/Monitor.S | GCC
- X64/LongJump.S | GCC
- X64/Invd.S | GCC
- X64/InterlockedIncrement.S | GCC
- X64/InterlockedDecrement.S | GCC
- X64/InterlockedCompareExchange64.S | GCC
- X64/InterlockedCompareExchange32.S | GCC
- X64/FxSave.S | GCC
- X64/FxRestore.S | GCC
- X64/FlushCacheLine.S | GCC
- X64/EnablePaging64.S | GCC
- X64/EnableInterrupts.S | GCC
- X64/EnableDisableInterrupts.S | GCC
- X64/DisablePaging64.S | GCC
- X64/DisableInterrupts.S | GCC
- X64/CpuPause.S | GCC
- X64/CpuId.S | GCC
- X64/CpuIdEx.S | GCC
- X64/CpuBreakpoint.S | GCC
- SynchronizationGcc.c | GCC
- ChkStkGcc.c | GCC
-
-[Sources.IPF]
- Ipf/asm.h
- Ipf/ia_64gen.h
- Ipf/PalCallStatic.s
- Ipf/setjmp.s
- Ipf/longjmp.s
- Ipf/SwitchStack.s
- Ipf/Unaligned.c
- Ipf/InterlockedCompareExchange32.s
- Ipf/InterlockedCompareExchange64.s
- Ipf/Synchronization.c
- Ipf/CpuPause.s
- Ipf/CpuFlushTlb.s
- Ipf/GetInterruptState.s
- Ipf/InternalSwitchStack.c
- Ipf/FlushCacheRange.s
- Ipf/AccessDbr.s
- Ipf/AccessEicr.s
- Ipf/AccessGcr.s
- Ipf/AccessKr.s
- Ipf/AccessPmr.s
- Ipf/AccessPsr.s
- Ipf/AsmPalCall.s
- Ipf/ExecFc.s
- Ipf/ReadCpuid.s
- Ipf/AccessGp.s
- Math64.c
- Ipf/CpuBreakpoint.c | INTEL
- Ipf/CpuBreakpointMsc.c | MSFT
- Synchronization.c | INTEL
- SynchronizationMsc.c | MSFT
- SynchronizationGcc.c | GCC
-
-[sources.ebc]
- Math64.c
- Unaligned.c
- Ebc/SwitchStack.c
- Ebc/SetJumpLongJump.c
- Ebc/CpuBreakpoint.c
- Ebc/Synchronization.c
- Synchronization.c
-
-[includes.common]
- .
- ../../Include
- ../../Include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[includes.IA32]
- ../../Include/Ia32
-
-[includes.X64]
- ../../Include/x64
-
-
-[libraries.common]
-#
-# Actually, BaesLib may refer
-# BaseTimerLibLocalApic::GetPerformanceCounter()in AcquireSpinLock()
-# BaseMemoryLib::ZeroMem() in StrnCpy()
-#
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
- \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLibInternals.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLibInternals.h
deleted file mode 100644
index 6c9e77cfdd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BaseLibInternals.h
+++ /dev/null
@@ -1,876 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- BaseLibInternals.h
-
-Abstract:
-
- Declaration of internal functions in BaseLib.
-
---*/
-
-#ifndef __BASE_LIB_INTERNALS_H__
-#define __BASE_LIB_INTERNALS_H__
-
-#include "EdkIIGlueBase.h"
-
-#define QUIENT_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 / 10)
-#define REMINDER_MAX_UINTN_DIVIDED_BY_10 ((UINTN) -1 % 10)
-
-#define QUIENT_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 / 16)
-#define REMINDER_MAX_UINTN_DIVIDED_BY_16 ((UINTN) -1 % 16)
-
-#define QUIENT_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 / 10)
-#define REMINDER_MAX_UINT64_DIVIDED_BY_10 ((UINT64) -1 % 10)
-
-#define QUIENT_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 / 16)
-#define REMINDER_MAX_UINT64_DIVIDED_BY_16 ((UINT64) -1 % 16)
-
-//
-// Math functions
-//
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count
-
-**/
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling
- the low bits with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling
- the high bits with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- );
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- );
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- );
-
-/**
- Multiples a 64-bit unsigned integer by a 64-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- );
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder
- );
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x64 (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder
- );
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- );
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- );
-
-
-/**
- Worker function that locates the Node in the List
-
- By searching the List, finds the location of the Node in List. At the same time,
- verifies the validity of this list.
-
- If List is NULL, then ASSERT().
- If List->ForwardLink is NULL, then ASSERT().
- If List->backLink is NULL, then ASSERT().
- If Node is NULL, then ASSERT();
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to a node in a linked list.
- @param Node A pointer to one nod.
-
- @retval TRUE Node is in List
- @retval FALSE Node isn't in List, or List is invalid
-
-**/
-BOOLEAN
-IsNodeInList (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- );
-
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncIncrement (
- IN volatile UINT32 *Value
- );
-
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decrement value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decrement value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncDecrement (
- IN volatile UINT32 *Value
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InternalSyncCompareExchange32 (
- IN volatile UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- );
-
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InternalSyncCompareExchange64 (
- IN volatile UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- );
-
-
-/**
- Worker function that returns a bit field from Operand
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
-
- @return The bit field read.
-
-**/
-unsigned int
-BitFieldReadUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- );
-
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise OR,
- and returns the result.
-
- Performs a bitwise OR between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param OrData The value to OR with the read value from the value
-
- @return The new value.
-
-**/
-unsigned int
-BitFieldOrUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN unsigned int OrData
- );
-
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise AND,
- and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param AndData The value to And with the read value from the value
-
- @return The new value.
-
-**/
-unsigned int
-BitFieldAndUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN unsigned int AndData
- );
-
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead is resumes execution based on the state of JumpBuffer.
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- );
-
-
-//
-// Ia32 and x64 specific functions
-//
-#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and X64.
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- );
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and X64.
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- );
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and X64.
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- );
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and X64.
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- );
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and X64.
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- );
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and X64.
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- );
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- );
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- );
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on X64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging64 (
- IN UINT16 Cs,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- );
-
-
-#elif defined (MDE_CPU_IPF)
-//
-//
-// IPF specific functions
-//
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param NewBsp A pointer to the new memory location for RSE backing
- store.
-
-**/
-VOID
-EFIAPI
-AsmSwitchStackAndBackingStore (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VOID *NewBsp
- );
-#else
-
-#endif
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BitField.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BitField.c
deleted file mode 100644
index 3ab979ee04..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/BitField.c
+++ /dev/null
@@ -1,873 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- BitField.c
-
-Abstract:
-
- Bit field functions of BaseLib.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that returns a bit field from Operand
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
-
- @return The bit field read.
-
-**/
-unsigned int
-BitFieldReadUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- //
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return (Operand & ~((unsigned int)-2 << EndBit)) >> StartBit;
-}
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise OR,
- and returns the result.
-
- Performs a bitwise OR between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param OrData The value to OR with the read value from the value
-
- @return The new value.
-
-**/
-unsigned int
-BitFieldOrUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN unsigned int OrData
- )
-{
- //
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return Operand | ((OrData << StartBit) & ~((unsigned int) -2 << EndBit));
-}
-
-/**
- Worker function that reads a bit field from Operand, performs a bitwise AND,
- and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new value is returned.
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- @param EndBit The ordinal of the most significant bit in the bit field.
- @param AndData The value to And with the read value from the value
-
- @return The new value.
-
-**/
-unsigned int
-BitFieldAndUint (
- IN unsigned int Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN unsigned int AndData
- )
-{
- //
- // ~((unsigned int)-2 << EndBit) is a mask in which bit[0] thru bit[EndBit]
- // are 1's while bit[EndBit + 1] thru the most significant bit are 0's.
- //
- return Operand & ~((~AndData << StartBit) & ~((unsigned int) -2 << EndBit));
-}
-
-/**
- Returns a bit field from an 8-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The bit field read.
-
-**/
-UINT8
-EFIAPI
-BitFieldRead8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)BitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an 8-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 8-bit value is
- returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldWrite8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr8 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the value
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAnd8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT8)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from an 8-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 8-bit value is returned.
-
- If 8-bit operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 8-bit value.
-
-**/
-UINT8
-EFIAPI
-BitFieldAndThenOr8 (
- IN UINT8 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr8 (
- BitFieldAnd8 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 16-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The bit field read.
-
-**/
-UINT16
-EFIAPI
-BitFieldRead16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT16)BitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a 16-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 16-bit value is
- returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldWrite16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr16 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT16)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAnd16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT16)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from a 16-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 16-bit value is returned.
-
- If 16-bit operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 16-bit value.
-
-**/
-UINT16
-EFIAPI
-BitFieldAndThenOr16 (
- IN UINT16 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr16 (
- BitFieldAnd16 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 32-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read.
-
-**/
-UINT32
-EFIAPI
-BitFieldRead32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)BitFieldReadUint (Operand, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a 32-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 32-bit value is
- returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldWrite32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr32 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the value
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)BitFieldOrUint (Operand, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAnd32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)BitFieldAndUint (Operand, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field from a 32-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 32-bit value is returned.
-
- If 32-bit operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 32-bit value.
-
-**/
-UINT32
-EFIAPI
-BitFieldAndThenOr32 (
- IN UINT32 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr32 (
- BitFieldAnd32 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Returns a bit field from a 64-bit value.
-
- Returns the bitfield specified by the StartBit and the EndBit from Operand.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The bit field read.
-
-**/
-UINT64
-EFIAPI
-BitFieldRead64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return RShiftU64 (Operand & ~LShiftU64 ((UINT64)-2, EndBit), StartBit);
-}
-
-/**
- Writes a bit field to a 64-bit value, and returns the result.
-
- Writes Value to the bit field specified by the StartBit and the EndBit in
- Operand. All other bits in Operand are preserved. The new 64-bit value is
- returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldWrite64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldAndThenOr64 (Operand, StartBit, EndBit, 0, Value);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the
- result.
-
- Performs a bitwise inclusive OR between the bit field specified by StartBit
- and EndBit in Operand and the value specified by OrData. All other bits in
- Operand are preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- UINT64 Value1;
- UINT64 Value2;
-
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
-
- Value1 = LShiftU64 (OrData, StartBit);
- Value2 = LShiftU64 ((UINT64) - 2, EndBit);
-
- return Operand | (Value1 & ~Value2);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND, and returns
- the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAnd64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- UINT64 Value1;
- UINT64 Value2;
-
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
-
- Value1 = LShiftU64 (~AndData, StartBit);
- Value2 = LShiftU64 ((UINT64)-2, EndBit);
-
- return Operand & ~(Value1 & ~Value2);
-}
-
-/**
- Reads a bit field from a 64-bit value, performs a bitwise AND followed by a
- bitwise OR, and returns the result.
-
- Performs a bitwise AND between the bit field specified by StartBit and EndBit
- in Operand and the value specified by AndData, followed by a bitwise
- inclusive OR with value specified by OrData. All other bits in Operand are
- preserved. The new 64-bit value is returned.
-
- If 64-bit operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Operand Operand on which to perform the bitfield operation.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the value.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The new 64-bit value.
-
-**/
-UINT64
-EFIAPI
-BitFieldAndThenOr64 (
- IN UINT64 Operand,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- ASSERT (EndBit < sizeof (Operand) * 8);
- ASSERT (StartBit <= EndBit);
- return BitFieldOr64 (
- BitFieldAnd64 (Operand, StartBit, EndBit, AndData),
- StartBit,
- EndBit,
- OrData
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CheckSum.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CheckSum.c
deleted file mode 100644
index ccffe6a915..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CheckSum.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/**
- Utility functions to generate checksum based on 2's complement
- algorithm.
-
- 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.
-
- Module Name: CheckSum.c
-
-**/
-
-#include "BaseLibInternals.h"
-
-/**
- Calculate the sum of all elements in a buffer in unit of UINT8.
- During calculation, the carry bits are dropped.
-
- This function calculates the sum of all elements in a buffer
- in unit of UINT8. The carry bits in result of addition are dropped.
- The result is returned as UINT8. If Length is Zero, then Zero is
- returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer .
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT8
-EFIAPI
-CalculateSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- )
-{
- UINT8 Sum;
- UINTN Count;
-
- ASSERT (Buffer != NULL);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- for (Sum = 0, Count = 0; Count < Length; Count++) {
- Sum = (UINT8) (Sum + *(Buffer + Count));
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer
- of 8-bit values.
-
- This function first calculates the sum of the 8-bit values in the
- buffer specified by Buffer and Length. The carry bits in the result
- of addition are dropped. Then, the two's complement of the sum is
- returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT8
-EFIAPI
-CalculateCheckSum8 (
- IN CONST UINT8 *Buffer,
- IN UINTN Length
- )
-{
- UINT8 CheckSum;
-
- CheckSum = CalculateSum8 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT8) (0x100 - CheckSum);
-}
-
-/**
- Returns the sum of all elements in a buffer of 16-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 16-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT16
-EFIAPI
-CalculateSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- )
-{
- UINT16 Sum;
- UINTN Count;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x1) == 0);
- ASSERT ((Length & 0x1) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
-
- for (Sum = 0, Count = 0; Count < Length; Count++) {
- Sum = (UINT16) (Sum + *(Buffer + Count));
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 16-bit values.
-
- This function first calculates the sum of the 16-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT16
-EFIAPI
-CalculateCheckSum16 (
- IN CONST UINT16 *Buffer,
- IN UINTN Length
- )
-{
- UINT16 CheckSum;
-
- CheckSum = CalculateSum16 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT16) (0x10000 - CheckSum);
-}
-
-
-/**
- Returns the sum of all elements in a buffer of 32-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 32-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT32
-EFIAPI
-CalculateSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- )
-{
- UINT32 Sum;
- UINTN Count;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x3) == 0);
- ASSERT ((Length & 0x3) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
-
- for (Sum = 0, Count = 0; Count < Length; Count++) {
- Sum = Sum + *(Buffer + Count);
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 32-bit values.
-
- This function first calculates the sum of the 32-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT32
-EFIAPI
-CalculateCheckSum32 (
- IN CONST UINT32 *Buffer,
- IN UINTN Length
- )
-{
- UINT32 CheckSum;
-
- CheckSum = CalculateSum32 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT32) ((UINT32)(-1) - CheckSum + 1);
-}
-
-
-/**
- Returns the sum of all elements in a buffer of 64-bit values. During
- calculation, the carry bits are dropped.
-
- This function calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in result of addition are dropped.
- The 64-bit result is returned. If Length is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the sum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Sum The sum of Buffer with carry bits dropped during additions.
-
-**/
-UINT64
-EFIAPI
-CalculateSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- )
-{
- UINT64 Sum;
- UINTN Count;
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN) Buffer & 0x7) == 0);
- ASSERT ((Length & 0x7) == 0);
- ASSERT (Length <= (MAX_ADDRESS - ((UINTN) Buffer) + 1));
-
- for (Sum = 0, Count = 0; Count < Length; Count++) {
- Sum = Sum + *(Buffer + Count);
- }
-
- return Sum;
-}
-
-
-/**
- Returns the two's complement checksum of all elements in a buffer of
- 64-bit values.
-
- This function first calculates the sum of the 64-bit values in the buffer
- specified by Buffer and Length. The carry bits in the result of addition
- are dropped. Then, the two's complement of the sum is returned. If Length
- is 0, then 0 is returned.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the buffer to carry out the checksum operation.
- @param Length The size, in bytes, of Buffer.
-
- @return Checksum The 2's complement checksum of Buffer.
-
-**/
-UINT64
-EFIAPI
-CalculateCheckSum64 (
- IN CONST UINT64 *Buffer,
- IN UINTN Length
- )
-{
- UINT64 CheckSum;
-
- CheckSum = CalculateSum64 (Buffer, Length);
-
- //
- // Return the checksum based on 2's complement.
- //
- return (UINT64) ((UINT64)(-1) - CheckSum + 1);
-}
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ChkStkGcc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ChkStkGcc.c
deleted file mode 100644
index b9b792a095..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ChkStkGcc.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/** @file
- Implementation of synchronization functions.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-VOID __chkstk() {
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Cpu.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Cpu.c
deleted file mode 100644
index c09961eccb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Cpu.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Cpu.c
-
-Abstract:
-
- Base Library CPU Functions for all architectures.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- Disables CPU interrupts and returns the interrupt state prior to the disable
- operation.
-
- @retval TRUE CPU interrupts were enabled on entry to this call.
- @retval FALSE CPU interrupts were disabled on entry to this call.
-
-**/
-BOOLEAN
-EFIAPI
-SaveAndDisableInterrupts (
- VOID
- )
-{
- BOOLEAN InterruptState;
-
- InterruptState = GetInterruptState ();
- DisableInterrupts ();
- return InterruptState;
-}
-
-/**
- Set the current CPU interrupt state.
-
- Sets the current CPU interrupt state to the state specified by
- InterruptState. If InterruptState is TRUE, then interrupts are enabled. If
- InterruptState is FALSE, then interrupts are disabled. InterruptState is
- returned.
-
- @param InterruptState TRUE if interrupts should enabled. FALSE if
- interrupts should be disabled.
-
- @return InterruptState
-
-**/
-BOOLEAN
-EFIAPI
-SetInterruptState (
- IN BOOLEAN InterruptState
- )
-{
- if (InterruptState) {
- EnableInterrupts ();
- } else {
- DisableInterrupts ();
- }
- return InterruptState;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CpuDeadLoop.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CpuDeadLoop.c
deleted file mode 100644
index c0ba27bb25..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/CpuDeadLoop.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- CpuDeadLoop.c
-
-Abstract:
-
- Base Library CPU Functions for all architectures.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Executes an infinite loop.
-
- Forces the CPU to execute an infinite loop. A debugger may be used to skip
- past the loop and the code that follows the loop must execute properly. This
- implies that the infinite loop must not cause the code that follow it to be
- optimized away.
-
-**/
-VOID
-EFIAPI
-CpuDeadLoop (
- VOID
- )
-{
- volatile UINTN Index;
-
- for (Index = 0; Index == 0;);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivS64x64Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivS64x64Remainder.c
deleted file mode 100644
index adfa24f66d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivS64x64Remainder.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DivS64x64Remainder.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit signed value Dividend by the 64-bit signed
- value Divisor and generates a 64-bit signed quotient. If Remainder is not
- NULL, then the 64-bit signed remainder is returned in Remainder. This
- function returns the 64-bit signed quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-EFIAPI
-DivS64x64Remainder (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemS64x64 (Dividend, Divisor, Remainder);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32.c
deleted file mode 100644
index 3bbf8d0c6b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DivU64x32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-GlueDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivU64x32 (Dividend, Divisor);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32Remainder.c
deleted file mode 100644
index 4fb77b43b2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x32Remainder.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DivU64x32Remainder.c
-
-Abstract:
-
- Math worker functions
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x32Remainder (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemU64x32 (Dividend, Divisor, Remainder);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x64Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x64Remainder.c
deleted file mode 100644
index 7f6bc2d7b8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/DivU64x64Remainder.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- DivU64x64Remainder.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates
- a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-DivU64x64Remainder (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathDivRemU64x64 (Dividend, Divisor, Remainder);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/CpuBreakpoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/CpuBreakpoint.c
deleted file mode 100644
index 50e202902e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/CpuBreakpoint.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- CpuBreakpoint.c
-
-Abstract:
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- _break (3);
-}
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
-}
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Retrieves the current CPU interrupt state.
-
- Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
- currently enabled. Otherwise returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GlueGetInterruptState (
- VOID
- )
-{
- ASSERT (FALSE);
- return FALSE;
-}
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- EnableInterrupts ();
- DisableInterrupts ();
-}
-
-/**
- Requests CPU to pause for a short period of time.
-
- Requests CPU to pause for a short period of time. Typically used in MP
- systems to prevent memory starvation while waiting for a spin lock.
-
-**/
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
-}
-
-/**
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
- Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
-
-**/
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- ASSERT (FALSE);
-}
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SetJumpLongJump.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SetJumpLongJump.c
deleted file mode 100644
index 4b205d3c2a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SetJumpLongJump.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SetJumpLongJump.c
-
-Abstract:
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-/**
- Saves the current CPU context that can be restored with a call to LongJump() and returns 0.
-
- Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
- call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
- value to be returned by SetJump().
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-UINTN
-EFIAPI
-SetJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- InternalAssertJumpBuffer (JumpBuffer);
- return 0;
-}
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead is resumes execution based on the state of JumpBuffer.
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- //
- // This function cannot work on EBC
- //
- ASSERT (FALSE);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SwitchStack.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SwitchStack.c
deleted file mode 100644
index f98c078c1b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/SwitchStack.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SwitchStack.c
-
-Abstract:
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-
-{
- //
- // This version of this function does not actually change the stack pointer
- // This is to support compilation of CPU types that do not support assemblers
- // such as EBC
- //
-
- //
- // Stack should be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- EntryPoint (Context1, Context2);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/Synchronization.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/Synchronization.c
deleted file mode 100644
index ca2bec699a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ebc/Synchronization.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Synchronization.c
-
-Abstract:
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-InternalSyncCompareExchange32 (
- IN volatile UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- return *Value != CompareValue ? *Value :
- ((*Value = ExchangeValue), CompareValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InternalSyncCompareExchange64 (
- IN volatile UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- return *Value != CompareValue ? *Value :
- ((*Value = ExchangeValue), CompareValue);
-}
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncIncrement (
- IN volatile UINT32 *Value
- )
-{
- return ++*Value;
-}
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decrement value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decrement value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncDecrement (
- IN volatile UINT32 *Value
- )
-{
- return --*Value;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo32.c
deleted file mode 100644
index 58c81e95bd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo32.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- GetPowerOfTwo32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the value of the highest bit set in a 32-bit value. Equivalent to
- 1 << HighBitSet32(x).
-
- This function computes the value of the highest bit set in the 32-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return 1 << HighBitSet32(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT32
-EFIAPI
-GetPowerOfTwo32 (
- IN UINT32 Operand
- )
-{
- if (Operand == 0) {
- return 0;
- }
-
- return 1ul << HighBitSet32 (Operand);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c
deleted file mode 100644
index 3a83ed68d7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/GetPowerOfTwo64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- GetPowerOfTwo64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the value of the highest bit set in a 64-bit value. Equivalent to
- 1 << HighBitSet64(x).
-
- This function computes the value of the highest bit set in the 64-bit value
- specified by Operand. If Operand is zero, then zero is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return 1 << HighBitSet64(Operand)
- @retval 0 Operand is zero.
-
-**/
-UINT64
-EFIAPI
-GetPowerOfTwo64 (
- IN UINT64 Operand
- )
-{
- if (Operand == 0) {
- return 0;
- }
-
- return LShiftU64 (1, (UINTN) HighBitSet64 (Operand));
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet32.c
deleted file mode 100644
index 0a3d05ebd7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet32.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- HighBitSet32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the highest bit set in a 32-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet32 (
- IN UINT32 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return - 1;
- }
- for (BitIndex = 31; (INT32)Operand > 0; BitIndex--, Operand <<= 1);
- return BitIndex;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet64.c
deleted file mode 100644
index b1120bf472..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/HighBitSet64.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- HighBitSet64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the highest bit set in a 64-bit value. Equivalent
- to log2(x).
-
- This function computes the bit position of the highest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return Position of the highest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-HighBitSet64 (
- IN UINT64 Operand
- )
-{
- if (Operand == (UINT32)Operand) {
- //
- // Operand is just a 32-bit integer
- //
- return HighBitSet32 ((UINT32)Operand);
- }
-
- //
- // Operand is really a 64-bit integer
- //
- if (sizeof (UINTN) == sizeof (UINT32)) {
- return HighBitSet32 (((UINT32*)&Operand)[1]) + 32;
- } else {
- return HighBitSet32 ((UINT32)RShiftU64 (Operand, 32)) + 32;
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.S
deleted file mode 100644
index e728aa16e9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ARShiftU64.asm
-#
-# Abstract:
-#
-# 64-bit arithmetic right shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathARShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathARShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathARShiftU64):
- movb 12(%esp), %cl
- movl 8(%esp), %eax
- cltd
- testb $32, %cl
- cmovz %eax, %edx
- cmovz 4(%esp), %eax
- shrdl %cl, %edx, %eax
- sar %cl, %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.asm
deleted file mode 100644
index 8ee717d54a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ARShiftU64.asm
-;
-; Abstract:
-;
-; 64-bit arithmetic right shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathARShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMathARShiftU64 PROC
- mov cl, [esp + 12]
- mov eax, [esp + 8]
- cdq
- test cl, 32
- cmovz edx, eax
- cmovz eax, [esp + 4]
- shrd eax, edx, cl
- sar edx, cl
- ret
-InternalMathARShiftU64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.c
deleted file mode 100644
index 5ccf040698..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ARShiftU64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- 64-bit arithmetic right shift function for IA-32.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov eax, dword ptr [Operand + 4]
- cdq
- test cl, 32
- cmovz edx, eax
- cmovz eax, dword ptr [Operand + 0]
- shrd eax, edx, cl
- sar edx, cl
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.S
deleted file mode 100644
index bfcb8b3264..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# 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.
-#
-# Module Name:
-#
-# CpuBreakpoint.s
-#
-# Abstract:
-#
-# CpuBreakpoint function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(CpuBreakpoint)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuBreakpoint (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuBreakpoint):
- int $3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.asm
deleted file mode 100644
index 891ae698b4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; 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.
-;
-; Module Name:
-;
-; CpuBreakpoint.Asm
-;
-; Abstract:
-;
-; CpuBreakpoint function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuBreakpoint (
-; VOID
-; );
-;------------------------------------------------------------------------------
-_CpuBreakpoint PROC
- int 3
- ret
-_CpuBreakpoint ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.c
deleted file mode 100644
index 45e5b91bf0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuBreakpoint.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- CpuBreakpoint.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-void __debugbreak ();
-
-#pragma intrinsic(__debugbreak)
-
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __debugbreak ();
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuFlushTlb.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuFlushTlb.c
deleted file mode 100644
index 4722e658ba..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuFlushTlb.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- CpuFlushTlb function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-CpuFlushTlb (
- VOID
- )
-{
- _asm {
- mov eax, cr3
- mov cr3, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.S
deleted file mode 100644
index 0b64fa31c8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.S
+++ /dev/null
@@ -1,65 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuId.Asm
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmCpuid)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmCpuid (
-# IN UINT32 RegisterInEax,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(AsmCpuid):
- push %ebx
- push %ebp
- movl %esp, %ebp
- movl 12(%ebp), %eax
- cpuid
- push %ecx
- movl 16(%ebp), %ecx
- jecxz L1
- movl %eax, (%ecx)
-L1:
- movl 20(%ebp), %ecx
- jecxz L2
- movl %ebx, (%ecx)
-L2:
- movl 24(%ebp), %ecx
- jecxz L3
- popl (%ecx)
-L3:
- movl 28(%ebp), %ecx
- jecxz L4
- movl %edx, (%ecx)
-L4:
- movl 12(%ebp), %eax
- leave
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.asm
deleted file mode 100644
index c1eb60423d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.asm
+++ /dev/null
@@ -1,66 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586P
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmCpuid (
-; IN UINT32 RegisterInEax,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; );
-;------------------------------------------------------------------------------
-AsmCpuid PROC USES ebx
- push ebp
- mov ebp, esp
- mov eax, [ebp + 12]
- cpuid
- push ecx
- mov ecx, [ebp + 16]
- jecxz @F
- mov [ecx], eax
-@@:
- mov ecx, [ebp + 20]
- jecxz @F
- mov [ecx], ebx
-@@:
- mov ecx, [ebp + 24]
- jecxz @F
- pop [ecx]
-@@:
- mov ecx, [ebp + 28]
- jecxz @F
- mov [ecx], edx
-@@:
- mov eax, [ebp + 12]
- leave
- ret
-AsmCpuid ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.c
deleted file mode 100644
index 6828e25d9a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuId.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- AsmCpuid function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-AsmCpuid (
- IN UINT32 Index,
- OUT UINT32 *RegisterEax, OPTIONAL
- OUT UINT32 *RegisterEbx, OPTIONAL
- OUT UINT32 *RegisterEcx, OPTIONAL
- OUT UINT32 *RegisterEdx OPTIONAL
- )
-{
- _asm {
- mov eax, Index
- cpuid
- push ecx
- mov ecx, RegisterEax
- jecxz SkipEax
- mov [ecx], eax
-SkipEax:
- mov ecx, RegisterEbx
- jecxz SkipEbx
- mov [ecx], ebx
-SkipEbx:
- pop eax
- mov ecx, RegisterEcx
- jecxz SkipEcx
- mov [ecx], eax
-SkipEcx:
- mov ecx, RegisterEdx
- jecxz SkipEdx
- mov [ecx], edx
-SkipEdx:
- mov eax, Index
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S
deleted file mode 100644
index dcc6c64d30..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.S
+++ /dev/null
@@ -1,69 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuIdEx.Asm
-#
-# Abstract:
-#
-# AsmCpuidEx function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
- .686:
- .code:
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# AsmCpuidEx (
-# IN UINT32 RegisterInEax,
-# IN UINT32 RegisterInEcx,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push %ebx
- push %ebp
- movl %esp, %ebp
- movl 12(%ebp), %eax
- movl 16(%ebp), %ecx
- cpuid
- push %ecx
- movl 20(%ebp), %ecx
- jecxz L1
- movl %eax, (%ecx)
-L1:
- movl 24(%ebp), %ecx
- jecxz L2
- movl %ebx, (%ecx)
-L2:
- movl 28(%ebp), %ecx
- jecxz L3
- popl (%ecx)
-L3:
- movl 32(%ebp), %edx
- jecxz L4
- movl %edx, (%ecx)
-L4:
- movl 12(%ebp), %eax
- leave
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm
deleted file mode 100644
index 7ac279290f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.asm
+++ /dev/null
@@ -1,68 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CpuIdEx.Asm
-;
-; Abstract:
-;
-; AsmCpuidEx function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; AsmCpuidEx (
-; IN UINT32 RegisterInEax,
-; IN UINT32 RegisterInEcx,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-AsmCpuidEx PROC USES ebx
- push ebp
- mov ebp, esp
- mov eax, [ebp + 12]
- mov ecx, [ebp + 16]
- cpuid
- push ecx
- mov ecx, [ebp + 20]
- jecxz @F
- mov [ecx], eax
-@@:
- mov ecx, [ebp + 24]
- jecxz @F
- mov [ecx], ebx
-@@:
- mov ecx, [ebp + 28]
- jecxz @F
- pop [ecx]
-@@:
- mov edx, [ebp + 32]
- jecxz @F
- mov [ecx], edx
-@@:
- mov eax, [ebp + 12]
- leave
- ret
-AsmCpuidEx ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.c
deleted file mode 100644
index 6134cbe9ef..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuIdEx.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- AsmCpuidEx function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-AsmCpuidEx (
- IN UINT32 Index,
- IN UINT32 SubIndex,
- OUT UINT32 *RegisterEax, OPTIONAL
- OUT UINT32 *RegisterEbx, OPTIONAL
- OUT UINT32 *RegisterEcx, OPTIONAL
- OUT UINT32 *RegisterEdx OPTIONAL
- )
-{
- _asm {
- mov eax, Index
- mov ecx, SubIndex
- cpuid
- push ecx
- mov ecx, RegisterEax
- jecxz SkipEax
- mov [ecx], eax
-SkipEax:
- mov ecx, RegisterEbx
- jecxz SkipEbx
- mov [ecx], ebx
-SkipEbx:
- pop eax
- mov ecx, RegisterEcx
- jecxz SkipEcx
- mov [ecx], eax
-SkipEcx:
- mov ecx, RegisterEdx
- jecxz SkipEdx
- mov [ecx], edx
-SkipEdx:
- mov eax, Index
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.S
deleted file mode 100644
index 02bff2a4c7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# 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.
-#
-# Module Name:
-#
-# CpuPause.Asm
-#
-# Abstract:
-#
-# CpuPause function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(CpuPause)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuPause (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuPause):
- pause
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.asm
deleted file mode 100644
index c4505034b4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; 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.
-;
-; Module Name:
-;
-; CpuPause.Asm
-;
-; Abstract:
-;
-; CpuPause function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuPause (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuPause PROC
- pause
- ret
-CpuPause ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.c
deleted file mode 100644
index 6b5513bbd3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuPause.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- CpuPause function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-CpuPause (
- VOID
- )
-{
- _asm {
- pause
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.S
deleted file mode 100644
index 65ca24458e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# 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.
-#
-# Module Name:
-#
-# CpuSleep.Asm
-#
-# Abstract:
-#
-# CpuSleep function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(CpuSleep)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuSleep (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(CpuSleep):
- hlt
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.asm
deleted file mode 100644
index 5318f6a432..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-;------------------------------------------------------------------------------ ;
-; 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.
-;
-; Module Name:
-;
-; CpuSleep.Asm
-;
-; Abstract:
-;
-; CpuSleep function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuSleep (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuSleep PROC
- hlt
- ret
-CpuSleep ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.c
deleted file mode 100644
index 3d94bd6d6f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/CpuSleep.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- CpuSleep function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
- _asm {
- hlt
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.S
deleted file mode 100644
index 5c35d89348..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DisableInterrupts.Asm
-#
-# Abstract:
-#
-# DisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(DisableInterrupts)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# DisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(DisableInterrupts):
- cli
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.asm
deleted file mode 100644
index f6a7fc5d21..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DisableInterrupts.Asm
-;
-; Abstract:
-;
-; DisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; DisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-DisableInterrupts PROC
- cli
- ret
-DisableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.c
deleted file mode 100644
index 9ec110e5d3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisableInterrupts.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- DisableInterrupts function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- _asm {
- cli
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.S
deleted file mode 100644
index a9fd7a62cd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DisablePaging32.Asm
-#
-# Abstract:
-#
-# InternalX86DisablePaging32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86DisablePaging32)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86DisablePaging32 (
-# IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-# IN VOID *Context1, OPTIONAL
-# IN VOID *Context2, OPTIONAL
-# IN VOID *NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86DisablePaging32):
- movl 4(%esp), %ebx
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- pushfl
- pop %edi
- cli
- movl %cr0, %eax
- btrl $31, %eax
- movl 16(%esp), %esp
- movl %eax, %cr0
- push %edi
- popfl
- push %edx
- push %ecx
- call *%ebx
- jmp .
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.asm
deleted file mode 100644
index 2bdceb75d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.asm
+++ /dev/null
@@ -1,57 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DisablePaging32.Asm
-;
-; Abstract:
-;
-; AsmDisablePaging32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86DisablePaging32 (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *NewStack
-; );
-;------------------------------------------------------------------------------
-InternalX86DisablePaging32 PROC
- mov ebx, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- pushfd
- pop edi ; save EFLAGS to edi
- cli
- mov eax, cr0
- btr eax, 31
- mov esp, [esp + 16]
- mov cr0, eax
- push edi
- popfd ; restore EFLAGS from edi
- push edx
- push ecx
- call ebx
- jmp $ ; EntryPoint() should not return
-InternalX86DisablePaging32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.c
deleted file mode 100644
index 3ed98fd0c6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DisablePaging32.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- AsmDisablePaging32 function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-__declspec (naked)
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- _asm {
- push ebp
- mov ebp, esp
- mov ebx, EntryPoint
- mov ecx, Context1
- mov edx, Context2
- pushfd
- pop edi // save EFLAGS to edi
- cli
- mov eax, cr0
- btr eax, 31
- mov esp, NewStack
- mov cr0, eax
- push edi
- popfd // restore EFLAGS from edi
- push edx
- push ecx
- call ebx
- jmp $ // EntryPoint() should not return
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivS64x64Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivS64x64Remainder.c
deleted file mode 100644
index a3a06a966f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivS64x64Remainder.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DivS64x64Remainder.c
-
-Abstract:
-
- Integer division worker functions for Ia32.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- INT64 Quot;
-
- Quot = InternalMathDivRemU64x64 (
- (UINT64) (Dividend >= 0 ? Dividend : -Dividend),
- (UINT64) (Divisor >= 0 ? Divisor : -Divisor),
- (UINT64 *) Remainder
- );
- if (Remainder != NULL && Dividend < 0) {
- *Remainder = -*Remainder;
- }
- return (Dividend ^ Divisor) >= 0 ? Quot : -Quot;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.S
deleted file mode 100644
index 1700cbad28..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DivU64x32.asm
-#
-# Abstract:
-#
-# Calculate the quotient of a 64-bit integer by a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathDivU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivU64x32):
- movl 8(%esp), %eax
- movl 12(%esp), %ecx
- xorl %edx, %edx
- divl %ecx
- push %eax
- movl 8(%esp), %eax
- divl %ecx
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.asm
deleted file mode 100644
index 6a1c52e122..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DivU64x32.asm
-;
-; Abstract:
-;
-; Calculate the quotient of a 64-bit integer by a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor
-; );
-;------------------------------------------------------------------------------
-InternalMathDivU64x32 PROC
- mov eax, [esp + 8]
- mov ecx, [esp + 12]
- xor edx, edx
- div ecx
- push eax ; save quotient on stack
- mov eax, [esp + 8]
- div ecx
- pop edx ; restore high-order dword of the quotient
- ret
-InternalMathDivU64x32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.c
deleted file mode 100644
index fc5dc2067f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- Calculate the quotient of a 64-bit integer by a 32-bit integer
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- _asm {
- mov eax, dword ptr [Dividend + 4]
- mov ecx, Divisor
- xor edx, edx
- div ecx
- push eax ; save quotient on stack
- mov eax, dword ptr [Dividend]
- div ecx
- pop edx ; restore high-order dword of the quotient
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.S
deleted file mode 100644
index b48f20b956..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DivError.asm
-#
-# Abstract:
-#
-# Set error flag for all division functions
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathDivRemU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivRemU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor,
-# OUT UINT32 *Remainder
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivRemU64x32):
- movl 12(%esp), %ecx
- movl 8(%esp), %eax
- xorl %edx, %edx
- divl %ecx
- push %eax
- movl 8(%esp), %eax
- divl %ecx
- movl 20(%esp), %ecx
- jecxz L1
- movl %edx, (%ecx)
-L1:
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.asm
deleted file mode 100644
index 1634ef478e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DivError.asm
-;
-; Abstract:
-;
-; Set error flag for all division functions
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivRemU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor,
-; OUT UINT32 *Remainder
-; );
-;------------------------------------------------------------------------------
-InternalMathDivRemU64x32 PROC
- mov ecx, [esp + 12] ; ecx <- divisor
- mov eax, [esp + 8] ; eax <- dividend[32..63]
- xor edx, edx
- div ecx ; eax <- quotient[32..63], edx <- remainder
- push eax
- mov eax, [esp + 8] ; eax <- dividend[0..31]
- div ecx ; eax <- quotient[0..31]
- mov ecx, [esp + 20] ; ecx <- Remainder
- jecxz @F ; abandon remainder if Remainder == NULL
- mov [ecx], edx
-@@:
- pop edx ; edx <- quotient[32..63]
- ret
-InternalMathDivRemU64x32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.c
deleted file mode 100644
index 4d91a934c3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x32Remainder.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- Set error flag for all division functions
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder
- )
-{
- _asm {
- mov ecx, Divisor
- mov eax, dword ptr [Dividend + 4]
- xor edx, edx
- div ecx
- push eax
- mov eax, dword ptr [Dividend + 0]
- div ecx
- mov ecx, Remainder
- jecxz RemainderNull // abandon remainder if Remainder == NULL
- mov [ecx], edx
-RemainderNull:
- pop edx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.S
deleted file mode 100644
index 934d1178f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.S
+++ /dev/null
@@ -1,91 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DivU64x64Remainder.asm
-#
-# Abstract:
-#
-# Calculate the quotient of a 64-bit integer by a 64-bit integer and returns
-# both the quotient and the remainder
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathDivRemU64x32), ASM_PFX(InternalMathDivRemU64x64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathDivRemU64x64 (
-# IN UINT64 Dividend,
-# IN UINT64 Divisor,
-# OUT UINT64 *Remainder OPTIONAL
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathDivRemU64x64):
- movl 16(%esp), %ecx
- testl %ecx, %ecx
- jnz Hard
- movl 20(%esp), %ecx
- jecxz L1
- and $0, 4(%ecx)
- movl %ecx, 16(%esp)
-L1:
- jmp ASM_PFX(InternalMathDivRemU64x32)
-Hard:
- push %ebx
- push %esi
- push %edi
- mov 20(%esp), %edx
- mov 16(%esp), %eax
- movl %edx, %edi
- movl %eax, %esi
- mov 24(%esp), %ebx
-L2:
- shrl %edx
- rcrl $1, %eax
- shrdl $1, %ecx, %ebx
- shrl %ecx
- jnz L2
- divl %ebx
- movl %eax, %ebx
- movl 28(%esp), %ecx
- mull 24(%esp)
- imull %ebx, %ecx
- addl %ecx, %edx
- mov 32(%esp), %ecx
- jc TooLarge
- cmpl %edx, %edi
- ja Correct
- jb TooLarge
- cmpl %eax, %esi
- jae Correct
-TooLarge:
- decl %ebx
- jecxz Return
- sub 24(%esp), %eax
- sbb 28(%esp), %edx
-Correct:
- jecxz Return
- subl %eax, %esi
- sbbl %edx, %edi
- movl %esi, (%ecx)
- movl %edi, 4(%ecx)
-Return:
- movl %ebx, %eax
- xorl %edx, %edx
- pop %edi
- pop %esi
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.asm
deleted file mode 100644
index 34d8a93125..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.asm
+++ /dev/null
@@ -1,92 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DivU64x64Remainder.asm
-;
-; Abstract:
-;
-; Calculate the quotient of a 64-bit integer by a 64-bit integer and returns
-; both the quotient and the remainder
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-EXTERN InternalMathDivRemU64x32:PROC
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathDivRemU64x64 (
-; IN UINT64 Dividend,
-; IN UINT64 Divisor,
-; OUT UINT64 *Remainder OPTIONAL
-; );
-;------------------------------------------------------------------------------
-InternalMathDivRemU64x64 PROC
- mov ecx, [esp + 16] ; ecx <- divisor[32..63]
- test ecx, ecx
- jnz _@DivRemU64x64 ; call _@DivRemU64x64 if Divisor > 2^32
- mov ecx, [esp + 20]
- jecxz @F
- and dword ptr [ecx + 4], 0 ; zero high dword of remainder
- mov [esp + 16], ecx ; set up stack frame to match DivRemU64x32
-@@:
- jmp InternalMathDivRemU64x32
-InternalMathDivRemU64x64 ENDP
-
-_@DivRemU64x64 PROC USES ebx esi edi
- mov edx, dword ptr [esp + 20]
- mov eax, dword ptr [esp + 16] ; edx:eax <- dividend
- mov edi, edx
- mov esi, eax ; edi:esi <- dividend
- mov ebx, dword ptr [esp + 24] ; ecx:ebx <- divisor
-@@:
- shr edx, 1
- rcr eax, 1
- shrd ebx, ecx, 1
- shr ecx, 1
- jnz @B
- div ebx
- mov ebx, eax ; ebx <- quotient
- mov ecx, [esp + 28] ; ecx <- high dword of divisor
- mul dword ptr [esp + 24] ; edx:eax <- quotient * divisor[0..31]
- imul ecx, ebx ; ecx <- quotient * divisor[32..63]
- add edx, ecx ; edx <- (quotient * divisor)[32..63]
- mov ecx, dword ptr [esp + 32] ; ecx <- addr for Remainder
- jc @TooLarge ; product > 2^64
- cmp edi, edx ; compare high 32 bits
- ja @Correct
- jb @TooLarge ; product > dividend
- cmp esi, eax
- jae @Correct ; product <= dividend
-@TooLarge:
- dec ebx ; adjust quotient by -1
- jecxz @Return ; return if Remainder == NULL
- sub eax, dword ptr [esp + 24]
- sbb edx, dword ptr [esp + 28] ; edx:eax <- (quotient - 1) * divisor
-@Correct:
- jecxz @Return
- sub esi, eax
- sbb edi, edx ; edi:esi <- remainder
- mov [ecx], esi
- mov [ecx + 4], edi
-@Return:
- mov eax, ebx ; eax <- quotient
- xor edx, edx ; quotient is 32 bits long
- ret
-_@DivRemU64x64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.c
deleted file mode 100644
index 315b35d592..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/DivU64x64Remainder.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- Calculate the quotient of a 64-bit integer by a 64-bit integer and returns
- both the quotient and the remainderSet error flag for all division functions
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathDivRemU64x64 (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- )
-{
- _asm {
- mov edx, dword ptr [Dividend + 4]
- mov eax, dword ptr [Dividend + 0] // edx:eax <- dividend
- mov edi, edx
- mov esi, eax // edi:esi <- dividend
- mov ecx, dword ptr [Divisor + 4]
- mov ebx, dword ptr [Divisor + 0] // ecx:ebx <- divisor
-BitLoop:
- shr edx, 1
- rcr eax, 1
- shrd ebx, ecx, 1
- shr ecx, 1
- jnz BitLoop
- div ebx
- mov ebx, eax // ebx <- quotient
- mov ecx, dword ptr [Divisor + 4]
- mul dword ptr [Divisor]
- imul ecx, ebx
- add edx, ecx
- mov ecx, Remainder
- jc TooLarge // product > 2^64
- cmp edi, edx // compare high 32 bits
- ja Correct
- jb TooLarge // product > dividend
- cmp esi, eax
- jae Correct // product <= dividend
-TooLarge:
- dec ebx // adjust quotient by -1
- jecxz Return // return if Remainder == NULL
- sub eax, dword ptr [Divisor + 0]
- sbb edx, dword ptr [Divisor + 4]
-Correct:
- jecxz Return
- sub esi, eax
- sbb edi, edx // edi:esi <- remainder
- mov [ecx], esi
- mov [ecx + 4], edi
-Return:
- mov eax, ebx // eax <- quotient
- xor edx, edx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.S
deleted file mode 100644
index 93bf84d890..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnableDisableInterrupts.Asm
-#
-# Abstract:
-#
-# EnableDisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(EnableDisableInterrupts)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableDisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.asm
deleted file mode 100644
index cf8e157d02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EnableDisableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableDisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableDisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-_EnableDisableInterrupts PROC
- sti
- cli
- ret
-_EnableDisableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.c
deleted file mode 100644
index aa94eb63a8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableDisableInterrupts.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- EnableDisableInterrupts function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- _asm {
- sti
- nop
- nop
- cli
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.S
deleted file mode 100644
index 35e5a6c770..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnableInterrupts.Asm
-#
-# Abstract:
-#
-# EnableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(EnableInterrupts)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EnableInterrupts):
- sti
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.asm
deleted file mode 100644
index 8536820486..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EnableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-_EnableInterrupts PROC
- sti
- ret
-_EnableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.c
deleted file mode 100644
index df0fa2a48e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnableInterrupts.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- EnableInterrupts function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- _asm {
- sti
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.S
deleted file mode 100644
index b1c3d4bc88..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnablePaging32.Asm
-#
-# Abstract:
-#
-# InternalX86EnablePaging32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86EnablePaging32)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86EnablePaging32 (
-# IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-# IN VOID *Context1, OPTIONAL
-# IN VOID *Context2, OPTIONAL
-# IN VOID *NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86EnablePaging32):
- movl 4(%esp), %ebx
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- pushfl
- pop %edi
- cli
- movl %cr0, %eax
- btsl $31, %eax
- movl 16(%esp), %esp
- movl %eax, %cr0
- push %edi
- popfl
- push %edx
- push %ecx
- call *%ebx
- jmp .
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.asm
deleted file mode 100644
index 5007462271..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.asm
+++ /dev/null
@@ -1,57 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EnablePaging32.Asm
-;
-; Abstract:
-;
-; AsmEnablePaging32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86EnablePaging32 (
-; IN SWITCH_STACK_ENTRY_POINT EntryPoint,
-; IN VOID *Context1, OPTIONAL
-; IN VOID *Context2, OPTIONAL
-; IN VOID *NewStack
-; );
-;------------------------------------------------------------------------------
-InternalX86EnablePaging32 PROC
- mov ebx, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- pushfd
- pop edi ; save flags in edi
- cli
- mov eax, cr0
- bts eax, 31
- mov esp, [esp + 16]
- mov cr0, eax
- push edi
- popfd ; restore flags
- push edx
- push ecx
- call ebx
- jmp $
-InternalX86EnablePaging32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.c
deleted file mode 100644
index bcfe917244..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging32.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- AsmEnablePaging32 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-__declspec (naked)
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- _asm {
- push ebp
- mov ebp, esp
- mov ebx, EntryPoint
- mov ecx, Context1
- mov edx, Context2
- pushfd
- pop edi
- cli
- mov eax, cr0
- bts eax, 31
- mov esp, NewStack
- mov cr0, eax
- push edi
- popfd
- push edx
- push ecx
- call ebx
- jmp $
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.S
deleted file mode 100644
index ad34a8d5bb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.S
+++ /dev/null
@@ -1,65 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnablePaging64.Asm
-#
-# Abstract:
-#
-# InternalX86EnablePaging64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86EnablePaging64)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86EnablePaging64 (
-# IN UINT16 CodeSelector,
-# IN UINT64 EntryPoint,
-# IN UINT64 Context1, OPTIONAL
-# IN UINT64 Context2, OPTIONAL
-# IN UINT64 NewStack
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86EnablePaging64):
- cli
- movl $LongStart, (%esp)
- movl %cr4, %eax
- orb $0x20, %al
- movl %eax, %cr4 # enable PAE
- movl $0xc0000080, %ecx
- rdmsr
- orb $1, %ah # set LME
- wrmsr
- movl %cr0, %eax
- btsl $31, %eax
- movl %eax, %cr0 # enable paging
- lret
-LongStart: # long mode starts here
- .byte 0x67, 0x48
- movl (%esp), %ebx # mov rbx, [esp]
- .byte 0x67, 0x48
- movl 8(%esp), %ecx # mov rcx, [esp + 8]
- .byte 0x67, 0x48
- movl 0x10(%esp), %edx # mov rdx, [esp + 10h]
- .byte 0x67, 0x48
- movl 0x18(%esp), %esp # mov rsp, [esp + 18h]
- .byte 0x48
- addl $0x-20, %esp # add rsp, -20h
- call *%ebx # call rbx
- jmp .
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.asm
deleted file mode 100644
index cd4c0006d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/EnablePaging64.asm
+++ /dev/null
@@ -1,66 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; EnablePaging64.Asm
-;
-; Abstract:
-;
-; AsmEnablePaging64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86EnablePaging64 (
-; IN UINT16 Cs,
-; IN UINT64 EntryPoint,
-; IN UINT64 Context1, OPTIONAL
-; IN UINT64 Context2, OPTIONAL
-; IN UINT64 NewStack
-; );
-;------------------------------------------------------------------------------
-InternalX86EnablePaging64 PROC
- cli
- mov [esp], @F ; offset for far retf, seg is the 1st arg
- mov eax, cr4
- or al, (1 SHL 5)
- mov cr4, eax ; enable PAE
- mov ecx, 0c0000080h
- rdmsr
- or ah, 1 ; set LME
- wrmsr
- mov eax, cr0
- bts eax, 31 ; set PG
- mov cr0, eax ; enable paging
- retf ; topmost 2 dwords hold the address
-@@: ; long mode starts here
- DB 67h, 48h ; 32-bit address size, 64-bit operand size
- mov ebx, [esp] ; mov rbx, [esp]
- DB 67h, 48h
- mov ecx, [esp + 8] ; mov rcx, [esp + 8]
- DB 67h, 48h
- mov edx, [esp + 10h] ; mov rdx, [esp + 10h]
- DB 67h, 48h
- mov esp, [esp + 18h] ; mov rsp, [esp + 18h]
- DB 48h
- add esp, -20h ; add rsp, -20h
- call ebx ; call rbx
- hlt ; no one should get here
-InternalX86EnablePaging64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.S
deleted file mode 100644
index 154670f3fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FlushCacheLine.Asm
-#
-# Abstract:
-#
-# AsmFlushCacheLine function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmFlushCacheLine)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmFlushCacheLine (
-# IN VOID *LinearAddress
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFlushCacheLine):
- movl 4(%esp), %eax
- clflush (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.asm
deleted file mode 100644
index cef4a6d6d1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; FlushCacheLine.Asm
-;
-; Abstract:
-;
-; AsmFlushCacheLine function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586P
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; AsmFlushCacheLine (
-; IN VOID *LinearAddress
-; );
-;------------------------------------------------------------------------------
-AsmFlushCacheLine PROC
- mov eax, [esp + 4]
- clflush [eax]
- ret
-AsmFlushCacheLine ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.c
deleted file mode 100644
index 1e29b258d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FlushCacheLine.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmFlushCacheLine function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID *
-EFIAPI
-AsmFlushCacheLine (
- IN VOID *LinearAddress
- )
-{
- _asm {
- mov eax, LinearAddress
- clflush [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.S
deleted file mode 100644
index 6ac53ba927..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FxRestore.Asm
-#
-# Abstract:
-#
-# InternalX86FxRestore function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86FxRestore)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86FxRestore):
- movl 4(%esp), %eax
- fxrstor (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.asm
deleted file mode 100644
index fde674fe0c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; FxRestore.Asm
-;
-; Abstract:
-;
-; AsmFxRestore function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-InternalX86FxRestore PROC
- mov eax, [esp + 4] ; Buffer must be 16-byte aligned
- fxrstor [eax]
- ret
-InternalX86FxRestore ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.c
deleted file mode 100644
index d20380d111..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxRestore.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmFxRestore function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86FxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- _asm {
- mov eax, Buffer
- fxrstor [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.S
deleted file mode 100644
index 5614423957..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FxSave.Asm
-#
-# Abstract:
-#
-# InternalX86FxSave function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86FxSave)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86FxSave):
- movl 4(%esp), %eax
- fxsave (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.asm
deleted file mode 100644
index 1eee3f2c45..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; FxSave.Asm
-;
-; Abstract:
-;
-; AsmFxSave function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-InternalX86FxSave PROC
- mov eax, [esp + 4] ; Buffer must be 16-byte aligned
- fxsave [eax]
- ret
-InternalX86FxSave ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.c
deleted file mode 100644
index 03ded3b5c5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/FxSave.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmFxSave function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86FxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- _asm {
- mov eax, Buffer
- fxsave [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.S
deleted file mode 100644
index 4681da6770..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedCompareExchange32.Asm
-#
-# Abstract:
-#
-# InternalSyncCompareExchange32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalSyncCompareExchange32)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncCompareExchange32 (
-# IN UINT32 *Value,
-# IN UINT32 CompareValue,
-# IN UINT32 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncCompareExchange32):
- movl 4(%esp), %ecx
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- lock
- cmpxchgl %edx, (%ecx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.asm
deleted file mode 100644
index 579d788ade..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; InterlockedCompareExchange32.Asm
-;
-; Abstract:
-;
-; InterlockedCompareExchange32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .486
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InternalSyncCompareExchange32 (
-; IN UINT32 *Value,
-; IN UINT32 CompareValue,
-; IN UINT32 ExchangeValue
-; );
-;------------------------------------------------------------------------------
-InternalSyncCompareExchange32 PROC
- mov ecx, [esp + 4]
- mov eax, [esp + 8]
- mov edx, [esp + 12]
- lock cmpxchg [ecx], edx
- ret
-InternalSyncCompareExchange32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
deleted file mode 100644
index 1a6c40ea46..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange32.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- InterlockedCompareExchange32 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-InternalSyncCompareExchange32 (
- IN volatile UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- _asm {
- mov ecx, Value
- mov eax, CompareValue
- mov edx, ExchangeValue
- lock cmpxchg [ecx], edx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.S
deleted file mode 100644
index cb1383e49f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedCompareExchange64.Asm
-#
-# Abstract:
-#
-# InternalSyncCompareExchange64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalSyncCompareExchange64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalSyncCompareExchange64 (
-# IN UINT64 *Value,
-# IN UINT64 CompareValue,
-# IN UINT64 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncCompareExchange64):
- push %esi
- push %ebx
- movl 12(%esp), %esi
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 24(%esp), %ebx
- movl 28(%esp), %ecx
- lock
- cmpxchg8b (%esi)
- pop %ebx
- pop %esi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.asm
deleted file mode 100644
index 5e072e394a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.asm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; InterlockedCompareExchange64.Asm
-;
-; Abstract:
-;
-; InterlockedCompareExchange64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586P
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalSyncCompareExchange64 (
-; IN UINT64 *Value,
-; IN UINT64 CompareValue,
-; IN UINT64 ExchangeValue
-; );
-;------------------------------------------------------------------------------
-InternalSyncCompareExchange64 PROC USES esi ebx
- mov esi, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov ebx, [esp + 24]
- mov ecx, [esp + 28]
- lock cmpxchg8b qword ptr [esi]
- ret
-InternalSyncCompareExchange64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
deleted file mode 100644
index a6711d3faa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedCompareExchange64.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- InterlockedCompareExchange64 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalSyncCompareExchange64 (
- IN volatile UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- _asm {
- mov esi, Value
- mov eax, dword ptr [CompareValue + 0]
- mov edx, dword ptr [CompareValue + 4]
- mov ebx, dword ptr [ExchangeValue + 0]
- mov ecx, dword ptr [ExchangeValue + 4]
- lock cmpxchg8b qword ptr [esi]
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.S
deleted file mode 100644
index bdc4a5fdea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedDecrement.Asm
-#
-# Abstract:
-#
-# InternalSyncDecrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalSyncDecrement)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncDecrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncDecrement):
- movl 4(%esp), %eax
- lock
- decl (%eax)
- movl (%eax), %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.asm
deleted file mode 100644
index eb6fed4a10..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; InterlockedDecrement.Asm
-;
-; Abstract:
-;
-; InterlockedDecrement function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InternalSyncDecrement (
-; IN UINT32 *Value
-; );
-;------------------------------------------------------------------------------
-InternalSyncDecrement PROC
- mov eax, [esp + 4]
- lock dec dword ptr [eax]
- mov eax, [eax]
- ret
-InternalSyncDecrement ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.c
deleted file mode 100644
index ce24b161f9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedDecrement.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- InterlockedDecrement function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-InternalSyncDecrement (
- IN volatile UINT32 *Value
- )
-{
- _asm {
- mov eax, Value
- lock dec dword ptr [eax]
- mov eax, [eax]
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.S
deleted file mode 100644
index 84ce03e041..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedIncrement.Asm
-#
-# Abstract:
-#
-# InternalSyncIncrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalSyncIncrement)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalSyncIncrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalSyncIncrement):
- movl 4(%esp), %eax
- lock
- incl (%eax)
- movl (%eax), %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.asm
deleted file mode 100644
index b3cb6797e0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; InterlockedIncrement.Asm
-;
-; Abstract:
-;
-; InterlockedIncrement function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InternalSyncIncrement (
-; IN UINT32 *Value
-; );
-;------------------------------------------------------------------------------
-InternalSyncIncrement PROC
- mov eax, [esp + 4]
- lock inc dword ptr [eax]
- mov eax, [eax]
- ret
-InternalSyncIncrement ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.c
deleted file mode 100644
index 30c7af4d10..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InterlockedIncrement.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- InterLockedIncrement function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-InternalSyncIncrement (
- IN volatile UINT32 *Value
- )
-{
- _asm {
- mov eax, Value
- lock inc dword ptr [eax]
- mov eax, [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InternalSwitchStack.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InternalSwitchStack.c
deleted file mode 100644
index 0c832fa290..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/InternalSwitchStack.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- InternalSwitchStack.c
-
-Abstract:
-
- SwitchStack() function for IA-32.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-{
- BASE_LIBRARY_JUMP_BUFFER JumpBuffer;
-
- //
- // Stack should be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- JumpBuffer.Eip = (UINTN)EntryPoint;
- JumpBuffer.Esp = (UINTN)NewStack - sizeof (VOID*);
- JumpBuffer.Esp -= sizeof (Context1) + sizeof (Context2);
- ((VOID**)JumpBuffer.Esp)[1] = Context1;
- ((VOID**)JumpBuffer.Esp)[2] = Context2;
-
- LongJump (&JumpBuffer, (UINTN)-1);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.S
deleted file mode 100644
index 304bb84c8a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Invd.Asm
-#
-# Abstract:
-#
-# AsmInvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmInvd)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmInvd (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmInvd):
- invd
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.asm
deleted file mode 100644
index cc53b7ef6f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; Invd.Asm
-;
-; Abstract:
-;
-; AsmInvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .486p
- .model flat
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmInvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-_AsmInvd PROC
- invd
- ret
-_AsmInvd ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.c
deleted file mode 100644
index 7df6c97bd1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Invd.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmInvd function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmInvd (
- VOID
- )
-{
- _asm {
- invd
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.S
deleted file mode 100644
index 33e4a503d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# LRotU64.asm
-#
-# Abstract:
-#
-# 64-bit left rotation for Ia32
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathLRotU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathLRotU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathLRotU64):
- push %ebx
- movb 16(%esp), %cl
- movl 12(%esp), %edx
- movl 8(%esp), %eax
- shldl %cl, %edx, %ebx
- shldl %cl, %eax, %edx
- rorl %cl, %ebx
- shldl %cl, %ebx, %eax
- testb $32, %cl
- cmovnz %eax, %ecx
- cmovnz %edx, %eax
- cmovnz %ecx, %edx
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.asm
deleted file mode 100644
index 940efc877b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; LRotU64.asm
-;
-; Abstract:
-;
-; 64-bit left rotation for Ia32
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathLRotU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMathLRotU64 PROC USES ebx
- mov cl, [esp + 16]
- mov edx, [esp + 12]
- mov eax, [esp + 8]
- shld ebx, edx, cl
- shld edx, eax, cl
- ror ebx, cl
- shld eax, ebx, cl
- test cl, 32 ; Count >= 32?
- cmovnz ecx, eax
- cmovnz eax, edx
- cmovnz edx, ecx
- ret
-InternalMathLRotU64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.c
deleted file mode 100644
index 1e37dda2bd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LRotU64.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LRotU64.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov edx, dword ptr [Operand + 4]
- mov eax, dword ptr [Operand + 0]
- shld ebx, edx, cl
- shld edx, eax, cl
- ror ebx, cl
- shld eax, ebx, cl
- test cl, 32 ; Count >= 32?
- cmovnz ecx, eax
- cmovnz eax, edx
- cmovnz edx, ecx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.S
deleted file mode 100644
index 5051f8902c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# LShiftU64.asm
-#
-# Abstract:
-#
-# 64-bit left shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathLShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathLShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathLShiftU64):
- movb 12(%esp), %cl
- xorl %eax, %eax
- movl 4(%esp), %edx
- testb $32, %cl
- cmovz %edx, %eax
- cmovz 0x8(%esp), %edx
- shld %cl, %eax, %edx
- shl %cl, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.asm
deleted file mode 100644
index 741f3b1d98..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; LShiftU64.asm
-;
-; Abstract:
-;
-; 64-bit left shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathLShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMathLShiftU64 PROC
- mov cl, [esp + 12]
- xor eax, eax
- mov edx, [esp + 4]
- test cl, 32 ; Count >= 32?
- cmovz eax, edx
- cmovz edx, [esp + 8]
- shld edx, eax, cl
- shl eax, cl
- ret
-InternalMathLShiftU64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.c
deleted file mode 100644
index cf8f489223..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LShiftU64.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LShiftU64.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- xor eax, eax
- mov edx, dword ptr [Operand + 0]
- test cl, 32 // Count >= 32?
- cmovz eax, edx
- cmovz edx, dword ptr [Operand + 4]
- shld edx, eax, cl
- shl eax, cl
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.S
deleted file mode 100644
index 15186e1229..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# LongJump.Asm
-#
-# Abstract:
-#
-# Implementation of _LongJump() on IA-32.
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalLongJump)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalLongJump):
- pop %eax
- pop %edx
- pop %eax
- movl (%edx), %ebx
- movl 4(%edx), %esi
- movl 8(%edx), %edi
- movl 12(%edx), %ebp
- movl 16(%edx), %esp
- jmp *20(%edx)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.asm
deleted file mode 100644
index b1dff1c876..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; LongJump.Asm
-;
-; Abstract:
-;
-; Implementation of _LongJump() on IA-32.
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-InternalLongJump PROC
- pop eax ; skip return address
- pop edx ; edx <- JumpBuffer
- pop eax ; eax <- Value
- mov ebx, [edx]
- mov esi, [edx + 4]
- mov edi, [edx + 8]
- mov ebp, [edx + 12]
- mov esp, [edx + 16]
- jmp dword ptr [edx + 20] ; restore "eip"
-InternalLongJump ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.c
deleted file mode 100644
index 5d71847cd2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/LongJump.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- Implementation of _LongJump() on IA-32.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-__declspec (naked)
-VOID
-EFIAPI
-InternalLongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- _asm {
- pop eax ; skip return address
- pop edx ; edx <- JumpBuffer
- pop eax ; eax <- Value
- mov ebx, [edx]
- mov esi, [edx + 4]
- mov edi, [edx + 8]
- mov ebp, [edx + 12]
- mov esp, [edx + 16]
- jmp dword ptr [edx + 20]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.S
deleted file mode 100644
index cc62f8ccff..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.S
+++ /dev/null
@@ -1,42 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DivU64x32.S
-#
-# Abstract:
-#
-# Calculate the remainder of a 64-bit integer by a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathModU64x32)
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InternalMathModU64x32 (
-# IN UINT64 Dividend,
-# IN UINT32 Divisor
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathModU64x32):
- movl 8(%esp), %eax
- movl 12(%esp), %ecx
- xorl %edx, %edx
- divl %ecx
- movl 4(%esp), %eax
- divl %ecx
- movl %edx, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.asm
deleted file mode 100644
index e228c6bcb1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; DivU64x32.asm
-;
-; Abstract:
-;
-; Calculate the remainder of a 64-bit integer by a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InternalMathModU64x32 (
-; IN UINT64 Dividend,
-; IN UINT32 Divisor
-; );
-;------------------------------------------------------------------------------
-InternalMathModU64x32 PROC
- mov eax, [esp + 8]
- mov ecx, [esp + 12]
- xor edx, edx
- div ecx
- mov eax, [esp + 4]
- div ecx
- mov eax, edx
- ret
-InternalMathModU64x32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.c
deleted file mode 100644
index 9f6de3e3a0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ModU64x32.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ModU64x32.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- _asm {
- mov eax, dword ptr [Dividend + 4]
- mov ecx, Divisor
- xor edx, edx
- div ecx
- mov eax, dword ptr [Dividend + 0]
- div ecx
- mov eax, edx
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.S
deleted file mode 100644
index 56bc3f4aca..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.S
+++ /dev/null
@@ -1,42 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Monitor.Asm
-#
-# Abstract:
-#
-# AsmMonitor function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmMonitor)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMonitor (
-# IN UINTN Eax,
-# IN UINTN Ecx,
-# IN UINTN Edx
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmMonitor):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- movl 12(%esp), %edx
- monitor %eax, %ecx, %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.asm
deleted file mode 100644
index 4fd0c4695f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; Monitor.Asm
-;
-; Abstract:
-;
-; AsmMonitor function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmMonitor (
-; IN UINTN Eax,
-; IN UINTN Ecx,
-; IN UINTN Edx
-; );
-;------------------------------------------------------------------------------
-AsmMonitor PROC
- mov eax, [esp + 4]
- mov ecx, [esp + 8]
- mov edx, [esp + 12]
- DB 0fh, 1, 0c8h ; monitor
- ret
-AsmMonitor ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.c
deleted file mode 100644
index 26bf6b7399..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Monitor.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- AsmMonitor function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmMonitor (
- IN UINTN RegisterEax,
- IN UINTN RegisterEcx,
- IN UINTN RegisterEdx
- )
-{
- _asm {
- mov eax, RegisterEax
- mov ecx, RegisterEcx
- mov edx, RegisterEdx
- _emit 0x0f // monitor
- _emit 0x01
- _emit 0xc8
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.S
deleted file mode 100644
index b98b13866e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# MultU64x32.asm
-#
-# Abstract:
-#
-# Calculate the product of a 64-bit integer and a 32-bit integer
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
- .386:
- .code:
-
-.globl ASM_PFX(InternalMathMultU64x32)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathMultU64x32 (
-# IN UINT64 Multiplicand,
-# IN UINT32 Multiplier
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathMultU64x32):
- movl 12(%esp), %ecx
- movl %ecx, %eax
- imull 8(%esp), %ecx
- mull 0x4(%esp)
- addl %ecx, %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.asm
deleted file mode 100644
index f563e1695a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; MultU64x32.asm
-;
-; Abstract:
-;
-; Calculate the product of a 64-bit integer and a 32-bit integer
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathMultU64x32 (
-; IN UINT64 Multiplicand,
-; IN UINT32 Multiplier
-; );
-;------------------------------------------------------------------------------
-InternalMathMultU64x32 PROC
- mov ecx, [esp + 12]
- mov eax, ecx
- imul ecx, [esp + 8] ; overflow not detectable
- mul dword ptr [esp + 4]
- add edx, ecx
- ret
-InternalMathMultU64x32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.c
deleted file mode 100644
index 472909d97b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x32.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MultU64x32.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- _asm {
- mov ecx, Multiplier
- mov eax, ecx
- imul ecx, dword ptr [Multiplicand + 4] // overflow not detectable
- mul dword ptr [Multiplicand + 0]
- add edx, ecx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.S
deleted file mode 100644
index 5e9afe4dc7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# MultU64x64.asm
-#
-# Abstract:
-#
-# Calculate the product of a 64-bit integer and another 64-bit integer
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathMultU64x64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathMultU64x64 (
-# IN UINT64 Multiplicand,
-# IN UINT64 Multiplier
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathMultU64x64):
- push %ebx
- movl 8(%esp), %ebx
- movl 16(%esp), %edx
- movl %ebx, %ecx
- movl %edx, %eax
- imull 20(%esp), %ebx
- imull 12(%esp), %edx
- addl %edx, %ebx
- mull %ecx
- addl %ebx, %edx
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.asm
deleted file mode 100644
index 7605ec8a80..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.asm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; MultU64x64.asm
-;
-; Abstract:
-;
-; Calculate the product of a 64-bit integer and another 64-bit integer
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathMultU64x64 (
-; IN UINT64 Multiplicand,
-; IN UINT64 Multiplier
-; );
-;------------------------------------------------------------------------------
-InternalMathMultU64x64 PROC USES ebx
- mov ebx, [esp + 8] ; ebx <- M1[0..31]
- mov edx, [esp + 16] ; edx <- M2[0..31]
- mov ecx, ebx
- mov eax, edx
- imul ebx, [esp + 20] ; ebx <- M1[0..31] * M2[32..63]
- imul edx, [esp + 12] ; edx <- M1[32..63] * M2[0..31]
- add ebx, edx ; carries are abandoned
- mul ecx ; edx:eax <- M1[0..31] * M2[0..31]
- add edx, ebx ; carries are abandoned
- ret
-InternalMathMultU64x64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.c
deleted file mode 100644
index 1ddc6e1db4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/MultU64x64.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MultU64x64.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- _asm {
- mov ebx, dword ptr [Multiplicand + 0]
- mov edx, dword ptr [Multiplier + 0]
- mov ecx, ebx
- mov eax, edx
- imul ebx, dword ptr [Multiplier + 4]
- imul edx, dword ptr [Multiplicand + 4]
- add ebx, edx
- mul ecx
- add edx, ebx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.S
deleted file mode 100644
index 0be9f4e291..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Mwait.Asm
-#
-# Abstract:
-#
-# AsmMwait function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmMwait)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMwait (
-# IN UINTN Eax,
-# IN UINTN Ecx
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmMwait):
- movl 4(%esp), %eax
- movl 8(%esp), %ecx
- mwait %eax, %ecx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.asm
deleted file mode 100644
index f467abec1f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; Mwait.Asm
-;
-; Abstract:
-;
-; AsmMwait function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmMwait (
-; IN UINTN Eax,
-; IN UINTN Ecx
-; );
-;------------------------------------------------------------------------------
-AsmMwait PROC
- mov eax, [esp + 4]
- mov ecx, [esp + 8]
- DB 0fh, 1, 0c9h ; mwait
- ret
-AsmMwait ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.c
deleted file mode 100644
index c3fd363d44..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Mwait.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmMwait function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmMwait (
- IN UINTN RegisterEax,
- IN UINTN RegisterEcx
- )
-{
- _asm {
- mov eax, RegisterEax
- mov ecx, RegisterEcx
- _emit 0x0f // mwait
- _emit 0x01
- _emit 0xC9
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Non-existing.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Non-existing.c
deleted file mode 100644
index 546d006272..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Non-existing.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Non-existing.c
-
-Abstract:
-
- Non-existing BaseLib functions on Ia32
-
---*/
-
-#include "BaseLibInternals.h"
-
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on X64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging64 (
- IN UINT16 CodeSelector,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- )
-{
- //
- // This function cannot work on IA32 platform
- //
- ASSERT (FALSE);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.S
deleted file mode 100644
index d090fcc12a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.S
+++ /dev/null
@@ -1,48 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# RRotU64.asm
-#
-# Abstract:
-#
-# 64-bit right rotation for Ia32
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalMathRRotU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathRRotU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathRRotU64):
- push %ebx
- movb 16(%esp), %cl
- movl 8(%esp), %eax
- movl 12(%esp), %edx
- shrdl %cl, %eax, %ebx
- shrdl %cl, %edx, %eax
- roll %cl, %ebx
- shrdl %cl, %ebx, %edx
- testb $32, %cl
- cmovnz %eax, %ecx
- cmovnz %edx, %eax
- cmovnz %ecx, %edx
- pop %ebx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.asm
deleted file mode 100644
index 151e39382d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; RRotU64.asm
-;
-; Abstract:
-;
-; 64-bit right rotation for Ia32
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathRRotU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMathRRotU64 PROC USES ebx
- mov cl, [esp + 16]
- mov eax, [esp + 8]
- mov edx, [esp + 12]
- shrd ebx, eax, cl
- shrd eax, edx, cl
- rol ebx, cl
- shrd edx, ebx, cl
- test cl, 32 ; Count >= 32?
- cmovnz ecx, eax ; switch eax & edx if Count >= 32
- cmovnz eax, edx
- cmovnz edx, ecx
- ret
-InternalMathRRotU64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.c
deleted file mode 100644
index a80ffa1024..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RRotU64.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- 64-bit right rotation for Ia32
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- mov eax, dword ptr [Operand + 0]
- mov edx, dword ptr [Operand + 4]
- shrd ebx, eax, cl
- shrd eax, edx, cl
- rol ebx, cl
- shrd edx, ebx, cl
- test cl, 32 // Count >= 32?
- cmovnz ecx, eax
- cmovnz eax, edx
- cmovnz edx, ecx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.S
deleted file mode 100644
index d8f0f7f499..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# RShiftU64.asm
-#
-# Abstract:
-#
-# 64-bit logical right shift function for IA-32
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
- .686:
- .code:
-
-.globl ASM_PFX(InternalMathRShiftU64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathRShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMathRShiftU64):
- movb 12(%esp), %cl
- xorl %edx, %edx
- movl 8(%esp), %eax
- testb $32, %cl
- cmovz %eax, %edx
- cmovz 0x4(%esp), %eax
- shrdl %cl, %edx, %eax
- shr %cl, %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.asm
deleted file mode 100644
index 665a9301be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; RShiftU64.asm
-;
-; Abstract:
-;
-; 64-bit logical right shift function for IA-32
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathRShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMathRShiftU64 PROC
- mov cl, [esp + 12] ; cl <- Count
- xor edx, edx
- mov eax, [esp + 8]
- test cl, 32 ; Count >= 32?
- cmovz edx, eax
- cmovz eax, [esp + 4]
- shrd eax, edx, cl
- shr edx, cl
- ret
-InternalMathRShiftU64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.c
deleted file mode 100644
index 454f7cd2e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/RShiftU64.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RShiftU64.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- _asm {
- mov cl, byte ptr [Count]
- xor edx, edx
- mov eax, dword ptr [Operand + 4]
- test cl, 32
- cmovz edx, eax
- cmovz eax, dword ptr [Operand + 0]
- shrd eax, edx, cl
- shr edx, cl
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.S
deleted file mode 100644
index 5ff1964b43..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr0.Asm
-#
-# Abstract:
-#
-# AsmReadCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadCr0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr0):
- movl %cr0, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.asm
deleted file mode 100644
index 6864f2a32e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadCr0.Asm
-;
-; Abstract:
-;
-; AsmReadCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr0 PROC
- mov eax, cr0
- ret
-AsmReadCr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.c
deleted file mode 100644
index 7bb99490d9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr0.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- AsmReadCr0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadCr0 (
- VOID
- )
-{
- __asm {
- mov eax, cr0
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.S
deleted file mode 100644
index 9f44bcfcad..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr2.Asm
-#
-# Abstract:
-#
-# AsmReadCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadCr2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr2):
- movl %cr2, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.asm
deleted file mode 100644
index e63283287a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadCr2.Asm
-;
-; Abstract:
-;
-; AsmReadCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr2 PROC
- mov eax, cr2
- ret
-AsmReadCr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.c
deleted file mode 100644
index 5133645af4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr2.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadCr2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadCr2 (
- VOID
- )
-{
- __asm {
- mov eax, cr2
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.S
deleted file mode 100644
index c4d54c0b28..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr3.Asm
-#
-# Abstract:
-#
-# AsmReadCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadCr3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr3):
- movl %cr3, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.asm
deleted file mode 100644
index 9071a7ab56..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadCr3.Asm
-;
-; Abstract:
-;
-; AsmReadCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr3 PROC
- mov eax, cr3
- ret
-AsmReadCr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.c
deleted file mode 100644
index a2b2b58db2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr3.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadCr3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadCr3 (
- VOID
- )
-{
- __asm {
- mov eax, cr3
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.S
deleted file mode 100644
index 6301396af9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr4.Asm
-#
-# Abstract:
-#
-# AsmReadCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadCr4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCr4):
- movl %cr4, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.asm
deleted file mode 100644
index 313e43940c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadCr4.Asm
-;
-; Abstract:
-;
-; AsmReadCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr4 PROC
- mov eax, cr4
- ret
-AsmReadCr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.c
deleted file mode 100644
index 424d3807a4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCr4.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- AsmReadCr4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadCr4 (
- VOID
- )
-{
- __asm {
- _emit 0x0f // mov eax, cr4
- _emit 0x20
- _emit 0xE0
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.S
deleted file mode 100644
index eee3ec2d87..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCs.Asm
-#
-# Abstract:
-#
-# AsmReadCs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadCs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadCs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadCs):
- movl %cs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.asm
deleted file mode 100644
index 4573aacf25..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadCs.Asm
-;
-; Abstract:
-;
-; AsmReadCs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadCs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCs PROC
- mov eax, cs
- ret
-AsmReadCs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.c
deleted file mode 100644
index aa12b08a28..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadCs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadCs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadCs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, cs
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.S
deleted file mode 100644
index 1f3257c431..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr0.Asm
-#
-# Abstract:
-#
-# AsmReadDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr0):
- movl %dr0, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.asm
deleted file mode 100644
index 95b9fdb517..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr0.Asm
-;
-; Abstract:
-;
-; AsmReadDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr0 PROC
- mov eax, dr0
- ret
-AsmReadDr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.c
deleted file mode 100644
index f5589d5b50..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr0.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr0 (
- VOID
- )
-{
- __asm {
- mov eax, dr0
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.S
deleted file mode 100644
index d63f42ffde..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr1.Asm
-#
-# Abstract:
-#
-# AsmReadDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr1)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr1):
- movl %dr1, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.asm
deleted file mode 100644
index 9ef9a21f3c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr1.Asm
-;
-; Abstract:
-;
-; AsmReadDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr1 PROC
- mov eax, dr1
- ret
-AsmReadDr1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.c
deleted file mode 100644
index 5d6656ad0e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr1.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr1 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr1 (
- VOID
- )
-{
- __asm {
- mov eax, dr1
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.S
deleted file mode 100644
index 6910e2722f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr2.Asm
-#
-# Abstract:
-#
-# AsmReadDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr2):
- movl %dr2, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.asm
deleted file mode 100644
index 920aafe14b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr2.Asm
-;
-; Abstract:
-;
-; AsmReadDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr2 PROC
- mov eax, dr2
- ret
-AsmReadDr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.c
deleted file mode 100644
index b9f2bd5aec..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr2.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr2 (
- VOID
- )
-{
- __asm {
- mov eax, dr2
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.S
deleted file mode 100644
index 8192d90ec1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr3.Asm
-#
-# Abstract:
-#
-# AsmReadDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr3):
- movl %dr3, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.asm
deleted file mode 100644
index 40fc25e7f7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr3.Asm
-;
-; Abstract:
-;
-; AsmReadDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr3 PROC
- mov eax, dr3
- ret
-AsmReadDr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.c
deleted file mode 100644
index 32ff6f2709..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr3.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr3 (
- VOID
- )
-{
- __asm {
- mov eax, dr3
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.S
deleted file mode 100644
index 56ed126d23..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr4.Asm
-#
-# Abstract:
-#
-# AsmReadDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr4):
- movl %dr4, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.asm
deleted file mode 100644
index fb350f8a2f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.asm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr4.Asm
-;
-; Abstract:
-;
-; AsmReadDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr4 PROC
- ;
- ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, reading
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0fh, 21h, 0e0h
- ret
-AsmReadDr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.c
deleted file mode 100644
index 826b107a04..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr4.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- AsmReadDr4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr4 (
- VOID
- )
-{
- __asm {
- _emit 0x0f
- _emit 0x21
- _emit 0xe0
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.S
deleted file mode 100644
index a428223161..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr5.Asm
-#
-# Abstract:
-#
-# AsmReadDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr5)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr5):
- movl %dr5, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.asm
deleted file mode 100644
index a897ef8b02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.asm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr5.Asm
-;
-; Abstract:
-;
-; AsmReadDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr5 PROC
- ;
- ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, reading
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0fh, 21h, 0e8h
- ret
-AsmReadDr5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.c
deleted file mode 100644
index 64f0989324..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr5.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- AsmReadDr5 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr5 (
- VOID
- )
-{
- __asm {
- _emit 0x0f
- _emit 0x21
- _emit 0xe8
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.S
deleted file mode 100644
index c27f0a56e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr6.Asm
-#
-# Abstract:
-#
-# AsmReadDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr6)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr6):
- movl %dr6, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.asm
deleted file mode 100644
index c86e2e62b8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr6.Asm
-;
-; Abstract:
-;
-; AsmReadDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr6 PROC
- mov eax, dr6
- ret
-AsmReadDr6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.c
deleted file mode 100644
index a3ef69ab78..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr6.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr6 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr6 (
- VOID
- )
-{
- __asm {
- mov eax, dr6
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.S
deleted file mode 100644
index df02b602c1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr7.Asm
-#
-# Abstract:
-#
-# AsmReadDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDr7)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDr7):
- movl %dr7, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.asm
deleted file mode 100644
index f7fbdbe1df..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDr7.Asm
-;
-; Abstract:
-;
-; AsmReadDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr7 PROC
- mov eax, dr7
- ret
-AsmReadDr7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.c
deleted file mode 100644
index 9c20e65083..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDr7.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadDr7 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadDr7 (
- VOID
- )
-{
- __asm {
- mov eax, dr7
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.S
deleted file mode 100644
index 0c2f0c2dee..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDs.Asm
-#
-# Abstract:
-#
-# AsmReadDs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadDs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadDs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadDs):
- movl %ds, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.asm
deleted file mode 100644
index 46c244c8f5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadDs.Asm
-;
-; Abstract:
-;
-; AsmReadDs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadDs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDs PROC
- mov eax, ds
- ret
-AsmReadDs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.c
deleted file mode 100644
index 5cfcd7ee87..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadDs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadDs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadDs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, ds
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.S
deleted file mode 100644
index 93b3fa1684..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadEflags.Asm
-#
-# Abstract:
-#
-# AsmReadEflags function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadEflags)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadEflags):
- pushfl
- pop %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.asm
deleted file mode 100644
index 03be2ba998..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadEflags.Asm
-;
-; Abstract:
-;
-; AsmReadEflags function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadEflags PROC
- pushfd
- pop eax
- ret
-AsmReadEflags ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.c
deleted file mode 100644
index 69bb4aac53..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEflags.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadEflags function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmReadEflags (
- VOID
- )
-{
- __asm {
- pushfd
- pop eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.S
deleted file mode 100644
index 9217a8571b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadEs.Asm
-#
-# Abstract:
-#
-# AsmReadEs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadEs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadEs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadEs):
- movl %es, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.asm
deleted file mode 100644
index 7f365a7af1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadEs.Asm
-;
-; Abstract:
-;
-; AsmReadEs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadEs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadEs PROC
- mov eax, es
- ret
-AsmReadEs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.c
deleted file mode 100644
index bf9b803d23..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadEs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadEs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadEs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, es
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.S
deleted file mode 100644
index 1051474c36..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadFs.Asm
-#
-# Abstract:
-#
-# AsmReadFs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadFs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadFs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadFs):
- movl %fs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.asm
deleted file mode 100644
index 663d70698f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadFs.Asm
-;
-; Abstract:
-;
-; AsmReadFs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadFs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadFs PROC
- mov eax, fs
- ret
-AsmReadFs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.c
deleted file mode 100644
index 2c6f0357d5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadFs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadFs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadFs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, fs
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.S
deleted file mode 100644
index 19a077d7a5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadGdtr.Asm
-#
-# Abstract:
-#
-# InternalX86ReadGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86ReadGdtr)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86ReadGdtr):
- movl 4(%esp), %eax
- sgdt (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.asm
deleted file mode 100644
index eb9683f775..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadGdtr.Asm
-;
-; Abstract:
-;
-; AsmReadGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadGdtr (
-; OUT IA32_DESCRIPTOR *Gdtr
-; );
-;------------------------------------------------------------------------------
-InternalX86ReadGdtr PROC
- mov eax, [esp + 4]
- sgdt fword ptr [eax]
- ret
-InternalX86ReadGdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.c
deleted file mode 100644
index cafe7d8849..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGdtr.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadGdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86ReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- _asm {
- mov eax, Gdtr
- sgdt fword ptr [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.S
deleted file mode 100644
index 5097854523..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadGs.Asm
-#
-# Abstract:
-#
-# AsmReadGs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadGs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadGs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadGs):
- movl %gs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.asm
deleted file mode 100644
index b25ca0affe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadGs.Asm
-;
-; Abstract:
-;
-; AsmReadGs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadGs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadGs PROC
- mov eax, gs
- ret
-AsmReadGs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.c
deleted file mode 100644
index 795cb7b7b8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadGs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadGs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadGs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, gs
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.S
deleted file mode 100644
index 47b42c6723..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadIdtr.Asm
-#
-# Abstract:
-#
-# InternalX86ReadIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(InternalX86ReadIdtr)
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalX86ReadIdtr):
- movl 4(%esp), %eax
- sidt (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.asm
deleted file mode 100644
index f4ff1cafd8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadIdtr.Asm
-;
-; Abstract:
-;
-; AsmReadIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadIdtr (
-; OUT IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86ReadIdtr PROC
- mov eax, [esp + 4]
- sidt fword ptr [eax]
- ret
-InternalX86ReadIdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.c
deleted file mode 100644
index f2431fd6e5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadIdtr.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadIdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86ReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- _asm {
- mov eax, Idtr
- sidt fword ptr [eax]
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.S
deleted file mode 100644
index b14a97b677..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadLdtr.Asm
-#
-# Abstract:
-#
-# AsmReadLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadLdtr)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadLdtr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadLdtr):
- sldt %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.asm
deleted file mode 100644
index f517161ca9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadLdtr.Asm
-;
-; Abstract:
-;
-; AsmReadLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadLdtr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadLdtr PROC
- sldt ax
- ret
-AsmReadLdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.c
deleted file mode 100644
index d5341ef49e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadLdtr.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadLdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadLdtr (
- VOID
- )
-{
- _asm {
- sldt ax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.S
deleted file mode 100644
index 571b75ee6d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm0.Asm
-#
-# Abstract:
-#
-# AsmReadMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm0)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm0):
- push %eax
- push %eax
- movq %mm0, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.asm
deleted file mode 100644
index 0e73dfb588..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm0.Asm
-;
-; Abstract:
-;
-; AsmReadMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm0 PROC
- push eax
- push eax
- movq [esp], mm0
- pop eax
- pop edx
- ret
-AsmReadMm0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.c
deleted file mode 100644
index a32d89f98f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm0.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm0 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm0
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.S
deleted file mode 100644
index ccd51248e7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm1.Asm
-#
-# Abstract:
-#
-# AsmReadMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm1)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm1):
- push %eax
- push %eax
- movq %mm1, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.asm
deleted file mode 100644
index 6f26a75878..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm1.Asm
-;
-; Abstract:
-;
-; AsmReadMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm1 PROC
- push eax
- push eax
- movq [esp], mm1
- pop eax
- pop edx
- ret
-AsmReadMm1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.c
deleted file mode 100644
index 4cbbdbb506..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm1.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm1 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm1 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm1
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.S
deleted file mode 100644
index 2f8b0c4523..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm2.Asm
-#
-# Abstract:
-#
-# AsmReadMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm2)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm2):
- push %eax
- push %eax
- movq %mm2, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.asm
deleted file mode 100644
index 4174020569..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm2.Asm
-;
-; Abstract:
-;
-; AsmReadMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm2 PROC
- push eax
- push eax
- movq [esp], mm2
- pop eax
- pop edx
- ret
-AsmReadMm2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.c
deleted file mode 100644
index 86b4c3504f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm2.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm2 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm2
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.S
deleted file mode 100644
index 39f755e548..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm3.Asm
-#
-# Abstract:
-#
-# AsmReadMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm3)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm3):
- push %eax
- push %eax
- movq %mm3, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.asm
deleted file mode 100644
index 3efaca8cb3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm3.Asm
-;
-; Abstract:
-;
-; AsmReadMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm3 PROC
- push eax
- push eax
- movq [esp], mm3
- pop eax
- pop edx
- ret
-AsmReadMm3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.c
deleted file mode 100644
index 0317fc77e9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm3.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm3 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm3
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.S
deleted file mode 100644
index 7ec82510e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm4.Asm
-#
-# Abstract:
-#
-# AsmReadMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm4)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm4):
- push %eax
- push %eax
- movq %mm4, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.asm
deleted file mode 100644
index 17dbaf5a02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm4.Asm
-;
-; Abstract:
-;
-; AsmReadMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm4 PROC
- push eax
- push eax
- movq [esp], mm4
- pop eax
- pop edx
- ret
-AsmReadMm4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.c
deleted file mode 100644
index bff6e084d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm4.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm4 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm4
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.S
deleted file mode 100644
index 35b38e9bbf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm5.Asm
-#
-# Abstract:
-#
-# AsmReadMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm5)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm5):
- push %eax
- push %eax
- movq %mm5, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.asm
deleted file mode 100644
index 8380e215f3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm5.Asm
-;
-; Abstract:
-;
-; AsmReadMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm5 PROC
- push eax
- push eax
- movq [esp], mm5
- pop eax
- pop edx
- ret
-AsmReadMm5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.c
deleted file mode 100644
index 5746fd34d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm5.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm5 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm5 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm5
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.S
deleted file mode 100644
index 879b226fe9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm6.Asm
-#
-# Abstract:
-#
-# AsmReadMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm6)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm6):
- push %eax
- push %eax
- movq %mm6, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.asm
deleted file mode 100644
index e7dbea71b7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm6.Asm
-;
-; Abstract:
-;
-; AsmReadMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm6 PROC
- push eax
- push eax
- movq [esp], mm6
- pop eax
- pop edx
- ret
-AsmReadMm6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.c
deleted file mode 100644
index 858375186e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm6.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- AsmReadMm6 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm6 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm6
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.S
deleted file mode 100644
index 1f43d01c02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.S
+++ /dev/null
@@ -1,41 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm7.Asm
-#
-# Abstract:
-#
-# AsmReadMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMm7)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadMm7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMm7):
- push %eax
- push %eax
- movq %mm7, (%esp)
- pop %eax
- pop %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.asm
deleted file mode 100644
index cd6cf8831e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMm7.Asm
-;
-; Abstract:
-;
-; AsmReadMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm7 PROC
- push eax
- push eax
- movq [esp], mm7
- pop eax
- pop edx
- ret
-AsmReadMm7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.c
deleted file mode 100644
index 853b995c99..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMm7.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ReadMm7.c
-
-Abstract:
-
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMm7 (
- VOID
- )
-{
- _asm {
- push eax
- push eax
- movq [esp], mm7
- pop eax
- pop edx
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.S
deleted file mode 100644
index f28cffc546..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMsr64.Asm
-#
-# Abstract:
-#
-# AsmReadMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadMsr64)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMsr64 (
-# IN UINT32 Index
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadMsr64):
- movl 4(%esp), %ecx
- rdmsr
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.asm
deleted file mode 100644
index b3cbbb35de..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadMsr64.Asm
-;
-; Abstract:
-;
-; AsmReadMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMsr64 (
-; IN UINT64 Index
-; );
-;------------------------------------------------------------------------------
-AsmReadMsr64 PROC
- mov ecx, [esp + 4]
- rdmsr
- ret
-AsmReadMsr64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.c
deleted file mode 100644
index 2043e0e1d6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadMsr64.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadMsr64 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- _asm {
- mov ecx, Index
- rdmsr
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.S
deleted file mode 100644
index 21f12a2537..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadPmc.Asm
-#
-# Abstract:
-#
-# AsmReadPmc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadPmc)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadPmc (
-# IN UINT32 PmcIndex
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadPmc):
- movl 4(%esp), %ecx
- rdpmc
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.asm
deleted file mode 100644
index 8a58a0ca7f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadPmc.Asm
-;
-; Abstract:
-;
-; AsmReadPmc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadPmc (
-; IN UINT32 PmcIndex
-; );
-;------------------------------------------------------------------------------
-AsmReadPmc PROC
- mov ecx, [esp + 4]
- rdpmc
- ret
-AsmReadPmc ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.c
deleted file mode 100644
index ef8b5d4b9a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadPmc.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadPmc function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadPmc (
- IN UINT32 PmcIndex
- )
-{
- _asm {
- mov ecx, PmcIndex
- rdpmc
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.S
deleted file mode 100644
index 796ff816ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadSs.Asm
-#
-# Abstract:
-#
-# AsmReadSs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadSs)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadSs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadSs):
- movl %ss, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.asm
deleted file mode 100644
index 23324ed5b8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadSs.Asm
-;
-; Abstract:
-;
-; AsmReadSs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadSs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadSs PROC
- mov eax, ss
- ret
-AsmReadSs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.c
deleted file mode 100644
index 272cc720e8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadSs.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmReadSs function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadSs (
- VOID
- )
-{
- __asm {
- xor eax, eax
- mov ax, ss
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.S
deleted file mode 100644
index 7da8dcebd9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadTr.Asm
-#
-# Abstract:
-#
-# AsmReadTr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadTr)
-
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadTr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadTr):
- str %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.asm
deleted file mode 100644
index ed816bb4fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadTr.Asm
-;
-; Abstract:
-;
-; AsmReadTr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadTr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadTr PROC
- str ax
- ret
-AsmReadTr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.c
deleted file mode 100644
index c2c437fc6a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTr.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadTr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT16
-EFIAPI
-AsmReadTr (
- VOID
- )
-{
- _asm {
- str ax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.S
deleted file mode 100644
index d3b40fcb8b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadTsc.Asm
-#
-# Abstract:
-#
-# AsmReadTsc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(AsmReadTsc)
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadTsc (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmReadTsc):
- rdtsc
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.asm
deleted file mode 100644
index 67973ee3d5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadTsc.Asm
-;
-; Abstract:
-;
-; AsmReadTsc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadTsc (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadTsc PROC
- rdtsc
- ret
-AsmReadTsc ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.c
deleted file mode 100644
index cc943d4360..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/ReadTsc.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmReadTsc function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmReadTsc (
- VOID
- )
-{
- _asm {
- rdtsc
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.S
deleted file mode 100644
index 99dd81d33d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetJump.Asm
-#
-# Abstract:
-#
-# Implementation of SetJump() on IA-32.
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(SetJump), ASM_PFX(InternalAssertJumpBuffer)
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# SetJump (
-# OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(SetJump):
- pushl 0x4(%esp)
- call ASM_PFX(InternalAssertJumpBuffer)
- pop %ecx
- pop %ecx
- movl (%esp), %edx
- movl %ebx, (%edx)
- movl %esi, 4(%edx)
- movl %edi, 8(%edx)
- movl %ebp, 12(%edx)
- movl %esp, 16(%edx)
- movl %ecx, 20(%edx)
- xorl %eax, %eax
- jmp *%ecx
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.asm
deleted file mode 100644
index 65068aca5b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetJump.Asm
-;
-; Abstract:
-;
-; Implementation of SetJump() on IA-32.
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-InternalAssertJumpBuffer PROTO C
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; SetJump (
-; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-; );
-;------------------------------------------------------------------------------
-SetJump PROC
- push [esp + 4]
- call InternalAssertJumpBuffer ; To validate JumpBuffer
- pop ecx
- pop ecx ; ecx <- return address
- mov edx, [esp]
- mov [edx], ebx
- mov [edx + 4], esi
- mov [edx + 8], edi
- mov [edx + 12], ebp
- mov [edx + 16], esp
- mov [edx + 20], ecx ; eip value to restore in LongJump
- xor eax, eax
- jmp ecx
-SetJump ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.c
deleted file mode 100644
index d3e1291368..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SetJump.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- Implementation of SetJump() on IA-32.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- );
-
-_declspec (naked)
-UINTN
-EFIAPI
-SetJump (
- OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- _asm {
- push [esp + 4]
- call InternalAssertJumpBuffer
- pop ecx
- pop ecx
- mov edx, [esp]
- mov [edx], ebx
- mov [edx + 4], esi
- mov [edx + 8], edi
- mov [edx + 12], ebp
- mov [edx + 16], esp
- mov [edx + 20], ecx
- xor eax, eax
- jmp ecx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.S
deleted file mode 100644
index d6c2f8514d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuId.Asm
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InternalMathSwapBytes64 (
-# IN UINT64 Operand
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMathSwapBytes64)
-ASM_PFX(InternalMathSwapBytes64):
- movl 8(%esp), %eax
- movl 4(%esp), %edx
- bswapl %eax
- bswapl %edx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.asm
deleted file mode 100644
index 967a3bc44f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InternalMathSwapBytes64 (
-; IN UINT64 Operand
-; );
-;------------------------------------------------------------------------------
-InternalMathSwapBytes64 PROC
- mov eax, [esp + 8] ; eax <- upper 32 bits
- mov edx, [esp + 4] ; edx <- lower 32 bits
- bswap eax
- bswap edx
- ret
-InternalMathSwapBytes64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.c
deleted file mode 100644
index 6dc850f4c9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/SwapBytes64.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- Implementation of 64-bit swap bytes
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- )
-{
- _asm {
- mov eax, dword ptr [Operand + 4]
- mov edx, dword ptr [Operand + 0]
- bswap eax
- bswap edx
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S
deleted file mode 100644
index 0f144e714b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.S
+++ /dev/null
@@ -1,203 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2011, 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.
-#
-# Module Name:
-#
-# Thunk16.S
-#
-# Abstract:
-#
-# Real mode thunk
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(m16Start), ASM_PFX(m16Size), ASM_PFX(mThunk16Attr), ASM_PFX(m16Gdt), ASM_PFX(m16GdtrBase), ASM_PFX(mTransition)
-.globl ASM_PFX(InternalAsmThunk16)
-
-ASM_PFX(m16Start):
-
-SavedGdt: .space 6
-
-ASM_PFX(BackFromUserCode):
- push %ss
- push %cs
- .byte 0x66
- call L_Base1 # push eip
-L_Base1:
- pushfw # pushfd actually
- cli # disable interrupts
- push %gs
- push %fs
- push %es
- push %ds
- pushaw # pushad actually
- .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
- cli # disable interrupts
- jnc 2f
-1:
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
- jz 2f
- inb $0x92, %al
- 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
-SavedCr4: .space 4
- movl %eax, %cr4
- lgdtw %cs:0xfffffff2(%edi)
- .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
-SavedEsp: .space 4
- .byte 0x66
- lret # return to protected mode
-
-_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
- .word 0x8
-_16Idtr: .word 0x3ff
- .long 0
-_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
-
-L_RealMode:
- mov %edx, %cs:0xffffffc5(%esi)
- mov %bx, %cs:0xffffffcb(%esi)
- lidtw %cs:0xffffffd7(%esi)
- popaw # popad actually
- pop %ds
- pop %es
- pop %fs
- pop %gs
- popfw # popfd
- lretw # transfer control to user code
-
-_NullSegDesc: .quad 0
-_16CsDesc:
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-_16DsDesc:
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-GdtEnd:
-
-#
-# @param RegSet The pointer to a IA32_DWORD_REGS structure
-# @param Transition The pointer to the transition code
-# @return The address of the 16-bit stack after returning from user code
-#
-ASM_PFX(InternalAsmThunk16):
- push %ebp
- push %ebx
- push %esi
- push %edi
- push %ds
- push %es
- push %fs
- push %gs
- movl 36(%esp), %esi # esi <- RegSet
- movzwl 0x32(%esi), %edx
- mov 0xc(%esi), %edi
- add $0xffffffc8, %edi
- movl %edi, %ebx # ebx <- stack offset
- imul $0x10, %edx, %eax
- push $0xd
- 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
- movl %eax, %ecx
- andl $0xf, %ecx
- shll $12, %eax
- lea 0x6(%ecx), %ecx
- movw %cx, %ax
- stosl # [edi] <- return address of user code
- sgdtl 0xffffff9f(%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)
- andl $0x300, %ebp # clear all but PCE and OSFXSR bits
- pushl $0x10
- pop %ecx # ecx <- selector for data segments
- lgdtl 0x20(%edx)
- pushfl
- lcall *0x14(%edx)
- popfl
- lidtl 0x24(%esp)
- lea 0xffffffcc(%ebp), %eax
- pop %gs
- pop %fs
- pop %es
- pop %ds
- pop %edi
- pop %esi
- pop %ebx
- pop %ebp
- ret
-
- .const:
-
-ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr): .word ASM_PFX(ThunkAttr) - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt): .word _NullSegDesc - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm
deleted file mode 100644
index 8b22e0f336..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Thunk16.asm
+++ /dev/null
@@ -1,251 +0,0 @@
-; Copyright (c) 2004 - 2011, 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.
-;
-; Module Name:
-;
-; Thunk.asm
-;
-; Abstract:
-;
-; Real mode thunk
-;
-;------------------------------------------------------------------------------
-
- .686p
- .model flat,C
-
-EXTERNDEF C m16Start:BYTE
-EXTERNDEF C m16Size:WORD
-EXTERNDEF C mThunk16Attr:WORD
-EXTERNDEF C m16Gdt:WORD
-EXTERNDEF C m16GdtrBase:WORD
-EXTERNDEF C mTransition:WORD
-
-THUNK_ATTRIBUTE_BIG_REAL_MODE EQU 1
-THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 EQU 2
-THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL EQU 4
-
-;
-; Here is the layout of the real mode stack. _ToUserCode() is responsible for
-; loading all these registers from real mode stack.
-;
-IA32_REGS STRUC 4t
-_EDI DD ?
-_ESI DD ?
-_EBP DD ?
-_ESP DD ?
-_EBX DD ?
-_EDX DD ?
-_ECX DD ?
-_EAX DD ?
-_DS DW ?
-_ES DW ?
-_FS DW ?
-_GS DW ?
-_EFLAGS DD ?
-_EIP DD ?
-_CS DW ?
-_SS DW ?
-IA32_REGS ENDS
-
- .const
-
-;
-; These are global constant to convey information to C code.
-;
-m16Size DW InternalAsmThunk16 - m16Start
-mThunk16Attr DW _ThunkAttr - m16Start
-m16Gdt DW _NullSegDesc - m16Start
-m16GdtrBase DW _16GdtrBase - m16Start
-mTransition DW _EntryPoint - m16Start
-
- .code
-
-m16Start LABEL BYTE
-
-SavedGdt LABEL FWORD
- DW ?
- DD ?
-;------------------------------------------------------------------------------
-; _BackFromUserCode() takes control in real mode after 'retf' has been executed
-; by user code. It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_BackFromUserCode PROC
- ;
- ; The order of saved registers on the stack matches the order they appears
- ; in IA32_REGS structure. This facilitates wrapper function to extract them
- ; into that structure.
- ;
- push ss
- push cs
- DB 66h
- call @Base ; push eip
-@Base:
- pushf ; pushfd actually
- cli ; disable interrupts
- push gs
- push fs
- push es
- push ds
- pushaw ; pushad actually
- DB 66h, 0bah ; mov edx, imm32
-_ThunkAttr DD ?
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15
- jz @1
- mov eax, 15cd2401h ; mov ax, 2401h & int 15h
- cli ; disable interrupts
- jnc @2
-@1:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL
- jz @2
- in al, 92h
- or al, 2
- out 92h, al ; deactivate A20M#
-@2:
- xor ax, ax ; xor eax, eax
- mov eax, ss ; mov ax, ss
- DB 67h
- lea bp, [esp + sizeof (IA32_REGS)]
- ;
- ; esi's in the following 2 instructions are indeed bp in 16-bit code. Fact
- ; is "esi" in 32-bit addressing mode has the same encoding of "bp" in 16-
- ; bit addressing mode.
- ;
- mov word ptr (IA32_REGS ptr [esi - sizeof (IA32_REGS)])._ESP, bp
- mov ebx, (IA32_REGS ptr [esi - sizeof (IA32_REGS)])._EIP
- shl ax, 4 ; shl eax, 4
- add bp, ax ; add ebp, eax
- DB 66h, 0b8h ; mov eax, imm32
-SavedCr4 DD ?
- mov cr4, eax
- DB 66h
- lgdt fword ptr cs:[edi + (SavedGdt - @Base)]
- DB 66h, 0b8h ; mov eax, imm32
-SavedCr0 DD ?
- mov cr0, eax
- DB 0b8h ; mov ax, imm16
-SavedSs DW ?
- mov ss, eax
- DB 66h, 0bch ; mov esp, imm32
-SavedEsp DD ?
- DB 66h
- retf ; return to protected mode
-_BackFromUserCode ENDP
-
-_EntryPoint DD _ToUserCode - m16Start
- DW 8h
-_16Idtr FWORD (1 SHL 10) - 1
-_16Gdtr LABEL FWORD
- DW GdtEnd - _NullSegDesc - 1
-_16GdtrBase DD _NullSegDesc
-
-;------------------------------------------------------------------------------
-; _ToUserCode() takes control in real mode before passing control to user code.
-; It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_ToUserCode PROC
- mov edx, ss
- mov ss, ecx ; set new segment selectors
- mov ds, ecx
- mov es, ecx
- mov fs, ecx
- mov gs, ecx
- mov cr0, eax
- mov cr4, ebp ; real mode starts at next instruction
- 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)]
- popaw ; popad actually
- pop ds
- pop es
- pop fs
- pop gs
- popf ; popfd
- DB 66h ; Use 32-bit addressing for "retf" below
- retf ; transfer control to user code
-_ToUserCode ENDP
-
-_NullSegDesc DQ 0
-_16CsDesc LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_16DsDesc LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-GdtEnd LABEL QWORD
-
-;------------------------------------------------------------------------------
-; IA32_REGISTER_SET *
-; EFIAPI
-; InternalAsmThunk16 (
-; IN IA32_REGISTER_SET *RegisterSet,
-; IN OUT VOID *Transition
-; );
-;------------------------------------------------------------------------------
-InternalAsmThunk16 PROC USES ebp ebx esi edi ds es fs gs
- mov esi, [esp + 36] ; esi <- RegSet, the 1st parameter
- movzx edx, (IA32_REGS ptr [esi])._SS
- mov edi, (IA32_REGS ptr [esi])._ESP
- add edi, - (sizeof (IA32_REGS) + 4) ; reserve stack space
- mov ebx, edi ; ebx <- stack offset
- imul eax, edx, 16 ; eax <- edx * 16
- push sizeof (IA32_REGS) / 4
- add edi, eax ; edi <- linear address of 16-bit stack
- pop ecx
- rep movsd ; copy RegSet
- mov eax, [esp + 40] ; eax <- address of transition code
- mov esi, edx ; esi <- 16-bit stack segment
- lea edx, [eax + (SavedCr0 - m16Start)]
- mov ecx, eax
- and ecx, 0fh
- shl eax, 12
- lea ecx, [ecx + (_BackFromUserCode - m16Start)]
- mov ax, cx
- stosd ; [edi] <- return address of user code
- sgdt fword ptr [edx + (SavedGdt - SavedCr0)]
- sidt fword ptr [esp + 36] ; save IDT stack in argument space
- mov eax, cr0
- mov [edx], eax ; save CR0 in SavedCr0
- and eax, 7ffffffeh ; clear PE, PG bits
- mov ebp, cr4
- mov [edx + (SavedCr4 - SavedCr0)], ebp
- and ebp, 300h ; clear all but PCE and OSFXSR bits
- push 10h
- pop ecx ; ecx <- selector for data segments
- lgdt fword ptr [edx + (_16Gdtr - SavedCr0)]
- pushfd ; Save df/if indeed
- call fword ptr [edx + (_EntryPoint - SavedCr0)]
- popfd
- lidt fword ptr [esp + 36] ; restore protected mode IDTR
- lea eax, [ebp - sizeof (IA32_REGS)] ; eax <- the address of IA32_REGS
- ret
-InternalAsmThunk16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.S
deleted file mode 100644
index 9dd4ba9e88..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Wbinvd.Asm
-#
-# Abstract:
-#
-# AsmWbinvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWbinvd (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWbinvd)
-ASM_PFX(AsmWbinvd):
- wbinvd
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.asm
deleted file mode 100644
index 6da13b5ca3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; Wbinvd.Asm
-;
-; Abstract:
-;
-; AsmWbinvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .486p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWbinvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmWbinvd PROC
- wbinvd
- ret
-AsmWbinvd ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.c
deleted file mode 100644
index db7bc34246..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/Wbinvd.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmWbinvd function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWbinvd (
- VOID
- )
-{
- _asm {
- wbinvd
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.S
deleted file mode 100644
index bfedb2fcd6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr0.Asm
-#
-# Abstract:
-#
-# AsmWriteCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr0 (
-# IN UINTN Cr0
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- movl 4(%esp), %eax
- movl %eax, %cr0
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.asm
deleted file mode 100644
index b09de59300..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteCr0.Asm
-;
-; Abstract:
-;
-; AsmWriteCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr0 (
-; UINTN Cr0
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr0 PROC
- mov eax, [esp + 4]
- mov cr0, eax
- ret
-AsmWriteCr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.c
deleted file mode 100644
index 00c3fdd1a1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr0.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteCr0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteCr0 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr0, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.S
deleted file mode 100644
index 03da16665e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr2.Asm
-#
-# Abstract:
-#
-# AsmWriteCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr2 (
-# IN UINTN Cr2
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- movl 4(%esp), %eax
- movl %eax, %cr2
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.asm
deleted file mode 100644
index 629b8a8e11..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteCr2.Asm
-;
-; Abstract:
-;
-; AsmWriteCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr2 (
-; UINTN Cr2
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr2 PROC
- mov eax, [esp + 4]
- mov cr2, eax
- ret
-AsmWriteCr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.c
deleted file mode 100644
index 258aa436a4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteCr2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteCr2 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr2, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.S
deleted file mode 100644
index 9d5a3324c5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr3.Asm
-#
-# Abstract:
-#
-# AsmWriteCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr3 (
-# IN UINTN Cr3
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- movl 4(%esp), %eax
- movl %eax, %cr3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.asm
deleted file mode 100644
index 36042af313..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteCr3.Asm
-;
-; Abstract:
-;
-; AsmWriteCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr3 (
-; UINTN Cr3
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr3 PROC
- mov eax, [esp + 4]
- mov cr3, eax
- ret
-AsmWriteCr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.c
deleted file mode 100644
index f2301e02da..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr3.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteCr3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteCr3 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov cr3, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.S
deleted file mode 100644
index 6a4641b6c4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr4.Asm
-#
-# Abstract:
-#
-# AsmWriteCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr4 (
-# IN UINTN Cr4
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- movl 4(%esp), %eax
- movl %eax, %cr4
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.asm
deleted file mode 100644
index e83649ba4d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteCr4.Asm
-;
-; Abstract:
-;
-; AsmWriteCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr4 (
-; UINTN Cr4
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr4 PROC
- mov eax, [esp + 4]
- mov cr4, eax
- ret
-AsmWriteCr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.c
deleted file mode 100644
index 4ad9097b4f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteCr4.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- AsmWriteCr4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteCr4 (
- UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov cr4, eax
- _emit 0x22
- _emit 0xE0
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.S
deleted file mode 100644
index 791eb01e64..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr0.Asm
-#
-# Abstract:
-#
-# AsmWriteDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr0 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- movl 4(%esp), %eax
- movl %eax, %dr0
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.asm
deleted file mode 100644
index 8f60fc797a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr0.Asm
-;
-; Abstract:
-;
-; AsmWriteDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr0 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr0 PROC
- mov eax, [esp + 4]
- mov dr0, eax
- ret
-AsmWriteDr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.c
deleted file mode 100644
index c2716d6499..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr0.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr0 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr0, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.S
deleted file mode 100644
index e58e253e65..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr1.Asm
-#
-# Abstract:
-#
-# AsmWriteDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr1 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- movl 4(%esp), %eax
- movl %eax, %dr1
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.asm
deleted file mode 100644
index c65fb882fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr1.Asm
-;
-; Abstract:
-;
-; AsmWriteDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr1 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr1 PROC
- mov eax, [esp + 4]
- mov dr1, eax
- ret
-AsmWriteDr1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.c
deleted file mode 100644
index 73e12f889a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr1 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr1 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr1, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.S
deleted file mode 100644
index 7a25591e53..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr2.Asm
-#
-# Abstract:
-#
-# AsmWriteDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr2 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- movl 4(%esp), %eax
- movl %eax, %dr2
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.asm
deleted file mode 100644
index 36c17f38bb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr2.Asm
-;
-; Abstract:
-;
-; AsmWriteDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr2 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr2 PROC
- mov eax, [esp + 4]
- mov dr2, eax
- ret
-AsmWriteDr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.c
deleted file mode 100644
index 561c54d539..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr2 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr2, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.S
deleted file mode 100644
index a5d137d9d3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr3.Asm
-#
-# Abstract:
-#
-# AsmWriteDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr3 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- movl 4(%esp), %eax
- movl %eax, %dr3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.asm
deleted file mode 100644
index 15f5c3d561..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr3.Asm
-;
-; Abstract:
-;
-; AsmWriteDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr3 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr3 PROC
- mov eax, [esp + 4]
- mov dr3, eax
- ret
-AsmWriteDr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.c
deleted file mode 100644
index eccc370d9f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr3.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr3 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr3, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.S
deleted file mode 100644
index e09a9605f8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr4.Asm
-#
-# Abstract:
-#
-# AsmWriteDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr4 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- movl 4(%esp), %eax
- movl %eax, %dr4
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.asm
deleted file mode 100644
index dc8312e6f5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.asm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr4.Asm
-;
-; Abstract:
-;
-; AsmWriteDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr4 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr4 PROC
- mov eax, [esp + 4]
- ;
- ; DR4 is alias to DR6 only if DE (in CR4) is cleared. Otherwise, writing to
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0fh, 23h, 0e0h
- ret
-AsmWriteDr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.c
deleted file mode 100644
index 8e5c9aa7c1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr4.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- AsmWriteDr4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr4 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov dr4, eax
- _emit 0x23
- _emit 0xe0
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.S
deleted file mode 100644
index 3098bb6606..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr5.Asm
-#
-# Abstract:
-#
-# AsmWriteDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr5 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- movl 4(%esp), %eax
- movl %eax, %dr5
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.asm
deleted file mode 100644
index 00be9198e0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.asm
+++ /dev/null
@@ -1,48 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr5.Asm
-;
-; Abstract:
-;
-; AsmWriteDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr5 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr5 PROC
- mov eax, [esp + 4]
- ;
- ; DR5 is alias to DR7 only if DE (in CR4) is cleared. Otherwise, writing to
- ; this register will cause a #UD exception.
- ;
- ; MS assembler doesn't support this instruction since no one would use it
- ; under normal circustances. Here opcode is used.
- ;
- DB 0fh, 23h, 0e8h
- ret
-AsmWriteDr5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.c
deleted file mode 100644
index 3690d5ad8d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr5.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- AsmWriteDr5 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr5 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- _emit 0x0f // mov dr5, eax
- _emit 0x23
- _emit 0xe8
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.S
deleted file mode 100644
index c79e9e68e9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr6.Asm
-#
-# Abstract:
-#
-# AsmWriteDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr6 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- movl 4(%esp), %eax
- movl %eax, %dr6
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.asm
deleted file mode 100644
index 6df2460619..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr6.Asm
-;
-; Abstract:
-;
-; AsmWriteDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr6 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr6 PROC
- mov eax, [esp + 4]
- mov dr6, eax
- ret
-AsmWriteDr6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.c
deleted file mode 100644
index e15c87f38c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr6.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr6 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr6 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr6, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.S
deleted file mode 100644
index a683f6ef02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr7.Asm
-#
-# Abstract:
-#
-# AsmWriteDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr7 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- movl 4(%esp), %eax
- movl %eax, %dr7
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.asm
deleted file mode 100644
index 2afc4092ec..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteDr7.Asm
-;
-; Abstract:
-;
-; AsmWriteDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr7 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr7 PROC
- mov eax, [esp + 4]
- mov dr7, eax
- ret
-AsmWriteDr7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.c
deleted file mode 100644
index 551532d359..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteDr7.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteDr7 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINTN
-EFIAPI
-AsmWriteDr7 (
- IN UINTN Value
- )
-{
- _asm {
- mov eax, Value
- mov dr7, eax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.S
deleted file mode 100644
index 54350ee9fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteGdtr.Asm
-#
-# Abstract:
-#
-# InternalX86WriteGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- movl 4(%esp), %eax
- lgdt (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.asm
deleted file mode 100644
index 9bbbf8851e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteGdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteGdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86WriteGdtr PROC
- mov eax, [esp + 4]
- lgdt fword ptr [eax]
- ret
-InternalX86WriteGdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.c
deleted file mode 100644
index 24d151487d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteGdtr.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteGdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86WriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- _asm {
- mov eax, Gdtr
- lgdt fword ptr [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.S
deleted file mode 100644
index 426e42a7be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteIdtr.Asm
-#
-# Abstract:
-#
-# InternalX86WriteIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- movl 4(%esp), %eax
- lidt (%eax)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.asm
deleted file mode 100644
index e45afa7915..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteIdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteIdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86WriteIdtr PROC
- mov eax, [esp + 4]
- lidt fword ptr [eax]
- ret
-InternalX86WriteIdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.c
deleted file mode 100644
index b58f6a6c12..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteIdtr.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteIdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-InternalX86WriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- _asm {
- mov eax, Idtr
- lidt fword ptr [eax]
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.S
deleted file mode 100644
index a62c7ad3c8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteLdtr.Asm
-#
-# Abstract:
-#
-# AsmWriteLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteLdtr (
-# IN UINT16 Ldtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteLdtr)
-ASM_PFX(AsmWriteLdtr):
- movl 4(%esp), %eax
- lldtw %ax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.asm
deleted file mode 100644
index 0a1dae8f1b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteLdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386p
- .model flat
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteLdtr (
-; IN UINT16 Ldtr
-; );
-;------------------------------------------------------------------------------
-_AsmWriteLdtr PROC
- mov eax, [esp + 4]
- lldt ax
- ret
-_AsmWriteLdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.c
deleted file mode 100644
index b9934de1a0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteLdtr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- AsmWriteLdtr function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteLdtr (
- IN UINT16 Ldtr
- )
-{
- _asm {
- xor eax, eax
- mov ax, Ldtr
- lldt ax
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.S
deleted file mode 100644
index dcc6c76dff..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm0.Asm
-#
-# Abstract:
-#
-# AsmWriteMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm0 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm0)
-ASM_PFX(AsmWriteMm0):
- movq 4(%esp), %mm0
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.asm
deleted file mode 100644
index 949b1c380a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm0.Asm
-;
-; Abstract:
-;
-; AsmWriteMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm0 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm0 PROC
- movq mm0, [esp + 4]
- ret
-AsmWriteMm0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.c
deleted file mode 100644
index 3768e231f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm0.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteMm0 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm0 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm0, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.S
deleted file mode 100644
index f7206a3583..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm1.Asm
-#
-# Abstract:
-#
-# AsmWriteMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm1 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm1)
-ASM_PFX(AsmWriteMm1):
- movq 4(%esp), %mm1
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.asm
deleted file mode 100644
index 0393a8ec59..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm1.Asm
-;
-; Abstract:
-;
-; AsmWriteMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm1 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm1 PROC
- movq mm1, [esp + 4]
- ret
-AsmWriteMm1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.c
deleted file mode 100644
index e62bb34db6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteMm1 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm1 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm1, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.S
deleted file mode 100644
index 882f04c0c1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm2.Asm
-#
-# Abstract:
-#
-# AsmWriteMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm2 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- movq 4(%esp), %mm2
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.asm
deleted file mode 100644
index 07d762d7e9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm2.Asm
-;
-; Abstract:
-;
-; AsmWriteMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm2 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm2 PROC
- movq mm2, [esp + 4]
- ret
-AsmWriteMm2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.c
deleted file mode 100644
index d9c0ad2f7e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm2.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteMm2 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm2 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm2, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.S
deleted file mode 100644
index f2b229b77b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm3.Asm
-#
-# Abstract:
-#
-# AsmWriteMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm3 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- movq 4(%esp), %mm3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.asm
deleted file mode 100644
index 9eb5504fc8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm3.Asm
-;
-; Abstract:
-;
-; AsmWriteMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm3 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm3 PROC
- movq mm3, [esp + 4]
- ret
-AsmWriteMm3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.c
deleted file mode 100644
index a1c28583a9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm3.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteMm3 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm3 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm3, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.S
deleted file mode 100644
index 10c952d866..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm4.Asm
-#
-# Abstract:
-#
-# AsmWriteMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm4 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- movq 4(%esp), %mm4
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.asm
deleted file mode 100644
index adda5665e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm4.Asm
-;
-; Abstract:
-;
-; AsmWriteMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm4 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm4 PROC
- movq mm4, [esp + 4]
- ret
-AsmWriteMm4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.c
deleted file mode 100644
index 079432209b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm4.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmWriteMm4 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm4 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm4, qword ptr [Value]
- emms
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.S
deleted file mode 100644
index f20702d2de..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm5.Asm
-#
-# Abstract:
-#
-# AsmWriteMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm5 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- movq 4(%esp), %mm5
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.asm
deleted file mode 100644
index a0d50bac80..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm5.Asm
-;
-; Abstract:
-;
-; AsmWriteMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm5 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm5 PROC
- movq mm5, [esp + 4]
- ret
-AsmWriteMm5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.c
deleted file mode 100644
index d5481e7cfb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm5.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- AsmWriteMm5 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm5 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm5, qword ptr [Value]
- emms
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.S
deleted file mode 100644
index ec96949c7d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm6.Asm
-#
-# Abstract:
-#
-# AsmWriteMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm6 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- movq 4(%esp), %mm6
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.asm
deleted file mode 100644
index 8762b9998d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm6.Asm
-;
-; Abstract:
-;
-; AsmWriteMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm6 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm6 PROC
- movq mm6, [esp + 4]
- ret
-AsmWriteMm6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.c
deleted file mode 100644
index 9a4f3e44f5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm6.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- AsmWriteMm6 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm6 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm6, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.S
deleted file mode 100644
index c8b976d1d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm7.Asm
-#
-# Abstract:
-#
-# AsmWriteMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm7 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- movq 4(%esp), %mm7
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.asm
deleted file mode 100644
index 1fed061d71..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMm7.Asm
-;
-; Abstract:
-;
-; AsmWriteMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm7 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm7 PROC
- movq mm7, [esp + 4]
- ret
-AsmWriteMm7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.c
deleted file mode 100644
index 8acb7c7741..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMm7.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- WriteMm7.c
-
-Abstract:
-
-
---*/
-
-#include "BaseLibInternals.h"
-
-VOID
-EFIAPI
-AsmWriteMm7 (
- IN UINT64 Value
- )
-{
- _asm {
- movq mm7, qword ptr [Value]
- emms
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.S
deleted file mode 100644
index 15b6180e26..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMsr64.Asm
-#
-# Abstract:
-#
-# AsmWriteMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmWriteMsr64 (
-# IN UINT32 Index,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMsr64)
-ASM_PFX(AsmWriteMsr64):
- movl 12(%esp), %edx
- movl 8(%esp), %eax
- movl 4(%esp), %ecx
- wrmsr
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.asm
deleted file mode 100644
index c4a96cc98c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteMsr64.Asm
-;
-; Abstract:
-;
-; AsmWriteMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmWriteMsr64 (
-; IN UINT32 Index,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMsr64 PROC
- mov edx, [esp + 12]
- mov eax, [esp + 8]
- mov ecx, [esp + 4]
- wrmsr
- ret
-AsmWriteMsr64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.c
deleted file mode 100644
index 4d523ac3ec..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ia32/WriteMsr64.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- AsmWriteMsr64 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- _asm {
- mov edx, dword ptr [Value + 4]
- mov eax, dword ptr [Value + 0]
- mov ecx, Index
- wrmsr
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessDbr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessDbr.s
deleted file mode 100644
index d7855874e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessDbr.s
+++ /dev/null
@@ -1,117 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessDbr.s
-///
-///
-/// IPF specific Debug Breakpoint Registers accessing functions
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadDbr
-//
-// This routine is used to Reads the current value of Data Breakpoint Register (DBR).
-//
-// Arguments :
-//
-// On Entry : The 8-bit DBR index to read.
-//
-// Return Value: The current value of DBR by Index.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadDbr, @function
-.proc AsmReadDbr
-.regstk 1, 0, 0, 0
-
-AsmReadDbr::
- mov r8 = dbr[in0];;
- br.ret.dpnt b0;;
-.endp AsmReadDbr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteDbr
-//
-// This routine is used to write the current value to Data Breakpoint Register (DBR).
-//
-// Arguments :
-//
-// On Entry : The 8-bit DBR index to read.
-// The value should be written to DBR
-//
-// Return Value: The value written to DBR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteDbr, @function
-.proc AsmWriteDbr
-.regstk 2, 0, 0, 0
-
-AsmWriteDbr::
- mov dbr[in0] = in1
- mov r8 = in1;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteDbr
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIbr
-//
-// This routine is used to Reads the current value of Instruction Breakpoint Register (IBR).
-//
-// Arguments :
-//
-// On Entry : The 8-bit IBR index.
-//
-// Return Value: The current value of IBR by Index.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIbr, @function
-.proc AsmReadIbr
-.regstk 1, 0, 0, 0
-
-AsmReadIbr::
- mov r8 = ibr[in0];;
- br.ret.dpnt b0;;
-.endp AsmReadIbr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteIbr
-//
-// This routine is used to write the current value to Instruction Breakpoint Register (IBR).
-//
-// Arguments :
-//
-// On Entry : The 8-bit IBR index.
-// The value should be written to IBR
-//
-// Return Value: The value written to IBR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteIbr, @function
-.proc AsmWriteIbr
-.regstk 2, 0, 0, 0
-
-AsmWriteIbr::
- mov ibr[in0] = in1
- mov r8 = in1;;
- srlz.i;;
- br.ret.dpnt b0;;
-.endp AsmWriteIbr
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessEicr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessEicr.s
deleted file mode 100644
index fbb6fc6d1e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessEicr.s
+++ /dev/null
@@ -1,511 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessEicr.s
-///
-///
-/// IPF specific External Interrupt Control Registers accessing functions
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadLid
-//
-// This routine is used to read the value of Local Interrupt ID Register (LID).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of LID.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadLid, @function
-.proc AsmReadLid
-
-AsmReadLid::
- mov r8 = cr.lid;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmReadLid
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteLid
-//
-// This routine is used to write the value to Local Interrupt ID Register (LID).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to LID.
-//
-// Return Value: The value written to LID.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteLid, @function
-.proc AsmWriteLid
-.regstk 1, 0, 0, 0
-
-AsmWriteLid::
- mov cr.lid = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteLid
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIvr
-//
-// This routine is used to read the value of External Interrupt Vector Register (IVR).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IVR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIvr, @function
-.proc AsmReadIvr
-
-AsmReadIvr::
- mov r8 = cr.ivr;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmReadIvr
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadTpr
-//
-// This routine is used to read the value of Task Priority Register (TPR).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of TPR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadTpr, @function
-.proc AsmReadTpr
-
-AsmReadTpr::
- mov r8 = cr.tpr;;
- br.ret.dpnt b0;;
-.endp AsmReadTpr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteTpr
-//
-// This routine is used to write the value to Task Priority Register (TPR).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to TPR.
-//
-// Return Value: The value written to TPR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteTpr, @function
-.proc AsmWriteTpr
-.regstk 1, 0, 0, 0
-
-AsmWriteTpr::
- mov cr.tpr = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteTpr
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteEoi
-//
-// This routine is used to write the value to End of External Interrupt Register (EOI).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to EOI.
-//
-// Return Value: The value written to EOI.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteEoi, @function
-.proc AsmWriteEoi
-
-AsmWriteEoi::
- mov cr.eoi = r0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteEoi
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIrr0
-//
-// This routine is used to Read the value of External Interrupt Request Register 0 (IRR0).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IRR0.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIrr0, @function
-.proc AsmReadIrr0
-
-AsmReadIrr0::
- mov r8 = cr.irr0;;
- br.ret.dpnt b0;;
-.endp AsmReadIrr0
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIrr1
-//
-// This routine is used to Read the value of External Interrupt Request Register 1 (IRR1).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IRR1.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIrr1, @function
-.proc AsmReadIrr1
-
-AsmReadIrr1::
- mov r8 = cr.irr1;;
- br.ret.dpnt b0;;
-.endp AsmReadIrr1
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIrr2
-//
-// This routine is used to Read the value of External Interrupt Request Register 2 (IRR2).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IRR2.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIrr2, @function
-.proc AsmReadIrr2
-
-AsmReadIrr2::
- mov r8 = cr.irr2;;
- br.ret.dpnt b0;;
-.endp AsmReadIrr2
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIrr3
-//
-// This routine is used to Read the value of External Interrupt Request Register 3 (IRR3).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IRR3.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIrr3, @function
-.proc AsmReadIrr3
-
-AsmReadIrr3::
- mov r8 = cr.irr3;;
- br.ret.dpnt b0;;
-.endp AsmReadIrr3
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadItv
-//
-// This routine is used to Read the value of Interval Timer Vector Register (ITV).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of ITV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadItv, @function
-.proc AsmReadItv
-
-AsmReadItv::
- mov r8 = cr.itv;;
- br.ret.dpnt b0;;
-.endp AsmReadItv
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteItv
-//
-// This routine is used to write the value to Interval Timer Vector Register (ITV).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to ITV
-//
-// Return Value: The value written to ITV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteItv, @function
-.proc AsmWriteItv
-.regstk 1, 0, 0, 0
-
-AsmWriteItv::
- mov cr.itv = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteItv
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadPmv
-//
-// This routine is used to Read the value of Performance Monitoring Vector Register (PMV).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of PMV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadPmv, @function
-.proc AsmReadPmv
-
-AsmReadPmv::
- mov r8 = cr.pmv;;
- br.ret.dpnt b0;;
-.endp AsmReadPmv
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWritePmv
-//
-// This routine is used to write the value to Performance Monitoring Vector Register (PMV).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to PMV
-//
-// Return Value: The value written to PMV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWritePmv, @function
-.proc AsmWritePmv
-.regstk 1, 0, 0, 0
-
-AsmWritePmv::
- mov cr.pmv = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWritePmv
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadCmcv
-//
-// This routine is used to Read the value of Corrected Machine Check Vector Register (CMCV).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of CMCV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadCmcv, @function
-.proc AsmReadCmcv
-
-AsmReadCmcv::
- mov r8 = cr.cmcv;;
- br.ret.dpnt b0;;
-.endp AsmReadCmcv
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteCmcv
-//
-// This routine is used to write the value to Corrected Machine Check Vector Register (CMCV).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to CMCV
-//
-// Return Value: The value written to CMCV.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteCmcv, @function
-.proc AsmWriteCmcv
-.regstk 1, 0, 0, 0
-
-AsmWriteCmcv::
- mov cr.cmcv = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteCmcv
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadLrr0
-//
-// This routine is used to read the value of Local Redirection Register 0 (LRR0).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of LRR0.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadLrr0, @function
-.proc AsmReadLrr0
-
-AsmReadLrr0::
- mov r8 = cr.lrr0;;
- br.ret.dpnt b0;;
-.endp AsmReadLrr0
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteLrr0
-//
-// This routine is used to write the value to Local Redirection Register 0 (LRR0).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to LRR0.
-//
-// Return Value: The value written to LRR0.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteLrr0, @function
-.proc AsmWriteLrr0
-.regstk 1, 0, 0, 0
-
-AsmWriteLrr0::
- mov cr.lrr0 = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteLrr0
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadLrr1
-//
-// This routine is used to read the value of Local Redirection Register 1 (LRR1).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of LRR1.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadLrr1, @function
-.proc AsmReadLrr1
-
-AsmReadLrr1::
- mov r8 = cr.lrr1;;
- br.ret.dpnt b0;;
-.endp AsmReadLrr1
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteLrr1
-//
-// This routine is used to write the value to Local Redirection Register 1 (LRR1).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to LRR1.
-//
-// Return Value: The value written to LRR1.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteLrr1, @function
-.proc AsmWriteLrr1
-.regstk 1, 0, 0, 0
-
-AsmWriteLrr1::
- mov cr.lrr1 = in0
- mov r8 = in0;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteLrr1
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s
deleted file mode 100644
index 2cfefe70e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGcr.s
+++ /dev/null
@@ -1,263 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessGcr.s
-///
-///
-/// IPF specific Global Control Registers accessing functions
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadDcr
-//
-// This routine is used to Read the value of Default Control Register (DCR).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of DCR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadDcr, @function
-.proc AsmReadDcr
-
-AsmReadDcr::
- mov r8 = cr.dcr;;
- br.ret.dpnt b0;;
-.endp AsmReadDcr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteDcr
-//
-// This routine is used to write the value to Default Control Register (DCR).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to DCR
-//
-// Return Value: The value written to DCR.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteDcr, @function
-.proc AsmWriteDcr
-.regstk 1, 0, 0, 0
-
-AsmWriteDcr::
- mov cr.dcr = in0
- mov r8 = in0;;
- srlz.i;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWriteDcr
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadItc
-//
-// This routine is used to Read the value of Interval Timer Counter Register (ITC).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of ITC.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadItc, @function
-.proc AsmReadItc
-
-AsmReadItc::
- mov r8 = ar.itc;;
- br.ret.dpnt b0;;
-.endp AsmReadItc
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteItc
-//
-// This routine is used to write the value to Interval Timer Counter Register (ITC).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to the ITC
-//
-// Return Value: The value written to the ITC.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteItc, @function
-.proc AsmWriteItc
-.regstk 1, 0, 0, 0
-
-AsmWriteItc::
- mov ar.itc = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteItc
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadItm
-//
-// This routine is used to Read the value of Interval Timer Match Register (ITM).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of ITM.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadItm, @function
-.proc AsmReadItm
-
-AsmReadItm::
- mov r8 = cr.itm;;
- br.ret.dpnt b0;;
-.endp AsmReadItm
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteItm
-//
-// This routine is used to write the value to Interval Timer Match Register (ITM).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to ITM
-//
-// Return Value: The value written to ITM.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteItm, @function
-.proc AsmWriteItm
-.regstk 1, 0, 0, 0
-
-AsmWriteItm::
- mov cr.itm = in0
- mov r8 = in0;;
- srlz.d;
- br.ret.dpnt b0;;
-.endp AsmWriteItm
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadIva
-//
-// This routine is used to read the value of Interruption Vector Address Register (IVA).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of IVA.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadIva, @function
-.proc AsmReadIva
-
-AsmReadIva::
- mov r8 = cr.iva;;
- br.ret.dpnt b0;;
-.endp AsmReadIva
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteIva
-//
-// This routine is used to write the value to Interruption Vector Address Register (IVA).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to IVA
-//
-// Return Value: The value written to IVA.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteIva, @function
-.proc AsmWriteIva
-.regstk 1, 0, 0, 0
-
-AsmWriteIva::
- mov cr.iva = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteIva
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadPta
-//
-// This routine is used to read the value of Page Table Address Register (PTA).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current value of PTA.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadPta, @function
-.proc AsmReadPta
-
-AsmReadPta::
- mov r8 = cr.pta;;
- br.ret.dpnt b0;;
-.endp AsmReadPta
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWritePta
-//
-// This routine is used to write the value to Page Table Address Register (PTA)).
-//
-// Arguments :
-//
-// On Entry : The value need to be written to PTA
-//
-// Return Value: The value written to PTA.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWritePta, @function
-.proc AsmWritePta
-.regstk 1, 0, 0, 0
-
-AsmWritePta::
- mov cr.pta = in0
- mov r8 = in0;;
- srlz.i;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWritePta \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGp.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGp.s
deleted file mode 100644
index b2787d0e17..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessGp.s
+++ /dev/null
@@ -1,85 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessGp.s
-///
-///
-/// IPF specific Global Pointer and Stack Pointer accessing functions
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadGp
-//
-// This routine is used to read the current value of 64-bit Global Pointer (GP).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current GP value.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadGp, @function
-.proc AsmReadGp
-
-AsmReadGp::
- mov r8 = gp;;
- br.ret.dpnt b0;;
-.endp AsmReadGp
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteGp
-//
-// This routine is used to write the current value of 64-bit Global Pointer (GP).
-//
-// Arguments :
-//
-// On Entry : The value need to be written.
-//
-// Return Value: The value have been written.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteGp, @function
-.proc AsmWriteGp
-.regstk 1, 0, 0, 0
-
-AsmWriteGp::
- mov gp = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteGp
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadSp
-//
-// This routine is used to read the current value of 64-bit Stack Pointer (SP).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current SP value.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadSp, @function
-.proc AsmReadSp
-
-AsmReadSp::
- mov r8 = sp;;
- br.ret.dpnt b0;;
-.endp AsmReadSp
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessKr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessKr.s
deleted file mode 100644
index 80b9ee457a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessKr.s
+++ /dev/null
@@ -1,399 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessKr.s
-///
-///
-/// IPF specific AsmReadKrX() and AsmWriteKrX functions, 'X' is from '0' to '7'
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr0
-//
-// This routine is used to get KR0.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR0.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr0, @function
-.proc AsmReadKr0
-
-AsmReadKr0::
- mov r8 = ar.k0;;
- br.ret.dpnt b0;;
-.endp AsmReadKr0
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr0
-//
-// This routine is used to Write KR0.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR0.
-//
-//--
-//----------------------------------------------------------------------------------
-
-.text
-.type AsmWriteKr0, @function
-.proc AsmWriteKr0
-.regstk 1, 0, 0, 0
-
-AsmWriteKr0::
- mov ar.k0 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr0
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr1
-//
-// This routine is used to get KR1.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR1.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr1, @function
-.proc AsmReadKr1
-
-AsmReadKr1::
- mov r8 = ar.k1;;
- br.ret.dpnt b0;;
-.endp AsmReadKr1
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr1
-//
-// This routine is used to Write KR1.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR1.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr1, @function
-.proc AsmWriteKr1
-
-AsmWriteKr1::
- mov ar.k1 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr1
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr2
-//
-// This routine is used to get KR2.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR2.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr2, @function
-.proc AsmReadKr2
-
-AsmReadKr2::
- mov r8 = ar.k2;;
- br.ret.dpnt b0;;
-.endp AsmReadKr2
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr2
-//
-// This routine is used to Write KR2.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR2.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr2, @function
-.proc AsmWriteKr2
-
-AsmWriteKr2::
- mov ar.k2 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr2
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr3
-//
-// This routine is used to get KR3.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR3.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr3, @function
-.proc AsmReadKr3
-
-AsmReadKr3::
- mov r8 = ar.k3;;
- br.ret.dpnt b0;;
-.endp AsmReadKr3
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr3
-//
-// This routine is used to Write KR3.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR3.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr3, @function
-.proc AsmWriteKr3
-
-AsmWriteKr3::
- mov ar.k3 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr3
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr4
-//
-// This routine is used to get KR4.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR4.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr4, @function
-.proc AsmReadKr4
-
-AsmReadKr4::
- mov r8 = ar.k4;;
- br.ret.dpnt b0;;
-.endp AsmReadKr4
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr4
-//
-// This routine is used to Write KR4.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR4.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr4, @function
-.proc AsmWriteKr4
-
-AsmWriteKr4::
- mov ar.k4 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr4
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr5
-//
-// This routine is used to get KR5.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR5.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr5, @function
-.proc AsmReadKr5
-
-AsmReadKr5::
- mov r8 = ar.k5;;
- br.ret.dpnt b0;;
-.endp AsmReadKr5
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr5
-//
-// This routine is used to Write KR5.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR5.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr5, @function
-.proc AsmWriteKr5
-
-AsmWriteKr5::
- mov ar.k5 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr5
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr6
-//
-// This routine is used to get KR6.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR6.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr6, @function
-.proc AsmReadKr6
-
-AsmReadKr6::
- mov r8 = ar.k6;;
- br.ret.dpnt b0;;
-.endp AsmReadKr6
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr6
-//
-// This routine is used to write KR6.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR6.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr6, @function
-.proc AsmWriteKr6
-
-AsmWriteKr6::
- mov ar.k6 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr6
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr7
-//
-// This routine is used to get KR7.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value store in KR7.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadKr7, @function
-.proc AsmReadKr7
-
-AsmReadKr7::
- mov r8 = ar.k7;;
- br.ret.dpnt b0;;
-.endp AsmReadKr7
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr7
-//
-// This routine is used to write KR7.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: The value written to the KR7.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWriteKr7, @function
-.proc AsmWriteKr7
-
-AsmWriteKr7::
- mov ar.k7 = in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmWriteKr7
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPmr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPmr.s
deleted file mode 100644
index 1d657738bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPmr.s
+++ /dev/null
@@ -1,123 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessPmr.s
-///
-///
-/// IPF specific Performance Monitor Configuration/Data Registers accessing functions
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadPmc
-//
-// This routine is used to Reads the current value of Performance Monitor Configuration Register (PMC).
-//
-// Arguments :
-//
-// On Entry : The 8-bit PMC index.
-//
-// Return Value: The current value of PMC by Index.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadPmc, @function
-.proc AsmReadPmc
-.regstk 1, 0, 0, 0
-
-AsmReadPmc::
- srlz.i;;
- srlz.d;;
- mov r8 = pmc[in0];;
- br.ret.dpnt b0;;
-.endp AsmReadPmc
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWritePmc
-//
-// This routine is used to write the current value to a Performance Monitor Configuration Register (PMC).
-//
-// Arguments :
-//
-// On Entry : The 8-bit PMC index.
-// The value should be written to PMC
-//
-// Return Value: The value written to PMC.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWritePmc, @function
-.proc AsmWritePmc
-.regstk 2, 0, 0, 0
-
-AsmWritePmc::
- mov pmc[in0] = in1
- mov r8 = in1;;
- srlz.i;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWritePmc
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadPmd
-//
-// This routine is used to Reads the current value of Performance Monitor Data Register (PMD).
-//
-// Arguments :
-//
-// On Entry : The 8-bit PMD index.
-//
-// Return Value: The current value of PMD by Index.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadPmd, @function
-.proc AsmReadPmd
-.regstk 1, 0, 0, 0
-
-AsmReadPmd::
- srlz.i;;
- srlz.d;;
- mov r8 = pmd[in0];;
- br.ret.dpnt b0;;
-.endp AsmReadPmd
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWritePmd
-//
-// This routine is used to write the current value to Performance Monitor Data Register (PMD).
-//
-// Arguments :
-//
-// On Entry : The 8-bit PMD index.
-// The value should be written to PMD
-//
-// Return Value: The value written to PMD.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWritePmd, @function
-.proc AsmWritePmd
-.regstk 2, 0, 0, 0
-
-AsmWritePmd::
- mov pmd[in0] = in1
- mov r8 = in1;;
- srlz.i;;
- srlz.d;;
- br.ret.dpnt b0;;
-.endp AsmWritePmd
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPsr.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPsr.s
deleted file mode 100644
index cbd188abd1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AccessPsr.s
+++ /dev/null
@@ -1,110 +0,0 @@
-/// 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.
-///
-/// Module Name: AccessPsr.s
-///
-///
-/// IPF specific Processor Status Register accessing functions
-///
-
-#define CpuModeMask 0x0000001008020000
-
-#define CpuInVirtualMode 0x1
-#define CpuInPhysicalMode 0x0
-#define CpuInMixMode (0x0 - 0x1)
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadPsr
-//
-// This routine is used to read the current value of Processor Status Register (PSR).
-//
-// Arguments :
-//
-// On Entry :
-//
-// Return Value: The current PSR value.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadPsr, @function
-.proc AsmReadPsr
-
-AsmReadPsr::
- mov r8 = psr;;
- br.ret.dpnt b0;;
-.endp AsmReadPsr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWritePsr
-//
-// This routine is used to write the value of Processor Status Register (PSR).
-//
-// Arguments :
-//
-// On Entry : The value need to be written.
-//
-// Return Value: The value have been written.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmWritePsr, @function
-.proc AsmWritePsr
-.regstk 1, 0, 0, 0
-
-AsmWritePsr::
- mov psr.l = in0
- mov r8 = in0;;
- srlz.d;;
- srlz.i;;
- br.ret.dpnt b0;;
-.endp AsmWritePsr
-
-//---------------------------------------------------------------------------------
-//++
-// AsmCpuVirtual
-//
-// This routine is used to determines if the CPU is currently executing
-// in virtual, physical, or mixed mode.
-//
-// If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned.
-// If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned.
-// If the CPU is not in physical mode or virtual mode, then it is in mixed mode,
-// and -1 is returned.
-//
-// Arguments:
-//
-// On Entry: None
-//
-// Return Value: The CPU mode flag
-// return 1 The CPU is in virtual mode.
-// return 0 The CPU is in physical mode.
-// return -1 The CPU is in mixed mode.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmCpuVirtual, @function
-.proc AsmCpuVirtual
-
-AsmCpuVirtual::
- mov r29 = psr
- movl r30 = CpuModeMask;;
- and r28 = r30, r29;;
- cmp.eq p6, p7 = r30, r28;;
-(p6) mov r8 = CpuInVirtualMode;;
-(p6) br.ret.dpnt b0;;
-(p7) cmp.eq p6, p7 = 0x0, r28;;
-(p6) mov r8 = CpuInPhysicalMode;;
-(p7) mov r8 = CpuInMixMode;;
- br.ret.dpnt b0;;
-.endp AsmCpuVirtual \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AsmPalCall.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AsmPalCall.s
deleted file mode 100644
index 3e6fdc86ba..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/AsmPalCall.s
+++ /dev/null
@@ -1,158 +0,0 @@
-/// 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.
-///
-/// Module Name: AsmPalCall.s
-///
-///
-/// Contains an implementation of CallPalProcStacked on Itanium-based
-/// architecture.
-///
-
-
-
-//-----------------------------------------------------------------------------
-//++
-// AsmPalCall
-//
-// Makes a PAL procedure call.
-// This is function to make a PAL procedure call. Based on the Index
-// value this API will make static or stacked PAL call. The following table
-// describes the usage of PAL Procedure Index Assignment. Architected procedures
-// may be designated as required or optional. If a PAL procedure is specified
-// as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the
-// Status field of the PAL_CALL_RETURN structure.
-// This indicates that the procedure is not present in this PAL implementation.
-// It is the caller's responsibility to check for this return code after calling
-// any optional PAL procedure.
-// No parameter checking is performed on the 5 input parameters, but there are
-// some common rules that the caller should follow when making a PAL call. Any
-// address passed to PAL as buffers for return parameters must be 8-byte aligned.
-// Unaligned addresses may cause undefined results. For those parameters defined
-// as reserved or some fields defined as reserved must be zero filled or the invalid
-// argument return value may be returned or undefined result may occur during the
-// execution of the procedure. If the PalEntryPoint does not point to a valid
-// PAL entry point then the system behavior is undefined. This function is only
-// available on IPF.
-//
-// On Entry :
-// in0: PAL_PROC entrypoint
-// in1-in4 : PAL_PROC arguments
-//
-// Return Value:
-//
-// As per stacked calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-
-//
-// PAL function calls
-//
-#define PAL_MC_CLEAR_LOG 0x0015
-#define PAL_MC_DYNAMIC_STATE 0x0018
-#define PAL_MC_ERROR_INFO 0x0019
-#define PAL_MC_RESUME 0x001a
-
-
-.text
-.proc AsmPalCall
-.type AsmPalCall, @function
-
-AsmPalCall::
- alloc loc1 = ar.pfs,5,8,4,0
- mov loc0 = b0
- mov loc3 = b5
- mov loc4 = r2
- mov loc7 = r1
- mov r2 = psr;;
- mov r28 = in1
- mov loc5 = r2;;
-
- movl loc6 = 0x100;;
- cmp.ge p6,p7 = r28,loc6;;
-
-(p6) movl loc6 = 0x1FF;;
-(p7) br.dpnt.few PalCallStatic;; // 0 ~ 255 make a static Pal Call
-(p6) cmp.le p6,p7 = r28,loc6;;
-(p6) br.dpnt.few PalCallStacked;; // 256 ~ 511 make a stacked Pal Call
-(p7) movl loc6 = 0x300;;
-(p7) cmp.ge p6,p7 = r28,loc6;;
-(p7) br.dpnt.few PalCallStatic;; // 512 ~ 767 make a static Pal Call
-(p6) movl loc6 = 0x3FF;;
-(p6) cmp.le p6,p7 = r28,loc6;;
-(p6) br.dpnt.few PalCallStacked;; // 768 ~ 1023 make a stacked Pal Call
-
-(p7) mov r8 = 0xFFFFFFFFFFFFFFFF;; // > 1024 return invalid
-(p7) br.dpnt.few ComeBackFromPALCall;;
-
-PalCallStatic:
- movl loc6 = PAL_MC_CLEAR_LOG;;
- cmp.eq p6,p7 = r28,loc6;;
-
-(p7) movl loc6 = PAL_MC_DYNAMIC_STATE;;
-(p7) cmp.eq p6,p7 = r28,loc6;;
-
-(p7) movl loc6 = PAL_MC_ERROR_INFO;;
-(p7) cmp.eq p6,p7 = r28,loc6;;
-
-(p7) movl loc6 = PAL_MC_RESUME;;
-(p7) cmp.eq p6,p7 = r28,loc6 ;;
-
- mov loc6 = 0x1;;
-(p7) dep r2 = loc6,r2,13,1;; // psr.ic = 1
-
-// p6 will be true, if it is one of the MCHK calls. There has been lots of debate
-// on psr.ic for these values. For now, do not do any thing to psr.ic
-
- dep r2 = r0,r2,14,1;; // psr.i = 0
-
- mov psr.l = r2
- srlz.d // Needs data serailization.
- srlz.i // Needs instruction serailization.
-
-StaticGetPALLocalIP:
- mov loc2 = ip;;
- add loc2 = ComeBackFromPALCall - StaticGetPALLocalIP,loc2;;
- mov b0 = loc2 // return address after Pal call
-
- mov r29 = in2
- mov r30 = in3
- mov r31 = in4
- mov b5 = in0;; // get the PalProcEntrypt from input
- br.sptk b5;; // Take the plunge.
-
-PalCallStacked:
- dep r2 = r0,r2,14,1;; // psr.i = 0
- mov psr.l = r2;;
- srlz.d // Needs data serailization.
- srlz.i // Needs instruction serailization.
-
-StackedGetPALLocalIP:
- mov out0 = in1
- mov out1 = in2
- mov out2 = in3
- mov out3 = in4
- mov b5 = in0 ;; // get the PalProcEntrypt from input
- br.call.dpnt b0 = b5 ;; // Take the plunge.
-
-ComeBackFromPALCall:
- mov psr.l = loc5 ;;
- srlz.d // Needs data serailization.
- srlz.i // Needs instruction serailization.
-
- mov b5 = loc3
- mov r2 = loc4
- mov r1 = loc7
-
- mov b0 = loc0
- mov ar.pfs = loc1;;
- br.ret.dpnt b0;;
-
-.endp AsmPalCall
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpoint.c
deleted file mode 100644
index b99faa91d0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpoint.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- CpuBreakpint.c
-
-Abstract:
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __break (0);
-}
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- __mfa ();
-}
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- _disable ();
-}
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- _enable ();
-}
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- EnableInterrupts ();
- DisableInterrupts ();
-}
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
- PalCallStatic (NULL, 29, 0, 0, 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpointMsc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpointMsc.c
deleted file mode 100644
index 4171185088..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuBreakpointMsc.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
- Base Library CPU functions for Itanium
-
- Copyright (c) 2006 - 2011, 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 "BaseLibInternals.h"
-
-#pragma intrinsic (_enable)
-#pragma intrinsic (_disable)
-#pragma intrinsic (__break)
-#pragma intrinsic (__mfa)
-
-/**
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-**/
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __break (0);
-}
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- __mfa ();
-}
-
-/**
- Disables CPU interrupts.
-
- Disables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-DisableInterrupts (
- VOID
- )
-{
- _disable ();
-}
-
-/**
- Enables CPU interrupts.
-
- Enables CPU interrupts.
-
-**/
-VOID
-EFIAPI
-EnableInterrupts (
- VOID
- )
-{
- _enable ();
-}
-
-/**
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
- Enables CPU interrupts for the smallest window required to capture any
- pending interrupts.
-
-**/
-VOID
-EFIAPI
-EnableDisableInterrupts (
- VOID
- )
-{
- EnableInterrupts ();
- DisableInterrupts ();
-}
-
-/**
- Places the CPU in a sleep state until an interrupt is received.
-
- Places the CPU in a sleep state until an interrupt is received. If interrupts
- are disabled prior to calling this function, then the CPU will be placed in a
- sleep state indefinitely.
-
-**/
-VOID
-EFIAPI
-CpuSleep (
- VOID
- )
-{
- PalCallStatic (NULL, 29, 0, 0, 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuFlushTlb.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuFlushTlb.s
deleted file mode 100644
index 1b66ca65a9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuFlushTlb.s
+++ /dev/null
@@ -1,59 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// CpuFlushTlb.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.globl PalCallStatic
-.type PalCallStatic, @function
-
-.proc CpuFlushTlb
-.type CpuFlushTlb, @function
-CpuFlushTlb::
- alloc loc0 = ar.pfs, 0, 3, 5, 0
- mov out0 = 0
- mov out1 = 6
- mov out2 = 0
- mov out3 = 0
- mov loc1 = b0
- mov out4 = 0
- brl.call.sptk b0 = PalCallStatic
- mov loc2 = psr // save PSR
- mov ar.pfs = loc0
- extr.u r14 = r10, 32, 32 // r14 <- count1
- rsm 1 << 14 // Disable interrupts
- extr.u r15 = r11, 32, 32 // r15 <- stride1
- extr.u r10 = r10, 0, 32 // r10 <- count2
- add r10 = -1, r10
- extr.u r11 = r11, 0, 32 // r11 <- stride2
- br.cond.sptk LoopPredicate
-LoopOuter:
- mov ar.lc = r10 // LC <- count2
- mov ar.ec = r0 // EC <- 0
-Loop:
- ptc.e r9
- add r9 = r11, r9 // r9 += stride2
- br.ctop.sptk Loop
- add r9 = r15, r9 // r9 += stride1
-LoopPredicate:
- cmp.ne p6 = r0, r14 // count1 == 0?
- add r14 = -1, r14
-(p6) br.cond.sptk LoopOuter
- mov psr.l = loc2
- mov b0 = loc1
- br.ret.sptk.many b0
-.endp
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuPause.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuPause.s
deleted file mode 100644
index abbcb10c73..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/CpuPause.s
+++ /dev/null
@@ -1,26 +0,0 @@
-/// Copyright (c) 2004 - 2011, 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.
-///
-/// Module Name:
-///
-/// CpuPause.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc CpuPause
-.type CpuPause, @function
-CpuPause::
- hint.i @pause
- br.ret.sptk.many b0
-.endp
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ExecFc.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ExecFc.s
deleted file mode 100644
index 7f555ee7d1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ExecFc.s
+++ /dev/null
@@ -1,66 +0,0 @@
-/// 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.
-///
-/// Module Name: ExecFc.s
-///
-///
-/// IPF specific AsmFc() and AsmFci () functions
-///
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmFc
-//
-// This routine is used to execute a FC instruction on the specific address.
-//
-// Arguments :
-//
-// On Entry : The specific address need to execute FC instruction.
-//
-// Return Value: The specific address have been execute FC instruction.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmFc, @function
-.proc AsmFc
-.regstk 1, 0, 0, 0
-
-AsmFc::
- fc in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmFc
-
-
-//---------------------------------------------------------------------------------
-//++
-// AsmFci
-//
-// This routine is used to execute a FC.i instruction on the specific address.
-//
-// Arguments :
-//
-// On Entry : The specific address need to execute FC.i instruction.
-//
-// Return Value: The specific address have been execute FC.i instruction.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmFci, @function
-.proc AsmFci
-.regstk 1, 0, 0, 0
-
-AsmFci::
- fc.i in0
- mov r8 = in0;;
- br.ret.dpnt b0;;
-.endp AsmFci \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/FlushCacheRange.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/FlushCacheRange.s
deleted file mode 100644
index 38531bc1e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/FlushCacheRange.s
+++ /dev/null
@@ -1,95 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// FlushCacheRange.s
-///
-/// Abstract:
-///
-///
-
-.file "IpfCpuCache.s"
-
-#include "IpfMacro.i"
-#include "IpfDefines.h"
-
-//
-// Invalidates a range of instruction cache lines in the cache coherency domain
-// of the calling CPU.
-//
-// Invalidates the instruction cache lines specified by Address and Length. If
-// Address is not aligned on a cache line boundary, then entire instruction
-// cache line containing Address is invalidated. If Address + Length is not
-// aligned on a cache line boundary, then the entire instruction cache line
-// containing Address + Length -1 is invalidated. This function may choose to
-// invalidate the entire instruction cache if that is more efficient than
-// invalidating the specified range. If Length is 0, the no instruction cache
-// lines are invalidated. Address is returned.
-// This function is only available on IPF.
-//
-// If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
-//
-// @param Address The base address of the instruction cache lines to
-// invalidate. If the CPU is in a physical addressing mode, then
-// Address is a physical address. If the CPU is in a virtual
-// addressing mode, then Address is a virtual address.
-//
-// @param Length The number of bytes to invalidate from the instruction cache.
-//
-// @return Address
-//
-// VOID *
-// EFIAPI
-// AsmFlushCacheRange (
-// IN VOID *Address,
-// IN UINTN Length
-// );
-//
-PROCEDURE_ENTRY (AsmFlushCacheRange)
-
- NESTED_SETUP (5,8,0,0)
-
- mov loc2 = ar.lc
-
- mov loc3 = in0 // Start address.
- mov loc4 = in1;; // Length in bytes.
-
- cmp.eq p6,p7 = loc4, r0;; // If Length is zero then don't flush any cache
- (p6) br.spnt.many DoneFlushingC;;
-
- add loc4 = loc4,loc3
- mov loc5 = 1;;
- sub loc4 = loc4, loc5 ;; // the End address to flush
-
- dep loc3 = r0,loc3,0,5
- dep loc4 = r0,loc4,0,5;;
- shr loc3 = loc3,5
- shr loc4 = loc4,5;; // 32 byte cache line
-
- sub loc4 = loc4,loc3;; // total flush count, It should be add 1 but
- // the br.cloop will first execute one time
- mov loc3 = in0
- mov loc5 = 32
- mov ar.lc = loc4;;
-
-StillFlushingC:
- fc loc3;;
- sync.i;;
- srlz.i;;
- add loc3 = loc5,loc3;;
- br.cloop.sptk.few StillFlushingC;;
-
-DoneFlushingC:
- mov ar.lc = loc2
- mov r8 = in0 // return *Address
- NESTED_RETURN
-
-PROCEDURE_EXIT (AsmFlushCacheRange)
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/GetInterruptState.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/GetInterruptState.s
deleted file mode 100644
index 8716cc5178..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/GetInterruptState.s
+++ /dev/null
@@ -1,27 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// GetInterruptState.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc GlueGetInterruptState
-.type GlueGetInterruptState, @function
-GlueGetInterruptState::
- mov r8 = psr
- extr.u r8 = r8, 14, 1
- br.ret.sptk.many b0
-.endp GlueGetInterruptState
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange32.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange32.s
deleted file mode 100644
index 5572282070..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange32.s
+++ /dev/null
@@ -1,29 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// InterlockedCompareExchange32.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc InternalSyncCompareExchange32
-.type InternalSyncCompareExchange32, @function
-InternalSyncCompareExchange32::
- zxt4 r33 = r33
- mov ar.ccv = r33
- cmpxchg4.rel r8 = [r32], r34
- mf
- br.ret.sptk.many b0
-.endp InternalSyncCompareExchange32 \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange64.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange64.s
deleted file mode 100644
index ce4f3b7c11..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InterlockedCompareExchange64.s
+++ /dev/null
@@ -1,28 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// InterlockedCompareExchange64.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc InternalSyncCompareExchange64
-.type InternalSyncCompareExchange64, @function
-InternalSyncCompareExchange64::
- mov ar.ccv = r33
- cmpxchg8.rel r8 = [r32], r34
- mf
- br.ret.sptk.many b0
-.endp InternalSyncCompareExchange64 \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InternalSwitchStack.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InternalSwitchStack.c
deleted file mode 100644
index 3ed934a669..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/InternalSwitchStack.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- SwitchStack() function for IPF.
-
- 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.
-
- Module Name: InternalSwitchStack.c
-
-**/
-
-#include <BaseLibInternals.h>
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return.
- Marker will be ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
- @param Marker VA_LIST marker for the variable argument list.
-
-**/
-VOID
-EFIAPI
-InternalSwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- IN VA_LIST Marker
- )
-
-{
- VOID *NewBsp;
-
- //
- // Get new backing store pointer from variable list
- //
- NewBsp = VA_ARG (Marker, VOID *);
-
- //
- // Stack should be aligned with CPU_STACK_ALIGNMENT
- //
- ASSERT (((UINTN)NewStack & (CPU_STACK_ALIGNMENT - 1)) == 0);
- ASSERT (((UINTN)NewBsp & (CPU_STACK_ALIGNMENT - 1)) == 0);
-
- AsmSwitchStackAndBackingStore (EntryPoint, Context1, Context2, NewStack, NewBsp);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/PalCallStatic.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/PalCallStatic.s
deleted file mode 100644
index 98fdd9e995..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/PalCallStatic.s
+++ /dev/null
@@ -1,48 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// PalCallStatic.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc PalCallStatic
-.type PalCallStatic, @function
-.regstk 5, 0, 0, 0
-PalCallStatic::
- cmp.eq p15 = in0, r0
- mov r31 = in4
- mov r8 = ip
-
-(p15) mov in0 = ar.k5
- add r8 = (_PalProcReturn - PalCallStatic), r8
- mov r30 = in3
-
- mov in4 = psr
- mov in3 = b0
- mov b7 = in0
-
- rsm 1 << 14 // Disable interrupts
- mov r29 = in2
- mov r28 = in1
-
- mov b0 = r8
- br.cond.sptk.many b7
-
-_PalProcReturn:
- mov psr.l = in4
- mov b0 = in3
- br.ret.sptk.many b0
-.endp PalCallStatic
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ReadCpuid.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ReadCpuid.s
deleted file mode 100644
index ff610c546c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ReadCpuid.s
+++ /dev/null
@@ -1,39 +0,0 @@
-/// 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.
-///
-/// Module Name: ReadCpuid.s
-///
-///
-/// IPF specific AsmReadCpuid()function
-///
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadCpuid
-//
-// This routine is used to Reads the current value of Processor Identifier Register (CPUID).
-//
-// Arguments :
-//
-// On Entry : The 8-bit Processor Identifier Register index to read.
-//
-// Return Value: The current value of Processor Identifier Register specified by Index.
-//
-//--
-//----------------------------------------------------------------------------------
-.text
-.type AsmReadCpuid, @function
-.proc AsmReadCpuid
-.regstk 1, 0, 0, 0
-
-AsmReadCpuid::
- mov r8 = cpuid[in0];;
- br.ret.dpnt b0;;
-.endp AsmReadCpuid
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/SwitchStack.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/SwitchStack.s
deleted file mode 100644
index f04cdbbd99..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/SwitchStack.s
+++ /dev/null
@@ -1,51 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// SwitchStack.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc AsmSwitchStackAndBackingStore
-.type AsmSwitchStackAndBackingStore, @function
-.regstk 5, 0, 0, 0
-AsmSwitchStackAndBackingStore::
- mov r14 = ar.rsc
- movl r2 = ~((((1 << 14) - 1) << 16) | 3)
-
- mov r17 = in1
- mov r18 = in2
- and r2 = r14, r2
-
- mov ar.rsc = r2
- mov sp = in3
- mov r19 = in4
-
- ld8.nt1 r16 = [in0], 8
- ld8.nta gp = [in0]
- mov r3 = -1
-
- loadrs
- mov ar.bspstore = r19
- mov b7 = r16
-
- alloc r2 = ar.pfs, 0, 0, 2, 0
- mov out0 = r17
- mov out1 = r18
-
- mov ar.rnat = r3
- mov ar.rsc = r14
- br.call.sptk.many b0 = b7
-.endp AsmSwitchStackAndBackingStore
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Synchronization.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Synchronization.c
deleted file mode 100644
index dce24695e3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Synchronization.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Synchronization.c
-
-Abstract:
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncIncrement (
- IN volatile UINT32 *Value
- )
-{
- UINT32 OriginalValue;
-
- do {
- OriginalValue = *Value;
- } while (OriginalValue != InternalSyncCompareExchange32 (
- Value,
- OriginalValue,
- OriginalValue + 1
- ));
- return OriginalValue + 1;
-}
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decrement value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decrement value.
-
-**/
-UINT32
-EFIAPI
-InternalSyncDecrement (
- IN volatile UINT32 *Value
- )
-{
- UINT32 OriginalValue;
-
- do {
- OriginalValue = *Value;
- } while (OriginalValue != InternalSyncCompareExchange32 (
- Value,
- OriginalValue,
- OriginalValue - 1
- ));
- return OriginalValue - 1;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Unaligned.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Unaligned.c
deleted file mode 100644
index 14512dc91f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/Unaligned.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Unaligned.c
-
-Abstract:
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
-
- @return *Uint16
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return (UINT16)(((UINT8*)Buffer)[0] | (((UINT8*)Buffer)[1] << 8));
-}
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- ((UINT8*)Buffer)[0] = (UINT8)Value;
- ((UINT8*)Buffer)[1] = (UINT8)(Value >> 8);
-
- return Value;
-}
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return (UINT32)(
- ReadUnaligned16 ((UINT16*)Buffer) |
- (((UINT8*)Buffer)[2] << 16)
- );
-}
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The value written.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
- *(UINT8*)((UINT16*)Buffer + 1) = (UINT8)(Value >> 16);
- return Value;
-}
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
-
- @return *Uint32
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Buffer
- )
-{
- UINT16 LowerBytes;
- UINT16 HigherBytes;
-
- ASSERT (Buffer != NULL);
-
- LowerBytes = ReadUnaligned16 ((UINT16*) Buffer);
- HigherBytes = ReadUnaligned16 ((UINT16*) Buffer + 1);
-
- return (UINT32) (LowerBytes | (HigherBytes << 16));
-}
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
- @param Value 32-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned16 ((UINT16*)Buffer, (UINT16)Value);
- WriteUnaligned16 ((UINT16*)Buffer + 1, (UINT16)(Value >> 16));
- return Value;
-}
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
-
- @return *Uint64
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Buffer
- )
-{
- UINT32 LowerBytes;
- UINT32 HigherBytes;
-
- ASSERT (Buffer != NULL);
-
- LowerBytes = ReadUnaligned32 ((UINT32*) Buffer);
- HigherBytes = ReadUnaligned32 ((UINT32*) Buffer + 1);
-
- return (UINT64) (LowerBytes | LShiftU64 (HigherBytes, 32));
-}
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
- @param Value 64-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- WriteUnaligned32 ((UINT32*)Buffer, (UINT32)Value);
- WriteUnaligned32 ((UINT32*)Buffer + 1, (UINT32)RShiftU64 (Value, 32));
- return Value;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/asm.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/asm.h
deleted file mode 100644
index 53ea80907b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/asm.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- asm.h
-
-Abstract:
-
---*/
-
-#ifndef _ASM_H
-#define _ASM_H
-
-#define TRUE 1
-#define FALSE 0
-#define PROCEDURE_ENTRY(name) .##text; \
- .##type name, @function; \
- .##proc name; \
- name::
-
-#define PROCEDURE_EXIT(name) .##endp name
-
-#endif // _ASM_H
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ia_64gen.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ia_64gen.h
deleted file mode 100644
index 92f0733256..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/ia_64gen.h
+++ /dev/null
@@ -1,211 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- asm.h
-
-Abstract:
-
---*/
-
-#ifndef _IA64GEN_H
-#define _IA64GEN_H
-
-#define TT_UNAT 0
-#define C_PSR 0
-#define J_UNAT 0
-#define T_TYPE 0
-#define T_IPSR 0x8
-#define T_ISR 0x10
-#define T_IIP 0x18
-#define T_IFA 0x20
-#define T_IIPA 0x28
-#define T_IFS 0x30
-#define T_IIM 0x38
-#define T_RSC 0x40
-#define T_BSP 0x48
-#define T_BSPSTORE 0x50
-#define T_RNAT 0x58
-#define T_PFS 0x60
-#define T_KBSPSTORE 0x68
-#define T_UNAT 0x70
-#define T_CCV 0x78
-#define T_DCR 0x80
-#define T_PREDS 0x88
-#define T_NATS 0x90
-#define T_R1 0x98
-#define T_GP 0x98
-#define T_R2 0xa0
-#define T_R3 0xa8
-#define T_R4 0xb0
-#define T_R5 0xb8
-#define T_R6 0xc0
-#define T_R7 0xc8
-#define T_R8 0xd0
-#define T_R9 0xd8
-#define T_R10 0xe0
-#define T_R11 0xe8
-#define T_R12 0xf0
-#define T_SP 0xf0
-#define T_R13 0xf8
-#define T_R14 0x100
-#define T_R15 0x108
-#define T_R16 0x110
-#define T_R17 0x118
-#define T_R18 0x120
-#define T_R19 0x128
-#define T_R20 0x130
-#define T_R21 0x138
-#define T_R22 0x140
-#define T_R23 0x148
-#define T_R24 0x150
-#define T_R25 0x158
-#define T_R26 0x160
-#define T_R27 0x168
-#define T_R28 0x170
-#define T_R29 0x178
-#define T_R30 0x180
-#define T_R31 0x188
-#define T_F2 0x1f0
-#define T_F3 0x200
-#define T_F4 0x210
-#define T_F5 0x220
-#define T_F6 0x230
-#define T_F7 0x240
-#define T_F8 0x250
-#define T_F9 0x260
-#define T_F10 0x270
-#define T_F11 0x280
-#define T_F12 0x290
-#define T_F13 0x2a0
-#define T_F14 0x2b0
-#define T_F15 0x2c0
-#define T_F16 0x2d0
-#define T_F17 0x2e0
-#define T_F18 0x2f0
-#define T_F19 0x300
-#define T_F20 0x310
-#define T_F21 0x320
-#define T_F22 0x330
-#define T_F23 0x340
-#define T_F24 0x350
-#define T_F25 0x360
-#define T_F26 0x370
-#define T_F27 0x380
-#define T_F28 0x390
-#define T_F29 0x3a0
-#define T_F30 0x3b0
-#define T_F31 0x3c0
-#define T_FPSR 0x1e0
-#define T_B0 0x190
-#define T_B1 0x198
-#define T_B2 0x1a0
-#define T_B3 0x1a8
-#define T_B4 0x1b0
-#define T_B5 0x1b8
-#define T_B6 0x1c0
-#define T_B7 0x1c8
-#define T_EC 0x1d0
-#define T_LC 0x1d8
-#define J_NATS 0x8
-#define J_PFS 0x10
-#define J_BSP 0x18
-#define J_RNAT 0x20
-#define J_PREDS 0x28
-#define J_LC 0x30
-#define J_R4 0x38
-#define J_R5 0x40
-#define J_R6 0x48
-#define J_R7 0x50
-#define J_SP 0x58
-#define J_F2 0x60
-#define J_F3 0x70
-#define J_F4 0x80
-#define J_F5 0x90
-#define J_F16 0xa0
-#define J_F17 0xb0
-#define J_F18 0xc0
-#define J_F19 0xd0
-#define J_F20 0xe0
-#define J_F21 0xf0
-#define J_F22 0x100
-#define J_F23 0x110
-#define J_F24 0x120
-#define J_F25 0x130
-#define J_F26 0x140
-#define J_F27 0x150
-#define J_F28 0x160
-#define J_F29 0x170
-#define J_F30 0x180
-#define J_F31 0x190
-#define J_FPSR 0x1a0
-#define J_B0 0x1a8
-#define J_B1 0x1b0
-#define J_B2 0x1b8
-#define J_B3 0x1c0
-#define J_B4 0x1c8
-#define J_B5 0x1d0
-#define TRAP_FRAME_LENGTH 0x3d0
-#define C_UNAT 0x28
-#define C_NATS 0x30
-#define C_PFS 0x8
-#define C_BSPSTORE 0x10
-#define C_RNAT 0x18
-#define C_RSC 0x20
-#define C_PREDS 0x38
-#define C_LC 0x40
-#define C_DCR 0x48
-#define C_R1 0x50
-#define C_GP 0x50
-#define C_R4 0x58
-#define C_R5 0x60
-#define C_R6 0x68
-#define C_R7 0x70
-#define C_SP 0x78
-#define C_R13 0x80
-#define C_F2 0x90
-#define C_F3 0xa0
-#define C_F4 0xb0
-#define C_F5 0xc0
-#define C_F16 0xd0
-#define C_F17 0xe0
-#define C_F18 0xf0
-#define C_F19 0x100
-#define C_F20 0x110
-#define C_F21 0x120
-#define C_F22 0x130
-#define C_F23 0x140
-#define C_F24 0x150
-#define C_F25 0x160
-#define C_F26 0x170
-#define C_F27 0x180
-#define C_F28 0x190
-#define C_F29 0x1a0
-#define C_F30 0x1b0
-#define C_F31 0x1c0
-#define C_FPSR 0x1d0
-#define C_B0 0x1d8
-#define C_B1 0x1e0
-#define C_B2 0x1e8
-#define C_B3 0x1f0
-#define C_B4 0x1f8
-#define C_B5 0x200
-#define TT_R2 0x8
-#define TT_R3 0x10
-#define TT_R8 0x18
-#define TT_R9 0x20
-#define TT_R10 0x28
-#define TT_R11 0x30
-#define TT_R14 0x38
-
-#endif _IA64GEN_H
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/longjmp.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/longjmp.s
deleted file mode 100644
index 9da5095872..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/longjmp.s
+++ /dev/null
@@ -1,122 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// longjmp.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.proc InternalLongJump
-.type InternalLongJump, @function
-.regstk 2, 0, 0, 0
-InternalLongJump::
- add r10 = 0x10*20 + 8*14, in0
- movl r2 = ~((((1 << 14) - 1) << 16) | 3)
-
- ld8.nt1 r14 = [r10], -8*2 // BSP, skip PFS
- mov r15 = ar.bspstore // BSPSTORE
-
- ld8.nt1 r17 = [r10], -8 // UNAT after spill
- mov r16 = ar.rsc // RSC
- cmp.leu p6 = r14, r15
-
- ld8.nt1 r18 = [r10], -8 // UNAT
- ld8.nt1 r25 = [r10], -8 // b5
- and r2 = r16, r2
-
- ldf.fill.nt1 f2 = [in0], 0x10
- ld8.nt1 r24 = [r10], -8 // b4
- mov b5 = r25
-
- mov ar.rsc = r2
- ld8.nt1 r23 = [r10], -8 // b3
- mov b4 = r24
-
- ldf.fill.nt1 f3 = [in0], 0x10
- mov ar.unat = r17
-(p6) br.spnt.many _skip_flushrs
-
- flushrs
- mov r15 = ar.bsp // New BSPSTORE
-
-_skip_flushrs:
- mov r31 = ar.rnat // RNAT
- loadrs
-
- ldf.fill.nt1 f4 = [in0], 0x10
- ld8.nt1 r22 = [r10], -8
- dep r2 = -1, r14, 3, 6
-
- ldf.fill.nt1 f5 = [in0], 0x10
- ld8.nt1 r21 = [r10], -8
- cmp.ltu p6 = r2, r15
-
- ld8.nt1 r20 = [r10], -0x10 // skip sp
-(p6) ld8.nta r31 = [r2]
- mov b3 = r23
-
- ldf.fill.nt1 f16 = [in0], 0x10
- ld8.fill.nt1 r7 = [r10], -8
- mov b2 = r22
-
- ldf.fill.nt1 f17 = [in0], 0x10
- ld8.fill.nt1 r6 = [r10], -8
- mov b1 = r21
-
- ldf.fill.nt1 f18 = [in0], 0x10
- ld8.fill.nt1 r5 = [r10], -8
- mov b0 = r20
-
- ldf.fill.nt1 f19 = [in0], 0x10
- ld8.fill.nt1 r4 = [r10], 8*13
-
- ldf.fill.nt1 f20 = [in0], 0x10
- ld8.nt1 r19 = [r10], 0x10 // PFS
-
- ldf.fill.nt1 f21 = [in0], 0x10
- ld8.nt1 r26 = [r10], 8 // Predicate
- mov ar.pfs = r19
-
- ldf.fill.nt1 f22 = [in0], 0x10
- ld8.nt1 r27 = [r10], 8 // LC
- mov pr = r26, -1
-
- ldf.fill.nt1 f23 = [in0], 0x10
- ld8.nt1 r28 = [r10], -17*8 - 0x10
- mov ar.lc = r27
-
- ldf.fill.nt1 f24 = [in0], 0x10
- ldf.fill.nt1 f25 = [in0], 0x10
- mov r8 = in1
-
- ldf.fill.nt1 f26 = [in0], 0x10
- ldf.fill.nt1 f31 = [r10], -0x10
-
- ldf.fill.nt1 f27 = [in0], 0x10
- ldf.fill.nt1 f30 = [r10], -0x10
-
- ldf.fill.nt1 f28 = [in0]
- ldf.fill.nt1 f29 = [r10], 0x10*3 + 8*4
-
- ld8.fill.nt1 sp = [r10]
- mov ar.unat = r18
-
- mov ar.bspstore = r14
- mov ar.rnat = r31
-
- invala
- mov ar.rsc = r16
- br.ret.sptk b0
-.endp
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/setjmp.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/setjmp.s
deleted file mode 100644
index ead46e0a26..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Ipf/setjmp.s
+++ /dev/null
@@ -1,109 +0,0 @@
-/// Copyright (c) 2004, 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.
-///
-/// Module Name:
-///
-/// setjmp.s
-///
-/// Abstract:
-///
-///
-
-.auto
-.text
-
-.globl InternalAssertJumpBuffer
-.type InternalAssertJumpBuffer, @function
-
-.proc SetJump
-.type SetJump, @function
-SetJump::
- alloc loc0 = ar.pfs, 1, 2, 1, 0
- mov loc1 = b0
- mov out0 = in0
-
- brl.call.sptk.many b0 = InternalAssertJumpBuffer
-
- mov r14 = ar.unat
- mov r15 = ar.bsp
- add r10 = 0x10*20, in0
-
- stf.spill.nta [in0] = f2, 0x10
- st8.spill.nta [r10] = r4, 8
- mov r21 = b1
-
- stf.spill.nta [in0] = f3, 0x10
- st8.spill.nta [r10] = r5, 8
- mov r22 = b2
-
- stf.spill.nta [in0] = f4, 0x10
- st8.spill.nta [r10] = r6, 8
- mov r23 = b3
-
- stf.spill.nta [in0] = f5, 0x10
- st8.spill.nta [r10] = r7, 8
- mov r24 = b4
-
- stf.spill.nta [in0] = f16, 0x10
- st8.spill.nta [r10] = sp, 8
- mov r25 = b5
-
- stf.spill.nta [in0] = f17, 0x10
- st8.nta [r10] = loc1, 8
- mov r16 = pr
-
- stf.spill.nta [in0] = f18, 0x10
- st8.nta [r10] = r21, 8
- mov r17 = ar.lc
-
- stf.spill.nta [in0] = f19, 0x10
- st8.nta [r10] = r22, 8
-
- stf.spill.nta [in0] = f20, 0x10
- st8.nta [r10] = r23, 8
-
- stf.spill.nta [in0] = f21, 0x10
- st8.nta [r10] = r24, 8
-
- stf.spill.nta [in0] = f22, 0x10
- st8.nta [r10] = r25, 8
-
- stf.spill.nta [in0] = f23, 0x10
- mov r18 = ar.unat
-
- stf.spill.nta [in0] = f24, 0x10
- st8.nta [r10] = r14, 8 // UNAT
-
- stf.spill.nta [in0] = f25, 0x10
- st8.nta [r10] = r18, 8 // UNAT after spill
-
- stf.spill.nta [in0] = f26, 0x10
- st8.nta [r10] = loc0, 8 // PFS
-
- stf.spill.nta [in0] = f27, 0x10
- st8.nta [r10] = r15, 8 // BSP
- mov r8 = 0
-
- stf.spill.nta [in0] = f28, 0x10
- mov r19 = ar.fpsr
-
- stf.spill.nta [in0] = f29, 0x10
- st8.nta [r10] = r16, 8 // PR
- mov ar.pfs = loc0
-
- stf.spill.nta [in0] = f30, 0x10
- st8.nta [r10] = r17, 8 // LC
- mov b0 = loc1
-
- stf.spill.nta [in0] = f31, 0x10
- st8.nta [r10] = r19 // FPSR
-
- mov ar.unat = r14
- br.ret.sptk b0
-.endp SetJump
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU32.c
deleted file mode 100644
index 968fcf1087..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LRotU32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 32-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT32
-EFIAPI
-LRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return (Operand << Count) | (Operand >> (32 - Count));
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU64.c
deleted file mode 100644
index e48fb8d4f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LRotU64.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LRotU64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits
- with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-LRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return InternalMathLRotU64 (Operand, Count);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LShiftU64.c
deleted file mode 100644
index fa0cbc4601..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LShiftU64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LShiftU64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled
- with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-GlueLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return InternalMathLShiftU64 (Operand, Count);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LinkedList.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LinkedList.c
deleted file mode 100644
index 13f86f0c9a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LinkedList.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LinkedList.c
-
-Abstract:
-
- Linked List Library Functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that locates the Node in the List
-
- By searching the List, finds the location of the Node in List. At the same time,
- verifies the validity of this list.
-
- If List is NULL, then ASSERT().
- If List->ForwardLink is NULL, then ASSERT().
- If List->backLink is NULL, then ASSERT().
- If Node is NULL, then ASSERT();
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to a node in a linked list.
- @param Node A pointer to one nod.
-
- @retval TRUE Node is in List
- @retval FALSE Node isn't in List, or List is invalid
-
-**/
-BOOLEAN
-IsNodeInList (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- UINTN Count;
- CONST LIST_ENTRY *Ptr;
- BOOLEAN Found;
-
- //
- // Test the validity of List and Node
- //
- ASSERT (List != NULL);
- ASSERT (List->ForwardLink != NULL);
- ASSERT (List->BackLink != NULL);
- ASSERT (Node != NULL);
-
- Count = PcdGet32 (PcdMaximumLinkedListLength);
-
- Ptr = List;
- do {
- Ptr = Ptr->ForwardLink;
- Count--;
- } while ((Ptr != List) && (Ptr != Node) && (Count > 0));
- Found = (BOOLEAN)(Ptr == Node);
-
- if (PcdGet32 (PcdMaximumLinkedListLength) > 0) {
- while ((Count > 0) && (Ptr != List)) {
- Ptr = Ptr->ForwardLink;
- Count--;
- }
- ASSERT (Count > 0);
- }
-
- return Found;
-}
-
-/**
- Initializes the head node of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Initializes the forward and backward links of a new linked list. After
- initializing a linked list with this function, the other linked list
- functions may be used to add and remove nodes from the linked list. It is up
- to the caller of this function to allocate the memory for ListHead.
-
- If ListHead is NULL, then ASSERT().
-
- @param ListHead A pointer to the head node of a new doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInitializeListHead (
- IN OUT LIST_ENTRY *List
- )
-
-{
- ASSERT (List != NULL);
-
- List->ForwardLink = List;
- List->BackLink = List;
- return List;
-}
-
-/**
- Adds a node to the beginning of a doubly linked list, and returns the pointer
- to the head node of the doubly linked list.
-
- Adds the node Entry at the beginning of the doubly linked list denoted by
- ListHead, and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be inserted at the beginning
- of a doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInsertHeadList (
- IN OUT LIST_ENTRY *List,
- IN OUT LIST_ENTRY *Entry
- )
-{
- //
- // ASSERT List not too long and Entry is not one of the nodes of List
- //
- ASSERT (!IsNodeInList (List, Entry));
-
- Entry->ForwardLink = List->ForwardLink;
- Entry->BackLink = List;
- Entry->ForwardLink->BackLink = Entry;
- List->ForwardLink = Entry;
- return List;
-}
-
-/**
- Adds a node to the end of a doubly linked list, and returns the pointer to
- the head node of the doubly linked list.
-
- Adds the node Entry to the end of the doubly linked list denoted by ListHead,
- and returns ListHead.
-
- If ListHead is NULL, then ASSERT().
- If Entry is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and prior to insertion the number
- of nodes in ListHead, including the ListHead node, is greater than or
- equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
- @param Entry A pointer to a node that is to be added at the end of the
- doubly linked list.
-
- @return ListHead
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueInsertTailList (
- IN OUT LIST_ENTRY *List,
- IN OUT LIST_ENTRY *Entry
- )
-{
- //
- // ASSERT List not too long and Entry is not one of the nodes of List
- //
- ASSERT (!IsNodeInList (List, Entry));
-
- Entry->ForwardLink = List;
- Entry->BackLink = List->BackLink;
- Entry->BackLink->ForwardLink = Entry;
- List->BackLink = Entry;
- return List;
-}
-
-/**
- Retrieves the first node of a doubly linked list.
-
- Returns the first node of a doubly linked list. List must have been
- initialized with InitializeListHead(). If List is empty, then NULL is
- returned.
-
- If List is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
-
- @return The first node of a doubly linked list.
- @retval NULL The list is empty.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueGetFirstNode (
- IN CONST LIST_ENTRY *List
- )
-{
- //
- // ASSERT List not too long
- //
- ASSERT (IsNodeInList (List, List));
-
- return List->ForwardLink;
-}
-
-/**
- Retrieves the next node of a doubly linked list.
-
- Returns the node of a doubly linked list that follows Node. List must have
- been initialized with InitializeListHead(). If List is empty, then List is
- returned.
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and List contains more than
- PcdMaximumLinkedListLenth nodes, then ASSERT().
- If Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @return Pointer to the next node if one exists. Otherwise a null value which
- is actually List is returned.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueGetNextNode (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT (IsNodeInList (List, Node));
-
- return Node->ForwardLink;
-}
-
-/**
- Checks to see if a doubly linked list is empty or not.
-
- Checks to see if the doubly linked list is empty. If the linked list contains
- zero nodes, this function returns TRUE. Otherwise, it returns FALSE.
-
- If ListHead is NULL, then ASSERT().
- If ListHead was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param ListHead A pointer to the head node of a doubly linked list.
-
- @retval TRUE The linked list is empty.
- @retval FALSE The linked list is not empty.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsListEmpty (
- IN CONST LIST_ENTRY *List
- )
-{
- //
- // ASSERT List not too long
- //
- ASSERT (IsNodeInList (List, List));
-
- return (BOOLEAN)(List->ForwardLink == List);
-}
-
-/**
- Determines if a node in a doubly linked list is null.
-
- Returns FALSE if Node is one of the nodes in the doubly linked list specified
- by List. Otherwise, TRUE is returned. List must have been initialized with
- InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If Node is not a node in List and Node is not equal to List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is one of the nodes in the doubly linked list.
- @retval FALSE Node is not one of the nodes in the doubly linked list.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsNull (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT (IsNodeInList (List, Node));
-
- return (BOOLEAN)(Node == List);
-}
-
-/**
- Determines if a node the last node in a doubly linked list.
-
- Returns TRUE if Node is the last node in the doubly linked list specified by
- List. Otherwise, FALSE is returned. List must have been initialized with
- InitializeListHead().
-
- If List is NULL, then ASSERT().
- If Node is NULL, then ASSERT().
- If List was not initialized with InitializeListHead(), then ASSERT().
- If PcdMaximumLinkedListLenth is not zero, and the number of nodes
- in List, including the List node, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
- If Node is not a node in List, then ASSERT().
-
- @param List A pointer to the head node of a doubly linked list.
- @param Node A pointer to a node in the doubly linked list.
-
- @retval TRUE Node is the last node in the linked list.
- @retval FALSE Node is not the last node in the linked list.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsNodeAtEnd (
- IN CONST LIST_ENTRY *List,
- IN CONST LIST_ENTRY *Node
- )
-{
- //
- // ASSERT List not too long and Node is one of the nodes of List
- //
- ASSERT (IsNodeInList (List, Node));
-
- return (BOOLEAN)(!IsNull (List, Node) && List->BackLink == Node);
-}
-
-/**
- Swaps the location of two nodes in a doubly linked list, and returns the
- first node after the swap.
-
- If FirstEntry is identical to SecondEntry, then SecondEntry is returned.
- Otherwise, the location of the FirstEntry node is swapped with the location
- of the SecondEntry node in a doubly linked list. SecondEntry must be in the
- same double linked list as FirstEntry and that double linked list must have
- been initialized with InitializeListHead(). SecondEntry is returned after the
- nodes are swapped.
-
- If FirstEntry is NULL, then ASSERT().
- If SecondEntry is NULL, then ASSERT().
- If SecondEntry and FirstEntry are not in the same linked list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing the FirstEntry and SecondEntry nodes, including
- the FirstEntry and SecondEntry nodes, is greater than or equal to
- PcdMaximumLinkedListLength, then ASSERT().
-
- @param FirstEntry A pointer to a node in a linked list.
- @param SecondEntry A pointer to another node in the same linked list.
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueSwapListEntries (
- IN OUT LIST_ENTRY *FirstEntry,
- IN OUT LIST_ENTRY *SecondEntry
- )
-{
- LIST_ENTRY *Ptr;
-
- if (FirstEntry == SecondEntry) {
- return SecondEntry;
- }
-
- //
- // ASSERT Entry1 and Entry2 are in the same linked list
- //
- ASSERT (IsNodeInList (FirstEntry, SecondEntry));
-
- //
- // Ptr is the node pointed to by FirstEntry->ForwardLink
- //
- Ptr = RemoveEntryList (FirstEntry);
-
- //
- // If FirstEntry immediately follows SecondEntry, FirstEntry willl be placed
- // immediately in front of SecondEntry
- //
- if (Ptr->BackLink == SecondEntry) {
- return InsertTailList (SecondEntry, FirstEntry);
- }
-
- //
- // Ptr == SecondEntry means SecondEntry immediately follows FirstEntry,
- // then there are no further steps necessary
- //
- if (Ptr == InsertHeadList (SecondEntry, FirstEntry)) {
- return Ptr;
- }
-
- //
- // Move SecondEntry to the front of Ptr
- //
- RemoveEntryList (SecondEntry);
- InsertTailList (Ptr, SecondEntry);
- return SecondEntry;
-}
-
-/**
- Removes a node from a doubly linked list, and returns the node that follows
- the removed node.
-
- Removes the node Entry from a doubly linked list. It is up to the caller of
- this function to release the memory used by this node if that is required. On
- exit, the node following Entry in the doubly linked list is returned. If
- Entry is the only node in the linked list, then the head node of the linked
- list is returned.
-
- If Entry is NULL, then ASSERT().
- If Entry is the head node of an empty list, then ASSERT().
- If PcdMaximumLinkedListLength is not zero, and the number of nodes in the
- linked list containing Entry, including the Entry node, is greater than
- or equal to PcdMaximumLinkedListLength, then ASSERT().
-
- @param Entry A pointer to a node in a linked list
-
- @return Entry
-
-**/
-LIST_ENTRY *
-EFIAPI
-GlueRemoveEntryList (
- IN CONST LIST_ENTRY *Entry
- )
-{
- ASSERT (!IsListEmpty (Entry));
-
- Entry->ForwardLink->BackLink = Entry->BackLink;
- Entry->BackLink->ForwardLink = Entry->ForwardLink;
- return Entry->ForwardLink;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LongJump.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LongJump.c
deleted file mode 100644
index f9e50b2c91..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LongJump.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LongJump.c
-
-Abstract:
-
- Long Jump functions
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Restores the CPU context that was saved with SetJump().
-
- Restores the CPU context from the buffer specified by JumpBuffer.
- This function never returns to the caller.
- Instead is resumes execution based on the state of JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
- If Value is 0, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
- @param Value The value to return when the SetJump() context is restored.
-
-**/
-VOID
-EFIAPI
-LongJump (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
- IN UINTN Value
- )
-{
- InternalAssertJumpBuffer (JumpBuffer);
- ASSERT (Value != 0);
-
- InternalLongJump (JumpBuffer, Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet32.c
deleted file mode 100644
index a20d381296..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet32.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LowBitSet32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the lowest bit set in a 32-bit value.
-
- This function computes the bit position of the lowest bit set in the 32-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 31 is returned.
-
- @param Operand The 32-bit operand to evaluate.
-
- @return Position of the lowest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet32 (
- IN UINT32 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return -1;
- }
-
- for (BitIndex = 0; (Operand & 1) == 0; BitIndex++, Operand >>= 1);
- return BitIndex;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet64.c
deleted file mode 100644
index 8e3cebcc23..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/LowBitSet64.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- LowBitSet64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the bit position of the lowest bit set in a 64-bit value.
-
- This function computes the bit position of the lowest bit set in the 64-bit
- value specified by Operand. If Operand is zero, then -1 is returned.
- Otherwise, a value between 0 and 63 is returned.
-
- @param Operand The 64-bit operand to evaluate.
-
- @return Position of the lowest bit set in Operand if found.
- @retval -1 Operand is zero.
-
-**/
-INTN
-EFIAPI
-LowBitSet64 (
- IN UINT64 Operand
- )
-{
- INTN BitIndex;
-
- if (Operand == 0) {
- return -1;
- }
-
- for (BitIndex = 0;
- (Operand & 1) == 0;
- BitIndex++, Operand = RShiftU64 (Operand, 1));
- return BitIndex;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Math64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Math64.c
deleted file mode 100644
index eb17ff98f0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Math64.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Match64.c
-
-Abstract:
-
- Leaf math worker functions that require 64-bit arithmetic support from the
- compiler.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer left between 0 and 63 bits. The low bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the left by Count bits. The
- low Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift left.
- @param Count The number of bits to shift left.
-
- @return Operand << Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return Operand << Count;
-}
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits
- are filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return Operand >> Count;
-}
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. The high bits
- are filled with original integer's bit 63. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to bit 63 of Operand. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand arithmetically shifted right by Count
-
-**/
-UINT64
-EFIAPI
-InternalMathARShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- INTN TestValue;
-
- //
- // Test if this compiler supports arithmetic shift
- //
- TestValue = (((-1) << (sizeof (-1) * 8 - 1)) >> (sizeof (-1) * 8 - 1));
- if (TestValue == -1) {
- //
- // Arithmetic shift is supported
- //
- return (UINT64)((INT64)Operand >> Count);
- }
-
- //
- // Arithmetic is not supported
- //
- return (Operand >> Count) |
- ((INTN)Operand < 0 ? ~((UINTN)-1 >> Count) : 0);
-}
-
-
-/**
- Rotates a 64-bit integer left between 0 and 63 bits, filling
- the low bits with the high bits that were rotated.
-
- This function rotates the 64-bit value Operand to the left by Count bits. The
- low Count bits are fill with the high Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate left.
- @param Count The number of bits to rotate left.
-
- @return Operand <<< Count
-
-**/
-UINT64
-EFIAPI
-InternalMathLRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return (Operand << Count) | (Operand >> (64 - Count));
-}
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling
- the high bits with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-InternalMathRRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- return (Operand >> Count) | (Operand << (64 - Count));
-}
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT64
-EFIAPI
-InternalMathSwapBytes64 (
- IN UINT64 Operand
- )
-{
- UINT64 LowerBytes;
- UINT64 HigherBytes;
-
- LowerBytes = (UINT64) SwapBytes32 ((UINT32) Operand);
- HigherBytes = (UINT64) SwapBytes32 ((UINT32) (Operand >> 32));
-
- return (LowerBytes << 32 | HigherBytes);
-}
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- return Multiplicand * Multiplier;
-}
-
-
-/**
- Multiples a 64-bit unsigned integer by a 64-bit unsigned integer
- and generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-InternalMathMultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- return Multiplicand * Multiplier;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. This
- function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer
- and generates a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-InternalMathModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- return (UINT32)(Dividend % Divisor);
-}
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 32-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
- @param Remainder A pointer to a 32-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor,
- OUT UINT32 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = (UINT32)(Dividend % Divisor);
- }
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result and an optional 64-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 64-bit unsigned value.
- @param Remainder A pointer to a 64-bit unsigned value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-UINT64
-EFIAPI
-InternalMathDivRemU64x64 (
- IN UINT64 Dividend,
- IN UINT64 Divisor,
- OUT UINT64 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = Dividend % Divisor;
- }
- return Dividend / Divisor;
-}
-
-/**
- Divides a 64-bit signed integer by a 64-bit signed integer and
- generates a 64-bit signed result and a optional 64-bit signed remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 64-bit
- unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder
- is not NULL, then the 64-bit unsigned remainder is returned in Remainder.
- This function returns the 64-bit unsigned quotient.
-
- @param Dividend A 64-bit signed value.
- @param Divisor A 64-bit signed value.
- @param Remainder A pointer to a 64-bit signed value. This parameter is
- optional and may be NULL.
-
- @return Dividend / Divisor
-
-**/
-INT64
-InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
- )
-{
- if (Remainder != NULL) {
- *Remainder = Dividend % Divisor;
- }
- return Dividend / Divisor;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ModU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ModU64x32.c
deleted file mode 100644
index 5f5867cf0b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/ModU64x32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ModU64x32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates
- a 32-bit unsigned remainder.
-
- This function divides the 64-bit unsigned value Dividend by the 32-bit
- unsigned value Divisor and generates a 32-bit remainder. This function
- returns the 32-bit unsigned remainder.
-
- If Divisor is 0, then ASSERT().
-
- @param Dividend A 64-bit unsigned value.
- @param Divisor A 32-bit unsigned value.
-
- @return Dividend % Divisor
-
-**/
-UINT32
-EFIAPI
-ModU64x32 (
- IN UINT64 Dividend,
- IN UINT32 Divisor
- )
-{
- ASSERT (Divisor != 0);
- return InternalMathModU64x32 (Dividend, Divisor);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultS64x64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultS64x64.c
deleted file mode 100644
index 62cbc8b863..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultS64x64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MultS64x64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Multiples a 64-bit signed integer by a 64-bit signed integer and generates a
- 64-bit signed result.
-
- This function multiples the 64-bit signed value Multiplicand by the 64-bit
- signed value Multiplier and generates a 64-bit signed result. This 64-bit
- signed result is returned.
-
- If the result overflows, then ASSERT().
-
- @param Multiplicand A 64-bit signed value.
- @param Multiplier A 64-bit signed value.
-
- @return Multiplicand * Multiplier
-
-**/
-INT64
-EFIAPI
-MultS64x64 (
- IN INT64 Multiplicand,
- IN INT64 Multiplier
- )
-{
- return (INT64)MultU64x64 ((UINT64) Multiplicand, (UINT64) Multiplier);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x32.c
deleted file mode 100644
index e86959a444..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x32.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MultU64x32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 32-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 32-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-GlueMultU64x32 (
- IN UINT64 Multiplicand,
- IN UINT32 Multiplier
- )
-{
- UINT64 Result;
-
- Result = InternalMathMultU64x32 (Multiplicand, Multiplier);
-
- return Result;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x64.c
deleted file mode 100644
index e9f20bda4a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/MultU64x64.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MultU64x64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and
- generates a 64-bit unsigned result.
-
- This function multiples the 64-bit unsigned value Multiplicand by the 64-bit
- unsigned value Multiplier and generates a 64-bit unsigned result. This 64-
- bit unsigned result is returned.
-
- @param Multiplicand A 64-bit unsigned value.
- @param Multiplier A 64-bit unsigned value.
-
- @return Multiplicand * Multiplier
-
-**/
-UINT64
-EFIAPI
-MultU64x64 (
- IN UINT64 Multiplicand,
- IN UINT64 Multiplier
- )
-{
- UINT64 Result;
-
- Result = InternalMathMultU64x64 (Multiplicand, Multiplier);
-
- return Result;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU32.c
deleted file mode 100644
index 1845b1d1e1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RRotU32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits
- with the low bits that were rotated.
-
- This function rotates the 32-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 31, then ASSERT().
-
- @param Operand The 32-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT32
-EFIAPI
-RRotU32 (
- IN UINT32 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return (Operand >> Count) | (Operand << (32 - Count));
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU64.c
deleted file mode 100644
index fb07d011ea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RRotU64.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RRotU64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits
- with the high low bits that were rotated.
-
- This function rotates the 64-bit value Operand to the right by Count bits.
- The high Count bits are fill with the low Count bits of Operand. The rotated
- value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to rotate right.
- @param Count The number of bits to rotate right.
-
- @return Operand >>> Count
-
-**/
-UINT64
-EFIAPI
-RRotU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return InternalMathRRotU64 (Operand, Count);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RShiftU64.c
deleted file mode 100644
index d9df6db5e7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/RShiftU64.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RShiftU64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Shifts a 64-bit integer right between 0 and 63 bits. This high bits are
- filled with zeros. The shifted value is returned.
-
- This function shifts the 64-bit value Operand to the right by Count bits. The
- high Count bits are set to zero. The shifted value is returned.
-
- If Count is greater than 63, then ASSERT().
-
- @param Operand The 64-bit operand to shift right.
- @param Count The number of bits to shift right.
-
- @return Operand >> Count
-
-**/
-UINT64
-EFIAPI
-GlueRShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-{
- ASSERT (Count < sizeof (Operand) * 8);
- return InternalMathRShiftU64 (Operand, Count);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SetJump.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SetJump.c
deleted file mode 100644
index add9a1d4cd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SetJump.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SetJump.c
-
-Abstract:
-
- Internal ASSERT () functions for SetJump.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Worker function that checks ASSERT condition for JumpBuffer
-
- Checks ASSERT condition for JumpBuffer.
-
- If JumpBuffer is NULL, then ASSERT().
- If JumpBuffer is not aligned on a BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT
- boundary, then ASSERT().
-
- @param JumpBuffer A pointer to CPU context buffer.
-
-**/
-VOID
-EFIAPI
-InternalAssertJumpBuffer (
- IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
- )
-{
- ASSERT (JumpBuffer != NULL);
-
- ASSERT (((UINTN)JumpBuffer & ((BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT - 1) >> 8)) == 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/String.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/String.c
deleted file mode 100644
index 29b1963ad5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/String.c
+++ /dev/null
@@ -1,2088 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- String.c
-
-Abstract:
-
- Unicode string primatives.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Copies one Null-terminated Unicode string to another Null-terminated Unicode
- string and returns the new Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
-
- @return Destiantion
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- )
-{
- CHAR16 *ReturnValue;
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
- ASSERT (((UINTN) Destination & 0x01) == 0);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > StrLen (Source));
- ASSERT ((UINTN)(Source - Destination) > StrLen (Source));
-
- ReturnValue = Destination;
- while (*Source) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
- return ReturnValue;
-}
-
-/**
- Copies one Null-terminated Unicode string with a maximum length to another
- Null-terminated Unicode string with a maximum length and returns the new
- Unicode string.
-
- This function copies the contents of the Unicode string Source to the Unicode
- string Destination, and returns Destination. At most, Length Unicode
- characters are copied from Source to Destination. If Length is 0, then
- Destination is returned unmodified. If Length is greater that the number of
- Unicode characters in Source, then Destination is padded with Null Unicode
- characters. If Source and Destination overlap, then the results are
- undefined.
-
- If Length > 0 and Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit bounadry, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to copy.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrnCpy (
- OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- CHAR16 *ReturnValue;
-
- if (Length == 0) {
- return Destination;
- }
-
- //
- // Destination cannot be NULL if Length is not zero
- //
- ASSERT (Destination != NULL);
- ASSERT (((UINTN) Destination & 0x01) == 0);
-
- //
- // Destination and source cannot overlap
- // Q: Does Source have to be NULL-terminated?
- //
- ASSERT ((UINTN)(Destination - Source) > StrLen (Source));
- ASSERT ((UINTN)(Source - Destination) >= Length);
-
- ReturnValue = Destination;
-
- while ((*Source != L'\0') && (Length > 0)) {
- *(Destination++) = *(Source++);
- Length--;
- }
-
- ZeroMem (Destination, Length * sizeof (*Destination));
- return ReturnValue;
-}
-
-/**
- Returns the length of a Null-terminated Unicode string.
-
- This function returns the number of Unicode characters in the Null-terminated
- Unicode string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-GlueStrLen (
- IN CONST CHAR16 *String
- )
-{
- UINTN Length;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
-
- for (Length = 0; *String != L'\0'; String++, Length++) {
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (Length < PcdGet32 (PcdMaximumUnicodeStringLength));
- }
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated Unicode string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated Unicode
- string specified by String.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-GlueStrSize (
- IN CONST CHAR16 *String
- )
-{
- return (StrLen (String) + 1) * sizeof (*String);
-}
-
-/**
- Compares two Null-terminated Unicode strings, and returns the difference
- between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched Unicode character in SecondString subtracted from the first
- mismatched Unicode character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If FirstString is not aligned on a 16-bit boundary, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If SecondString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated Unicode string.
- @param SecondString Pointer to a Null-terminated Unicode string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-GlueStrCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString
- )
-{
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- while ((*FirstString != L'\0') && (*FirstString == *SecondString)) {
- FirstString++;
- SecondString++;
- }
- return *FirstString - *SecondString;
-}
-
-/**
- Compares two Null-terminated Unicode strings with maximum lengths, and
- returns the difference between the first mismatched Unicode characters.
-
- This function compares the Null-terminated Unicode string FirstString to the
- Null-terminated Unicode string SecondString. At most, Length Unicode
- characters will be compared. If Length is 0, then 0 is returned. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched Unicode character in SecondString
- subtracted from the first mismatched Unicode character in FirstString.
-
- If Length > 0 and FirstString is NULL, then ASSERT().
- If Length > 0 and FirstString is not aligned on a 16-bit bounadary, then ASSERT().
- If Length > 0 and SecondString is NULL, then ASSERT().
- If Length > 0 and SecondString is not aligned on a 16-bit bounadary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString Pointer to a Null-terminated Unicode string.
- @param SecondString Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to compare.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-GlueStrnCmp (
- IN CONST CHAR16 *FirstString,
- IN CONST CHAR16 *SecondString,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- //
- // ASSERT both strings are less long than PcdMaximumUnicodeStringLength.
- // Length tests are performed inside StrLen().
- //
- ASSERT (StrSize (FirstString) != 0);
- ASSERT (StrSize (SecondString) != 0);
-
- while ((*FirstString != L'\0') &&
- (*FirstString == *SecondString) &&
- (Length > 1)) {
- FirstString++;
- SecondString++;
- Length--;
- }
-
- return *FirstString - *SecondString;
-}
-
-/**
- Concatenates one Null-terminated Unicode string to another Null-terminated
- Unicode string, and returns the concatenated Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination. The Null-terminated concatenated
- Unicode String is returned. If Source and Destination overlap, then the
- results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than
- PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source
- )
-{
- StrCpy (Destination + StrLen (Destination), Source);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (StrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- Concatenates one Null-terminated Unicode string with a maximum length to the
- end of another Null-terminated Unicode string, and returns the concatenated
- Unicode string.
-
- This function concatenates two Null-terminated Unicode strings. The contents
- of Null-terminated Unicode string Source are concatenated to the end of
- Null-terminated Unicode string Destination, and Destination is returned. At
- most, Length Unicode characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Length > 0 and Source is NULL, then ASSERT().
- If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Length is greater than
- PcdMaximumUnicodeStringLength, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Destination contains more
- than PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength Unicode characters, not including the
- Null-terminator, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination
- and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength
- Unicode characters, not including the Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated Unicode string.
- @param Source Pointer to a Null-terminated Unicode string.
- @param Length Maximum number of Unicode characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR16 *
-EFIAPI
-GlueStrnCat (
- IN OUT CHAR16 *Destination,
- IN CONST CHAR16 *Source,
- IN UINTN Length
- )
-{
- StrnCpy (Destination + StrLen (Destination), Source, Length);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (StrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- Returns the first occurance of a Null-terminated Unicode sub-string
- in a Null-terminated Unicode string.
-
- This function scans the contents of the Null-terminated Unicode string
- specified by String and returns the first occurrence of SearchString.
- If SearchString is not found in String, then NULL is returned. If
- the length of SearchString is zero, then String is
- returned.
-
- If String is NULL, then ASSERT().
- If String is not aligned on a 16-bit boundary, then ASSERT().
- If SearchString is NULL, then ASSERT().
- If SearchString is not aligned on a 16-bit boundary, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and SearchString
- or String contains more than PcdMaximumUnicodeStringLength Unicode
- characters not including the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
- @param SearchString Pointer to a Null-terminated Unicode string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval !NULL If there is a match.
-
-**/
-CHAR16 *
-EFIAPI
-StrStr (
- IN CONST CHAR16 *String,
- IN CONST CHAR16 *SearchString
- )
-{
- CONST CHAR16 *FirstMatch;
- CONST CHAR16 *SearchStringTmp;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
- ASSERT (SearchString != NULL);
- ASSERT (((UINTN) SearchString & 0x01) == 0);
-
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length of String should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (StrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
- }
-
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length of SearchString should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (StrLen (SearchString) < PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- while (*String != '\0') {
- SearchStringTmp = SearchString;
- FirstMatch = String;
-
- while ((*String == *SearchStringTmp)
- && (*SearchStringTmp != '\0')
- && (*String != '\0')) {
- String++;
- SearchStringTmp++;
- }
-
- if (*SearchStringTmp == '\0') {
- return (CHAR16 *) FirstMatch;
- }
-
- if (SearchStringTmp == SearchString) {
- //
- // If no character from SearchString match,
- // move the pointer to the String under search
- // by one character.
- //
- String++;
- }
- }
-
- return NULL;
-}
-
-/**
- Check if a Unicode character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- L'0' to L'9'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE Otherwise.
-
-**/
-STATIC
-BOOLEAN
-InternalIsDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
- return (BOOLEAN) (Char >= L'0' && Char <= L'9');
-}
-
-/**
- Convert a Unicode character to upper case only if
- it maps to a valid small-case ASCII character.
-
- This internal function only deal with Unicode character
- which maps to a valid small-case ASII character, i.e.
- L'a' to L'z'. For other Unicode character, the input character
- is returned directly.
-
-
- @param Char The character to convert.
-
- @retval LowerCharacter If the Char is with range L'a' to L'z'.
- @retval Unchanged Otherwise.
-
-**/
-STATIC
-CHAR16
-InternalCharToUpper (
- IN CHAR16 Char
- )
-{
- if (Char >= L'a' && Char <= L'z') {
- return (CHAR16) (Char - (L'a' - L'A'));
- }
-
- return Char;
-}
-
-/**
- Convert a Unicode character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- L'0' to L'9', L'a' to L'f' or L'A' to L'F'. For other
- Unicode character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @retval UINTN The numerical value converted.
-
-**/
-STATIC
-UINTN
-InternalHexCharToUintn (
- IN CHAR16 Char
- )
-{
- if (InternalIsDecimalDigitCharacter (Char)) {
- return Char - L'0';
- }
-
- return (UINTN) (10 + InternalCharToUpper (Char) - L'A');
-}
-
-/**
- Check if a Unicode character is a hexadecimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE Otherwise.
-
-**/
-STATIC
-BOOLEAN
-InternalIsHexaDecimalDigitCharacter (
- IN CHAR16 Char
- )
-{
-
- return (BOOLEAN) (InternalIsDecimalDigitCharacter (Char) ||
- (Char >= L'A' && Char <= L'F') ||
- (Char >= L'a' && Char <= L'f'));
-}
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINTN, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-StrDecimalToUintn (
- IN CONST CHAR16 *String
- )
-{
- UINTN Result;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
- ASSERT (StrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- Result = 0;
-
- while (InternalIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) &&
- (*String - L'0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)
- );
-
- Result = Result * 10 + (*String - L'0');
- String++;
- }
-
- return Result;
-}
-
-
-/**
- Convert a Null-terminated Unicode decimal string to a value of
- type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a decimal number. The format
- of the input Unicode string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The
- function will ignore the pad space, which includes spaces or
- tab characters, before [decimal digits]. The running zero in the
- beginning of [decimal digits] will be ignored. Then, the function
- stops at the first character that is a not a valid decimal character
- or a Null-terminator, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits,
- then 0 is returned.
- If the number represented by String overflows according
- to the range defined by UINT64, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-StrDecimalToUint64 (
- IN CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
- ASSERT (StrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- Result = 0;
-
- while (InternalIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) ||
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) &&
- (*String - L'0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)
- );
-
- Result = MultU64x32 (Result, 10) + (*String - L'0');
- String++;
- }
-
- return Result;
-}
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-StrHexToUintn (
- IN CONST CHAR16 *String
- )
-{
- UINTN Result;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
- ASSERT (StrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (InternalCharToUpper (*String) == L'X') {
- ASSERT (*(String - 1) == L'0');
- if (*(String - 1) != L'0') {
- return 0;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- Result = 0;
-
- while (InternalIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the Hex Number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) &&
- (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))
- );
-
- Result = (Result << 4) + InternalHexCharToUintn (*String);
- String++;
- }
-
- return Result;
-}
-
-
-/**
- Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the Unicode string specified by String as a hexadecimal number.
- The format of the input Unicode string String is
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix.
- If "x" appears in the input string, it must be prefixed with at least one 0.
- The function will ignore the pad space, which includes spaces or tab characters,
- before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or
- [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the
- first valid hexadecimal digit. Then, the function stops at the first character that is
- a not a valid hexadecimal character or NULL, whichever one comes first.
-
- If String is NULL, then ASSERT().
- If String is not aligned in a 16-bit boundary, then ASSERT().
- If String has only pad spaces, then zero is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits,
- then zero is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and String contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated Unicode string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-StrHexToUint64 (
- IN CONST CHAR16 *String
- )
-{
- UINT64 Result;
-
- ASSERT (String != NULL);
- ASSERT (((UINTN) String & 0x01) == 0);
- ASSERT (StrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == L' ') || (*String == L'\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == L'0') {
- String++;
- }
-
- if (InternalCharToUpper (*String) == L'X') {
- ASSERT (*(String - 1) == L'0');
- if (*(String - 1) != L'0') {
- return 0;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- Result = 0;
-
- while (InternalIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the Hex Number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16)||
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) &&
- (InternalHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))
- );
-
- Result = LShiftU64 (Result, 4);
- Result = Result + InternalHexCharToUintn (*String);
- String++;
- }
-
- return Result;
-}
-
-/**
- Check if a ASCII character is a decimal character.
-
- This internal function checks if a Unicode character is a
- decimal character. The valid decimal character is from
- '0' to '9'.
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a decmial character.
- @retval FALSE Otherwise.
-
-**/
-STATIC
-BOOLEAN
-InternalAsciiIsDecimalDigitCharacter (
- IN CHAR8 Char
- )
-{
- return (BOOLEAN) (Char >= '0' && Char <= '9');
-}
-
-/**
- Check if a ASCII character is a hexadecimal character.
-
- This internal function checks if a ASCII character is a
- decimal character. The valid hexadecimal character is
- L'0' to L'9', L'a' to L'f', or L'A' to L'F'.
-
-
- @param Char The character to check against.
-
- @retval TRUE If the Char is a hexadecmial character.
- @retval FALSE Otherwise.
-
-**/
-STATIC
-BOOLEAN
-InternalAsciiIsHexaDecimalDigitCharacter (
- IN CHAR8 Char
- )
-{
-
- return (BOOLEAN) (InternalAsciiIsDecimalDigitCharacter (Char) ||
- (Char >= 'A' && Char <= 'F') ||
- (Char >= 'a' && Char <= 'f'));
-}
-
-/**
- Convert a Null-terminated Unicode string to a Null-terminated
- ASCII string and returns the ASCII string.
-
- This function converts the content of the Unicode string Source
- to the ASCII string Destination by copying the lower 8 bits of
- each Unicode character. It returns Destination. The function terminates
- the ASCII string Destination by appending a Null-terminator character
- at the end. The caller is responsible to make sure Destination points
- to a buffer with size equal or greater than (StrLen (Source) + 1) in bytes.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source is not aligned on a 16-bit boundary, then ASSERT().
- If Source and Destination overlap, then ASSERT().
-
- If any Unicode characters in Source contain non-zero value in
- the upper 8 bits, then ASSERT().
-
- If PcdMaximumUnicodeStringLength is not zero, and Source contains
- more than PcdMaximumUnicodeStringLength Unicode characters not including
- the Null-terminator, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and Source contains more
- than PcdMaximumAsciiStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param Source Pointer to a Null-terminated Unicode string.
- @param Destination Pointer to a Null-terminated ASCII string.
-
- @reture Destination
-
-**/
-CHAR8 *
-EFIAPI
-UnicodeStrToAsciiStr (
- IN CONST CHAR16 *Source,
- OUT CHAR8 *Destination
- )
-{
- ASSERT (Destination != NULL);
- ASSERT (Source != NULL);
- ASSERT (((UINTN) Source & 0x01) == 0);
-
- //
- // Source and Destination should not overlap
- //
- ASSERT ((UINTN) ((CHAR16 *) Destination - Source) > StrLen (Source));
- ASSERT ((UINTN) ((CHAR8 *) Source - Destination) > StrLen (Source));
-
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length of Source should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumUnicodeStringLength) != 0) {
- ASSERT (StrLen (Source) < PcdGet32 (PcdMaximumUnicodeStringLength));
- }
-
- while (*Source != '\0') {
- //
- // If any Unicode characters in Source contain
- // non-zero value in the upper 8 bits, then ASSERT().
- //
- ASSERT (*Source < 0x100);
- *(Destination++) = (CHAR8) *(Source++);
- }
-
- *Destination = '\0';
-
- return Destination;
-}
-
-
-/**
- Copies one Null-terminated ASCII string to another Null-terminated ASCII
- string and returns the new ASCII string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. If Source and Destination
- overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- )
-{
- CHAR8 *ReturnValue;
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN)(Source - Destination) > AsciiStrLen (Source));
-
- ReturnValue = Destination;
- while (*Source) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
- return ReturnValue;
-}
-
-/**
- Copies one Null-terminated ASCII string with a maximum length to another
- Null-terminated ASCII string with a maximum length and returns the new ASCII
- string.
-
- This function copies the contents of the ASCII string Source to the ASCII
- string Destination, and returns Destination. At most, Length ASCII characters
- are copied from Source to Destination. If Length is 0, then Destination is
- returned unmodified. If Length is greater that the number of ASCII characters
- in Source, then Destination is padded with Null ASCII characters. If Source
- and Destination overlap, then the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
- @param Length Maximum number of ASCII characters to copy.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCpy (
- OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- CHAR8 *ReturnValue;
-
- if (Length == 0) {
- return Destination;
- }
-
- //
- // Destination cannot be NULL
- //
- ASSERT (Destination != NULL);
-
- //
- // Destination and source cannot overlap
- //
- ASSERT ((UINTN)(Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN)(Source - Destination) >= Length);
-
- ReturnValue = Destination;
-
- while (*Source && Length > 0) {
- *(Destination++) = *(Source++);
- Length--;
- }
-
- ZeroMem (Destination, Length * sizeof (*Destination));
- return ReturnValue;
-}
-
-/**
- Returns the length of a Null-terminated ASCII string.
-
- This function returns the number of ASCII characters in the Null-terminated
- ASCII string specified by String.
-
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @return The length of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrLen (
- IN CONST CHAR8 *String
- )
-{
- UINTN Length;
-
- ASSERT (String != NULL);
-
- for (Length = 0; *String != '\0'; String++, Length++) {
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
- }
- }
- return Length;
-}
-
-/**
- Returns the size of a Null-terminated ASCII string in bytes, including the
- Null terminator.
-
- This function returns the size, in bytes, of the Null-terminated ASCII string
- specified by String.
-
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @return The size of String.
-
-**/
-UINTN
-EFIAPI
-AsciiStrSize (
- IN CONST CHAR8 *String
- )
-{
- return (AsciiStrLen (String) + 1) * sizeof (*String);
-}
-
-/**
- Compares two Null-terminated ASCII strings, and returns the difference
- between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. If FirstString is identical to
- SecondString, then 0 is returned. Otherwise, the value returned is the first
- mismatched ASCII character in SecondString subtracted from the first
- mismatched ASCII character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- )
-{
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- while ((*FirstString != '\0') && (*FirstString == *SecondString)) {
- FirstString++;
- SecondString++;
- }
-
- return *FirstString - *SecondString;
-}
-
-/**
- Converts a lowercase Ascii character to upper one
-
- If Chr is lowercase Ascii character, then converts it to upper one.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param chr one Ascii character
-
- @return The uppercase value of Ascii character
-
-**/
-STATIC
-CHAR8
-AsciiToUpper (
- IN CHAR8 Chr
- )
-{
- return (UINT8) ((Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr);
-}
-
-/**
- Convert a ASCII character to numerical value.
-
- This internal function only deal with Unicode character
- which maps to a valid hexadecimal ASII character, i.e.
- '0' to '9', 'a' to 'f' or 'A' to 'F'. For other
- ASCII character, the value returned does not make sense.
-
- @param Char The character to convert.
-
- @retval UINTN The numerical value converted.
-
-**/
-STATIC
-UINTN
-InternalAsciiHexCharToUintn (
- IN CHAR8 Char
- )
-{
- if (InternalIsDecimalDigitCharacter (Char)) {
- return Char - '0';
- }
-
- return (UINTN) (10 + AsciiToUpper (Char) - 'A');
-}
-
-
-/**
- Performs a case insensitive comparison of two Null-terminated ASCII strings,
- and returns the difference between the first mismatched ASCII characters.
-
- This function performs a case insensitive comparison of the Null-terminated
- ASCII string FirstString to the Null-terminated ASCII string SecondString. If
- FirstString is identical to SecondString, then 0 is returned. Otherwise, the
- value returned is the first mismatched lower case ASCII character in
- SecondString subtracted from the first mismatched lower case ASCII character
- in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and SecondString contains more
- than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString using case insensitive
- comparisons.
- @retval !=0 FirstString is not identical to SecondString using case
- insensitive comparisons.
-
-**/
-INTN
-EFIAPI
-AsciiStriCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString
- )
-{
- CHAR8 UpperFirstString;
- CHAR8 UpperSecondString;
-
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- UpperFirstString = AsciiToUpper (*FirstString);
- UpperSecondString = AsciiToUpper (*SecondString);
- while ((*FirstString != '\0') && (UpperFirstString == UpperSecondString)) {
- FirstString++;
- SecondString++;
- UpperFirstString = AsciiToUpper (*FirstString);
- UpperSecondString = AsciiToUpper (*SecondString);
- }
-
- return UpperFirstString - UpperSecondString;
-}
-
-/**
- Compares two Null-terminated ASCII strings with maximum lengths, and returns
- the difference between the first mismatched ASCII characters.
-
- This function compares the Null-terminated ASCII string FirstString to the
- Null-terminated ASCII string SecondString. At most, Length ASCII characters
- will be compared. If Length is 0, then 0 is returned. If FirstString is
- identical to SecondString, then 0 is returned. Otherwise, the value returned
- is the first mismatched ASCII character in SecondString subtracted from the
- first mismatched ASCII character in FirstString.
-
- If FirstString is NULL, then ASSERT().
- If SecondString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
-
- @param FirstString Pointer to a Null-terminated ASCII string.
- @param SecondString Pointer to a Null-terminated ASCII string.
-
- @retval 0 FirstString is identical to SecondString.
- @retval !=0 FirstString is not identical to SecondString.
-
-**/
-INTN
-EFIAPI
-AsciiStrnCmp (
- IN CONST CHAR8 *FirstString,
- IN CONST CHAR8 *SecondString,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- //
- // ASSERT both strings are less long than PcdMaximumAsciiStringLength
- //
- ASSERT (AsciiStrSize (FirstString));
- ASSERT (AsciiStrSize (SecondString));
-
- while ((*FirstString != '\0') &&
- (*FirstString == *SecondString) &&
- (Length > 1)) {
- FirstString++;
- SecondString++;
- Length--;
- }
- return *FirstString - *SecondString;
-}
-
-/**
- Concatenates one Null-terminated ASCII string to another Null-terminated
- ASCII string, and returns the concatenated ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents of
- Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination. The Null-terminated concatenated ASCII
- String is returned.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source
- )
-{
- AsciiStrCpy (Destination + AsciiStrLen (Destination), Source);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (AsciiStrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- Concatenates one Null-terminated ASCII string with a maximum length to the
- end of another Null-terminated ASCII string, and returns the concatenated
- ASCII string.
-
- This function concatenates two Null-terminated ASCII strings. The contents
- of Null-terminated ASCII string Source are concatenated to the end of Null-
- terminated ASCII string Destination, and Destination is returned. At most,
- Length ASCII characters are concatenated from Source to the end of
- Destination, and Destination is always Null-terminated. If Length is 0, then
- Destination is returned unmodified. If Source and Destination overlap, then
- the results are undefined.
-
- If Destination is NULL, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Length is greater than
- PcdMaximumAsciiStringLength, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Destination contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,
- then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and
- Source results in a ASCII string with more than PcdMaximumAsciiStringLength
- ASCII characters, not including the Null-terminator, then ASSERT().
-
- @param Destination Pointer to a Null-terminated ASCII string.
- @param Source Pointer to a Null-terminated ASCII string.
- @param Length Maximum number of ASCII characters to concatenate from
- Source.
-
- @return Destination
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrnCat (
- IN OUT CHAR8 *Destination,
- IN CONST CHAR8 *Source,
- IN UINTN Length
- )
-{
- AsciiStrnCpy (Destination + AsciiStrLen (Destination), Source, Length);
-
- //
- // Size of the resulting string should never be zero.
- // PcdMaximumUnicodeStringLength is tested inside StrLen().
- //
- ASSERT (AsciiStrSize (Destination) != 0);
- return Destination;
-}
-
-/**
- Returns the first occurance of a Null-terminated ASCII sub-string
- in a Null-terminated ASCII string.
-
- This function scans the contents of the ASCII string specified by String
- and returns the first occurrence of SearchString. If SearchString is not
- found in String, then NULL is returned. If the length of SearchString is zero,
- then String is returned.
-
- If String is NULL, then ASSERT().
- If SearchString is NULL, then ASSERT().
-
- If PcdMaximumAsciiStringLength is not zero, and SearchString or
- String contains more than PcdMaximumAsciiStringLength Unicode characters
- not including the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
- @param SearchString Pointer to a Null-terminated ASCII string to search for.
-
- @retval NULL If the SearchString does not appear in String.
- @retval !NULL If there is a match.
-
-**/
-CHAR8 *
-EFIAPI
-AsciiStrStr (
- IN CONST CHAR8 *String,
- IN CONST CHAR8 *SearchString
- )
-{
- CONST CHAR8 *FirstMatch;
- CONST CHAR8 *SearchStringTmp;
-
- ASSERT (String != NULL);
- ASSERT (SearchString != NULL);
-
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length of String should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (AsciiStrLen (String) < PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- //
- // If PcdMaximumUnicodeStringLength is not zero,
- // length of SearchString should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (AsciiStrLen (SearchString) < PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- while (*String != '\0') {
- SearchStringTmp = SearchString;
- FirstMatch = String;
-
- while ((*String == *SearchStringTmp)
- && (*SearchStringTmp != '\0')
- && (*String != '\0')) {
- String++;
- SearchStringTmp++;
- }
-
- if (*SearchStringTmp == '\0') {
- return (CHAR8 *) FirstMatch;
- }
-
- if (SearchStringTmp == SearchString) {
- //
- // If no character from SearchString match,
- // move the pointer to the String under search
- // by one character.
- //
- String++;
- }
-
- }
-
- return NULL;
-}
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINTN.
-
- This function returns a value of type UINTN by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINTN, then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-AsciiStrDecimalToUintn (
- IN CONST CHAR8 *String
- )
-{
- UINTN Result;
-
- ASSERT (String != NULL);
- ASSERT (AsciiStrLen (String) < PcdGet32 (PcdMaximumAsciiStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- Result = 0;
-
- while (InternalAsciiIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_10) ||
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_10) &&
- (*String - '0') <= REMINDER_MAX_UINTN_DIVIDED_BY_10)
- );
-
- Result = Result * 10 + (*String - '0');
- String++;
- }
-
- return Result;
-}
-
-
-/**
- Convert a Null-terminated ASCII decimal string to a value of type
- UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents
- of the ASCII string String as a decimal number. The format of the input
- ASCII string String is:
-
- [spaces] [decimal digits].
-
- The valid decimal digit character is in the range [0-9]. The function will
- ignore the pad space, which includes spaces or tab characters, before the digits.
- The running zero in the beginning of [decimal digits] will be ignored. Then, the
- function stops at the first character that is a not a valid decimal character or
- Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no pad spaces or valid decimal digits, then 0 is returned.
- If the number represented by String overflows according to the range defined by
- UINT64, then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and String contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-AsciiStrDecimalToUint64 (
- IN CONST CHAR8 *String
- )
-{
- UINT64 Result;
-
- ASSERT (String != NULL);
- ASSERT (AsciiStrLen (String) < PcdGet32 (PcdMaximumAsciiStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- Result = 0;
-
- while (InternalAsciiIsDecimalDigitCharacter (*String)) {
- //
- // If the number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_10) ||
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_10) &&
- (*String - '0') <= REMINDER_MAX_UINT64_DIVIDED_BY_10)
- );
-
- Result = MultU64x32 (Result, 10) + (*String - '0');
- String++;
- }
-
- return Result;
-}
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN.
-
- This function returns a value of type UINTN by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINTN,
- then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINTN
-
-**/
-UINTN
-EFIAPI
-AsciiStrHexToUintn (
- IN CONST CHAR8 *String
- )
-{
- UINTN Result;
-
- ASSERT (String != NULL);
- ASSERT (AsciiStrLen (String) < PcdGet32 (PcdMaximumAsciiStringLength));
-
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- if (AsciiToUpper (*String) == 'X') {
- ASSERT (*(String - 1) == '0');
- if (*(String - 1) != '0') {
- return 0;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- Result = 0;
-
- while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the Hex Number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINTN_DIVIDED_BY_16) ||
- ((Result == QUIENT_MAX_UINTN_DIVIDED_BY_16) &&
- (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINTN_DIVIDED_BY_16))
- );
-
- Result = (Result << 4) + InternalAsciiHexCharToUintn (*String);
- String++;
- }
-
- return Result;
-}
-
-
-/**
- Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64.
-
- This function returns a value of type UINT64 by interpreting the contents of
- the ASCII string String as a hexadecimal number. The format of the input ASCII
- string String is:
-
- [spaces][zeros][x][hexadecimal digits].
-
- The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F].
- The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x"
- appears in the input string, it must be prefixed with at least one 0. The function
- will ignore the pad space, which includes spaces or tab characters, before [zeros],
- [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits]
- will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal
- digit. Then, the function stops at the first character that is a not a valid
- hexadecimal character or Null-terminator, whichever on comes first.
-
- If String has only pad spaces, then 0 is returned.
- If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then
- 0 is returned.
-
- If the number represented by String overflows according to the range defined by UINT64,
- then ASSERT().
- If String is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero,
- and String contains more than PcdMaximumAsciiStringLength ASCII characters not including
- the Null-terminator, then ASSERT().
-
- @param String Pointer to a Null-terminated ASCII string.
-
- @retval UINT64
-
-**/
-UINT64
-EFIAPI
-AsciiStrHexToUint64 (
- IN CONST CHAR8 *String
- )
-{
- UINT64 Result;
-
- ASSERT (String != NULL);
- ASSERT (AsciiStrLen (String) < PcdGet32 (PcdMaximumUnicodeStringLength));
-
- //
- // Ignore the pad spaces (space or tab) and leading Zeros
- //
- //
- // Ignore the pad spaces (space or tab)
- //
- while ((*String == ' ') || (*String == '\t')) {
- String++;
- }
-
- //
- // Ignore leading Zeros after the spaces
- //
- while (*String == '0') {
- String++;
- }
-
- if (AsciiToUpper (*String) == 'X') {
- ASSERT (*(String - 1) == '0');
- if (*(String - 1) != '0') {
- return 0;
- }
- //
- // Skip the 'X'
- //
- String++;
- }
-
- Result = 0;
-
- while (InternalAsciiIsHexaDecimalDigitCharacter (*String)) {
- //
- // If the Hex Number represented by String overflows according
- // to the range defined by UINTN, then ASSERT().
- //
- ASSERT ((Result < QUIENT_MAX_UINT64_DIVIDED_BY_16) ||
- ((Result == QUIENT_MAX_UINT64_DIVIDED_BY_16) &&
- (InternalAsciiHexCharToUintn (*String) <= REMINDER_MAX_UINT64_DIVIDED_BY_16))
- );
-
- Result = LShiftU64 (Result, 4);
- Result = Result + InternalAsciiHexCharToUintn (*String);
- String++;
- }
-
- return Result;
-}
-
-
-/**
- Convert one Null-terminated ASCII string to a Null-terminated
- Unicode string and returns the Unicode string.
-
- This function converts the contents of the ASCII string Source to the Unicode
- string Destination, and returns Destination. The function terminates the
- Unicode string Destination by appending a Null-terminator character at the end.
- The caller is responsible to make sure Destination points to a buffer with size
- equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes.
-
- If Destination is NULL, then ASSERT().
- If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If Source is NULL, then ASSERT().
- If Source and Destination overlap, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and Source contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator,
- then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and Source contains more than
- PcdMaximumUnicodeStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param Source Pointer to a Null-terminated ASCII string.
- @param Destination Pointer to a Null-terminated Unicode string.
-
- @reture Destination
-
-**/
-CHAR16 *
-EFIAPI
-AsciiStrToUnicodeStr (
- IN CONST CHAR8 *Source,
- OUT CHAR16 *Destination
- )
-{
- ASSERT (Destination != NULL);
- ASSERT (Source != NULL);
-
- //
- // Source and Destination should not overlap
- //
- ASSERT ((UINTN) ((CHAR8 *) Destination - Source) > AsciiStrLen (Source));
- ASSERT ((UINTN) (Source - (CHAR8 *) Destination) > (AsciiStrLen (Source) * sizeof (CHAR16)));
-
- //
- // If PcdMaximumAsciiStringLength is not zero,
- // length of Source should not more than PcdMaximumUnicodeStringLength
- //
- if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
- ASSERT (AsciiStrLen (Source) < PcdGet32 (PcdMaximumAsciiStringLength));
- }
-
- while (*Source != '\0') {
- *(Destination++) = (CHAR16) *(Source++);
- }
- //
- // End the Destination with a NULL.
- //
- *Destination = '\0';
-
- return Destination;
-}
-
-/**
- Converts an 8-bit value to an 8-bit BCD value.
-
- Converts the 8-bit value specified by Value to BCD. The BCD value is
- returned.
-
- If Value >= 100, then ASSERT().
-
- @param Value The 8-bit value to convert to BCD. Range 0..99.
-
- @return The BCD value
-
-**/
-UINT8
-EFIAPI
-DecimalToBcd8 (
- IN UINT8 Value
- )
-{
- ASSERT (Value < 100);
- return (UINT8) (((Value / 10) << 4) | (Value % 10));
-}
-
-/**
- Converts an 8-bit BCD value to an 8-bit value.
-
- Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit
- value is returned.
-
- If Value >= 0xA0, then ASSERT().
- If (Value & 0x0F) >= 0x0A, then ASSERT().
-
- @param Value The 8-bit BCD value to convert to an 8-bit value.
-
- @return The 8-bit value is returned.
-
-**/
-UINT8
-EFIAPI
-BcdToDecimal8 (
- IN UINT8 Value
- )
-{
- ASSERT (Value < 0xa0);
- ASSERT ((Value & 0xf) < 0xa);
- return (UINT8) ((Value >> 4) * 10 + (Value & 0xf));
-}
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes16.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes16.c
deleted file mode 100644
index 7a2305e789..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes16.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SwapBytes16.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 16-bit integer.
-
- This function swaps the bytes in a 16-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 16-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT16
-EFIAPI
-SwapBytes16 (
- IN UINT16 Operand
- )
-{
- return (UINT16) ((Operand << 8) | (Operand >> 8));
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes32.c
deleted file mode 100644
index a795484e59..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes32.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SwapBytes32.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 32-bit integer.
-
- This function swaps the bytes in a 32-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 32-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT32
-EFIAPI
-SwapBytes32 (
- IN UINT32 Operand
- )
-{
- UINT32 LowerBytes;
- UINT32 HigherBytes;
-
- LowerBytes = (UINT32) SwapBytes16 ((UINT16) Operand);
- HigherBytes = (UINT32) SwapBytes16 ((UINT16) (Operand >> 16));
-
- return (LowerBytes << 16 | HigherBytes);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes64.c
deleted file mode 100644
index 51749f9336..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwapBytes64.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SwapBytes64.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Switches the endianess of a 64-bit integer.
-
- This function swaps the bytes in a 64-bit unsigned value to switch the value
- from little endian to big endian or vice versa. The byte swapped value is
- returned.
-
- @param Operand A 64-bit unsigned value.
-
- @return The byte swaped Operand.
-
-**/
-UINT64
-EFIAPI
-SwapBytes64 (
- IN UINT64 Operand
- )
-{
- return InternalMathSwapBytes64 (Operand);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwitchStack.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwitchStack.c
deleted file mode 100644
index d9b7548906..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SwitchStack.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SwitchStack.c
-
-Abstract:
-
- Switch Stack functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Transfers control to a function starting with a new stack.
-
- Transfers control to the function specified by EntryPoint using the new stack
- new stack specified by NewStack and passing in the parameters specified
- by Context1 and Context2. Context1 and Context2 are optional and may
- be NULL. The function EntryPoint must never return. This function
- supports a variable number of arguments following the NewStack parameter.
- These additional arguments are ignored on IA-32, x64, and EBC.
- IPF CPUs expect one additional parameter of type VOID * that specifies
- the new backing store pointer.
-
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- @param EntryPoint A pointer to function to call with the new stack.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function.
-
-**/
-VOID
-EFIAPI
-SwitchStack (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack,
- ...
- )
-{
- VA_LIST Marker;
-
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
-
- VA_START (Marker, NewStack);
-
- InternalSwitchStack (EntryPoint, Context1, Context2, NewStack, Marker);
-
- VA_END (Marker);
- //
- // InternalSwitchStack () will never return
- //
- ASSERT (FALSE);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Synchronization.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Synchronization.c
deleted file mode 100644
index 6e52006a03..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Synchronization.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Synchronization.c
-
-Abstract:
-
- Implementation of synchronization functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-#define SPIN_LOCK_RELEASED ((UINTN) 1)
-#define SPIN_LOCK_ACQUIRED ((UINTN) 2)
-
-/**
- Retrieves the architecture specific spin lock alignment requirements for
- optimal spin lock performance.
-
- This function retrieves the spin lock alignment requirements for optimal
- performance on a given CPU architecture. The spin lock alignment must be a
- power of two and is returned by this function. If there are no alignment
- requirements, then 1 must be returned. The spin lock synchronization
- functions must function correctly if the spin lock size and alignment values
- returned by this function are not used at all. These values are hints to the
- consumers of the spin lock synchronization functions to obtain optimal spin
- lock performance.
-
- @return The architecture specific spin lock alignment.
-
-**/
-UINTN
-EFIAPI
-GetSpinLockProperties (
- VOID
- )
-{
- // @bug May use a PCD entry to determine this alignment.
- return 32;
-}
-
-/**
- Initializes a spin lock to the released state and returns the spin lock.
-
- This function initializes the spin lock specified by SpinLock to the released
- state, and returns SpinLock. Optimal performance can be achieved by calling
- GetSpinLockProperties() to determine the size and alignment requirements for
- SpinLock.
-
- If SpinLock is NULL, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to initialize to the released
- state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-InitializeSpinLock (
- OUT SPIN_LOCK *SpinLock
- )
-{
- ASSERT (SpinLock != NULL);
- *SpinLock = SPIN_LOCK_RELEASED;
- return SpinLock;
-}
-
-/**
- Waits until a spin lock can be placed in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns SpinLock. Otherwise, this function waits
- indefinitely for the spin lock to be released, and then places it in the
- acquired state and returns SpinLock. All state transitions of SpinLock must
- be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
- If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in
- PcdSpinLockTimeout microseconds, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-AcquireSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- UINT64 Tick;
- UINT64 Start, End;
- UINT64 Timeout;
-
- Tick = 0;
- Start = 0;
- End = 0;
- if (PcdGet32 (PcdSpinLockTimeout) > 0) {
- Tick = GetPerformanceCounter ();
- Timeout = DivU64x32 (
- MultU64x32 (
- GetPerformanceCounterProperties (&Start, &End),
- PcdGet32 (PcdSpinLockTimeout)
- ),
- 1000000
- );
- if (Start < End) {
- Tick += Timeout;
- } else {
- Tick -= Timeout;
- }
- }
-
- while (!AcquireSpinLockOrFail (SpinLock)) {
- CpuPause ();
- ASSERT ((Start < End) ^ (Tick <= GetPerformanceCounter ()));
- }
- return SpinLock;
-}
-
-/**
- Attempts to place a spin lock in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns TRUE. Otherwise, FALSE is returned. All state
- transitions of SpinLock must be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @retval TRUE SpinLock was placed in the acquired state.
- @retval FALSE SpinLock could not be acquired.
-
-**/
-BOOLEAN
-EFIAPI
-AcquireSpinLockOrFail (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- return (BOOLEAN)(
- InterlockedCompareExchangePointer (
- (VOID**)SpinLock,
- (VOID*)SPIN_LOCK_RELEASED,
- (VOID*)SPIN_LOCK_ACQUIRED
- ) == (VOID*)SPIN_LOCK_RELEASED
- );
-}
-
-/**
- Releases a spin lock.
-
- This function places the spin lock specified by SpinLock in the release state
- and returns SpinLock.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to release.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-ReleaseSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- *SpinLock = SPIN_LOCK_RELEASED;
- return SpinLock;
-}
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedIncrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncIncrement (Value);
-}
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decremented value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedDecrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncDecrement (Value);
-}
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InterlockedCompareExchange32 (
- IN OUT UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange32 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InterlockedCompareExchange64 (
- IN OUT UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange64 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a pointer value.
-
- Performs an atomic compare exchange operation on the pointer value specified
- by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to
- CompareValue, then Value is returned. The compare exchange operation must be
- performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the pointer value for the compare exchange
- operation.
- @param CompareValue Pointer value used in compare operation.
- @param ExchangeValue Pointer value used in exchange operation.
-
-**/
-VOID *
-EFIAPI
-InterlockedCompareExchangePointer (
- IN OUT VOID **Value,
- IN VOID *CompareValue,
- IN VOID *ExchangeValue
- )
-{
- UINT8 SizeOfValue;
-
- SizeOfValue = sizeof (*Value);
-
- switch (SizeOfValue) {
- case sizeof (UINT32):
- return (VOID*)(UINTN)InterlockedCompareExchange32 (
- (UINT32*)Value,
- (UINT32)(UINTN)CompareValue,
- (UINT32)(UINTN)ExchangeValue
- );
- case sizeof (UINT64):
- return (VOID*)(UINTN)InterlockedCompareExchange64 (
- (UINT64*)Value,
- (UINT64)(UINTN)CompareValue,
- (UINT64)(UINTN)ExchangeValue
- );
- default:
- ASSERT (FALSE);
- return NULL;
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationGcc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationGcc.c
deleted file mode 100644
index e8d117bb0d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationGcc.c
+++ /dev/null
@@ -1,403 +0,0 @@
-/** @file
- Implementation of synchronization functions.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-
-#include "BaseLibInternals.h"
-
-//
-// GCC inline assembly for Read Write Barrier
-//
-#define _ReadWriteBarrier() do { asm volatile ("": : : "memory"); } while(0)
-
-#define SPIN_LOCK_RELEASED ((UINTN) 1)
-#define SPIN_LOCK_ACQUIRED ((UINTN) 2)
-
-/**
- Retrieves the architecture specific spin lock alignment requirements for
- optimal spin lock performance.
-
- This function retrieves the spin lock alignment requirements for optimal
- performance on a given CPU architecture. The spin lock alignment must be a
- power of two and is returned by this function. If there are no alignment
- requirements, then 1 must be returned. The spin lock synchronization
- functions must function correctly if the spin lock size and alignment values
- returned by this function are not used at all. These values are hints to the
- consumers of the spin lock synchronization functions to obtain optimal spin
- lock performance.
-
- @return The architecture specific spin lock alignment.
-
-**/
-UINTN
-EFIAPI
-GetSpinLockProperties (
- VOID
- )
-{
- // @bug May use a PCD entry to determine this alignment.
- return 32;
-}
-
-/**
- Initializes a spin lock to the released state and returns the spin lock.
-
- This function initializes the spin lock specified by SpinLock to the released
- state, and returns SpinLock. Optimal performance can be achieved by calling
- GetSpinLockProperties() to determine the size and alignment requirements for
- SpinLock.
-
- If SpinLock is NULL, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to initialize to the released
- state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-InitializeSpinLock (
- OUT SPIN_LOCK *SpinLock
- )
-{
- ASSERT (SpinLock != NULL);
-
- _ReadWriteBarrier();
- *SpinLock = SPIN_LOCK_RELEASED;
- _ReadWriteBarrier();
-
- return SpinLock;
-}
-
-/**
- Waits until a spin lock can be placed in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns SpinLock. Otherwise, this function waits
- indefinitely for the spin lock to be released, and then places it in the
- acquired state and returns SpinLock. All state transitions of SpinLock must
- be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
- If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in
- PcdSpinLockTimeout microseconds, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-AcquireSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- UINT64 Current;
- UINT64 Previous;
- UINT64 Total;
- UINT64 Start;
- UINT64 End;
- UINT64 Timeout;
- INT64 Cycle;
- INT64 Delta;
-
- if (PcdGet32 (PcdSpinLockTimeout) > 0) {
- //
- // Get the current timer value
- //
- Current = GetPerformanceCounter();
-
- //
- // Initialize local variables
- //
- Start = 0;
- End = 0;
- Total = 0;
-
- //
- // Retrieve the performance counter properties and compute the number of performance
- // counter ticks required to reach the timeout
- //
- Timeout = DivU64x32 (
- MultU64x32 (
- GetPerformanceCounterProperties (&Start, &End),
- PcdGet32 (PcdSpinLockTimeout)
- ),
- 1000000
- );
- Cycle = End - Start;
- if (Cycle < 0) {
- Cycle = -Cycle;
- }
- Cycle++;
-
- while (!AcquireSpinLockOrFail (SpinLock)) {
- CpuPause ();
- Previous = Current;
- Current = GetPerformanceCounter();
- Delta = (INT64) (Current - Previous);
- if (Start > End) {
- Delta = -Delta;
- }
- if (Delta < 0) {
- Delta += Cycle;
- }
- Total += Delta;
- ASSERT (Total < Timeout);
- }
- } else {
- while (!AcquireSpinLockOrFail (SpinLock)) {
- CpuPause ();
- }
- }
- return SpinLock;
-}
-
-/**
- Attempts to place a spin lock in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns TRUE. Otherwise, FALSE is returned. All state
- transitions of SpinLock must be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @retval TRUE SpinLock was placed in the acquired state.
- @retval FALSE SpinLock could not be acquired.
-
-**/
-BOOLEAN
-EFIAPI
-AcquireSpinLockOrFail (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
- VOID *Result;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- _ReadWriteBarrier ();
- Result = InterlockedCompareExchangePointer (
- (VOID**)SpinLock,
- (VOID*)SPIN_LOCK_RELEASED,
- (VOID*)SPIN_LOCK_ACQUIRED
- );
-
- _ReadWriteBarrier ();
- return (BOOLEAN) (Result == (VOID*) SPIN_LOCK_RELEASED);
-}
-
-/**
- Releases a spin lock.
-
- This function places the spin lock specified by SpinLock in the release state
- and returns SpinLock.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to release.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-ReleaseSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- _ReadWriteBarrier ();
- *SpinLock = SPIN_LOCK_RELEASED;
- _ReadWriteBarrier ();
-
- return SpinLock;
-}
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedIncrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncIncrement (Value);
-}
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decremented value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedDecrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncDecrement (Value);
-}
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InterlockedCompareExchange32 (
- IN OUT UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange32 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InterlockedCompareExchange64 (
- IN OUT UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange64 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a pointer value.
-
- Performs an atomic compare exchange operation on the pointer value specified
- by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to
- CompareValue, then Value is returned. The compare exchange operation must be
- performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the pointer value for the compare exchange
- operation.
- @param CompareValue Pointer value used in compare operation.
- @param ExchangeValue Pointer value used in exchange operation.
-
-**/
-VOID *
-EFIAPI
-InterlockedCompareExchangePointer (
- IN OUT VOID **Value,
- IN VOID *CompareValue,
- IN VOID *ExchangeValue
- )
-{
- UINT8 SizeOfValue;
-
- SizeOfValue = sizeof (*Value);
-
- switch (SizeOfValue) {
- case sizeof (UINT32):
- return (VOID*)(UINTN)InterlockedCompareExchange32 (
- (UINT32*)Value,
- (UINT32)(UINTN)CompareValue,
- (UINT32)(UINTN)ExchangeValue
- );
- case sizeof (UINT64):
- return (VOID*)(UINTN)InterlockedCompareExchange64 (
- (UINT64*)Value,
- (UINT64)(UINTN)CompareValue,
- (UINT64)(UINTN)ExchangeValue
- );
- default:
- ASSERT (FALSE);
- return NULL;
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationMsc.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationMsc.c
deleted file mode 100644
index 871f25d58c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/SynchronizationMsc.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/**
- Implementation of synchronization functions.
-
- Copyright (c) 2006 - 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.
-
- Module Name: SynchronizationMsc.c
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for read write barrier Intrinsics
-//
-void _ReadWriteBarrier (void);
-#pragma intrinsic(_ReadWriteBarrier)
-
-
-#define SPIN_LOCK_RELEASED ((UINTN) 1)
-#define SPIN_LOCK_ACQUIRED ((UINTN) 2)
-
-/**
- Retrieves the architecture specific spin lock alignment requirements for
- optimal spin lock performance.
-
- This function retrieves the spin lock alignment requirements for optimal
- performance on a given CPU architecture. The spin lock alignment must be a
- power of two and is returned by this function. If there are no alignment
- requirements, then 1 must be returned. The spin lock synchronization
- functions must function correctly if the spin lock size and alignment values
- returned by this function are not used at all. These values are hints to the
- consumers of the spin lock synchronization functions to obtain optimal spin
- lock performance.
-
- @return The architecture specific spin lock alignment.
-
-**/
-UINTN
-EFIAPI
-GetSpinLockProperties (
- VOID
- )
-{
- // @bug May use a PCD entry to determine this alignment.
- return 32;
-}
-
-/**
- Initializes a spin lock to the released state and returns the spin lock.
-
- This function initializes the spin lock specified by SpinLock to the released
- state, and returns SpinLock. Optimal performance can be achieved by calling
- GetSpinLockProperties() to determine the size and alignment requirements for
- SpinLock.
-
- If SpinLock is NULL, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to initialize to the released
- state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-InitializeSpinLock (
- OUT SPIN_LOCK *SpinLock
- )
-{
- ASSERT (SpinLock != NULL);
-
- _ReadWriteBarrier();
- *SpinLock = SPIN_LOCK_RELEASED;
- _ReadWriteBarrier();
-
- return SpinLock;
-}
-
-/**
- Waits until a spin lock can be placed in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns SpinLock. Otherwise, this function waits
- indefinitely for the spin lock to be released, and then places it in the
- acquired state and returns SpinLock. All state transitions of SpinLock must
- be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
- If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in
- PcdSpinLockTimeout microseconds, then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-AcquireSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- UINT64 Tick;
- UINT64 Start, End;
- UINT64 Timeout;
-
- Tick = 0;
- Start = 0;
- End = 0;
- if (PcdGet32 (PcdSpinLockTimeout) > 0) {
- Tick = GetPerformanceCounter ();
- Timeout = DivU64x32 (
- MultU64x32 (
- GetPerformanceCounterProperties (&Start, &End),
- PcdGet32 (PcdSpinLockTimeout)
- ),
- 1000000
- );
- if (Start < End) {
- Tick += Timeout;
- } else {
- Tick -= Timeout;
- }
- }
-
- while (!AcquireSpinLockOrFail (SpinLock)) {
- CpuPause ();
- ASSERT ((Start < End) ^ (Tick <= GetPerformanceCounter ()));
- }
- return SpinLock;
-}
-
-/**
- Attempts to place a spin lock in the acquired state.
-
- This function checks the state of the spin lock specified by SpinLock. If
- SpinLock is in the released state, then this function places SpinLock in the
- acquired state and returns TRUE. Otherwise, FALSE is returned. All state
- transitions of SpinLock must be performed using MP safe mechanisms.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to place in the acquired state.
-
- @retval TRUE SpinLock was placed in the acquired state.
- @retval FALSE SpinLock could not be acquired.
-
-**/
-BOOLEAN
-EFIAPI
-AcquireSpinLockOrFail (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
- VOID *Result;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- _ReadWriteBarrier ();
- Result = InterlockedCompareExchangePointer (
- (VOID**)SpinLock,
- (VOID*)SPIN_LOCK_RELEASED,
- (VOID*)SPIN_LOCK_ACQUIRED
- );
-
- _ReadWriteBarrier ();
- return (BOOLEAN) (Result == (VOID*) SPIN_LOCK_RELEASED);
-}
-
-/**
- Releases a spin lock.
-
- This function places the spin lock specified by SpinLock in the release state
- and returns SpinLock.
-
- If SpinLock is NULL, then ASSERT().
- If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().
-
- @param SpinLock A pointer to the spin lock to release.
-
- @return SpinLock
-
-**/
-SPIN_LOCK *
-EFIAPI
-ReleaseSpinLock (
- IN OUT SPIN_LOCK *SpinLock
- )
-{
- SPIN_LOCK LockValue;
-
- ASSERT (SpinLock != NULL);
-
- LockValue = *SpinLock;
- ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
-
- _ReadWriteBarrier ();
- *SpinLock = SPIN_LOCK_RELEASED;
- _ReadWriteBarrier ();
-
- return SpinLock;
-}
-
-/**
- Performs an atomic increment of an 32-bit unsigned integer.
-
- Performs an atomic increment of the 32-bit unsigned integer specified by
- Value and returns the incremented value. The increment operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to increment.
-
- @return The incremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedIncrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncIncrement (Value);
-}
-
-/**
- Performs an atomic decrement of an 32-bit unsigned integer.
-
- Performs an atomic decrement of the 32-bit unsigned integer specified by
- Value and returns the decremented value. The decrement operation must be
- performed using MP safe mechanisms. The state of the return value is not
- guaranteed to be MP safe.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value to decrement.
-
- @return The decremented value.
-
-**/
-UINT32
-EFIAPI
-InterlockedDecrement (
- IN UINT32 *Value
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncDecrement (Value);
-}
-
-/**
- Performs an atomic compare exchange operation on a 32-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 32-bit unsigned integer
- specified by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
- then Value is returned. The compare exchange operation must be performed using
- MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 32-bit value for the compare exchange
- operation.
- @param CompareValue 32-bit value used in compare operation.
- @param ExchangeValue 32-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT32
-EFIAPI
-InterlockedCompareExchange32 (
- IN OUT UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange32 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a 64-bit unsigned integer.
-
- Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
- by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
- CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
- The compare exchange operation must be performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the 64-bit value for the compare exchange
- operation.
- @param CompareValue 64-bit value used in compare operation.
- @param ExchangeValue 64-bit value used in exchange operation.
-
- @return The original *Value before exchange.
-
-**/
-UINT64
-EFIAPI
-InterlockedCompareExchange64 (
- IN OUT UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- ASSERT (Value != NULL);
- return InternalSyncCompareExchange64 (Value, CompareValue, ExchangeValue);
-}
-
-/**
- Performs an atomic compare exchange operation on a pointer value.
-
- Performs an atomic compare exchange operation on the pointer value specified
- by Value. If Value is equal to CompareValue, then Value is set to
- ExchangeValue and CompareValue is returned. If Value is not equal to
- CompareValue, then Value is returned. The compare exchange operation must be
- performed using MP safe mechanisms.
-
- If Value is NULL, then ASSERT().
-
- @param Value A pointer to the pointer value for the compare exchange
- operation.
- @param CompareValue Pointer value used in compare operation.
- @param ExchangeValue Pointer value used in exchange operation.
-
-**/
-VOID *
-EFIAPI
-InterlockedCompareExchangePointer (
- IN OUT VOID **Value,
- IN VOID *CompareValue,
- IN VOID *ExchangeValue
- )
-{
- UINT8 SizeOfValue;
-
- SizeOfValue = (UINT8) sizeof (*Value);
-
- switch (SizeOfValue) {
- case sizeof (UINT32):
- return (VOID*)(UINTN)InterlockedCompareExchange32 (
- (UINT32*)Value,
- (UINT32)(UINTN)CompareValue,
- (UINT32)(UINTN)ExchangeValue
- );
- case sizeof (UINT64):
- return (VOID*)(UINTN)InterlockedCompareExchange64 (
- (UINT64*)Value,
- (UINT64)(UINTN)CompareValue,
- (UINT64)(UINTN)ExchangeValue
- );
- default:
- ASSERT (FALSE);
- return NULL;
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Unaligned.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Unaligned.c
deleted file mode 100644
index 9c4b0cb2df..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/Unaligned.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Unaligned.c
-
-Abstract:
-
- Unaligned access functions of BaseLib.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Reads a 16-bit value from memory that may be unaligned.
-
- This function returns the 16-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
-
- @return *Uint16
-
-**/
-UINT16
-EFIAPI
-ReadUnaligned16 (
- IN CONST UINT16 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 16-bit value to memory that may be unaligned.
-
- This function writes the 16-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 16-bit value that may be unaligned.
- @param Value 16-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT16
-EFIAPI
-WriteUnaligned16 (
- OUT UINT16 *Buffer,
- IN UINT16 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-/**
- Reads a 24-bit value from memory that may be unaligned.
-
- This function returns the 24-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned24 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer & 0xffffff;
-}
-
-/**
- Writes a 24-bit value to memory that may be unaligned.
-
- This function writes the 24-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 24-bit value that may be unaligned.
- @param Value 24-bit value to write to Buffer.
-
- @return The value written.
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned24 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- *Buffer = BitFieldWrite32 (*Buffer, 0, 23, Value);
- return Value;
-}
-
-/**
- Reads a 32-bit value from memory that may be unaligned.
-
- This function returns the 32-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
-
- @return *Uint32
-
-**/
-UINT32
-EFIAPI
-ReadUnaligned32 (
- IN CONST UINT32 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 32-bit value to memory that may be unaligned.
-
- This function writes the 32-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 32-bit value that may be unaligned.
- @param Value 32-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-WriteUnaligned32 (
- OUT UINT32 *Buffer,
- IN UINT32 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
-
-/**
- Reads a 64-bit value from memory that may be unaligned.
-
- This function returns the 64-bit value pointed to by Buffer. The function
- guarantees that the read operation does not produce an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
-
- @return *Uint64
-
-**/
-UINT64
-EFIAPI
-ReadUnaligned64 (
- IN CONST UINT64 *Buffer
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer;
-}
-
-/**
- Writes a 64-bit value to memory that may be unaligned.
-
- This function writes the 64-bit value specified by Value to Buffer. Value is
- returned. The function guarantees that the write operation does not produce
- an alignment fault.
-
- If the Buffer is NULL, then ASSERT().
-
- @param Buffer Pointer to a 64-bit value that may be unaligned.
- @param Value 64-bit value to write to Buffer.
-
- @return Value
-
-**/
-UINT64
-EFIAPI
-WriteUnaligned64 (
- OUT UINT64 *Buffer,
- IN UINT64 Value
- )
-{
- ASSERT (Buffer != NULL);
-
- return *Buffer = Value;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.S
deleted file mode 100644
index 2ab97c2645..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.S
+++ /dev/null
@@ -1,26 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuBreakpoint.S
-#
-# Abstract:
-#
-# Implementation of CpuBreakpoint() on x86_64
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(CpuBreakpoint)
-ASM_PFX(CpuBreakpoint):
- int $0x3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.asm
deleted file mode 100644
index 9e33155b88..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuBreakpoint.Asm
-;
-; Abstract:
-;
-; CpuBreakpoint function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuBreakpoint (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuBreakpoint PROC
- int 3
- ret
-CpuBreakpoint ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.c
deleted file mode 100644
index ca80dcbd1d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuBreakpoint.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-void __debugbreak ();
-
-#pragma intrinsic(__debugbreak)
-
-VOID
-EFIAPI
-CpuBreakpoint (
- VOID
- )
-{
- __debugbreak ();
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuFlushTlb.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuFlushTlb.asm
deleted file mode 100644
index 18ce94f833..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuFlushTlb.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuFlushTlb.Asm
-;
-; Abstract:
-;
-; CpuFlushTlb function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuFlushTlb (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuFlushTlb PROC
- mov rax, cr3
- mov cr3, rax
- ret
-CpuFlushTlb ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.S
deleted file mode 100644
index f981cf3fa0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.S
+++ /dev/null
@@ -1,62 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuId.S
-#
-# Abstract:
-#
-# AsmCpuid function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmCpuid (
-# IN UINT32 RegisterInEax,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmCpuid)
-ASM_PFX(AsmCpuid):
- push %rbx
- mov %ecx, %eax
- push %rax # save Index on stack
- push %rdx
- cpuid
- test %r9, %r9
- jz L1
- mov %ecx, (%r9)
-L1:
- pop %rcx
- jrcxz L2
- mov %eax, (%rcx)
-L2:
- mov %r8, %rcx
- jrcxz L3
- mov %ebx, (%rcx)
-L3:
- mov 0x38(%rsp), %rcx
- jrcxz L4
- mov %edx, (%rcx)
-L4:
- pop %rax # restore Index to rax as return value
- pop %rbx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.asm
deleted file mode 100644
index 8510edbe93..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuId.asm
+++ /dev/null
@@ -1,60 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuId.Asm
-;
-; Abstract:
-;
-; AsmCpuid function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmCpuid (
-; IN UINT32 RegisterInEax,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-AsmCpuid PROC USES rbx
- mov eax, ecx
- push rax ; save Index on stack
- push rdx
- cpuid
- test r9, r9
- jz @F
- mov [r9], ecx
-@@:
- pop rcx
- jrcxz @F
- mov [rcx], eax
-@@:
- mov rcx, r8
- jrcxz @F
- mov [rcx], ebx
-@@:
- mov rcx, [rsp + 38h]
- jrcxz @F
- mov [rcx], edx
-@@:
- pop rax ; restore Index to rax as return value
- ret
-AsmCpuid ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.S
deleted file mode 100644
index 1bdc18929d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.S
+++ /dev/null
@@ -1,63 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CpuIdEx.Asm
-#
-# Abstract:
-#
-# AsmCpuidEx function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# AsmCpuidEx (
-# IN UINT32 RegisterInEax,
-# IN UINT32 RegisterInEcx,
-# OUT UINT32 *RegisterOutEax OPTIONAL,
-# OUT UINT32 *RegisterOutEbx OPTIONAL,
-# OUT UINT32 *RegisterOutEcx OPTIONAL,
-# OUT UINT32 *RegisterOutEdx OPTIONAL
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmCpuidEx)
-ASM_PFX(AsmCpuidEx):
- push %rbx
- movl %ecx,%eax
- movl %edx,%ecx
- push %rax
- cpuid
- mov 0x38(%rsp), %r10
- test %r10, %r10
- jz L1
- mov %ecx,(%r10)
-L1:
- mov %r8, %rcx
- jrcxz L2
- movl %eax,(%rcx)
-L2:
- mov %r9, %rcx
- jrcxz L3
- mov %ebx, (%rcx)
-L3:
- mov 0x40(%rsp), %rcx
- jrcxz L4
- mov %edx, (%rcx)
-L4:
- pop %rax
- pop %rbx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.asm
deleted file mode 100644
index 3335f96635..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuIdEx.asm
+++ /dev/null
@@ -1,62 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuIdEx.Asm
-;
-; Abstract:
-;
-; AsmCpuidEx function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; AsmCpuidEx (
-; IN UINT32 RegisterInEax,
-; IN UINT32 RegisterInEcx,
-; OUT UINT32 *RegisterOutEax OPTIONAL,
-; OUT UINT32 *RegisterOutEbx OPTIONAL,
-; OUT UINT32 *RegisterOutEcx OPTIONAL,
-; OUT UINT32 *RegisterOutEdx OPTIONAL
-; )
-;------------------------------------------------------------------------------
-AsmCpuidEx PROC USES rbx
- mov eax, ecx
- mov ecx, edx
- push rax ; save Index on stack
- cpuid
- mov r10, [rsp + 38h]
- test r10, r10
- jz @F
- mov [r10], ecx
-@@:
- mov rcx, r8
- jrcxz @F
- mov [rcx], eax
-@@:
- mov rcx, r9
- jrcxz @F
- mov [rcx], ebx
-@@:
- mov rcx, [rsp + 40h]
- jrcxz @F
- mov [rcx], edx
-@@:
- pop rax ; restore Index to rax as return value
- ret
-AsmCpuidEx ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.S
deleted file mode 100644
index d4408c7dae..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# 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.
-#
-# Module Name:
-#
-# CpuPause.S
-#
-# Abstract:
-#
-# CpuPause function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuPause (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(CpuPause)
-ASM_PFX(CpuPause):
- pause
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.asm
deleted file mode 100644
index 545b27f8d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuPause.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuPause.Asm
-;
-; Abstract:
-;
-; CpuPause function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuPause (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuPause PROC
- pause
- ret
-CpuPause ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.S
deleted file mode 100644
index 88dd63054c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.S
+++ /dev/null
@@ -1,34 +0,0 @@
-#------------------------------------------------------------------------------ ;
-# 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.
-#
-# Module Name:
-#
-# CpuSleep.S
-#
-# Abstract:
-#
-# CpuSleep function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# CpuSleep (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(CpuSleep)
-ASM_PFX(CpuSleep):
- hlt
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.asm
deleted file mode 100644
index 5e0951ded9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/CpuSleep.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; CpuSleep.Asm
-;
-; Abstract:
-;
-; CpuSleep function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuSleep (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuSleep PROC
- hlt
- ret
-CpuSleep ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.S
deleted file mode 100644
index 54c380c1f9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DisableInterrupts.S
-#
-# Abstract:
-#
-# DisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# DisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(DisableInterrupts)
-ASM_PFX(DisableInterrupts):
- cli
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.asm
deleted file mode 100644
index e2acca0015..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisableInterrupts.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; DisableInterrupts.Asm
-;
-; Abstract:
-;
-; DisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; DisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-DisableInterrupts PROC
- cli
- ret
-DisableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S
deleted file mode 100644
index a503d393e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.S
+++ /dev/null
@@ -1,66 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# DisablePaging64.S
-#
-# Abstract:
-#
-# AsmDisablePaging64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86DisablePaging64 (
-# IN UINT16 Cs, %rdi
-# IN UINT64 EntryPoint, %rsi
-# IN UINT64 Context1, OPTIONAL %rdx
-# IN UINT32 Context2, OPTIONAL %rcx
-# IN UINT64 NewStack %r8
-# );
-#------------------------------------------------------------------------------
-
-.globl ASM_PFX(InternalX86DisablePaging64)
-ASM_PFX(InternalX86DisablePaging64):
- cli
- shl $0x20,%rcx
- lea (%rip), %eax
- mov %eax,%ecx
- push %rcx
- mov %edx,%ebx
- mov %r8d,%esi
- mov %r9d,%edi
- mov 0x28(%rsp),%eax
- lret
-L1:
- mov %eax,%esp
- mov %cr0,%rax
- btr $0x1f,%eax
- mov %rax,%cr0
- mov $0xc0000080,%ecx
- rdmsr
- and $0xfe,%ah
- wrmsr
- mov %cr4,%rax
- and $0xdf,%al
- mov %rax,%cr4
- push %rdi
- push %rsi
- callq *%rbx
- jmp .
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.asm
deleted file mode 100644
index 853e60318c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/DisablePaging64.asm
+++ /dev/null
@@ -1,63 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; DisablePaging64.Asm
-;
-; Abstract:
-;
-; AsmDisablePaging64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86DisablePaging64 (
-; IN UINT16 Cs,
-; IN UINT32 EntryPoint,
-; IN UINT32 Context1, OPTIONAL
-; IN UINT32 Context2, OPTIONAL
-; IN UINT32 NewStack
-; );
-;------------------------------------------------------------------------------
-InternalX86DisablePaging64 PROC
- cli
- shl rcx, 32 ; rcx[32..47] <- Cs
- lea eax, @F
- mov esi, r8d
- or rcx, rax ; rcx[0..47] <- Cs:@F
- mov edi, r9d
- mov eax, [rsp + 28h] ; eax <- New Stack
- push rcx
- retf ; switch to compatibility mode
-@@:
- mov esp, eax ; set up new stack
- mov rax, cr0
- btr eax, 31
- mov cr0, rax ; disable paging
- mov ecx, 0c0000080h
- rdmsr
- and ah, NOT 1 ; clear LME
- wrmsr
- mov rax, cr4
- and al, NOT (1 SHL 5) ; clear PAE
- mov cr4, rax
- push rdi ; push Context2
- push rsi ; push Context1
- call rdx ; transfer control to EntryPoint
- hlt ; no one should get here
-InternalX86DisablePaging64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.S
deleted file mode 100644
index e68ee4f600..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnableDisableInterrupts.S
-#
-# Abstract:
-#
-# EnableDisableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableDisableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(EnableDisableInterrupts)
-ASM_PFX(EnableDisableInterrupts):
- sti
- cli
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.asm
deleted file mode 100644
index 4306f876f9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableDisableInterrupts.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; EnableDisableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableDisableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableDisableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-EnableDisableInterrupts PROC
- sti
- cli
- ret
-EnableDisableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.S
deleted file mode 100644
index acadeffdb1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnableInterrupts.S
-#
-# Abstract:
-#
-# EnableInterrupts function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# EnableInterrupts (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(EnableInterrupts)
-ASM_PFX(EnableInterrupts):
- sti
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.asm
deleted file mode 100644
index 037c1cfd98..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnableInterrupts.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; EnableInterrupts.Asm
-;
-; Abstract:
-;
-; EnableInterrupts function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; EnableInterrupts (
-; VOID
-; );
-;------------------------------------------------------------------------------
-EnableInterrupts PROC
- sti
- ret
-EnableInterrupts ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.S
deleted file mode 100644
index a7eef143a7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EnablePaging64.S
-#
-# Abstract:
-#
-# AsmEnablePaging64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86EnablePaging64 (
-# IN UINT16 Cs, %rdi
-# IN UINT64 EntryPoint, %rsi
-# IN UINT64 Context1, OPTIONAL %rdx
-# IN UINT64 Context2, OPTIONAL %rcx
-# IN UINT64 NewStack %r8
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86EnablePaging64)
-ASM_PFX(InternalX86EnablePaging64):
- cli
- pop %rax
- callq Base
-Base:
- addl $(L1-Base),(%rsp)
- mov %cr4,%rax
- or $0x20,%al
- mov %rax,%cr4
- mov $0xc0000080,%ecx
- rdmsr
- or $0x1,%ah
- wrmsr
- mov %cr0,%rax
- bts $0x1f,%eax
- mov %rax,%cr0
- lret
-L1:
- addr32 mov (%esp),%rbx
- addr32 mov 0x8(%esp),%rcx
- addr32 mov 0x10(%esp),%rdx
- addr32 mov 0x18(%esp),%rsp
- add $-0x20,%rsp
- callq *%rbx
- jmp .
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.asm
deleted file mode 100644
index 1492f5fdf4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/EnablePaging64.asm
+++ /dev/null
@@ -1,62 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; EnablePaging64.Asm
-;
-; Abstract:
-;
-; AsmEnablePaging64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86EnablePaging64 (
-; IN UINT16 Cs,
-; IN UINT64 EntryPoint,
-; IN UINT64 Context1, OPTIONAL
-; IN UINT64 Context2, OPTIONAL
-; IN UINT64 NewStack
-; );
-;------------------------------------------------------------------------------
-InternalX86EnablePaging64 PROC
- cli
- pop rax ; skip the return address
- call @Base
-@Base:
- add dword ptr [rsp], @F - @Base ; offset for far retf, seg is the 1st arg
- mov rax, cr4 ; mov eax, cr4
- or al, (1 SHL 5)
- mov cr4, rax ; enable PAE
- mov ecx, 0c0000080h
- rdmsr
- or ah, 1 ; set LME
- wrmsr
- mov rax, cr0 ; mov eax, cr0
- bts eax, 31
- mov cr0, rax ; enable paging
- retf
-@@: ; long mode starts here
- mov rbx, [esp]
- mov rcx, [esp + 8]
- mov rdx, [esp + 10h]
- mov rsp, [esp + 18h]
- add rsp, -20h
- call rbx
- hlt ; halt processor if EntryPoint() returned
-InternalX86EnablePaging64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.S
deleted file mode 100644
index 364b3936c8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FlushCacheLine.S
-#
-# Abstract:
-#
-# AsmFlushCacheLine function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# AsmFlushCacheLine (
-# IN VOID *LinearAddress
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmFlushCacheLine)
-ASM_PFX(AsmFlushCacheLine):
- clflush (%rdi)
- mov %rdi, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.asm
deleted file mode 100644
index 5c553d41ee..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FlushCacheLine.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; FlushCacheLine.Asm
-;
-; Abstract:
-;
-; AsmFlushCacheLine function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; AsmFlushCacheLine (
-; IN VOID *LinearAddress
-; );
-;------------------------------------------------------------------------------
-AsmFlushCacheLine PROC
- clflush [rcx]
- mov rax, rcx
- ret
-AsmFlushCacheLine ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.S
deleted file mode 100644
index c805aa57be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FxRestore.S
-#
-# Abstract:
-#
-# AsmFxRestore function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# )#
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86FxRestore)
-ASM_PFX(InternalX86FxRestore):
- fxrstor (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.asm
deleted file mode 100644
index 4f1bf22d8e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxRestore.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; FxRestore.Asm
-;
-; Abstract:
-;
-; AsmFxRestore function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-InternalX86FxRestore PROC
- fxrstor [rcx]
- ret
-InternalX86FxRestore ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.S
deleted file mode 100644
index 57d754b49a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# FxSave.S
-#
-# Abstract:
-#
-# AsmFxSave function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86FxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86FxSave)
-ASM_PFX(InternalX86FxSave):
- fxsave (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.asm
deleted file mode 100644
index 91b8dbd956..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/FxSave.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; FxSave.Asm
-;
-; Abstract:
-;
-; AsmFxSave function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86FxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-InternalX86FxSave PROC
- fxsave [rcx]
- ret
-InternalX86FxSave ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.S
deleted file mode 100644
index 3a8f6ca9fb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedCompareExchange32.Asm
-#
-# Abstract:
-#
-# InterlockedCompareExchange32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedCompareExchange32 (
-# IN UINT32 *Value,
-# IN UINT32 CompareValue,
-# IN UINT32 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalSyncCompareExchange32)
-ASM_PFX(InternalSyncCompareExchange32):
- mov %edx, %eax
- lock cmpxchg %r8d, (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.asm
deleted file mode 100644
index 8951aac2d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; InterlockedCompareExchange32.Asm
-;
-; Abstract:
-;
-; InterlockedCompareExchange32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InterlockedCompareExchange32 (
-; IN UINT32 *Value,
-; IN UINT32 CompareValue,
-; IN UINT32 ExchangeValue
-; );
-;------------------------------------------------------------------------------
-InternalSyncCompareExchange32 PROC
- mov eax, edx
- lock cmpxchg [rcx], r8d
- ret
-InternalSyncCompareExchange32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.c
deleted file mode 100644
index 9e039e3158..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange32.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- InterlockedCompareExchange32 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-long _InterlockedCompareExchange(
- long volatile * Destination,
- long Exchange,
- long Comperand
-);
-
-#pragma intrinsic(_InterlockedCompareExchange)
-
-UINT32
-EFIAPI
-InternalSyncCompareExchange32 (
- IN volatile UINT32 *Value,
- IN UINT32 CompareValue,
- IN UINT32 ExchangeValue
- )
-{
- return _InterlockedCompareExchange (Value, ExchangeValue, CompareValue);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.S
deleted file mode 100644
index 974bf81922..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedCompareExchange64.S
-#
-# Abstract:
-#
-# InterlockedCompareExchange64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# InterlockedCompareExchange64 (
-# IN UINT64 *Value,
-# IN UINT64 CompareValue,
-# IN UINT64 ExchangeValue
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalSyncCompareExchange64)
-ASM_PFX(InternalSyncCompareExchange64):
- mov %rsi, %rax
- lock cmpxchg %rdx,(%rdi)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.asm
deleted file mode 100644
index e703249f78..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; InterlockedCompareExchange64.Asm
-;
-; Abstract:
-;
-; InterlockedCompareExchange64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; InterlockedCompareExchange64 (
-; IN UINT64 *Value,
-; IN UINT64 CompareValue,
-; IN UINT64 ExchangeValue
-; );
-;------------------------------------------------------------------------------
-InternalSyncCompareExchange64 PROC
- mov rax, rdx
- lock cmpxchg [rcx], r8
- ret
-InternalSyncCompareExchange64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.c
deleted file mode 100644
index cb67a95239..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedCompareExchange64.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- InterlockedCompareExchange64 function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-__int64 _InterlockedCompareExchange64(
- __int64 volatile * Destination,
- __int64 Exchange,
- __int64 Comperand
-);
-
-#pragma intrinsic(_InterlockedCompareExchange64)
-
-UINT64
-EFIAPI
-InternalSyncCompareExchange64 (
- IN volatile UINT64 *Value,
- IN UINT64 CompareValue,
- IN UINT64 ExchangeValue
- )
-{
- return _InterlockedCompareExchange64 (Value, ExchangeValue, CompareValue);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.S
deleted file mode 100644
index df4f586dce..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedDecrement.S
-#
-# Abstract:
-#
-# InterlockedDecrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedDecrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalSyncDecrement)
-ASM_PFX(InternalSyncDecrement):
- lock decl (%rcx)
- mov (%rcx), %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.asm
deleted file mode 100644
index 42a7119e43..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; InterlockedDecrement.Asm
-;
-; Abstract:
-;
-; InterlockedDecrement function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InterlockedDecrement (
-; IN UINT32 *Value
-; );
-;------------------------------------------------------------------------------
-InternalSyncDecrement PROC
- lock dec dword ptr [rcx]
- mov eax, [rcx]
- ret
-InternalSyncDecrement ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.c
deleted file mode 100644
index 11155524cf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedDecrement.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- InterlockedDecrement function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-long _InterlockedDecrement(
- long * lpAddend
-);
-
-#pragma intrinsic(_InterlockedDecrement)
-
-UINT32
-EFIAPI
-InternalSyncDecrement (
- IN volatile UINT32 *Value
- )
-{
- return _InterlockedDecrement ((long *)Value);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.S
deleted file mode 100644
index 985f14f992..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# InterlockedIncrement.S
-#
-# Abstract:
-#
-# InterlockedIncrement function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT32
-# EFIAPI
-# InterlockedIncrement (
-# IN UINT32 *Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalSyncIncrement)
-ASM_PFX(InternalSyncIncrement):
- lock incl (%rcx)
- mov (%rcx), %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.asm
deleted file mode 100644
index f787a03789..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; InterlockedIncrement.Asm
-;
-; Abstract:
-;
-; InterlockedIncrement function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT32
-; EFIAPI
-; InterlockedIncrement (
-; IN UINT32 *Value
-; );
-;------------------------------------------------------------------------------
-InternalSyncIncrement PROC
- lock inc dword ptr [rcx]
- mov eax, [rcx]
- ret
-InternalSyncIncrement ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.c
deleted file mode 100644
index 6b291243e7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/InterlockedIncrement.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- InterLockedIncrement function
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-long _InterlockedIncrement(
- long * lpAddend
-);
-
-#pragma intrinsic(_InterlockedIncrement)
-
-UINT32
-EFIAPI
-InternalSyncIncrement (
- IN volatile UINT32 *Value
- )
-{
- return _InterlockedIncrement ((long *)Value);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.S
deleted file mode 100644
index 3ad09581b0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Invd.S
-#
-# Abstract:
-#
-# AsmInvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmInvd (
-# VOID
-# )#
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmInvd)
-ASM_PFX(AsmInvd):
- invd
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.asm
deleted file mode 100644
index dff83ce50a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Invd.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; Invd.Asm
-;
-; Abstract:
-;
-; AsmInvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmInvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmInvd PROC
- invd
- ret
-AsmInvd ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.S
deleted file mode 100644
index 9d83283231..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 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.
-#
-# Module Name:
-#
-# LongJump.S
-#
-# Abstract:
-#
-# Implementation of _LongJump() on x64.
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalLongJump (
-# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalLongJump)
-ASM_PFX(InternalLongJump):
- mov (%rcx), %rbx
- mov 0x8(%rcx), %rsp
- mov 0x10(%rcx), %rbp
- mov 0x18(%rcx), %rdi
- mov 0x20(%rcx), %rsi
- mov 0x28(%rcx), %r12
- mov 0x30(%rcx), %r13
- mov 0x38(%rcx), %r14
- mov 0x40(%rcx), %r15
- # load non-volatile fp registers
- ldmxcsr 0x50(%rcx)
- movdqu 0x58(%rcx), %xmm6
- movdqu 0x68(%rcx), %xmm7
- movdqu 0x78(%rcx), %xmm8
- movdqu 0x88(%rcx), %xmm9
- movdqu 0x98(%rcx), %xmm10
- movdqu 0xA8(%rcx), %xmm11
- movdqu 0xB8(%rcx), %xmm12
- movdqu 0xC8(%rcx), %xmm13
- movdqu 0xD8(%rcx), %xmm14
- movdqu 0xE8(%rcx), %xmm15
- mov %rdx, %rax # set return value
- jmp *0x48(%rcx)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.asm
deleted file mode 100644
index de6a81f015..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/LongJump.asm
+++ /dev/null
@@ -1,56 +0,0 @@
-; Copyright (c) 2004 - 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.
-;
-; Module Name:
-;
-; LongJump.Asm
-;
-; Abstract:
-;
-; Implementation of _LongJump() on x64.
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalLongJump (
-; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-InternalLongJump PROC
- mov rbx, [rcx]
- mov rsp, [rcx + 8]
- mov rbp, [rcx + 10h]
- mov rdi, [rcx + 18h]
- mov rsi, [rcx + 20h]
- mov r12, [rcx + 28h]
- mov r13, [rcx + 30h]
- mov r14, [rcx + 38h]
- mov r15, [rcx + 40h]
- ; load non-volatile fp registers
- ldmxcsr [rcx + 50h]
- movdqu xmm6, [rcx + 58h]
- movdqu xmm7, [rcx + 68h]
- movdqu xmm8, [rcx + 78h]
- movdqu xmm9, [rcx + 88h]
- movdqu xmm10, [rcx + 98h]
- movdqu xmm11, [rcx + 0A8h]
- movdqu xmm12, [rcx + 0B8h]
- movdqu xmm13, [rcx + 0C8h]
- movdqu xmm14, [rcx + 0D8h]
- movdqu xmm15, [rcx + 0E8h]
- mov rax, rdx ; set return value
- jmp qword ptr [rcx + 48h]
-InternalLongJump ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.S
deleted file mode 100644
index 3a881d08da..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.S
+++ /dev/null
@@ -1,40 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Monitor.S
-#
-# Abstract:
-#
-# AsmMonitor function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMonitor (
-# IN UINTN Eax,
-# IN UINTN Ecx,
-# IN UINTN Edx
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmMonitor)
-ASM_PFX(AsmMonitor):
- mov %ecx,%eax
- mov %edx,%ecx
- mov %r8d,%edx
- monitor
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.asm
deleted file mode 100644
index bf3738a3d9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Monitor.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; Monitor.Asm
-;
-; Abstract:
-;
-; AsmMonitor function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmMonitor (
-; IN UINTN Eax,
-; IN UINTN Ecx,
-; IN UINTN Edx
-; );
-;------------------------------------------------------------------------------
-AsmMonitor PROC
- mov eax, ecx
- mov ecx, edx
- mov edx, r8d
- DB 0fh, 1, 0c8h ; monitor
- ret
-AsmMonitor ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.S
deleted file mode 100644
index ea684e01de..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.S
+++ /dev/null
@@ -1,38 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Mwait.S
-#
-# Abstract:
-#
-# AsmMwait function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmMwait (
-# IN UINTN Eax,
-# IN UINTN Ecx
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmMwait)
-ASM_PFX(AsmMwait):
- mov %ecx,%eax
- mov %edx,%ecx
- mwait
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.asm
deleted file mode 100644
index 70f0769687..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Mwait.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; Mwait.Asm
-;
-; Abstract:
-;
-; AsmMwait function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmMwait (
-; IN UINTN Eax,
-; IN UINTN Ecx
-; );
-;------------------------------------------------------------------------------
-AsmMwait PROC
- mov eax, ecx
- mov ecx, edx
- DB 0fh, 1, 0c9h ; mwait
- ret
-AsmMwait ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Non-existing.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Non-existing.c
deleted file mode 100644
index 25e074cb3e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Non-existing.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Non-existing.c
-
-Abstract:
-
- Non-existing BaseLib functions on x64
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-InternalX86EnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- //
- // This function cannot work on X64 platform
- //
- ASSERT (FALSE);
-}
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-InternalX86DisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- //
- // This function cannot work on X64 platform
- //
- ASSERT (FALSE);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.S
deleted file mode 100644
index f3aaf56fcf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr0.S
-#
-# Abstract:
-#
-# AsmReadCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadCr0)
-ASM_PFX(AsmReadCr0):
- mov %cr0, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.asm
deleted file mode 100644
index b647920e2f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr0.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadCr0.Asm
-;
-; Abstract:
-;
-; AsmReadCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr0 PROC
- mov rax, cr0
- ret
-AsmReadCr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.S
deleted file mode 100644
index 7d57e35768..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr2.S
-#
-# Abstract:
-#
-# AsmReadCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadCr2)
-ASM_PFX(AsmReadCr2):
- mov %cr2, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.asm
deleted file mode 100644
index dd3032c901..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr2.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadCr2.Asm
-;
-; Abstract:
-;
-; AsmReadCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr2 PROC
- mov rax, cr2
- ret
-AsmReadCr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.S
deleted file mode 100644
index 53a5cd282f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr3.S
-#
-# Abstract:
-#
-# AsmReadCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadCr3)
-ASM_PFX(AsmReadCr3):
- mov %cr3, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.asm
deleted file mode 100644
index dd2438184c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr3.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadCr3.Asm
-;
-; Abstract:
-;
-; AsmReadCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr3 PROC
- mov rax, cr3
- ret
-AsmReadCr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.S
deleted file mode 100644
index f17d28f28f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCr4.S
-#
-# Abstract:
-#
-# AsmReadCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadCr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadCr4)
-ASM_PFX(AsmReadCr4):
- mov %cr4, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.asm
deleted file mode 100644
index 6bccddabc5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCr4.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadCr4.Asm
-;
-; Abstract:
-;
-; AsmReadCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadCr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCr4 PROC
- mov rax, cr4
- ret
-AsmReadCr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.S
deleted file mode 100644
index 9687158660..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadCs.S
-#
-# Abstract:
-#
-# AsmReadCs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadCs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadCs)
-ASM_PFX(AsmReadCs):
- mov %cs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.asm
deleted file mode 100644
index 34e437e755..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadCs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadCs.Asm
-;
-; Abstract:
-;
-; AsmReadCs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadCs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadCs PROC
- mov eax, cs
- ret
-AsmReadCs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.S
deleted file mode 100644
index 57c06381aa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr0.S
-#
-# Abstract:
-#
-# AsmReadDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr0)
-ASM_PFX(AsmReadDr0):
- mov %dr0, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.asm
deleted file mode 100644
index ec7979f858..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr0.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr0.Asm
-;
-; Abstract:
-;
-; AsmReadDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr0 PROC
- mov rax, dr0
- ret
-AsmReadDr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.S
deleted file mode 100644
index 83b141b1f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr1.S
-#
-# Abstract:
-#
-# AsmReadDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr1)
-ASM_PFX(AsmReadDr1):
- mov %dr1, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.asm
deleted file mode 100644
index bf881cbbe7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr1.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr1.Asm
-;
-; Abstract:
-;
-; AsmReadDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr1 PROC
- mov rax, dr1
- ret
-AsmReadDr1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.S
deleted file mode 100644
index d286a36d2d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr2.S
-#
-# Abstract:
-#
-# AsmReadDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr2)
-ASM_PFX(AsmReadDr2):
- mov %dr2, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.asm
deleted file mode 100644
index eada394e53..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr2.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr2.Asm
-;
-; Abstract:
-;
-; AsmReadDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr2 PROC
- mov rax, dr2
- ret
-AsmReadDr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.S
deleted file mode 100644
index 681f01319c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr3.S
-#
-# Abstract:
-#
-# AsmReadDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr3)
-ASM_PFX(AsmReadDr3):
- mov %dr3, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.asm
deleted file mode 100644
index 3156b52e7d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr3.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr3.Asm
-;
-; Abstract:
-;
-; AsmReadDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr3 PROC
- mov rax, dr3
- ret
-AsmReadDr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.S
deleted file mode 100644
index e5086ac289..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr4.S
-#
-# Abstract:
-#
-# AsmReadDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr4)
-ASM_PFX(AsmReadDr4):
- #DB 0fh, 21h, 0e0h
- mov %dr4, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.asm
deleted file mode 100644
index 33aa1b8142..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr4.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr4.Asm
-;
-; Abstract:
-;
-; AsmReadDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr4 PROC
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0fh, 21h, 0e0h
- ret
-AsmReadDr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.S
deleted file mode 100644
index 4b8688f876..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr5.S
-#
-# Abstract:
-#
-# AsmReadDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr5)
-ASM_PFX(AsmReadDr5):
- mov %dr5, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.asm
deleted file mode 100644
index eb381547e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr5.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr5.Asm
-;
-; Abstract:
-;
-; AsmReadDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr5 PROC
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0fh, 21h, 0e8h
- ret
-AsmReadDr5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.S
deleted file mode 100644
index 16406bb97a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr6.S
-#
-# Abstract:
-#
-# AsmReadDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr6)
-ASM_PFX(AsmReadDr6):
- mov %dr6, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.asm
deleted file mode 100644
index 69d270f02b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr6.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr6.Asm
-;
-; Abstract:
-;
-; AsmReadDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr6 PROC
- mov rax, dr6
- ret
-AsmReadDr6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.S
deleted file mode 100644
index 8994be9c0b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDr7.S
-#
-# Abstract:
-#
-# AsmReadDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadDr7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDr7)
-ASM_PFX(AsmReadDr7):
- mov %dr7, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.asm
deleted file mode 100644
index fe91b04693..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDr7.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDr7.Asm
-;
-; Abstract:
-;
-; AsmReadDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadDr7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDr7 PROC
- mov rax, dr7
- ret
-AsmReadDr7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.S
deleted file mode 100644
index 20173e318e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadDs.S
-#
-# Abstract:
-#
-# AsmReadDs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadDs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadDs)
-ASM_PFX(AsmReadDs):
- movl %ds, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.asm
deleted file mode 100644
index 0bb8a23e36..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadDs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadDs.Asm
-;
-; Abstract:
-;
-; AsmReadDs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadDs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadDs PROC
- mov eax, ds
- ret
-AsmReadDs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.S
deleted file mode 100644
index c12b398bea..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadEflags.S
-#
-# Abstract:
-#
-# AsmReadEflags function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmReadEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadEflags)
-ASM_PFX(AsmReadEflags):
- pushfq
- pop %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.asm
deleted file mode 100644
index 96e03bc959..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEflags.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadEflags.Asm
-;
-; Abstract:
-;
-; AsmReadEflags function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmReadEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadEflags PROC
- pushfq
- pop rax
- ret
-AsmReadEflags ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.S
deleted file mode 100644
index c68061b80d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadEs.S
-#
-# Abstract:
-#
-# AsmReadEs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadEs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadEs)
-ASM_PFX(AsmReadEs):
- mov %es, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.asm
deleted file mode 100644
index 90cb97ee41..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadEs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadEs.Asm
-;
-; Abstract:
-;
-; AsmReadEs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadEs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadEs PROC
- mov eax, es
- ret
-AsmReadEs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.S
deleted file mode 100644
index 14705d6c0e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadFs.S
-#
-# Abstract:
-#
-# AsmReadFs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadFs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadFs)
-ASM_PFX(AsmReadFs):
- mov %fs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.asm
deleted file mode 100644
index 85869ca2ac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadFs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadFs.Asm
-;
-; Abstract:
-;
-; AsmReadFs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadFs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadFs PROC
- mov eax, fs
- ret
-AsmReadFs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.S
deleted file mode 100644
index 9b6f16251f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadGdtr.S
-#
-# Abstract:
-#
-# AsmReadGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadGdtr (
-# OUT IA32_DESCRIPTOR *Gdtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86ReadGdtr)
-ASM_PFX(InternalX86ReadGdtr):
- sgdt (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.asm
deleted file mode 100644
index 4da4535a1c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadGdtr.Asm
-;
-; Abstract:
-;
-; AsmReadGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadGdtr (
-; OUT IA32_DESCRIPTOR *Gdtr
-; );
-;------------------------------------------------------------------------------
-InternalX86ReadGdtr PROC
- sgdt fword ptr [rcx]
- ret
-InternalX86ReadGdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.S
deleted file mode 100644
index fa955b791d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadGs.S
-#
-# Abstract:
-#
-# AsmReadGs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadGs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadGs)
-ASM_PFX(AsmReadGs):
- mov %gs, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.asm
deleted file mode 100644
index 457d0c0e96..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadGs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadGs.Asm
-;
-; Abstract:
-;
-; AsmReadGs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadGs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadGs PROC
- mov eax, gs
- ret
-AsmReadGs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.S
deleted file mode 100644
index fabbd2a2ed..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadIdtr.AS
-#
-# Abstract:
-#
-# AsmReadIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86ReadIdtr (
-# OUT IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86ReadIdtr)
-ASM_PFX(InternalX86ReadIdtr):
- sidt (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.asm
deleted file mode 100644
index 5a60494d0f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadIdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadIdtr.Asm
-;
-; Abstract:
-;
-; AsmReadIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86ReadIdtr (
-; OUT IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86ReadIdtr PROC
- sidt fword ptr [rcx]
- ret
-InternalX86ReadIdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.S
deleted file mode 100644
index db92a22e27..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadLdtr.AS
-#
-# Abstract:
-#
-# AsmReadLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadLdtr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadLdtr)
-ASM_PFX(AsmReadLdtr):
- sldt %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.asm
deleted file mode 100644
index 274b086462..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadLdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadLdtr.Asm
-;
-; Abstract:
-;
-; AsmReadLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadLdtr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadLdtr PROC
- sldt eax
- ret
-AsmReadLdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.S
deleted file mode 100644
index ca93d74e46..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm0.S
-#
-# Abstract:
-#
-# AsmReadMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm0 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm0)
-ASM_PFX(AsmReadMm0):
- #DB 48h, 0fh, 7eh, 0c0h
- movd %mm0, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.asm
deleted file mode 100644
index e40d77981a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm0.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm0.Asm
-;
-; Abstract:
-;
-; AsmReadMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm0 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm0 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0c0h
- ret
-AsmReadMm0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.S
deleted file mode 100644
index 99470f85ee..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm1.S
-#
-# Abstract:
-#
-# AsmReadMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm1 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm1)
-ASM_PFX(AsmReadMm1):
- #DB 48h, 0fh, 7eh, 0c8h
- movd %mm1, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.asm
deleted file mode 100644
index dcc548e3a3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm1.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm1.Asm
-;
-; Abstract:
-;
-; AsmReadMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm1 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm1 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0c8h
- ret
-AsmReadMm1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.S
deleted file mode 100644
index db9dfa237c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm2.S
-#
-# Abstract:
-#
-# AsmReadMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm2 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm2)
-ASM_PFX(AsmReadMm2):
- #DB 48h, 0fh, 7eh, 0d0h
- movd %mm2, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.asm
deleted file mode 100644
index ea924c3ad2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm2.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm2.Asm
-;
-; Abstract:
-;
-; AsmReadMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm2 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm2 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0d0h
- ret
-AsmReadMm2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.S
deleted file mode 100644
index 4c95753aba..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm3.S
-#
-# Abstract:
-#
-# AsmReadMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm3 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm3)
-ASM_PFX(AsmReadMm3):
- #DB 48h, 0fh, 7eh, 0d8h
- movd %mm3, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.asm
deleted file mode 100644
index fd754b3c20..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm3.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm3.Asm
-;
-; Abstract:
-;
-; AsmReadMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm3 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm3 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0d8h
- ret
-AsmReadMm3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.S
deleted file mode 100644
index 43f1f7753a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm4.AS
-#
-# Abstract:
-#
-# AsmReadMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm4 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm4)
-ASM_PFX(AsmReadMm4):
- #DB 48h, 0fh, 7eh, 0e0h
- movd %mm4, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.asm
deleted file mode 100644
index a698c261d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm4.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm4.Asm
-;
-; Abstract:
-;
-; AsmReadMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm4 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm4 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0e0h
- ret
-AsmReadMm4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.S
deleted file mode 100644
index 3f16745f0f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm5.S
-#
-# Abstract:
-#
-# AsmReadMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm5 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm5)
-ASM_PFX(AsmReadMm5):
- #DB 48h, 0fh, 7eh, 0e8h
- movd %mm5, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.asm
deleted file mode 100644
index cdbdb7299c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm5.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm5.Asm
-;
-; Abstract:
-;
-; AsmReadMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm5 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm5 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0e8h
- ret
-AsmReadMm5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.S
deleted file mode 100644
index a2428d8199..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm6.S
-#
-# Abstract:
-#
-# AsmReadMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm6 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm6)
-ASM_PFX(AsmReadMm6):
- #DB 48h, 0fh, 7eh, 0f0h
- movd %mm6, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.asm
deleted file mode 100644
index 1775cf26bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm6.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm6.Asm
-;
-; Abstract:
-;
-; AsmReadMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm6 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm6 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0f0h
- ret
-AsmReadMm6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.S
deleted file mode 100644
index c022c375bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMm7.S
-#
-# Abstract:
-#
-# AsmReadMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMm7 (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMm7)
-ASM_PFX(AsmReadMm7):
- #DB 48h, 0fh, 7eh, 0f8h
- movd %mm7, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.asm
deleted file mode 100644
index 588bad4a2b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMm7.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMm7.Asm
-;
-; Abstract:
-;
-; AsmReadMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMm7 (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadMm7 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 7eh, 0f8h
- ret
-AsmReadMm7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.S
deleted file mode 100644
index 5858f07bca..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadMsr64.S
-#
-# Abstract:
-#
-# AsmReadMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadMsr64 (
-# IN UINT32 Index
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadMsr64)
-ASM_PFX(AsmReadMsr64):
- rdmsr # edx & eax are zero extended
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.asm
deleted file mode 100644
index 6f4eed1dbe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadMsr64.Asm
-;
-; Abstract:
-;
-; AsmReadMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadMsr64 (
-; IN UINT32 Index
-; );
-;------------------------------------------------------------------------------
-AsmReadMsr64 PROC
- rdmsr ; edx & eax are zero extended
- shl rdx, 20h
- or rax, rdx
- ret
-AsmReadMsr64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.c
deleted file mode 100644
index 92fac17a34..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadMsr64.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-unsigned __int64 __readmsr (int register);
-
-#pragma intrinsic(__readmsr)
-
-
-UINT64
-EFIAPI
-AsmReadMsr64 (
- IN UINT32 Index
- )
-{
- return __readmsr (Index);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.S
deleted file mode 100644
index 2d833764da..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadPmc.S
-#
-# Abstract:
-#
-# AsmReadPmc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadPmc (
-# IN UINT32 PmcIndex
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadPmc)
-ASM_PFX(AsmReadPmc):
- rdpmc
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.asm
deleted file mode 100644
index cfb7120c3d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadPmc.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadPmc.Asm
-;
-; Abstract:
-;
-; AsmReadPmc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadPmc (
-; IN UINT32 PmcIndex
-; );
-;------------------------------------------------------------------------------
-AsmReadPmc PROC
- rdpmc
- shl rdx, 20h
- or rax, rdx
- ret
-AsmReadPmc ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.S
deleted file mode 100644
index dc961bd487..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadSs.S
-#
-# Abstract:
-#
-# AsmReadSs function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadSs (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadSs);
-ASM_PFX(AsmReadSs):
- movl %ss, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.asm
deleted file mode 100644
index d76998591b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadSs.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadSs.Asm
-;
-; Abstract:
-;
-; AsmReadSs function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadSs (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadSs PROC
- mov eax, ss
- ret
-AsmReadSs ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.S
deleted file mode 100644
index ff5b8aaf47..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadTr.S
-#
-# Abstract:
-#
-# AsmReadTr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT16
-# EFIAPI
-# AsmReadTr (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadTr)
-ASM_PFX(AsmReadTr):
- str %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.asm
deleted file mode 100644
index 69fe3d0ccf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadTr.Asm
-;
-; Abstract:
-;
-; AsmReadTr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT16
-; EFIAPI
-; AsmReadTr (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadTr PROC
- str eax
- ret
-AsmReadTr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.S
deleted file mode 100644
index b7167d3c41..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadTsc.S
-#
-# Abstract:
-#
-# AsmReadTsc function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmReadTsc (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmReadTsc)
-ASM_PFX(AsmReadTsc):
- rdtsc
- shl $0x20, %rdx
- or %rdx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.asm
deleted file mode 100644
index fb19e66668..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/ReadTsc.asm
+++ /dev/null
@@ -1,38 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ReadTsc.Asm
-;
-; Abstract:
-;
-; AsmReadTsc function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmReadTsc (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmReadTsc PROC
- rdtsc
- shl rdx, 20h
- or rax, rdx
- ret
-AsmReadTsc ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.S
deleted file mode 100644
index 6d4d225b43..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 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.
-#
-# Module Name:
-#
-# SetJump.S
-#
-# Abstract:
-#
-# Implementation of SetJump() on x86_64
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(SetJump)
-ASM_PFX(SetJump):
- push %rcx
- add $0xffffffffffffffe0,%rsp
- call ASM_PFX(InternalAssertJumpBuffer)
- add $0x20,%rsp
- pop %rcx
- pop %rdx
- mov %rbx,(%rcx)
- mov %rsp,0x8(%rcx)
- mov %rbp,0x10(%rcx)
- mov %rdi,0x18(%rcx)
- mov %rsi,0x20(%rcx)
- mov %r12,0x28(%rcx)
- mov %r13,0x30(%rcx)
- mov %r14,0x38(%rcx)
- mov %r15,0x40(%rcx)
- mov %rdx,0x48(%rcx)
- # save non-volatile fp registers
- stmxcsr 0x50(%rcx)
- movdqu %xmm6, 0x58(%rcx)
- movdqu %xmm7, 0x68(%rcx)
- movdqu %xmm8, 0x78(%rcx)
- movdqu %xmm9, 0x88(%rcx)
- movdqu %xmm10, 0x98(%rcx)
- movdqu %xmm11, 0xA8(%rcx)
- movdqu %xmm12, 0xB8(%rcx)
- movdqu %xmm13, 0xC8(%rcx)
- movdqu %xmm14, 0xD8(%rcx)
- movdqu %xmm15, 0xE8(%rcx)
- xor %rax,%rax
- jmpq *%rdx
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.asm
deleted file mode 100644
index e6ddeafa7b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SetJump.asm
+++ /dev/null
@@ -1,64 +0,0 @@
-; Copyright (c) 2004 - 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.
-;
-; Module Name:
-;
-; SetJump.Asm
-;
-; Abstract:
-;
-; Implementation of SetJump() on x64.
-;
-;------------------------------------------------------------------------------
-
- .code
-
-EXTERNDEF InternalAssertJumpBuffer:PROC
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; SetJump (
-; OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
-; );
-;------------------------------------------------------------------------------
-SetJump PROC
- push rcx
- add rsp, -20h
- call InternalAssertJumpBuffer
- add rsp, 20h
- pop rcx
- pop rdx
- mov [rcx], rbx
- mov [rcx + 8], rsp
- mov [rcx + 10h], rbp
- mov [rcx + 18h], rdi
- mov [rcx + 20h], rsi
- mov [rcx + 28h], r12
- mov [rcx + 30h], r13
- mov [rcx + 38h], r14
- mov [rcx + 40h], r15
- mov [rcx + 48h], rdx
- ; save non-volatile fp registers
- stmxcsr [rcx + 50h]
- movdqu [rcx + 58h], xmm6
- movdqu [rcx + 68h], xmm7
- movdqu [rcx + 78h], xmm8
- movdqu [rcx + 88h], xmm9
- movdqu [rcx + 98h], xmm10
- movdqu [rcx + 0A8h], xmm11
- movdqu [rcx + 0B8h], xmm12
- movdqu [rcx + 0C8h], xmm13
- movdqu [rcx + 0D8h], xmm14
- movdqu [rcx + 0E8h], xmm15
- xor rax, rax
- jmp rdx
-SetJump ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.S
deleted file mode 100644
index 28ab2a3c24..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.S
+++ /dev/null
@@ -1,44 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SwitchStack.S
-#
-# Abstract:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# Routine Description:
-#
-# Routine for switching stacks with 1 parameter
-#
-# Arguments:
-#
-# (rdi) EntryPoint - Entry point with new stack.
-# (rsi) Context1 - Parameter1 for entry point.
-# (rdx) Context2 - Parameter2 for entry point.
-# (rcx) NewStack - Pointer to new stack.
-#
-# Returns:
-#
-# None
-#
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalSwitchStack)
-ASM_PFX(InternalSwitchStack):
- mov %rcx, %rax
- mov %rdx, %rcx
- mov %r8, %rdx
- lea -0x20(%r9), %rsp
- call *%rax
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.asm
deleted file mode 100644
index 3c265b086e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/SwitchStack.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; SwitchStack.Asm
-;
-; Abstract:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; Routine Description:
-;
-; Routine for switching stacks with 1 parameter
-;
-; Arguments:
-;
-; (rcx) EntryPoint - Entry point with new stack.
-; (rdx) Context - Parameter for entry point.
-; (r8) Context2 - Parameter2 for entry point.
-; (r9) NewStack - Pointer to new stack.
-;
-; Returns:
-;
-; None
-;
-;------------------------------------------------------------------------------
-InternalSwitchStack PROC
- mov rax, rcx
- mov rcx, rdx
- mov rdx, r8
- lea rsp, [r9 - 20h]
- call rax
-InternalSwitchStack ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S
deleted file mode 100644
index 038cc75a67..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.S
+++ /dev/null
@@ -1,324 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# Copyright (c) 2006 - 2011, 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.
-#
-# Module Name:
-#
-# Thunk16.S
-#
-# Abstract:
-#
-# Real mode thunk
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-
-.globl ASM_PFX(m16Start)
-.globl ASM_PFX(m16Size)
-.globl ASM_PFX(mThunk16Attr)
-.globl ASM_PFX(m16Gdt)
-.globl ASM_PFX(m16GdtrBase)
-.globl ASM_PFX(mTransition)
-.globl ASM_PFX(InternalAsmThunk16)
-
-# define the structure of IA32_REGS
-.set _EDI, 0 #size 4
-.set _ESI, 4 #size 4
-.set _EBP, 8 #size 4
-.set _ESP, 12 #size 4
-.set _EBX, 16 #size 4
-.set _EDX, 20 #size 4
-.set _ECX, 24 #size 4
-.set _EAX, 28 #size 4
-.set _DS, 32 #size 2
-.set _ES, 34 #size 2
-.set _FS, 36 #size 2
-.set _GS, 38 #size 2
-.set _EFLAGS, 40 #size 8
-.set _EIP, 48 #size 4
-.set _CS, 52 #size 2
-.set _SS, 54 #size 2
-.set IA32_REGS_SIZE, 56
-
- .data
-
-#ifndef __APPLE__
-ASM_PFX(m16Size): .word ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start)
-ASM_PFX(mThunk16Attr): .word _ThunkAttr - ASM_PFX(m16Start)
-ASM_PFX(m16Gdt): .word ASM_PFX(NullSeg) - ASM_PFX(m16Start)
-ASM_PFX(m16GdtrBase): .word _16GdtrBase - ASM_PFX(m16Start)
-ASM_PFX(mTransition): .word _EntryPoint - ASM_PFX(m16Start)
-#endif
-
- .text
-
-ASM_PFX(m16Start):
-
-SavedGdt: .space 10
-
-#------------------------------------------------------------------------------
-# _BackFromUserCode() takes control in real mode after 'retf' has been executed
-# by user code. It will be shadowed to somewhere in memory below 1MB.
-#------------------------------------------------------------------------------
-.globl ASM_PFX(BackFromUserCode)
-ASM_PFX(BackFromUserCode):
-#ifdef __APPLE__
- int $3
-#else
- #
- # The order of saved registers on the stack matches the order they appears
- # in IA32_REGS structure. This facilitates wrapper function to extract them
- # into that structure.
- #
- # Some instructions for manipulation of segment registers have to be written
- # in opcode since 64-bit MASM prevents accesses to those registers.
- #
- .byte 0x16 # push ss
- .byte 0xe # push cs
- .byte 0x66
- call L_Base # push eip
-L_Base:
- .byte 0x66
- pushq $0 # reserved high order 32 bits of EFlags
- .byte 0x66, 0x9c # pushfd actually
- cli # disable interrupts
- push %gs
- push %fs
- .byte 6 # push es
- .byte 0x1e # push ds
- .byte 0x66,0x60 # pushad
- .byte 0x66,0xba # mov edx, imm32
-_ThunkAttr: .space 4
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
- jz L_1
- movl $0x15cd2401,%eax # mov ax, 2401h & int 15h
- cli # disable interrupts
- jnc L_2
-L_1:
- testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl
- jz L_2
- inb $0x92,%al
- orb $2,%al
- outb %al, $0x92 # deactivate A20M#
-L_2:
- xorw %ax,%ax # xor eax, eax
- movl %ss,%eax # mov ax, ss
- lea IA32_REGS_SIZE(%esp), %bp
- #
- # rsi in the following 2 instructions is indeed bp in 16-bit code
- #
- movw %bp, (_ESP - IA32_REGS_SIZE)(%rsi)
- .byte 0x66
- movl (_EIP - IA32_REGS_SIZE)(%rsi), %ebx
- shlw $4,%ax # shl eax, 4
- addw %ax,%bp # add ebp, eax
- movw %cs,%ax
- shlw $4,%ax
- lea (L_64BitCode - L_Base)(%ebx, %eax), %ax
- .byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax
- .word L_64Eip - L_Base
- .byte 0x66,0xb8 # mov eax, imm32
-SavedCr4: .space 4
- movq %rax, %cr4
- #
- # rdi in the instruction below is indeed bx in 16-bit code
- #
- .byte 0x66,0x2e # 2eh is "cs:" segment override
- lgdt (SavedGdt - L_Base)(%rdi)
- .byte 0x66
- movl $0xc0000080,%ecx
- rdmsr
- orb $1,%ah
- wrmsr
- .byte 0x66,0xb8 # mov eax, imm32
-SavedCr0: .space 4
- movq %rax, %cr0
- .byte 0x66,0xea # jmp far cs:L_64Bit
-L_64Eip: .space 4
-SavedCs: .space 2
-L_64BitCode:
- .byte 0x90
- .byte 0x67,0xbc # mov esp, imm32
-SavedSp: .space 4 # restore stack
- nop
-#endif
- ret
-
-#ifndef __APPLE__
-_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
- .word CODE16
-_16Gdtr: .word GDT_SIZE - 1
-_16GdtrBase: .quad ASM_PFX(NullSeg)
-_16Idtr: .word 0x3ff
- .long 0
-#endif
-
-#------------------------------------------------------------------------------
-# _ToUserCode() takes control in real mode before passing control to user code.
-# It will be shadowed to somewhere in memory below 1MB.
-#------------------------------------------------------------------------------
-.globl ASM_PFX(ToUserCode)
-ASM_PFX(ToUserCode):
-#ifdef __APPLE__
- int $3
-#else
- movl %edx,%ss # set new segment selectors
- movl %edx,%ds
- movl %edx,%es
- movl %edx,%fs
- movl %edx,%gs
- .byte 0x66
- movl $0xc0000080,%ecx
- movq %rax, %cr0
- rdmsr
- andb $0b11111110, %ah
- wrmsr
- movq %rbp, %cr4
- movl %esi,%ss # set up 16-bit stack segment
- movw %bx,%sp # set up 16-bit stack pointer
- .byte 0x66 # make the following call 32-bit
- call L_Base1 # push eip
-L_Base1:
- popw %bp # ebp <- address of L_Base1
- pushq (IA32_REGS_SIZE + 2)(%esp)
- lea 0x0c(%rsi), %eax
- pushq %rax
- lret # execution begins at next instruction
-L_RealMode:
- .byte 0x66,0x2e # CS and operand size override
- lidt (_16Idtr - L_Base1)(%rsi)
- .byte 0x66,0x61 # popad
- .byte 0x1f # pop ds
- .byte 0x7 # pop es
- .byte 0x0f, 0xa1 # pop fs
- .byte 0x0f, 0xa9 # pop gs
- .byte 0x66, 0x9d # popfd
- leaw 4(%esp),%sp # skip high order 32 bits of EFlags
- .byte 0x66 # make the following retf 32-bit
-#endif
- lret # transfer control to user code
-
-.set CODE16, ASM_PFX(_16Code) - .
-.set DATA16, ASM_PFX(_16Data) - .
-.set DATA32, ASM_PFX(_32Data) - .
-
-ASM_PFX(NullSeg): .quad 0
-ASM_PFX(_16Code):
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-ASM_PFX(_16Data):
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f # 16-bit segment, 4GB limit
- .byte 0
-ASM_PFX(_32Data):
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0xcf # 16-bit segment, 4GB limit
- .byte 0
-
-.set GDT_SIZE, . - ASM_PFX(NullSeg)
-
-#------------------------------------------------------------------------------
-# IA32_REGISTER_SET *
-# EFIAPI
-# InternalAsmThunk16 (
-# IN IA32_REGISTER_SET *RegisterSet,
-# IN OUT VOID *Transition
-# );
-#------------------------------------------------------------------------------
-
-.globl ASM_PFX(InternalAsmThunk16)
-ASM_PFX(InternalAsmThunk16):
-#ifdef __APPLE__
- int $3
-#else
- pushq %rbp
- pushq %rbx
- pushq %rsi
- pushq %rdi
-
- movq %ds, %rbx
- pushq %rbx # Save ds segment register on the stack
- movq %es, %rbx
- pushq %rbx # Save es segment register on the stack
- movq %ss, %rbx
- pushq %rbx # Save ss segment register on the stack
-
- .byte 0x0f, 0xa0 #push fs
- .byte 0x0f, 0xa8 #push gs
- movq %rcx, %rsi
- movzwl _SS(%rsi), %r8d
- movl _ESP(%rsi), %edi
- lea -(IA32_REGS_SIZE + 4)(%edi), %rdi
- imul $16, %r8d, %eax
- movl %edi,%ebx # ebx <- stack for 16-bit code
- pushq $(IA32_REGS_SIZE / 4)
- addl %eax,%edi # edi <- linear address of 16-bit stack
- popq %rcx
- rep
- movsl # copy RegSet
- lea (SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx
- movl %edx,%eax # eax <- transition code address
- andl $0xf,%edx
- shll $12,%eax # segment address in high order 16 bits
- lea (_BackFromUserCode - ASM_PFX(m16Start))(%rdx), %ax
- stosl # [edi] <- return address of user code
- sgdt (SavedGdt - SavedCr4)(%rcx)
- sidt 0x50(%rsp)
- movq %cr0, %rax
- movl %eax, (SavedCr0 - SavedCr4)(%rcx)
- andl $0x7ffffffe,%eax # clear PE, PG bits
- movq %cr4, %rbp
- movl %ebp, (%rcx) # save CR4 in SavedCr4
- andl $0x300,%ebp # clear all but PCE and OSFXSR bits
- movl %r8d, %esi # esi <- 16-bit stack segment
- .byte 0x6a, DATA32
- popq %rdx
- lgdt (_16Gdtr - SavedCr4)(%rcx)
- movl %edx,%ss
- pushfq
- lea -8(%rdx), %edx
- lea L_RetFromRealMode, %r8
- pushq %r8
- movl %cs, %r8d
- movw %r8w, (SavedCs - SavedCr4)(%rcx)
- movl %esp, (SavedSp - SavedCr4)(%rcx)
- .byte 0xff, 0x69 # jmp (_EntryPoint - SavedCr4)(%rcx)
- .byte _EntryPoint - SavedCr4
-L_RetFromRealMode:
- popfq
- lidt 0x50(%rsp)
- lea -IA32_REGS_SIZE(%rbp), %eax
- .byte 0x0f, 0xa9 # pop gs
- .byte 0x0f, 0xa1 # pop fs
-
- popq %rbx
- movq %rbx, %ss
- popq %rbx
- movq %rbx, %es
- popq %rbx
- movq %rbx, %ds
-
- popq %rdi
- popq %rsi
- popq %rbx
- popq %rbp
-#endif
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm
deleted file mode 100644
index b181a4ccfd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Thunk16.asm
+++ /dev/null
@@ -1,296 +0,0 @@
-; Copyright (c) 2004 - 2011, 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.
-;
-; Module Name:
-;
-; Thunk.asm
-;
-; Abstract:
-;
-; Real mode thunk
-;
-;------------------------------------------------------------------------------
-
-EXTERNDEF m16Start:BYTE
-EXTERNDEF m16Size:WORD
-EXTERNDEF mThunk16Attr:WORD
-EXTERNDEF m16Gdt:WORD
-EXTERNDEF m16GdtrBase:WORD
-EXTERNDEF mTransition:WORD
-
-THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 EQU 2
-THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL EQU 4
-
-IA32_REGS STRUC 4t
-_EDI DD ?
-_ESI DD ?
-_EBP DD ?
-_ESP DD ?
-_EBX DD ?
-_EDX DD ?
-_ECX DD ?
-_EAX DD ?
-_DS DW ?
-_ES DW ?
-_FS DW ?
-_GS DW ?
-_EFLAGS DQ ?
-_EIP DD ?
-_CS DW ?
-_SS DW ?
-IA32_REGS ENDS
-
- .const
-
-m16Size DW InternalAsmThunk16 - m16Start
-mThunk16Attr DW _ThunkAttr - m16Start
-m16Gdt DW _NullSeg - m16Start
-m16GdtrBase DW _16GdtrBase - m16Start
-mTransition DW _EntryPoint - m16Start
-
- .code
-
-m16Start LABEL BYTE
-
-SavedGdt LABEL FWORD
- DW ?
- DQ ?
-
-;------------------------------------------------------------------------------
-; _BackFromUserCode() takes control in real mode after 'retf' has been executed
-; by user code. It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_BackFromUserCode PROC
- ;
- ; The order of saved registers on the stack matches the order they appears
- ; in IA32_REGS structure. This facilitates wrapper function to extract them
- ; into that structure.
- ;
- ; Some instructions for manipulation of segment registers have to be written
- ; in opcode since 64-bit MASM prevents accesses to those registers.
- ;
- DB 16h ; push ss
- DB 0eh ; push cs
- DB 66h
- call @Base ; push eip
-@Base:
- DB 66h
- push 0 ; reserved high order 32 bits of EFlags
- pushf ; pushfd actually
- cli ; disable interrupts
- push gs
- push fs
- DB 6 ; push es
- DB 1eh ; push ds
- DB 66h, 60h ; pushad
- DB 66h, 0bah ; mov edx, imm32
-_ThunkAttr DD ?
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15
- jz @1
- mov eax, 15cd2401h ; mov ax, 2401h & int 15h
- cli ; disable interrupts
- jnc @2
-@1:
- test dl, THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL
- jz @2
- in al, 92h
- or al, 2
- out 92h, al ; deactivate A20M#
-@2:
- xor ax, ax ; xor eax, eax
- mov eax, ss ; mov ax, ss
- lea bp, [esp + sizeof (IA32_REGS)]
- ;
- ; rsi in the following 2 instructions is indeed bp in 16-bit code
- ;
- mov word ptr (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._ESP, bp
- DB 66h
- mov ebx, (IA32_REGS ptr [rsi - sizeof (IA32_REGS)])._EIP
- shl ax, 4 ; shl eax, 4
- add bp, ax ; add ebp, eax
- mov ax, cs
- shl ax, 4
- lea ax, [eax + ebx + (@64BitCode - @Base)]
- DB 66h, 2eh, 89h, 87h ; mov cs:[bx + (@64Eip - @Base)], eax
- DW @64Eip - @Base
- DB 66h, 0b8h ; mov eax, imm32
-SavedCr4 DD ?
- mov cr4, rax
- ;
- ; rdi in the instruction below is indeed bx in 16-bit code
- ;
- DB 66h, 2eh ; 2eh is "cs:" segment override
- lgdt fword ptr [rdi + (SavedGdt - @Base)]
- DB 66h
- mov ecx, 0c0000080h
- rdmsr
- or ah, 1
- wrmsr
- DB 66h, 0b8h ; mov eax, imm32
-SavedCr0 DD ?
- mov cr0, rax
- DB 66h, 0eah ; jmp far cs:@64Bit
-@64Eip DD ?
-SavedCs DW ?
-@64BitCode:
- db 090h
- db 067h, 0bch ; mov esp, imm32
-SavedSp DD ? ; restore stack
- nop
- ret
-_BackFromUserCode ENDP
-
-_EntryPoint DD _ToUserCode - m16Start
- DW CODE16
-_16Gdtr LABEL FWORD
- DW GDT_SIZE - 1
-_16GdtrBase DQ _NullSeg
-_16Idtr FWORD (1 SHL 10) - 1
-
-;------------------------------------------------------------------------------
-; _ToUserCode() takes control in real mode before passing control to user code.
-; It will be shadowed to somewhere in memory below 1MB.
-;------------------------------------------------------------------------------
-_ToUserCode PROC
- mov ss, edx ; set new segment selectors
- mov ds, edx
- mov es, edx
- mov fs, edx
- mov gs, edx
- DB 66h
- mov ecx, 0c0000080h
- mov cr0, rax ; real mode starts at next instruction
- rdmsr
- and ah, NOT 1
- wrmsr
- mov cr4, rbp
- mov ss, esi ; set up 16-bit stack segment
- mov sp, bx ; set up 16-bit stack pointer
- DB 66h ; make the following call 32-bit
- call @Base ; push eip
-@Base:
- pop bp ; ebp <- address of @Base
- push [esp + sizeof (IA32_REGS) + 2]
- lea eax, [rsi + (@RealMode - @Base)] ; rsi is "bp" in 16-bit code
- push rax
- retf ; execution begins at next instruction
-@RealMode:
- DB 66h, 2eh ; CS and operand size override
- lidt fword ptr [rsi + (_16Idtr - @Base)]
- DB 66h, 61h ; popad
- DB 1fh ; pop ds
- DB 07h ; pop es
- pop fs
- pop gs
- popf ; popfd
- lea sp, [esp + 4] ; skip high order 32 bits of EFlags
- DB 66h ; make the following retf 32-bit
- retf ; transfer control to user code
-_ToUserCode ENDP
-
-CODE16 = _16Code - $
-DATA16 = _16Data - $
-DATA32 = _32Data - $
-
-_NullSeg DQ 0
-_16Code LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_16Data LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment, 4GB limit
- DB 0
-_32Data LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 0cfh ; 16-bit segment, 4GB limit
- DB 0
-
-GDT_SIZE = $ - _NullSeg
-
-;------------------------------------------------------------------------------
-; IA32_REGISTER_SET *
-; EFIAPI
-; InternalAsmThunk16 (
-; IN IA32_REGISTER_SET *RegisterSet,
-; IN OUT VOID *Transition
-; );
-;------------------------------------------------------------------------------
-InternalAsmThunk16 PROC USES rbp rbx rsi rdi
- mov rbx, ds
- push rbx ; Save ds segment register on the stack
- mov rbx, es
- push rbx ; Save es segment register on the stack
- mov rbx, ss
- push rbx ; Save ss segment register on the stack
-
- push fs
- push gs
- mov rsi, rcx
- movzx r8d, (IA32_REGS ptr [rsi])._SS
- mov edi, (IA32_REGS ptr [rsi])._ESP
- lea rdi, [edi - (sizeof (IA32_REGS) + 4)]
- imul eax, r8d, 16 ; eax <- r8d(stack segment) * 16
- mov ebx, edi ; ebx <- stack for 16-bit code
- push sizeof (IA32_REGS) / 4
- add edi, eax ; edi <- linear address of 16-bit stack
- pop rcx
- rep movsd ; copy RegSet
- lea ecx, [rdx + (SavedCr4 - m16Start)]
- mov eax, edx ; eax <- transition code address
- and edx, 0fh
- shl eax, 12 ; segment address in high order 16 bits
- lea ax, [rdx + (_BackFromUserCode - m16Start)] ; offset address
- stosd ; [edi] <- return address of user code
- sgdt fword ptr [rcx + (SavedGdt - SavedCr4)]
- sidt fword ptr [rsp + 50h] ; save IDT stack in argument space
- mov rax, cr0
- mov [rcx + (SavedCr0 - SavedCr4)], eax
- and eax, 7ffffffeh ; clear PE, PG bits
- mov rbp, cr4
- mov [rcx], ebp ; save CR4 in SavedCr4
- and ebp, 300h ; clear all but PCE and OSFXSR bits
- mov esi, r8d ; esi <- 16-bit stack segment
- DB 6ah, DATA32 ; push DATA32
- pop rdx ; rdx <- 32-bit data segment selector
- lgdt fword ptr [rcx + (_16Gdtr - SavedCr4)]
- mov ss, edx
- pushfq
- lea edx, [rdx + DATA16 - DATA32]
- lea r8, @RetFromRealMode
- push r8
- mov r8d, cs
- mov [rcx + (SavedCs - SavedCr4)], r8w
- mov [rcx + (SavedSp - SavedCr4)], esp
- jmp fword ptr [rcx + (_EntryPoint - SavedCr4)]
-@RetFromRealMode:
- popfq
- lidt fword ptr [rsp + 50h] ; restore protected mode IDTR
- lea eax, [rbp - sizeof (IA32_REGS)]
- pop gs
- pop fs
- pop rbx
- mov ss, rbx
- pop rbx
- mov es, rbx
- pop rbx
- mov ds, rbx
- ret
-InternalAsmThunk16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.S
deleted file mode 100644
index 4ba20af71a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# Wbinvd.S
-#
-# Abstract:
-#
-# AsmWbinvd function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWbinvd (
-# VOID
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWbinvd)
-ASM_PFX(AsmWbinvd):
- wbinvd
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.asm
deleted file mode 100644
index fa86e95235..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/Wbinvd.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; Wbinvd.Asm
-;
-; Abstract:
-;
-; AsmWbinvd function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWbinvd (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmWbinvd PROC
- wbinvd
- ret
-AsmWbinvd ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.S
deleted file mode 100644
index 046750f58c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr0.S
-#
-# Abstract:
-#
-# AsmWriteCr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr0 (
-# UINTN Cr0
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr0)
-ASM_PFX(AsmWriteCr0):
- mov %rcx,%cr0
- mov %rcx,%rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.asm
deleted file mode 100644
index e08c3f06f8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr0.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteCr0.Asm
-;
-; Abstract:
-;
-; AsmWriteCr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr0 (
-; UINTN Cr0
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr0 PROC
- mov cr0, rcx
- mov rax, rcx
- ret
-AsmWriteCr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.S
deleted file mode 100644
index 0ef074ebee..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr2.S
-#
-# Abstract:
-#
-# AsmWriteCr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr2 (
-# UINTN Cr2
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr2)
-ASM_PFX(AsmWriteCr2):
- mov %rcx,%cr2
- mov %rcx,%rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.asm
deleted file mode 100644
index 1b9eb095e5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr2.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteCr2.Asm
-;
-; Abstract:
-;
-; AsmWriteCr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr2 (
-; UINTN Cr2
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr2 PROC
- mov cr2, rcx
- mov rax, rcx
- ret
-AsmWriteCr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.S
deleted file mode 100644
index 599b3c13d7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr3.S
-#
-# Abstract:
-#
-# AsmWriteCr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr3 (
-# UINTN Cr3
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr3)
-ASM_PFX(AsmWriteCr3):
- mov %rcx,%cr3
- mov %rcx,%rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.asm
deleted file mode 100644
index e386778ee1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr3.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteCr3.Asm
-;
-; Abstract:
-;
-; AsmWriteCr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr3 (
-; UINTN Cr3
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr3 PROC
- mov cr3, rcx
- mov rax, rcx
- ret
-AsmWriteCr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.S
deleted file mode 100644
index d45f0ba18b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteCr4.S
-#
-# Abstract:
-#
-# AsmWriteCr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteCr4 (
-# UINTN Cr4
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteCr4)
-ASM_PFX(AsmWriteCr4):
- mov %rcx,%cr4
- mov %rcx,%rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.asm
deleted file mode 100644
index 7057a0e5db..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteCr4.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteCr4.Asm
-;
-; Abstract:
-;
-; AsmWriteCr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteCr4 (
-; UINTN Cr4
-; );
-;------------------------------------------------------------------------------
-AsmWriteCr4 PROC
- mov cr4, rcx
- mov rax, rcx
- ret
-AsmWriteCr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.S
deleted file mode 100644
index 93e8b1fae3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr0.S
-#
-# Abstract:
-#
-# AsmWriteDr0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr0 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr0)
-ASM_PFX(AsmWriteDr0):
- mov %rcx, %dr0
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.asm
deleted file mode 100644
index fa68911456..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr0.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr0.Asm
-;
-; Abstract:
-;
-; AsmWriteDr0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr0 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr0 PROC
- mov dr0, rcx
- mov rax, rcx
- ret
-AsmWriteDr0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.S
deleted file mode 100644
index 0ad47b2f8e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr1.S
-#
-# Abstract:
-#
-# AsmWriteDr1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr1 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr1)
-ASM_PFX(AsmWriteDr1):
- mov %rcx, %dr1
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.asm
deleted file mode 100644
index aa55eb2527..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr1.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr1.Asm
-;
-; Abstract:
-;
-; AsmWriteDr1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr1 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr1 PROC
- mov dr1, rcx
- mov rax, rcx
- ret
-AsmWriteDr1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.S
deleted file mode 100644
index b37cd2e7eb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr2.S
-#
-# Abstract:
-#
-# AsmWriteDr2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr2 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr2)
-ASM_PFX(AsmWriteDr2):
- mov %rcx, %dr2
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.asm
deleted file mode 100644
index 494de45314..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr2.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr2.Asm
-;
-; Abstract:
-;
-; AsmWriteDr2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr2 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr2 PROC
- mov dr2, rcx
- mov rax, rcx
- ret
-AsmWriteDr2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.S
deleted file mode 100644
index a7ff4bfc61..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr3.S
-#
-# Abstract:
-#
-# AsmWriteDr3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr3 (
-# UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr3)
-ASM_PFX(AsmWriteDr3):
- mov %rcx, %dr3
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.asm
deleted file mode 100644
index 5f999b25bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr3.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr3.Asm
-;
-; Abstract:
-;
-; AsmWriteDr3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr3 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr3 PROC
- mov dr3, rcx
- mov rax, rcx
- ret
-AsmWriteDr3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.S
deleted file mode 100644
index 9c1ca0d49e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr4.S
-#
-# Abstract:
-#
-# AsmWriteDr4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr4 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr4)
-ASM_PFX(AsmWriteDr4):
- mov %rcx, %dr4
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.asm
deleted file mode 100644
index 046fc94119..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr4.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr4.Asm
-;
-; Abstract:
-;
-; AsmWriteDr4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr4 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr4 PROC
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR6 when DE=0 or an exception generated when DE=1
- ;
- DB 0fh, 23h, 0e1h
- mov rax, rcx
- ret
-AsmWriteDr4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.S
deleted file mode 100644
index bfe4df55c1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr5.S
-#
-# Abstract:
-#
-# AsmWriteDr5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr5 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr5)
-ASM_PFX(AsmWriteDr5):
- mov %rcx, %dr5
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.asm
deleted file mode 100644
index a130af3952..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr5.asm
+++ /dev/null
@@ -1,41 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr5.Asm
-;
-; Abstract:
-;
-; AsmWriteDr5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr6 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr5 PROC
- ;
- ; There's no obvious reason to access this register, since it's aliased to
- ; DR7 when DE=0 or an exception generated when DE=1
- ;
- DB 0fh, 23h, 0e9h
- mov rax, rcx
- ret
-AsmWriteDr5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.S
deleted file mode 100644
index ab3f88fd92..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr6.S
-#
-# Abstract:
-#
-# AsmWriteDr6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr6 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr6)
-ASM_PFX(AsmWriteDr6):
- mov %rcx, %dr6
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.asm
deleted file mode 100644
index a2691d8421..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr6.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr6.Asm
-;
-; Abstract:
-;
-; AsmWriteDr6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr6 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr6 PROC
- mov dr6, rcx
- mov rax, rcx
- ret
-AsmWriteDr6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.S
deleted file mode 100644
index 7801c88068..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.S
+++ /dev/null
@@ -1,36 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteDr7.S
-#
-# Abstract:
-#
-# AsmWriteDr7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINTN
-# EFIAPI
-# AsmWriteDr7 (
-# IN UINTN Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteDr7)
-ASM_PFX(AsmWriteDr7):
- mov %rcx, %dr7
- mov %rcx, %rax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.asm
deleted file mode 100644
index b67adfc399..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteDr7.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteDr7.Asm
-;
-; Abstract:
-;
-; AsmWriteDr7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; EFIAPI
-; AsmWriteDr7 (
-; IN UINTN Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteDr7 PROC
- mov dr7, rcx
- mov rax, rcx
- ret
-AsmWriteDr7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.S
deleted file mode 100644
index ddbc26fa87..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteGdtr.S
-#
-# Abstract:
-#
-# AsmWriteGdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteGdtr (
-# IN CONST IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86WriteGdtr)
-ASM_PFX(InternalX86WriteGdtr):
- lgdt (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.asm
deleted file mode 100644
index 1a92c383d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteGdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteGdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteGdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteGdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86WriteGdtr PROC
- lgdt fword ptr [rcx]
- ret
-InternalX86WriteGdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.S
deleted file mode 100644
index f24d9dc622..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteIdtr.S
-#
-# Abstract:
-#
-# AsmWriteIdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# InternalX86WriteIdtr (
-# IN CONST IA32_DESCRIPTOR *Idtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalX86WriteIdtr)
-ASM_PFX(InternalX86WriteIdtr):
- lidt (%rcx)
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.asm
deleted file mode 100644
index 57620cce04..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteIdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteIdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteIdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; InternalX86WriteIdtr (
-; IN CONST IA32_DESCRIPTOR *Idtr
-; );
-;------------------------------------------------------------------------------
-InternalX86WriteIdtr PROC
- lidt fword ptr [rcx]
- ret
-InternalX86WriteIdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.S
deleted file mode 100644
index b3646a1eb9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteLdtr.S
-#
-# Abstract:
-#
-# AsmWriteLdtr function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteLdtr (
-# IN UINT16 Ldtr
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteLdtr);
-ASM_PFX(AsmWriteLdtr):
- lldt %cx
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.asm
deleted file mode 100644
index b028d0f03a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteLdtr.asm
+++ /dev/null
@@ -1,36 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteLdtr.Asm
-;
-; Abstract:
-;
-; AsmWriteLdtr function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteLdtr (
-; IN UINT16 Ldtr
-; );
-;------------------------------------------------------------------------------
-AsmWriteLdtr PROC
- lldt cx
- ret
-AsmWriteLdtr ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.S
deleted file mode 100644
index 8cfccf990c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm0.S
-#
-# Abstract:
-#
-# AsmWriteMm0 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm0 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm0);
-ASM_PFX(AsmWriteMm0):
- movd %rcx, %xmm0
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.asm
deleted file mode 100644
index acb0db0316..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm0.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm0.Asm
-;
-; Abstract:
-;
-; AsmWriteMm0 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm0 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm0 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0c1h
- ret
-AsmWriteMm0 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.S
deleted file mode 100644
index df2a361c99..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm1.S
-#
-# Abstract:
-#
-# AsmWriteMm1 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm1 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm1);
-ASM_PFX(AsmWriteMm1):
- movd %rcx, %mm1
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.asm
deleted file mode 100644
index 374282f0ab..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm1.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm1.Asm
-;
-; Abstract:
-;
-; AsmWriteMm1 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm1 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm1 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0c9h
- ret
-AsmWriteMm1 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.S
deleted file mode 100644
index eb5871482e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm2.S
-#
-# Abstract:
-#
-# AsmWriteMm2 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm2 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm2)
-ASM_PFX(AsmWriteMm2):
- movd %rcx, %mm2
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.asm
deleted file mode 100644
index 2d8d81752b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm2.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm2.Asm
-;
-; Abstract:
-;
-; AsmWriteMm2 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm2 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm2 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0d1h
- ret
-AsmWriteMm2 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.S
deleted file mode 100644
index 3b65a2b40a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm3.S
-#
-# Abstract:
-#
-# AsmWriteMm3 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm3 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm3)
-ASM_PFX(AsmWriteMm3):
- movd %rcx, %mm3
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.asm
deleted file mode 100644
index 7acb7a8026..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm3.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm3.Asm
-;
-; Abstract:
-;
-; AsmWriteMm3 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm3 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm3 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0d9h
- ret
-AsmWriteMm3 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.S
deleted file mode 100644
index 0739589034..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm4.S
-#
-# Abstract:
-#
-# AsmWriteMm4 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm4 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm4)
-ASM_PFX(AsmWriteMm4):
- movd %rcx, %mm4
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.asm
deleted file mode 100644
index 6bbc64688c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm4.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm4.Asm
-;
-; Abstract:
-;
-; AsmWriteMm4 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm4 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm4 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0e1h
- ret
-AsmWriteMm4 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.S
deleted file mode 100644
index 24f6657b46..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm5.S
-#
-# Abstract:
-#
-# AsmWriteMm5 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm5 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm5)
-ASM_PFX(AsmWriteMm5):
- movd %rcx, %mm5
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.asm
deleted file mode 100644
index c43ffef541..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm5.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm5.Asm
-;
-; Abstract:
-;
-; AsmWriteMm5 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm5 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm5 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0e9h
- ret
-AsmWriteMm5 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.S
deleted file mode 100644
index 6b3948fd54..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm6.S
-#
-# Abstract:
-#
-# AsmWriteMm6 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm6 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm6)
-ASM_PFX(AsmWriteMm6):
- movd %rcx, %mm6
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.asm
deleted file mode 100644
index 3cde39cb15..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm6.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm6.Asm
-;
-; Abstract:
-;
-; AsmWriteMm6 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm6 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm6 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0f1h
- ret
-AsmWriteMm6 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.S
deleted file mode 100644
index e3474407bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.S
+++ /dev/null
@@ -1,35 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMm7.S
-#
-# Abstract:
-#
-# AsmWriteMm7 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID
-# EFIAPI
-# AsmWriteMm7 (
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMm7)
-ASM_PFX(AsmWriteMm7):
- movd %rcx, %mm7
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.asm
deleted file mode 100644
index 8d58561a15..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMm7.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMm7.Asm
-;
-; Abstract:
-;
-; AsmWriteMm7 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; AsmWriteMm7 (
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMm7 PROC
- ;
- ; 64-bit MASM doesn't support MMX instructions, so use opcode here
- ;
- DB 48h, 0fh, 6eh, 0f9h
- ret
-AsmWriteMm7 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.S
deleted file mode 100644
index a94fafe419..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.S
+++ /dev/null
@@ -1,39 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteMsr64.S
-#
-# Abstract:
-#
-# AsmWriteMsr64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# UINT64
-# EFIAPI
-# AsmWriteMsr64 (
-# IN UINT32 Index,
-# IN UINT64 Value
-# );
-# TODO:
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmWriteMsr64)
-ASM_PFX(AsmWriteMsr64):
- mov %rdx, %rax
- shr $0x20, %rdx
- wrmsr
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.asm
deleted file mode 100644
index b48c145b4c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.asm
+++ /dev/null
@@ -1,39 +0,0 @@
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; WriteMsr64.Asm
-;
-; Abstract:
-;
-; AsmWriteMsr64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; UINT64
-; EFIAPI
-; AsmWriteMsr64 (
-; IN UINT32 Index,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-AsmWriteMsr64 PROC
- mov rax, rdx ; meanwhile, rax <- return value
- shr rdx, 20h ; edx:eax contains the value to write
- wrmsr
- ret
-AsmWriteMsr64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.c
deleted file mode 100644
index 5d349c6b60..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X64/WriteMsr64.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- CpuBreakpoint function.
-
- Copyright (c) 2006 - 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.
-
-**/
-
-#include "BaseLibInternals.h"
-
-
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
-void __writemsr (unsigned long Register, unsigned __int64 Value);
-
-#pragma intrinsic(__writemsr)
-
-UINT64
-EFIAPI
-AsmWriteMsr64 (
- IN UINT32 Index,
- IN UINT64 Value
- )
-{
- __writemsr (Index, Value);
- return Value;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging32.c
deleted file mode 100644
index f03d3ee5be..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging32.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86DisablePaging32.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Disables the 32-bit paging mode on the CPU.
-
- Disables the 32-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 32-paged protected
- mode. This function is only available on IA-32. After the 32-bit paging mode
- is disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be NULL. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit paged mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit paged mode.
- 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode.
- 4) CR3 must point to valid page tables that guarantee that the pages for
- this function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is disabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is disabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is
- disabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
- InternalX86DisablePaging32 (EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging64.c
deleted file mode 100644
index 53bc05f215..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86DisablePaging64.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86DisablePaging64.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Disables the 64-bit paging mode on the CPU.
-
- Disables the 64-bit paging mode on the CPU and returns to 32-bit protected
- mode. This function assumes the current execution mode is 64-paging mode.
- This function is only available on X64. After the 64-bit paging mode is
- disabled, control is transferred to the function specified by EntryPoint
- using the new stack specified by NewStack and passing in the parameters
- specified by Context1 and Context2. Context1 and Context2 are optional and
- may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 64-bit paged mode, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for 32-bit protected mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is disabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is disabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is disabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is disabled.
-
-**/
-VOID
-EFIAPI
-AsmDisablePaging64 (
- IN UINT16 Cs,
- IN UINT32 EntryPoint,
- IN UINT32 Context1, OPTIONAL
- IN UINT32 Context2, OPTIONAL
- IN UINT32 NewStack
- )
-{
- ASSERT (EntryPoint != 0);
- ASSERT (NewStack != 0);
- InternalX86DisablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging32.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging32.c
deleted file mode 100644
index 009d3488d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging32.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86EnablePaging32.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 32-bit paging mode on the CPU.
-
- Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode. This function is
- only available on IA-32. After the 32-bit paging mode is enabled, control is
- transferred to the function specified by EntryPoint using the new stack
- specified by NewStack and passing in the parameters specified by Context1 and
- Context2. Context1 and Context2 are optional and may be NULL. The function
- EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
- If NewStack is NULL, then ASSERT().
-
- There are a number of constraints that must be followed before calling this
- function:
- 1) Interrupts must be disabled.
- 2) The caller must be in 32-bit protected mode with flat descriptors. This
- means all descriptors must have a base of 0 and a limit of 4GB.
- 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat
- descriptors.
- 4) CR3 must point to valid page tables that will be used once the transition
- is complete, and those page tables must guarantee that the pages for this
- function and the stack are identity mapped.
-
- @param EntryPoint A pointer to function to call with the new stack after
- paging is enabled.
- @param Context1 A pointer to the context to pass into the EntryPoint
- function as the first parameter after paging is enabled.
- @param Context2 A pointer to the context to pass into the EntryPoint
- function as the second parameter after paging is enabled.
- @param NewStack A pointer to the new stack to use for the EntryPoint
- function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging32 (
- IN SWITCH_STACK_ENTRY_POINT EntryPoint,
- IN VOID *Context1, OPTIONAL
- IN VOID *Context2, OPTIONAL
- IN VOID *NewStack
- )
-{
- ASSERT (EntryPoint != NULL);
- ASSERT (NewStack != NULL);
- InternalX86EnablePaging32 (EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging64.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging64.c
deleted file mode 100644
index 6c4e3961e2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86EnablePaging64.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86EnablePaging64.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Enables the 64-bit paging mode on the CPU.
-
- Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables
- must be properly initialized prior to calling this service. This function
- assumes the current execution mode is 32-bit protected mode with flat
- descriptors. This function is only available on IA-32. After the 64-bit
- paging mode is enabled, control is transferred to the function specified by
- EntryPoint using the new stack specified by NewStack and passing in the
- parameters specified by Context1 and Context2. Context1 and Context2 are
- optional and may be 0. The function EntryPoint must never return.
-
- If the current execution mode is not 32-bit protected mode with flat
- descriptors, then ASSERT().
- If EntryPoint is 0, then ASSERT().
- If NewStack is 0, then ASSERT().
-
- @param Cs The 16-bit selector to load in the CS before EntryPoint
- is called. The descriptor in the GDT that this selector
- references must be setup for long mode.
- @param EntryPoint The 64-bit virtual address of the function to call with
- the new stack after paging is enabled.
- @param Context1 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the first parameter after
- paging is enabled.
- @param Context2 The 64-bit virtual address of the context to pass into
- the EntryPoint function as the second parameter after
- paging is enabled.
- @param NewStack The 64-bit virtual address of the new stack to use for
- the EntryPoint function after paging is enabled.
-
-**/
-VOID
-EFIAPI
-AsmEnablePaging64 (
- IN UINT16 Cs,
- IN UINT64 EntryPoint,
- IN UINT64 Context1, OPTIONAL
- IN UINT64 Context2, OPTIONAL
- IN UINT64 NewStack
- )
-{
- ASSERT (EntryPoint != 0);
- ASSERT (NewStack != 0);
- InternalX86EnablePaging64 (Cs, EntryPoint, Context1, Context2, NewStack);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c
deleted file mode 100644
index cf3be0a0ff..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxRestore.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86FxRestore.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Restores the current floating point/SSE/SSE2 context from a buffer.
-
- Restores the current floating point/SSE/SSE2 state from the buffer specified
- by Buffer. Buffer must be aligned on a 16-byte boundary. This function is
- only available on IA-32 and X64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
- If Buffer was not saved with AsmFxSave(), then ASSERT().
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & 0xf) == 0);
-
- //
- // Check the flag recorded by AsmFxSave()
- //
- ASSERT (*(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) == 0xAA5555AA);
-
- InternalX86FxRestore (Buffer);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c
deleted file mode 100644
index b472981081..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86FxSave.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86FxSave.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Save the current floating point/SSE/SSE2 context to a buffer.
-
- Saves the current floating point/SSE/SSE2 state to the buffer specified by
- Buffer. Buffer must be aligned on a 16-byte boundary. This function is only
- available on IA-32 and X64.
-
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-byte boundary, then ASSERT().
-
- @param Buffer Pointer to a buffer to save the floating point/SSE/SSE2 context.
-
-**/
-VOID
-EFIAPI
-AsmFxSave (
- OUT IA32_FX_BUFFER *Buffer
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & 0xf) == 0);
-
- InternalX86FxSave (Buffer);
-
- //
- // Mark one flag at end of Buffer, it will be check by AsmFxRestor()
- //
- *(UINT32 *) (&Buffer->Buffer[sizeof (Buffer->Buffer) - 4]) = 0xAA5555AA;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86GetInterruptState.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86GetInterruptState.c
deleted file mode 100644
index c326113c99..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86GetInterruptState.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86GetInterruptState.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Retrieves the current CPU interrupt state.
-
- Retrieves the current CPU interrupt state. Returns TRUE is interrupts are
- currently enabled. Otherwise returns FALSE.
-
- @retval TRUE CPU interrupts are enabled.
- @retval FALSE CPU interrupts are disabled.
-
-**/
-BOOLEAN
-EFIAPI
-GlueGetInterruptState (
- VOID
- )
-{
- IA32_EFLAGS32 EFlags;
-
- EFlags.UintN = AsmReadEflags ();
- return (BOOLEAN)(EFlags.Bits.IF == 1);
-}
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86MemoryFence.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86MemoryFence.c
deleted file mode 100644
index ed12e76842..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86MemoryFence.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86MemoryFence.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-**/
-VOID
-EFIAPI
-MemoryFence (
- VOID
- )
-{
- return;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Msr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Msr.c
deleted file mode 100644
index a78b901696..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Msr.c
+++ /dev/null
@@ -1,657 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86Msr.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Returns the lower 32-bits of a Machine Specific Register(MSR).
-
- Reads and returns the lower 32-bits of the MSR specified by Index.
- No parameter checking is performed on Index, and some Index values may cause
- CPU exceptions. The caller must either guarantee that Index is valid, or the
- caller must set up exception handlers to catch the exceptions. This function
- is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to read.
-
- @return The lower 32 bits of the MSR identified by Index.
-
-**/
-UINT32
-EFIAPI
-AsmReadMsr32 (
- IN UINT32 Index
- )
-{
- return (UINT32)AsmReadMsr64 (Index);
-}
-
-/**
- Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).
-
- Writes the 32-bit value specified by Value to the MSR specified by Index. The
- upper 32-bits of the MSR write are set to zero. The 32-bit value written to
- the MSR is returned. No parameter checking is performed on Index or Value,
- and some of these may cause CPU exceptions. The caller must either guarantee
- that Index and Value are valid, or the caller must establish proper exception
- handlers. This function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param Value The 32-bit value to write to the MSR.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-AsmWriteMsr32 (
- IN UINT32 Index,
- IN UINT32 Value
- )
-{
- return (UINT32)AsmWriteMsr64 (Index, Value);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise inclusive OR on the lower 32-bits, and
- writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the lower 32-bits of the read result and the value specified by
- OrData, and writes the result to the 64-bit MSR specified by Index. The lower
- 32-bits of the value written to the MSR is returned. No parameter checking is
- performed on Index or OrData, and some of these may cause CPU exceptions. The
- caller must either guarantee that Index and OrData are valid, or the caller
- must establish proper exception handlers. This function is only available on
- IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrOr32 (
- IN UINT32 Index,
- IN UINT32 OrData
- )
-{
- return (UINT32)AsmMsrOr64 (Index, OrData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes
- the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData, and
- writes the result to the 64-bit MSR specified by Index. The lower 32-bits of
- the value written to the MSR is returned. No parameter checking is performed
- on Index or AndData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index and AndData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAnd32 (
- IN UINT32 Index,
- IN UINT32 AndData
- )
-{
- return (UINT32)AsmMsrAnd64 (Index, AndData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive OR
- on the lower 32-bits, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- lower 32-bits of the read result and the value specified by AndData
- preserving the upper 32-bits, performs a bitwise inclusive OR between the
- result of the AND operation and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Address. The lower 32-bits of the value
- written to the MSR is returned. No parameter checking is performed on Index,
- AndData, or OrData, and some of these may cause CPU exceptions. The caller
- must either guarantee that Index, AndData, and OrData are valid, or the
- caller must establish proper exception handlers. This function is only
- available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrAndThenOr32 (
- IN UINT32 Index,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return (UINT32)AsmMsrAndThenOr64 (Index, AndData, OrData);
-}
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned. The caller must either guarantee that Index is valid, or the caller
- must set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The bit field read from the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldRead32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (AsmReadMsr32 (Index), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination MSR are preserved. The lower 32-bits of the MSR written is
- returned. Extra left bits in Value are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldWrite32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT (EndBit < sizeof (Value) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldWrite64 (Index, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The lower 32-bits of the value
- written to the MSR are returned. Extra left bits in OrData are stripped. The
- caller must either guarantee that Index and the data written is valid, or
- the caller must set up exception handlers to catch the exceptions. This
- function is only available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (OrData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldOr64 (Index, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The lower 32-bits of the value written to the
- MSR are returned. Extra left bits in AndData are stripped. The caller must
- either guarantee that Index and the data written is valid, or the caller must
- set up exception handlers to catch the exceptions. This function is only
- available on IA-32 and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAnd32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT (EndBit < sizeof (AndData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldAnd64 (Index, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a
- bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- lower 32-bits of the value written to the MSR are returned. Extra left bits
- in both AndData and OrData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and X64.
-
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The lower 32-bit of the value written to the MSR.
-
-**/
-UINT32
-EFIAPI
-AsmMsrBitFieldAndThenOr32 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT (EndBit < sizeof (AndData) * 8);
- ASSERT (StartBit <= EndBit);
- return (UINT32)AsmMsrBitFieldAndThenOr64 (
- Index,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise inclusive OR, and writes the result
- back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. No parameter checking is performed on Index or OrData, and some of
- these may cause CPU exceptions. The caller must either guarantee that Index
- and OrData are valid, or the caller must establish proper exception handlers.
- This function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param OrData The value to OR with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrOr64 (
- IN UINT32 Index,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) | OrData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by OrData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned. No
- parameter checking is performed on Index or OrData, and some of these may
- cause CPU exceptions. The caller must either guarantee that Index and OrData
- are valid, or the caller must establish proper exception handlers. This
- function is only available on IA-32 and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAnd64 (
- IN UINT32 Index,
- IN UINT64 AndData
- )
-{
- return AsmWriteMsr64 (Index, AsmReadMsr64 (Index) & AndData);
-}
-
-/**
- Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive
- OR, and writes the result back to the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between read
- result and the value specified by AndData, performs a bitwise inclusive OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit MSR specified by Index. The value written
- to the MSR is returned. No parameter checking is performed on Index, AndData,
- or OrData, and some of these may cause CPU exceptions. The caller must either
- guarantee that Index, AndData, and OrData are valid, or the caller must
- establish proper exception handlers. This function is only available on IA-32
- and X64.
-
- @param Index The 32-bit MSR index to write.
- @param AndData The value to AND with the read value from the MSR.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrAndThenOr64 (
- IN UINT32 Index,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (Index, (AsmReadMsr64 (Index) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an MSR.
-
- Reads the bit field in the 64-bit MSR. The bit field is specified by the
- StartBit and the EndBit. The value of the bit field is returned. The caller
- must either guarantee that Index is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldRead64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (AsmReadMsr64 (Index), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an MSR.
-
- Writes Value to a bit field in a 64-bit MSR. The bit field is specified by
- the StartBit and the EndBit. All other bits in the destination MSR are
- preserved. The MSR written is returned. Extra left bits in Value are
- stripped. The caller must either guarantee that Index and the data written is
- valid, or the caller must set up exception handlers to catch the exceptions.
- This function is only available on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldWrite64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldWrite64 (AsmReadMsr64 (Index), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise inclusive OR, and
- writes the result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit MSR specified by Index. The value written to the MSR is
- returned. Extra left bits in OrData are stripped. The caller must either
- guarantee that Index and the data written is valid, or the caller must set up
- exception handlers to catch the exceptions. This function is only available
- on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldOr64 (AsmReadMsr64 (Index), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND between the
- read result and the value specified by AndData, and writes the result to the
- 64-bit MSR specified by Index. The value written to the MSR is returned.
- Extra left bits in AndData are stripped. The caller must either guarantee
- that Index and the data written is valid, or the caller must set up exception
- handlers to catch the exceptions. This function is only available on IA-32
- and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAnd64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldAnd64 (AsmReadMsr64 (Index), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MSR.
-
- Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by
- a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit MSR specified by Index. The
- value written to the MSR is returned. Extra left bits in both AndData and
- OrData are stripped. The caller must either guarantee that Index and the data
- written is valid, or the caller must set up exception handlers to catch the
- exceptions. This function is only available on IA-32 and X64.
-
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Index The 32-bit MSR index to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the bit field.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MSR.
-
-**/
-UINT64
-EFIAPI
-AsmMsrBitFieldAndThenOr64 (
- IN UINT32 Index,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return AsmWriteMsr64 (
- Index,
- BitFieldAndThenOr64 (
- AsmReadMsr64 (Index),
- StartBit,
- EndBit,
- AndData,
- OrData
- )
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadGdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadGdtr.c
deleted file mode 100644
index 4156c96065..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadGdtr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86ReadGdtr.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Reads the current Global Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current GDTR descriptor and returns it in Gdtr. This
- function is only available on IA-32 and X64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadGdtr (
- OUT IA32_DESCRIPTOR *Gdtr
- )
-{
- ASSERT (Gdtr != NULL);
- InternalX86ReadGdtr (Gdtr);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadIdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadIdtr.c
deleted file mode 100644
index 0be9e212bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86ReadIdtr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86ReadIdtr.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Reads and returns the current IDTR descriptor and returns it in Idtr. This
- function is only available on IA-32 and X64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmReadIdtr (
- OUT IA32_DESCRIPTOR *Idtr
- )
-{
- ASSERT (Idtr != NULL);
- InternalX86ReadIdtr (Idtr);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Thunk.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Thunk.c
deleted file mode 100644
index 8e394ca390..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86Thunk.c
+++ /dev/null
@@ -1,250 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86Thunk.c
-
-Abstract:
-
- Real Mode Thunk Functions for IA32 and X64.
-
---*/
-
-#include "BaseLibInternals.h"
-//
-// Byte packed structure for a segment descriptor in a GDT/LDT
-//
-typedef union {
- struct {
- UINT32 LimitLow:16;
- UINT32 BaseLow:16;
- UINT32 BaseMid:8;
- UINT32 Type:4;
- UINT32 S:1;
- UINT32 DPL:2;
- UINT32 P:1;
- UINT32 LimitHigh:4;
- UINT32 AVL:1;
- UINT32 L:1;
- UINT32 DB:1;
- UINT32 G:1;
- UINT32 BaseHigh:8;
- } Bits;
- UINT64 Uint64;
-} IA32_SEGMENT_DESCRIPTOR;
-
-extern CONST UINT8 m16Start;
-extern CONST UINT16 m16Size;
-extern CONST UINT16 mThunk16Attr;
-extern CONST UINT16 m16Gdt;
-extern CONST UINT16 m16GdtrBase;
-extern CONST UINT16 mTransition;
-
-/**
- Invokes 16-bit code in big real mode and returns the updated register set.
-
- This function transfers control to the 16-bit code specified by CS:EIP using
- the stack specified by SS:ESP in RegisterSet. The updated registers are saved
- on the real mode stack and the starting address of the save area is returned.
-
- @param RegisterSet Values of registers before invocation of 16-bit code.
- @param Transition Pointer to the transition code under 1MB.
-
- @return The pointer to a IA32_REGISTER_SET structure containing the updated
- register values.
-
-**/
-IA32_REGISTER_SET *
-EFIAPI
-InternalAsmThunk16 (
- IN IA32_REGISTER_SET *RegisterSet,
- IN OUT VOID *Transition
- );
-
-/**
- Retrieves the properties for 16-bit thunk functions.
-
- Computes the size of the buffer and stack below 1MB required to use the
- AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This
- buffer size is returned in RealModeBufferSize, and the stack size is returned
- in ExtraStackSize. If parameters are passed to the 16-bit real mode code,
- then the actual minimum stack size is ExtraStackSize plus the maximum number
- of bytes that need to be passed to the 16-bit real mode code.
-
- If RealModeBufferSize is NULL, then ASSERT().
- If ExtraStackSize is NULL, then ASSERT().
-
- @param RealModeBufferSize A pointer to the size of the buffer below 1MB
- required to use the 16-bit thunk functions.
- @param ExtraStackSize A pointer to the extra size of stack below 1MB
- that the 16-bit thunk functions require for
- temporary storage in the transition to and from
- 16-bit real mode.
-
-**/
-VOID
-EFIAPI
-AsmGetThunk16Properties (
- OUT UINT32 *RealModeBufferSize,
- OUT UINT32 *ExtraStackSize
- )
-{
- ASSERT (RealModeBufferSize != NULL);
- ASSERT (ExtraStackSize != NULL);
-
- *RealModeBufferSize = m16Size;
-
- //
- // Extra 4 bytes for return address, and another 4 bytes for mode transition
- //
- *ExtraStackSize = sizeof (IA32_DWORD_REGS) + 8;
-}
-
-/**
- Prepares all structures a code required to use AsmThunk16().
-
- Prepares all structures and code required to use AsmThunk16().
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareThunk16 (
- OUT THUNK_CONTEXT *ThunkContext
- )
-{
- IA32_SEGMENT_DESCRIPTOR *RealModeGdt;
-
- ASSERT (ThunkContext != NULL);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);
- ASSERT (ThunkContext->RealModeBufferSize >= m16Size);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);
-
- CopyMem (ThunkContext->RealModeBuffer, &m16Start, m16Size);
-
- //
- // Point RealModeGdt to the GDT to be used in transition
- //
- // RealModeGdt[0]: Reserved as NULL descriptor
- // RealModeGdt[1]: Code Segment
- // RealModeGdt[2]: Data Segment
- // RealModeGdt[3]: Call Gate
- //
- RealModeGdt = (IA32_SEGMENT_DESCRIPTOR*)(
- (UINTN)ThunkContext->RealModeBuffer + m16Gdt);
-
- //
- // Update Code & Data Segment Descriptor
- //
- RealModeGdt[1].Bits.BaseLow =
- (UINT32)(UINTN)ThunkContext->RealModeBuffer & ~0xf;
- RealModeGdt[1].Bits.BaseMid =
- (UINT32)(UINTN)ThunkContext->RealModeBuffer >> 16;
-
- //
- // Update transition code entry point offset
- //
- *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mTransition) +=
- (UINT32)(UINTN)ThunkContext->RealModeBuffer & 0xf;
-
- //
- // Update Segment Limits for both Code and Data Segment Descriptors
- //
- if ((ThunkContext->ThunkAttributes & THUNK_ATTRIBUTE_BIG_REAL_MODE) == 0) {
- //
- // Set segment limits to 64KB
- //
- RealModeGdt[1].Bits.LimitHigh = 0;
- RealModeGdt[1].Bits.G = 0;
- RealModeGdt[2].Bits.LimitHigh = 0;
- RealModeGdt[2].Bits.G = 0;
- }
-
- //
- // Update GDTBASE for this thunk context
- //
- *(VOID**)((UINTN)ThunkContext->RealModeBuffer + m16GdtrBase) = RealModeGdt;
-
- //
- // Update Thunk Attributes
- //
- *(UINT32*)((UINTN)ThunkContext->RealModeBuffer + mThunk16Attr) =
- ThunkContext->ThunkAttributes;
-}
-
-/**
- Transfers control to a 16-bit real mode entry point and returns the results.
-
- Transfers control to a 16-bit real mode entry point and returns the results.
- AsmPrepareThunk16() must be called with ThunkContext before this function is
- used. This function must be called with interrupts disabled.
-
- If ThunkContext is NULL, then ASSERT().
- If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-{
- IA32_REGISTER_SET *UpdatedRegs;
-
- ASSERT (ThunkContext != NULL);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer < 0x100000);
- ASSERT (ThunkContext->RealModeBufferSize >= m16Size);
- ASSERT ((UINTN)ThunkContext->RealModeBuffer + m16Size <= 0x100000);
-
- UpdatedRegs = InternalAsmThunk16 (
- ThunkContext->RealModeState,
- ThunkContext->RealModeBuffer
- );
-
- CopyMem (ThunkContext->RealModeState, UpdatedRegs, sizeof (*UpdatedRegs));
-}
-
-/**
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results.
-
- Prepares all structures and code for a 16-bit real mode thunk, transfers
- control to a 16-bit real mode entry point, and returns the results. If the
- caller only need to perform a single 16-bit real mode thunk, then this
- service should be used. If the caller intends to make more than one 16-bit
- real mode thunk, then it is more efficient if AsmPrepareThunk16() is called
- once and AsmThunk16() can be called for each 16-bit real mode thunk. This
- function must be called with interrupts disabled.
-
- If ThunkContext is NULL, then ASSERT().
-
- @param ThunkContext A pointer to the context structure that describes the
- 16-bit real mode code to call.
-
-**/
-VOID
-EFIAPI
-AsmPrepareAndThunk16 (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-{
- AsmPrepareThunk16 (ThunkContext);
- AsmThunk16 (ThunkContext);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteGdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteGdtr.c
deleted file mode 100644
index dad431c375..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteGdtr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86WriteGdtr.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Writes the current Global Descriptor Table Register (GDTR) descriptor.
-
- Writes and the current GDTR descriptor specified by Gdtr. This function is
- only available on IA-32 and X64.
-
- If Gdtr is NULL, then ASSERT().
-
- @param Gdtr Pointer to a GDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteGdtr (
- IN CONST IA32_DESCRIPTOR *Gdtr
- )
-{
- ASSERT (Gdtr != NULL);
- InternalX86WriteGdtr (Gdtr);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteIdtr.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteIdtr.c
deleted file mode 100644
index 20857c29d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseLib/X86WriteIdtr.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86WriteIdtr.c
-
-Abstract:
-
- IA-32/x64 specific functions.
-
---*/
-
-#include "BaseLibInternals.h"
-
-/**
- Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.
-
- Writes the current IDTR descriptor and returns it in Idtr. This function is
- only available on IA-32 and X64.
-
- If Idtr is NULL, then ASSERT().
-
- @param Idtr Pointer to a IDTR descriptor.
-
-**/
-VOID
-EFIAPI
-AsmWriteIdtr (
- IN CONST IA32_DESCRIPTOR *Idtr
- )
-{
- ASSERT (Idtr != NULL);
- InternalX86WriteIdtr (Idtr);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLib.inf
deleted file mode 100644
index 3a7dbce365..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLib.inf
+++ /dev/null
@@ -1,154 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseMemoryLib.inf
-#
-# Abstract:
-#
-# Component description file for BaseMemoryLib. This instance is not the
-# BaseMemoryLib in EdkII but almost BaseMemoryLibRepStr.
-# Use REP string instructions for Ia32 and X64 for high performance and small size
-# Use C implementation for IPF and EBC
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseMemoryLib
-COMPONENT_TYPE = LIBRARY
-
-[Sources.common]
- BaseMemoryLibInternal.h
-
-[Sources.Ia32]
- Ia32/ScanMem64.S
- Ia32/ScanMem32.S
- Ia32/ScanMem16.S
- Ia32/ScanMem8.S
- Ia32/CompareMem.S
- Ia32/ZeroMem.S
- Ia32/SetMem64.S
- Ia32/SetMem32.S
- Ia32/SetMem16.S
- Ia32/SetMem.S
- Ia32/CopyMem.S
- Ia32/ScanMem64.asm
- Ia32/ScanMem32.asm
- Ia32/ScanMem16.asm
- Ia32/ScanMem8.asm
- Ia32/CompareMem.asm
- Ia32/ZeroMem.asm
- Ia32/SetMem64.asm
- Ia32/SetMem32.asm
- Ia32/SetMem16.asm
- Ia32/SetMem.asm
- Ia32/CopyMem.asm
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- MemLibGuid.c
-
-[Sources.X64]
- X64/ScanMem64.S
- X64/ScanMem32.S
- X64/ScanMem16.S
- X64/ScanMem8.S
- X64/CompareMem.S
- X64/ZeroMem.S
- X64/SetMem64.S
- X64/SetMem32.S
- X64/SetMem16.S
- X64/SetMem.S
- X64/CopyMem.S
- X64/ScanMem64.asm
- X64/ScanMem32.asm
- X64/ScanMem16.asm
- X64/ScanMem8.asm
- X64/CompareMem.asm
- X64/ZeroMem.asm
- X64/SetMem64.asm
- X64/SetMem32.asm
- X64/SetMem16.asm
- X64/SetMem.asm
- X64/CopyMem.asm
- ScanMem64Wrapper.c
- ScanMem32Wrapper.c
- ScanMem16Wrapper.c
- ScanMem8Wrapper.c
- ZeroMemWrapper.c
- CompareMemWrapper.c
- SetMem64Wrapper.c
- SetMem32Wrapper.c
- SetMem16Wrapper.c
- SetMemWrapper.c
- CopyMemWrapper.c
- MemLibGuid.c
-
-[sources.ipf]
- Ipf/CopyMem.c
- Ipf/MemLibGeneric.c
- Ipf/SetMem.c
-
-[sources.ebc]
- Ebc/CopyMem.c
- Ebc/MemLibGeneric.c
- Ebc/SetMem.c
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLibInternal.h
deleted file mode 100644
index 44c3d38f1d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/BaseMemoryLibInternal.h
+++ /dev/null
@@ -1,227 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- BaseMemoryLibInternals.h
-
-Abstract:
-
- Header file for Base Memory Library.
-
---*/
-
-#ifndef __BASEMEMORY_LIB_INTERNALS_H__
-#define __BASEMEMORY_LIB_INTERNALS_H__
-
-#include "EdkIIGlueBase.h"
-/**
- Copy Length bytes from Source to Destination.
-
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
- @param Value Value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- );
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer First memory buffer
- @param SourceBuffer Second memory buffer
- @param Length Length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @retval 0 if MemOne == MemTwo
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- );
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- );
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- );
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- );
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
deleted file mode 100644
index 9562460e0f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- CompareMemWrapper.c
-
-Abstract:
-
- CompareMem() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Compares the contents of two buffers.
-
- This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.
- If all Length bytes of the two buffers are identical, then 0 is returned. Otherwise, the
- value returned is the first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
- If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT().
- If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT().
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
-
- @param DestinationBuffer Pointer to the destination buffer to compare.
- @param SourceBuffer Pointer to the source buffer to compare.
- @param Length Number of bytes to compare.
-
- @return 0 All Length bytes of the two buffers are identical.
- @retval Non-zero The first mismatched byte in SourceBuffer subtracted from the first
- mismatched byte in DestinationBuffer.
-
-**/
-INTN
-EFIAPI
-GlueCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0 || DestinationBuffer == SourceBuffer) {
- return 0;
- }
- ASSERT (DestinationBuffer != NULL);
- ASSERT (SourceBuffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CopyMemWrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CopyMemWrapper.c
deleted file mode 100644
index 0dfc9c787b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CopyMemWrapper.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- CopyMemWrapper.c
-
-Abstract:
-
- CopyMem() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Copies a source buffer to a destination buffer, and returns the destination buffer.
-
- This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns
- DestinationBuffer. The implementation must be reentrant, and it must handle the case
- where SourceBuffer overlaps DestinationBuffer.
- If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT().
- If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
-
- @param DestinationBuffer Pointer to the destination buffer of the memory copy.
- @param SourceBuffer Pointer to the source buffer of the memory copy.
- @param Length Number of bytes to copy from SourceBuffer to DestinationBuffer.
-
- @return DestinationBuffer.
-
-**/
-VOID *
-EFIAPI
-GlueCopyMem (
- OUT VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return DestinationBuffer;
- }
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));
-
- if (DestinationBuffer == SourceBuffer) {
- return DestinationBuffer;
- }
- return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/CopyMem.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/CopyMem.c
deleted file mode 100644
index bd65b2c1cf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/CopyMem.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- CopyMem.c
-
-Abstract:
-
- Internal CopyMem
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memcpy()
- //
- volatile UINT8 *Destination8;
- CONST UINT8 *Source8;
-
- if (Source > Destination) {
- Destination8 = (UINT8*)Destination;
- Source8 = (CONST UINT8*)Source;
- while (Length-- != 0) {
- *(Destination8++) = *(Source8++);
- }
- } else if (Source < Destination) {
- Destination8 = (UINT8*)Destination + Length;
- Source8 = (CONST UINT8*)Source + Length;
- while (Length-- != 0) {
- *(--Destination8) = *(--Source8);
- }
- }
- return Destination;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/MemLibGeneric.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/MemLibGeneric.c
deleted file mode 100644
index 3a1d09d61d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/MemLibGeneric.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MemLibGeneric.c
-
-Abstract:
-
- Architecture Independent Base Memory Library Implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- do {
- ((UINT16*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- do {
- ((UINT32*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- do {
- ((UINT64*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- return InternalMemSetMem (Buffer, Length, 0);
-}
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer First memory buffer
- @param SourceBuffer Second memory buffer
- @param Length Length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @retval 0 if MemOne == MemTwo
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- while ((--Length != 0) &&
- (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) {
- DestinationBuffer = (INT8*)DestinationBuffer + 1;
- SourceBuffer = (INT8*)SourceBuffer + 1;
- }
- return (INTN)*(UINT8*)DestinationBuffer - (INTN)*(UINT8*)SourceBuffer;
-}
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- CONST UINT8 *Pointer;
-
- Pointer = (CONST UINT8*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- CONST UINT16 *Pointer;
-
- Pointer = (CONST UINT16*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- CONST UINT32 *Pointer;
-
- Pointer = (CONST UINT32*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- CONST UINT64 *Pointer;
-
- Pointer = (CONST UINT64*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/SetMem.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/SetMem.c
deleted file mode 100644
index 4a1ff171f3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ebc/SetMem.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SetMem.c
-
-Abstract:
-
- Internal SetMem
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
- @param Value Value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN UINT8 Value
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memset()
- //
- volatile UINT8 *Pointer;
-
- Pointer = (UINT8*)Buffer;
- while (Size-- != 0) {
- *(Pointer++) = Value;
- }
- return Buffer;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S
deleted file mode 100644
index 99a6a5299c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.S
+++ /dev/null
@@ -1,53 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CompareMem.Asm
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemCompareMem)
-
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCompareMem):
- push %esi
- push %edi
- movl 12(%esp), %esi
- movl 16(%esp), %edi
- movl 20(%esp), %ecx
- repe cmpsb
- movzbl -1(%esi), %eax
- movzbl -1(%edi), %edx
- subl %edx, %eax
- pop %edi
- pop %esi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.asm
deleted file mode 100644
index bd93766fa7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CompareMem.asm
+++ /dev/null
@@ -1,54 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-InternalMemCompareMem PROC USES esi edi
- mov esi, [esp + 12]
- mov edi, [esp + 16]
- mov ecx, [esp + 20]
- repe cmpsb
- movzx eax, byte ptr [esi - 1]
- movzx edx, byte ptr [edi - 1]
- sub eax, edx
- ret
-InternalMemCompareMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S
deleted file mode 100644
index 2c3f8ecf8c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.S
+++ /dev/null
@@ -1,65 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CopyMem.Asm
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemCopyMem):
- push %esi
- push %edi
- movl 16(%esp), %esi # esi <- Source
- movl 12(%esp), %edi # edi <- Destination
- movl 20(%esp), %edx # edx <- Count
- leal -1(%esi, %edx), %eax # eax <- End of Source
- cmpl %edi, %esi
- jae L0
- cmpl %edi, %eax
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- movl %edx, %ecx
- andl $3, %edx
- shrl $2, %ecx
- rep
- movsl # Copy as many Dwords as possible
- jmp L_CopyBytes
-L_CopyBackward:
- movl %eax, %esi # esi <- End of Source
- leal -1(%edi, %edx), %edi # edi <- End of Destination
- std
-L_CopyBytes:
- movl %edx, %ecx
- rep
- movsb # Copy bytes backward
- cld
- movl 12(%esp), %eax # eax <- Destination as return value
- pop %edi
- pop %esi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.asm
deleted file mode 100644
index cc6a524cc4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/CopyMem.asm
+++ /dev/null
@@ -1,63 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.Asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-InternalMemCopyMem PROC USES esi edi
- mov esi, [esp + 16] ; esi <- Source
- mov edi, [esp + 12] ; edi <- Destination
- mov edx, [esp + 20] ; edx <- Count
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae @F
- cmp eax, edi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov ecx, edx
- and edx, 3
- shr ecx, 2
- rep movsd ; Copy as many Dwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-@CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
- mov eax, [esp + 12] ; eax <- Destination as return value
- ret
-InternalMemCopyMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S
deleted file mode 100644
index 1a11f76bd3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem16.Asm
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemScanMem16)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem16):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasw
- leal -2(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.asm
deleted file mode 100644
index 907d813305..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem16.asm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem16 PROC USES edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasw
- lea eax, [edi - 2]
- cmovnz eax, ecx
- ret
-InternalMemScanMem16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S
deleted file mode 100644
index 8785e96642..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem32.Asm
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemScanMem32)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem32):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movl 16(%esp), %eax
- repne scasl
- leal -4(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.asm
deleted file mode 100644
index 7e29f58155..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem32.asm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem32 PROC USES edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov eax, [esp + 16]
- repne scasd
- lea eax, [edi - 4]
- cmovnz eax, ecx
- ret
-InternalMemScanMem32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S
deleted file mode 100644
index 82304245f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.S
+++ /dev/null
@@ -1,59 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem64.Asm
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemScanMem64)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- cmpl (%edi), %eax
- leal 8(%edi), %edi
- loopne L0
- jne L1
- cmpl -4(%edi), %edx
- jecxz L1
- jne L0
-L1:
- leal -8(%edi), %eax
- cmovne %ecx, %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.asm
deleted file mode 100644
index 6932d924a5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem64.asm
+++ /dev/null
@@ -1,62 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem64 PROC USES edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-@@:
- cmp eax, [edi]
- lea edi, [edi + 8]
- loopne @B
- jne @F
- cmp edx, [edi - 4]
- jecxz @F
- jne @B
-@@:
- lea eax, [edi - 8]
- cmovne eax, ecx
- ret
-InternalMemScanMem64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S
deleted file mode 100644
index 84c14cd98c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem8.Asm
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemScanMem8)
-
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemScanMem8):
- push %edi
- movl 12(%esp), %ecx
- movl 8(%esp), %edi
- movb 16(%esp), %al
- repne scasb
- leal -1(%edi), %eax
- cmovnz %ecx, %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.asm
deleted file mode 100644
index 31a7bd0eed..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ScanMem8.asm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .686
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem8 PROC USES edi
- mov ecx, [esp + 12]
- mov edi, [esp + 8]
- mov al, [esp + 16]
- repne scasb
- lea eax, [edi - 1]
- cmovnz eax, ecx
- ret
-InternalMemScanMem8 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S
deleted file mode 100644
index d387be92c0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem.Asm
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
- .386:
- .code:
-
-.globl ASM_PFX(InternalMemSetMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem):
- push %edi
- movl 16(%esp),%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- rep
- stosb
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.asm
deleted file mode 100644
index 2101b430fa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.Asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem PROC USES edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosb
- mov eax, [esp + 8]
- ret
-InternalMemSetMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S
deleted file mode 100644
index 497fced59d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem16.Asm
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemSetMem16)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem16):
- push %edi
- movl 16(%esp), %eax
- movl 8(%esp), %edi
- movl 12(%esp), %ecx
- rep
- stosw
- movl 8(%esp), %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.asm
deleted file mode 100644
index a14ccc6d62..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem16.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem16.Asm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem16 PROC USES edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosw
- mov eax, [esp + 8]
- ret
-InternalMemSetMem16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S
deleted file mode 100644
index 6a840f014c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.S
+++ /dev/null
@@ -1,43 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem32.Asm
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemSetMem32)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem32):
- push %edi
- movl 16(%esp),%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- rep
- stosl
- movl 8(%esp),%eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.asm
deleted file mode 100644
index 7a885c6a69..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem32.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem32.Asm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem32 PROC USES edi
- mov eax, [esp + 16]
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- rep stosd
- mov eax, [esp + 8]
- ret
-InternalMemSetMem32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S
deleted file mode 100644
index 1c807d0179..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem64.Asm
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemSetMem64)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemSetMem64):
- push %edi
- movl 12(%esp), %ecx
- movl 16(%esp), %eax
- movl 20(%esp), %edx
- movl 8(%esp), %edi
-L0:
- mov %eax, -8(%edi, %ecx, 8)
- mov %edx, -4(%edi, %ecx, 8)
- loop L0
- movl %edi, %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.asm
deleted file mode 100644
index b3fed29cb3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/SetMem64.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem64.Asm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem64 PROC USES edi
- mov ecx, [esp + 12]
- mov eax, [esp + 16]
- mov edx, [esp + 20]
- mov edi, [esp + 8]
-@@:
- mov [edi + ecx*8 - 8], eax
- mov [edi + ecx*8 - 4], edx
- loop @B
- mov eax, edi
- ret
-InternalMemSetMem64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S
deleted file mode 100644
index 5a4a762504..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.S
+++ /dev/null
@@ -1,49 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ZeroMem.Asm
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EdkIIGlueBase.h>
-.globl ASM_PFX(InternalMemZeroMem)
-
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(InternalMemZeroMem):
- push %edi
- xorl %eax,%eax
- movl 8(%esp),%edi
- movl 12(%esp),%ecx
- movl %ecx,%edx
- shrl $2,%ecx
- andl $3,%edx
- pushl %edi
- rep
- stosl
- movl %edx,%ecx
- rep
- stosb
- popl %eax
- pop %edi
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.asm
deleted file mode 100644
index d9d3e574d3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ia32/ZeroMem.asm
+++ /dev/null
@@ -1,50 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ZeroMem.Asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMemZeroMem PROC USES edi
- xor eax, eax
- mov edi, [esp + 8]
- mov ecx, [esp + 12]
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- push edi
- rep stosd
- mov ecx, edx
- rep stosb
- pop eax
- ret
-InternalMemZeroMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/CopyMem.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/CopyMem.c
deleted file mode 100644
index bd65b2c1cf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/CopyMem.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- CopyMem.c
-
-Abstract:
-
- Internal CopyMem
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Copy Length bytes from Source to Destination.
-
- @param Destination Target of copy
- @param Source Place to copy from
- @param Length Number of bytes to copy
-
- @return Destination
-
-**/
-VOID *
-EFIAPI
-InternalMemCopyMem (
- OUT VOID *Destination,
- IN CONST VOID *Source,
- IN UINTN Length
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memcpy()
- //
- volatile UINT8 *Destination8;
- CONST UINT8 *Source8;
-
- if (Source > Destination) {
- Destination8 = (UINT8*)Destination;
- Source8 = (CONST UINT8*)Source;
- while (Length-- != 0) {
- *(Destination8++) = *(Source8++);
- }
- } else if (Source < Destination) {
- Destination8 = (UINT8*)Destination + Length;
- Source8 = (CONST UINT8*)Source + Length;
- while (Length-- != 0) {
- *(--Destination8) = *(--Source8);
- }
- }
- return Destination;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/MemLibGeneric.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/MemLibGeneric.c
deleted file mode 100644
index 3a1d09d61d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/MemLibGeneric.c
+++ /dev/null
@@ -1,261 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MemLibGeneric.c
-
-Abstract:
-
- Architecture Independent Base Memory Library Implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- do {
- ((UINT16*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- do {
- ((UINT32*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- do {
- ((UINT64*)Buffer)[--Length] = Value;
- } while (Length != 0);
- return Buffer;
-}
-
-/**
- Set Buffer to 0 for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- return InternalMemSetMem (Buffer, Length, 0);
-}
-
-/**
- Compares two memory buffers of a given length.
-
- @param DestinationBuffer First memory buffer
- @param SourceBuffer Second memory buffer
- @param Length Length of DestinationBuffer and SourceBuffer memory
- regions to compare. Must be non-zero.
-
- @retval 0 if MemOne == MemTwo
-
-**/
-INTN
-EFIAPI
-InternalMemCompareMem (
- IN CONST VOID *DestinationBuffer,
- IN CONST VOID *SourceBuffer,
- IN UINTN Length
- )
-{
- while ((--Length != 0) &&
- (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) {
- DestinationBuffer = (INT8*)DestinationBuffer + 1;
- SourceBuffer = (INT8*)SourceBuffer + 1;
- }
- return (INTN)*(UINT8*)DestinationBuffer - (INTN)*(UINT8*)SourceBuffer;
-}
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the
- matching 8-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- CONST UINT8 *Pointer;
-
- Pointer = (CONST UINT8*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the
- matching 16-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- CONST UINT16 *Pointer;
-
- Pointer = (CONST UINT16*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the
- matching 32-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- CONST UINT32 *Pointer;
-
- Pointer = (CONST UINT32*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the
- matching 64-bit value in the target buffer.
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan. Must be non-zero.
- @param Value Value to search for in the target buffer.
-
- @return Pointer to the first occurrence or NULL if not found.
-
-**/
-CONST VOID *
-EFIAPI
-InternalMemScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- CONST UINT64 *Pointer;
-
- Pointer = (CONST UINT64*)Buffer;
- do {
- if (*(Pointer++) == Value) {
- return Pointer;
- }
- } while (--Length != 0);
- return NULL;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/SetMem.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/SetMem.c
deleted file mode 100644
index 4a1ff171f3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/Ipf/SetMem.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SetMem.c
-
-Abstract:
-
- Internal SetMem
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Set Buffer to Value for Size bytes.
-
- @param Buffer Memory to set.
- @param Size Number of bytes to set
- @param Value Value of the set operation.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-InternalMemSetMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN UINT8 Value
- )
-{
- //
- // Declare the local variables that actually move the data elements as
- // volatile to prevent the optimizer from replacing this function with
- // the intrinsic memset()
- //
- volatile UINT8 *Pointer;
-
- Pointer = (UINT8*)Buffer;
- while (Size-- != 0) {
- *(Pointer++) = Value;
- }
- return Buffer;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/MemLibGuid.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/MemLibGuid.c
deleted file mode 100644
index b015facb49..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/MemLibGuid.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- MemLibGuid.c
-
-Abstract:
-
- Implementation of GUID functions.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Copies a source GUID to a destination GUID.
-
- This function copies the contents of the 128-bit GUID specified by SourceGuid to
- DestinationGuid, and returns DestinationGuid.
- If DestinationGuid is NULL, then ASSERT().
- If SourceGuid is NULL, then ASSERT().
-
- @param DestinationGuid Pointer to the destination GUID.
- @param SourceGuid Pointer to the source GUID.
-
- @return DestinationGuid.
-
-**/
-GUID *
-EFIAPI
-CopyGuid (
- OUT GUID *DestinationGuid,
- IN CONST GUID *SourceGuid
- )
-{
- WriteUnaligned64 (
- (UINT64*)DestinationGuid,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid)
- );
- WriteUnaligned64 (
- (UINT64*)DestinationGuid + 1,
- ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)
- );
- return DestinationGuid;
-}
-
-/**
- Compares two GUIDs.
-
- This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE is returned.
- If there are any bit differences in the two GUIDs, then FALSE is returned.
- If Guid1 is NULL, then ASSERT().
- If Guid2 is NULL, then ASSERT().
-
- @param Guid1 A pointer to a 128 bit GUID.
- @param Guid2 A pointer to a 128 bit GUID.
-
- @retval TRUE Guid1 and Guid2 are identical.
- @retval FALSE Guid1 and Guid2 are not identical.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCompareGuid (
- IN CONST GUID *Guid1,
- IN CONST GUID *Guid2
- )
-{
- UINT64 LowPartOfGuid1;
- UINT64 LowPartOfGuid2;
- UINT64 HighPartOfGuid1;
- UINT64 HighPartOfGuid2;
-
- LowPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1);
- LowPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2);
- HighPartOfGuid1 = ReadUnaligned64 ((CONST UINT64*) Guid1 + 1);
- HighPartOfGuid2 = ReadUnaligned64 ((CONST UINT64*) Guid2 + 1);
-
- return (BOOLEAN) (LowPartOfGuid1 == LowPartOfGuid2 && HighPartOfGuid1 == HighPartOfGuid2);
-}
-
-/**
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Guid Value to search for in the target buffer.
-
- @return A pointer to the matching Guid in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanGuid (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN CONST GUID *Guid
- )
-{
- CONST GUID *GuidPtr;
-
- ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);
-
- GuidPtr = (GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (CONST GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem16Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem16Wrapper.c
deleted file mode 100644
index 2c37efded0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem16Wrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ScanMem16Wrapper.c
-
-Abstract:
-
- ScanMem16() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 16-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem16 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem32Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem32Wrapper.c
deleted file mode 100644
index 66d346b00f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem32Wrapper.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ScanMem32Wrapper.c
-
-Abstract:
-
- ScanMem32() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 32-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem32 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem64Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem64Wrapper.c
deleted file mode 100644
index 62e609a213..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem64Wrapper.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- ScanMem64Wrapper.c
-
-Abstract:
-
- ScanMem64() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for a 64-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem64 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem8Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem8Wrapper.c
deleted file mode 100644
index 2341e42acb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ScanMem8Wrapper.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- ScanMem8Wrapper.c
-
-Abstract:
-
- ScanMem8() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from the lowest
- address to the highest address for an 8-bit value that matches Value. If a match is found,
- then a pointer to the matching byte in the target buffer is returned. If no match is found,
- then NULL is returned. If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to scan.
- @param Length Number of bytes in Buffer to scan.
- @param Value Value to search for in the target buffer.
-
- @return A pointer to the matching byte in the target buffer or NULL otherwise.
-
-**/
-VOID *
-EFIAPI
-ScanMem8 (
- IN CONST VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return NULL;
- }
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem16Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem16Wrapper.c
deleted file mode 100644
index 400c3fe883..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem16Wrapper.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- SetMem16Wrapper.c
-
-Abstract:
-
- SetMem16() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a 16-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 16-bit value specified by
- Value, and returns Buffer. Value is repeated every 16-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If Length is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem16 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT16 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem32Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem32Wrapper.c
deleted file mode 100644
index 95240fd118..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem32Wrapper.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- SetMem32Wrapper.c
-
-Abstract:
-
- SetMem32() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a 32-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 32-bit value specified by
- Value, and returns Buffer. Value is repeated every 32-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem32 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT32 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem64Wrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem64Wrapper.c
deleted file mode 100644
index 3b7a6db04a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMem64Wrapper.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- SetMem64Wrapper.c
-
-Abstract:
-
- SetMem64() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a 64-bit value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the 64-bit value specified by
- Value, and returns Buffer. Value is repeated every 64-bits in for Length
- bytes of Buffer.
-
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
- If Buffer is not aligned on a 64-bit boundary, then ASSERT().
- If Length is not aligned on a 64-bit boundary, then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill.
- @param Length Number of bytes in Buffer to fill.
- @param Value Value with which to fill Length bytes of Buffer.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-SetMem64 (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT64 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT (Buffer != NULL);
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
- ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);
- ASSERT ((Length & (sizeof (Value) - 1)) == 0);
-
- return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMemWrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMemWrapper.c
deleted file mode 100644
index f7de3b8945..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/SetMemWrapper.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- SetMemWrapper.c
-
-Abstract:
-
- SetMem() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with a byte value, and returns the target buffer.
-
- This function fills Length bytes of Buffer with Value, and returns Buffer.
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Memory to set.
- @param Length Number of bytes to set.
- @param Value Value of the set operation.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-GlueSetMem (
- OUT VOID *Buffer,
- IN UINTN Length,
- IN UINT8 Value
- )
-{
- if (Length == 0) {
- return Buffer;
- }
-
- ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));
-
- return InternalMemSetMem (Buffer, Length, Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S
deleted file mode 100644
index 020d5c86a5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.S
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CompareMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CompareMem.S
-#
-# Abstract:
-#
-# CompareMem function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# INTN
-# EFIAPI
-# InternalMemCompareMem (
-# IN CONST VOID *DestinationBuffer,
-# IN CONST VOID *SourceBuffer,
-# IN UINTN Length
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemCompareMem)
-ASM_PFX(InternalMemCompareMem):
- pushq %rsi
- pushq %rdi
- movq %rcx, %rsi
- movq %rdx, %rdi
- movq %r8, %rcx
- repe cmpsb
- movzbq -1(%rsi) , %rax
- movzbq -1(%rdi) , %rdx
- subq %rdx, %rax
- popq %rdi
- popq %rsi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.asm
deleted file mode 100644
index ff8de50bf1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CompareMem.asm
+++ /dev/null
@@ -1,52 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CompareMem.Asm
-;
-; Abstract:
-;
-; CompareMem function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; INTN
-; EFIAPI
-; InternalMemCompareMem (
-; IN CONST VOID *DestinationBuffer,
-; IN CONST VOID *SourceBuffer,
-; IN UINTN Length
-; );
-;------------------------------------------------------------------------------
-InternalMemCompareMem PROC USES rsi rdi
- mov rsi, rcx
- mov rdi, rdx
- mov rcx, r8
- repe cmpsb
- movzx rax, byte ptr [rsi - 1]
- movzx rdx, byte ptr [rdi - 1]
- sub rax, rdx
- ret
-InternalMemCompareMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S
deleted file mode 100644
index dddb866ba8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.S
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from CopyMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# CopyMem.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemCopyMem)
-ASM_PFX(InternalMemCopyMem):
- pushq %rsi
- pushq %rdi
- movq %rdx, %rsi # rsi <- Source
- movq %rcx, %rdi # rdi <- Destination
- leaq -1(%rsi, %r8,), %r9 # r9 <- End of Source
- cmpq %rdi, %rsi
- movq %rdi, %rax # rax <- Destination as return value
- jae L0
- cmpq %rdi, %r9
- jae L_CopyBackward # Copy backward if overlapped
-L0:
- movq %r8, %rcx
- andq $7, %r8
- shrq $3, %rcx
- rep movsq # Copy as many Qwords as possible
- jmp L_CopyBytes
-L_CopyBackward:
- movq %r9, %rsi # rsi <- End of Source
- leaq -1(%rdi, %r8), %rdi # esi <- End of Destination
- std # set direction flag
-L_CopyBytes:
- movq %r8, %rcx
- rep movsb # Copy bytes backward
- cld
- popq %rdi
- popq %rsi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.asm
deleted file mode 100644
index e422e7f35e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/CopyMem.asm
+++ /dev/null
@@ -1,61 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.Asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; )
-;------------------------------------------------------------------------------
-InternalMemCopyMem PROC USES rsi rdi
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- mov rax, rdi ; rax <- Destination as return value
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 7
- shr rcx, 3
- rep movsq ; Copy as many Qwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
- ret
-InternalMemCopyMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S
deleted file mode 100644
index 2139a2a25f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem16.S
-#
-# Abstract:
-#
-# ScanMem16 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem16 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT16 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemScanMem16)
-ASM_PFX(InternalMemScanMem16):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasw
- leaq -2(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.asm
deleted file mode 100644
index b5f09365f0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem16.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem16.Asm
-;
-; Abstract:
-;
-; ScanMem16 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem16 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT16 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem16 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasw
- lea rax, [rdi - 2]
- cmovnz rax, rcx
- ret
-InternalMemScanMem16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S
deleted file mode 100644
index ccb5d26df3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem32.S
-#
-# Abstract:
-#
-# ScanMem32 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem32 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemScanMem32)
-ASM_PFX(InternalMemScanMem32):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasl
- leaq -4(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.asm
deleted file mode 100644
index 37939b8a8b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem32.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem32.Asm
-;
-; Abstract:
-;
-; ScanMem32 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem32 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem32 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasd
- lea rax, [rdi - 4]
- cmovnz rax, rcx
- ret
-InternalMemScanMem32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S
deleted file mode 100644
index 8a08719e47..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem64.S
-#
-# Abstract:
-#
-# ScanMem64 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem64 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT64 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemScanMem64)
-ASM_PFX(InternalMemScanMem64):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasq
- leaq -8(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.asm
deleted file mode 100644
index fba7aa48ac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem64.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem64.Asm
-;
-; Abstract:
-;
-; ScanMem64 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem64 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT64 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem64 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- mov rcx, rdx
- repne scasq
- lea rax, [rdi - 8]
- cmovnz rax, rcx
- ret
-InternalMemScanMem64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S
deleted file mode 100644
index f495217296..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ScanMem8.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ScanMem8.S
-#
-# Abstract:
-#
-# ScanMem8 function
-#
-# Notes:
-#
-# The following BaseMemoryLib instances share the same version of this file:
-#
-# BaseMemoryLibRepStr
-# BaseMemoryLibMmx
-# BaseMemoryLibSse2
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# CONST VOID *
-# EFIAPI
-# InternalMemScanMem8 (
-# IN CONST VOID *Buffer,
-# IN UINTN Length,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemScanMem8)
-ASM_PFX(InternalMemScanMem8):
- pushq %rdi
- movq %rcx, %rdi
- movq %rdx, %rcx
- movq %r8, %rax
- repne scasb
- leaq -1(%rdi), %rax
- cmovnz %rcx, %rax # set rax to 0 if not found
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.asm
deleted file mode 100644
index 525cfbbb52..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ScanMem8.asm
+++ /dev/null
@@ -1,51 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ScanMem8.Asm
-;
-; Abstract:
-;
-; ScanMem8 function
-;
-; Notes:
-;
-; The following BaseMemoryLib instances share the same version of this file:
-;
-; BaseMemoryLibRepStr
-; BaseMemoryLibMmx
-; BaseMemoryLibSse2
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; CONST VOID *
-; EFIAPI
-; InternalMemScanMem8 (
-; IN CONST VOID *Buffer,
-; IN UINTN Length,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemScanMem8 PROC USES rdi
- mov rdi, rcx
- mov rcx, rdx
- mov rax, r8
- repne scasb
- lea rax, [rdi - 1]
- cmovnz rax, rcx ; set rax to 0 if not found
- ret
-InternalMemScanMem8 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S
deleted file mode 100644
index 07b924dace..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemSetMem)
-ASM_PFX(InternalMemSetMem):
- pushq %rdi
- movq %r8, %rax # rax = Value
- movq %rcx, %rdi # rdi = Buffer
- xchgq %rdx, %rcx # rcx = Count, rdx = Buffer
- rep stosb
- movq %rdx, %rax # rax = Buffer
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.asm
deleted file mode 100644
index c4f45b0ebe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.Asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem PROC USES rdi
- mov rax, r8 ; rax = Value
- mov rdi, rcx ; rdi = Buffer
- xchg rcx, rdx ; rcx = Count, rdx = Buffer
- rep stosb
- mov rax, rdx ; rax = Buffer
- ret
-InternalMemSetMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S
deleted file mode 100644
index b0f02410e8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem16.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem16.S
-#
-# Abstract:
-#
-# SetMem16 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem16 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT16 Value
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemSetMem16)
-ASM_PFX(InternalMemSetMem16):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchgq %rdx, %rcx
- rep stosw
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.asm
deleted file mode 100644
index 4ad87ee827..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem16.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem16.Asm
-;
-; Abstract:
-;
-; SetMem16 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem16 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT16 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem16 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosw
- mov rax, rdx
- ret
-InternalMemSetMem16 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S
deleted file mode 100644
index fe837d81b8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.S
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem32.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem32.S
-#
-# Abstract:
-#
-# SetMem32 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# EFIAPI
-# InternalMemSetMem32 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT32 Value
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemSetMem32)
-ASM_PFX(InternalMemSetMem32):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchgq %rdx, %rcx
- rep stosl
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.asm
deleted file mode 100644
index a008cf7fa8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem32.asm
+++ /dev/null
@@ -1,44 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem32.Asm
-;
-; Abstract:
-;
-; SetMem32 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; InternalMemSetMem32 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT32 Value
-; );
-;------------------------------------------------------------------------------
-InternalMemSetMem32 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosd
- mov rax, rdx
- ret
-InternalMemSetMem32 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S
deleted file mode 100644
index c01c7647b6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from SetMem64.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SetMem64.S
-#
-# Abstract:
-#
-# SetMem64 function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemSetMem64 (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT64 Value
-# )
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemSetMem64)
-ASM_PFX(InternalMemSetMem64):
- pushq %rdi
- movq %rcx, %rdi
- movq %r8, %rax
- xchgq %rdx, %rcx
- rep stosq
- movq %rdx, %rax
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.asm
deleted file mode 100644
index 6ab3312d40..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/SetMem64.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem64.Asm
-;
-; Abstract:
-;
-; SetMem64 function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemSetMem64 (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT64 Value
-; )
-;------------------------------------------------------------------------------
-InternalMemSetMem64 PROC USES rdi
- mov rdi, rcx
- mov rax, r8
- xchg rcx, rdx
- rep stosq
- mov rax, rdx
- ret
-InternalMemSetMem64 ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S
deleted file mode 100644
index 8fd0d30a73..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# ConvertAsm.py: Automatically generated from ZeroMem.asm
-#
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ZeroMem.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-
-#include <EdkIIGlueBase.h>
-#------------------------------------------------------------------------------
-# VOID *
-# InternalMemZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-.globl ASM_PFX(InternalMemZeroMem)
-ASM_PFX(InternalMemZeroMem):
- pushq %rdi
- pushq %rcx
- xorq %rax, %rax
- movq %rcx, %rdi
- movq %rdx, %rcx
- shrq $3, %rcx
- andq $7, %rdx
- rep stosq
- movl %edx, %ecx
- rep stosb
- popq %rax
- popq %rdi
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.asm
deleted file mode 100644
index 7e5b12651e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/X64/ZeroMem.asm
+++ /dev/null
@@ -1,47 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ZeroMem.Asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; InternalMemZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-InternalMemZeroMem PROC USES rdi
- push rcx
- xor rax, rax
- mov rdi, rcx
- mov rcx, rdx
- shr rcx, 3
- and rdx, 7
- rep stosq
- mov ecx, edx
- rep stosb
- pop rax
- ret
-InternalMemZeroMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ZeroMemWrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ZeroMemWrapper.c
deleted file mode 100644
index a1cf0b5147..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/ZeroMemWrapper.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- ZeroMemWrapper.c
-
-Abstract:
-
- ZeroMem() implementation.
-
---*/
-
-#include "BaseMemoryLibInternal.h"
-
-/**
- Fills a target buffer with zeros, and returns the target buffer.
-
- This function fills Length bytes of Buffer with zeros, and returns Buffer.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill with zeros.
- @param Length Number of bytes in Buffer to fill with zeros.
-
- @return Buffer.
-
-**/
-VOID *
-EFIAPI
-GlueZeroMem (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- ASSERT (!(Buffer == NULL && Length > 0));
- ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));
- return InternalMemZeroMem (Buffer, Length);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/BasePciCf8Lib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/BasePciCf8Lib.inf
deleted file mode 100644
index 71033306db..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/BasePciCf8Lib.inf
+++ /dev/null
@@ -1,84 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePciCf8Lib.inf
-#
-# Abstract:
-#
-# Component description file for BasePciCf8Lib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePciCf8Lib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PciLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
-
-
-[libraries.ia32]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.x64]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.ebc]
- EdkIIGlueDxeIoLibCpuIo
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/PciLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/PciLib.c
deleted file mode 100644
index 5a354373d2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciCf8Lib/PciLib.c
+++ /dev/null
@@ -1,1468 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PciLib.c
-
-Abstract:
-
- PCI Library.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-//
-// Declare I/O Ports used to perform PCI Confguration Cycles
-//
-#define PCI_CONFIGURATION_ADDRESS_PORT 0xCF8
-#define PCI_CONFIGURATION_DATA_PORT 0xCFC
-
-//
-// Declare macro to convert PCI Library formatted address to CF8 formatted address
-//
-// PCI Library formatted address CF8 Formatted Address
-// ============================= ======================
-// Bits 00..11 Register Bits 00..07 Register
-// Bits 12..14 Function Bits 08..10 Function
-// Bits 15..19 Device Bits 11..15 Device
-// Bits 20..27 Bus Bits 16..23 Bus
-// Bits 28..31 Reserved(MBZ) Bits 24..30 Reserved(MBZ)
-// Bits 31..31 Must be 1
-//
-
-/**
- Assert the validity of a PCI address. A valid PCI address should contain 1's
- only in the low 28 bits.
-
- @param A The address to validate.
- @param M Additional bits to assert to be zero.
-
-**/
-#define ASSERT_INVALID_PCI_ADDRESS(A,M) \
- ASSERT (((A) & (~0xffff0ff | (M))) == 0)
-
-/**
- Convert a PCI Express address to PCI CF8 address.
-
- @param A The address to convert.
-
- @retval The coverted address.
-
-**/
-#define PCI_TO_CF8_ADDRESS(A) \
- ((UINT32) ((((A) >> 4) & 0x00ffff00) | ((A) & 0xfc) | 0x80000000))
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Read8 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoRead8 (PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3));
-}
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Write8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoWrite8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- Value
- );
-}
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8Or8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoOr8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- OrData
- );
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8And8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAnd8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- AndData
- );
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8AndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAndThenOr8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldRead8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldWrite8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldOr8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAnd8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciCf8BitFieldAndThenOr8(
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 0);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAndThenOr8 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 3),
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Read16 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoRead16 (PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2));
-}
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Write16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoWrite16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- Value
- );
-}
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8Or16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoOr16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- OrData
- );
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8And16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAnd16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- AndData
- );
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8AndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAndThenOr16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldRead16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldWrite16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldOr16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAnd16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciCf8BitFieldAndThenOr16(
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 1);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAndThenOr16 (
- PCI_CONFIGURATION_DATA_PORT + (UINT16)(Address & 2),
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Read32 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoRead32 (PCI_CONFIGURATION_DATA_PORT);
-}
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Write32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoWrite32 (
- PCI_CONFIGURATION_DATA_PORT,
- Value
- );
-}
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8Or32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoOr32 (
- PCI_CONFIGURATION_DATA_PORT,
- OrData
- );
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8And32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAnd32 (
- PCI_CONFIGURATION_DATA_PORT,
- AndData
- );
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8AndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoAndThenOr32 (
- PCI_CONFIGURATION_DATA_PORT,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldRead32 (
- PCI_CONFIGURATION_DATA_PORT,
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldWrite32 (
- PCI_CONFIGURATION_DATA_PORT,
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldOr32 (
- PCI_CONFIGURATION_DATA_PORT,
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAnd32 (
- PCI_CONFIGURATION_DATA_PORT,
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If the register specified by Address >= 0x100, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciCf8BitFieldAndThenOr32(
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address, 3);
- IoWrite32 (PCI_CONFIGURATION_ADDRESS_PORT, PCI_TO_CF8_ADDRESS (Address));
- return IoBitFieldAndThenOr32 (
- PCI_CONFIGURATION_DATA_PORT,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciCf8ReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- )
-{
- UINTN ReturnValue;
-
- ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
-
- if (Size == 0) {
- return Size;
- }
-
- ASSERT (Buffer != NULL);
-
- //
- // Save Size for return
- //
- ReturnValue = Size;
-
- if ((StartAddress & 1) != 0) {
- //
- // Read a byte if StartAddress is byte aligned
- //
- *(volatile UINT8 *)Buffer = PciCf8Read8 (StartAddress);
- StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
- //
- // Read a word if StartAddress is word aligned
- //
- *(volatile UINT16 *)Buffer = PciCf8Read16 (StartAddress);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- while (Size >= sizeof (UINT32)) {
- //
- // Read as many double words as possible
- //
- *(volatile UINT32 *)Buffer = PciCf8Read32 (StartAddress);
- StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16)) {
- //
- // Read the last remaining word if exist
- //
- *(volatile UINT16 *)Buffer = PciCf8Read16 (StartAddress);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT8)) {
- //
- // Read the last remaining byte if exist
- //
- *(volatile UINT8 *)Buffer = PciCf8Read8 (StartAddress);
- }
-
- return ReturnValue;
-}
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If the register specified by StartAddress >= 0x100, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciCf8WriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- )
-{
- UINTN ReturnValue;
-
- ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);
-
- if (Size == 0) {
- return 0;
- }
-
- ASSERT (Buffer != NULL);
-
- //
- // Save Size for return
- //
- ReturnValue = Size;
-
- if ((StartAddress & 1) != 0) {
- //
- // Write a byte if StartAddress is byte aligned
- //
- PciCf8Write8 (StartAddress, *(UINT8*)Buffer);
- StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
- //
- // Write a word if StartAddress is word aligned
- //
- PciCf8Write16 (StartAddress, *(UINT16*)Buffer);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- while (Size >= sizeof (UINT32)) {
- //
- // Write as many double words as possible
- //
- PciCf8Write32 (StartAddress, *(UINT32*)Buffer);
- StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16)) {
- //
- // Write the last remaining word if exist
- //
- PciCf8Write16 (StartAddress, *(UINT16*)Buffer);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT8)) {
- //
- // Write the last remaining byte if exist
- //
- PciCf8Write8 (StartAddress, *(UINT8*)Buffer);
- }
-
- return ReturnValue;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/BasePciExpressLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/BasePciExpressLib.inf
deleted file mode 100644
index a2218ef15f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/BasePciExpressLib.inf
+++ /dev/null
@@ -1,83 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePciExpressLib.inf
-#
-# Abstract:
-#
-# Component description file for BasePciExpressLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePciExpressLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PciLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../Include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
-
-[libraries.ia32]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.x64]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.ebc]
- EdkIIGlueDxeIoLibCpuIo
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/PciLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/PciLib.c
deleted file mode 100644
index 9768691471..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciExpressLib/PciLib.c
+++ /dev/null
@@ -1,1373 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PciLib.c
-
-Abstract:
-
- PCI Library.
-
- Functions in this library instance make use of MMIO functions in IoLib to
- access memory mapped PCI configuration space.
-
- All assertions for I/O operations are handled in MMIO functions in the IoLib
- Library.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Assert the validity of a PCI address. A valid PCI address should contain 1's
- only in the low 28 bits.
-
- @param A The address to validate.
-
-**/
-#define ASSERT_INVALID_PCI_ADDRESS(A) \
- ASSERT (((A) & ~0xfffffff) == 0)
-
-
-/**
- Gets the base address of PCI Express.
-
- This internal functions retrieves PCI Express Base Address via a PCD entry
- PcdPciExpressBaseAddress.
-
- @return The base address of PCI Express.
-
-**/
-STATIC
-volatile VOID*
-GetPciExpressBaseAddress (
- VOID
- )
-{
- return (VOID*)(UINTN) PcdGet64 (PcdPciExpressBaseAddress);
-}
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressRead8 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioRead8 ((UINTN) GetPciExpressBaseAddress () + Address);
-}
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioWrite8 ((UINTN) GetPciExpressBaseAddress () + Address, Value);
-}
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioOr8 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAnd8 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAndThenOr8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldRead8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldWrite8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldOr8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAnd8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciExpressBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAndThenOr8 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressRead16 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioRead16 ((UINTN) GetPciExpressBaseAddress () + Address);
-}
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioWrite16 ((UINTN) GetPciExpressBaseAddress () + Address, Value);
-}
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioOr16 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAnd16 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAndThenOr16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldRead16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldWrite16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldOr16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAnd16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 16-bit boundary, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciExpressBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAndThenOr16 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressRead32 (
- IN UINTN Address
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioRead32 ((UINTN) GetPciExpressBaseAddress () + Address);
-}
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioWrite32 ((UINTN) GetPciExpressBaseAddress () + Address, Value);
-}
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioOr32 ((UINTN) GetPciExpressBaseAddress () + Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAnd32 ((UINTN) GetPciExpressBaseAddress () + Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioAndThenOr32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldRead32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit
- );
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldWrite32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- Value
- );
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldOr32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- OrData
- );
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAnd32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If Address is not aligned on a 32-bit boundary, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciExpressBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- ASSERT_INVALID_PCI_ADDRESS (Address);
- return MmioBitFieldAndThenOr32 (
- (UINTN) GetPciExpressBaseAddress () + Address,
- StartBit,
- EndBit,
- AndData,
- OrData
- );
-}
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciExpressReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- )
-{
- UINTN ReturnValue;
-
- ASSERT_INVALID_PCI_ADDRESS (StartAddress);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
-
- if (Size == 0) {
- return Size;
- }
-
- ASSERT (Buffer != NULL);
-
- //
- // Save Size for return
- //
- ReturnValue = Size;
-
- if ((StartAddress & 1) != 0) {
- //
- // Read a byte if StartAddress is byte aligned
- //
- *(volatile UINT8 *)Buffer = PciExpressRead8 (StartAddress);
- StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
- //
- // Read a word if StartAddress is word aligned
- //
- *(volatile UINT16 *)Buffer = PciExpressRead16 (StartAddress);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- while (Size >= sizeof (UINT32)) {
- //
- // Read as many double words as possible
- //
- *(volatile UINT32 *)Buffer = PciExpressRead32 (StartAddress);
- StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16)) {
- //
- // Read the last remaining word if exist
- //
- *(volatile UINT16 *)Buffer = PciExpressRead16 (StartAddress);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT8)) {
- //
- // Read the last remaining byte if exist
- //
- *(volatile UINT8 *)Buffer = PciExpressRead8 (StartAddress);
- }
-
- return ReturnValue;
-}
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciExpressWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- )
-{
- UINTN ReturnValue;
-
- ASSERT_INVALID_PCI_ADDRESS (StartAddress);
- ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
-
- if (Size == 0) {
- return 0;
- }
-
- ASSERT (Buffer != NULL);
-
- //
- // Save Size for return
- //
- ReturnValue = Size;
-
- if ((StartAddress & 1) != 0) {
- //
- // Write a byte if StartAddress is byte aligned
- //
- PciExpressWrite8 (StartAddress, *(UINT8*)Buffer);
- StartAddress += sizeof (UINT8);
- Size -= sizeof (UINT8);
- Buffer = (UINT8*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16) && (StartAddress & 2) != 0) {
- //
- // Write a word if StartAddress is word aligned
- //
- PciExpressWrite16 (StartAddress, *(UINT16*)Buffer);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- while (Size >= sizeof (UINT32)) {
- //
- // Write as many double words as possible
- //
- PciExpressWrite32 (StartAddress, *(UINT32*)Buffer);
- StartAddress += sizeof (UINT32);
- Size -= sizeof (UINT32);
- Buffer = (UINT32*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT16)) {
- //
- // Write the last remaining word if exist
- //
- PciExpressWrite16 (StartAddress, *(UINT16*)Buffer);
- StartAddress += sizeof (UINT16);
- Size -= sizeof (UINT16);
- Buffer = (UINT16*)Buffer + 1;
- }
-
- if (Size >= sizeof (UINT8)) {
- //
- // Write the last remaining byte if exist
- //
- PciExpressWrite8 (StartAddress, *(UINT8*)Buffer);
- }
-
- return ReturnValue;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/BasePciLibCf8.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/BasePciLibCf8.inf
deleted file mode 100644
index b02eccbc75..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/BasePciLibCf8.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePciLibCf8.inf
-#
-# Abstract:
-#
-# Component description file for BasePciLibCf8.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePciLibCf8
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PciLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBasePciCf8Lib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/PciLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/PciLib.c
deleted file mode 100644
index 68f99fd995..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibCf8/PciLib.c
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PciLib.c
-
-Abstract:
-
- PCI Library using Port CF8/CFC access.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciRead8 (
- IN UINTN Address
- )
-{
- return PciCf8Read8 (Address);
-}
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciWrite8 (
- IN UINTN Address,
- IN UINT8 Data
- )
-{
- return PciCf8Write8 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- return PciCf8Or8 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- return PciCf8And8 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return PciCf8AndThenOr8 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciCf8BitFieldRead8 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return PciCf8BitFieldWrite8 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return PciCf8BitFieldOr8 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return PciCf8BitFieldAnd8 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return PciCf8BitFieldAndThenOr8 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciRead16 (
- IN UINTN Address
- )
-{
- return PciCf8Read16 (Address);
-}
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciWrite16 (
- IN UINTN Address,
- IN UINT16 Data
- )
-{
- return PciCf8Write16 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- return PciCf8Or16 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- return PciCf8And16 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return PciCf8AndThenOr16 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciCf8BitFieldRead16 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return PciCf8BitFieldWrite16 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return PciCf8BitFieldOr16 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return PciCf8BitFieldAnd16 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return PciCf8BitFieldAndThenOr16 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciRead32 (
- IN UINTN Address
- )
-{
- return PciCf8Read32 (Address);
-}
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciWrite32 (
- IN UINTN Address,
- IN UINT32 Data
- )
-{
- return PciCf8Write32 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- return PciCf8Or32 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- return PciCf8And32 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return PciCf8AndThenOr32 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciCf8BitFieldRead32 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return PciCf8BitFieldWrite32 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return PciCf8BitFieldOr32 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return PciCf8BitFieldAnd32 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return PciCf8BitFieldAndThenOr32 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- )
-{
- return PciCf8ReadBuffer (StartAddress, Size, Buffer);
-}
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- )
-{
- return PciCf8WriteBuffer (StartAddress, Size, Buffer);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
deleted file mode 100644
index 8e6103fb77..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePciLibPciExpress.inf
-#
-# Abstract:
-#
-# Component description file for BasePciLibPciExpress.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePciLibPciExpress
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PciLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBasePciExpressLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/PciLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/PciLib.c
deleted file mode 100644
index 185c36a669..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePciLibPciExpress/PciLib.c
+++ /dev/null
@@ -1,1076 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PciLib.c
-
-Abstract:
-
- PCI Library using PC Express access.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Reads an 8-bit PCI configuration register.
-
- Reads and returns the 8-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciRead8 (
- IN UINTN Address
- )
-{
- return PciExpressRead8 (Address);
-}
-
-/**
- Writes an 8-bit PCI configuration register.
-
- Writes the 8-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciWrite8 (
- IN UINTN Address,
- IN UINT8 Data
- )
-{
- return PciExpressWrite8 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of an 8-bit PCI configuration register with
- an 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- return PciExpressOr8 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- return PciExpressAnd8 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit
- value, followed a bitwise inclusive OR with another 8-bit value.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return PciExpressAndThenOr8 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in an 8-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciExpressBitFieldRead8 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 8-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return PciExpressBitFieldWrite8 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 8-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return PciExpressBitFieldOr8 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in an 8-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 8-bit register.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 8-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return PciExpressBitFieldAnd8 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 8-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT8
-EFIAPI
-PciBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return PciExpressBitFieldAndThenOr8 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a 16-bit PCI configuration register.
-
- Reads and returns the 16-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciRead16 (
- IN UINTN Address
- )
-{
- return PciExpressRead16 (Address);
-}
-
-/**
- Writes a 16-bit PCI configuration register.
-
- Writes the 16-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciWrite16 (
- IN UINTN Address,
- IN UINT16 Data
- )
-{
- return PciExpressWrite16 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of a 16-bit PCI configuration register with
- a 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- return PciExpressOr16 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- return PciExpressAnd16 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit
- value, followed a bitwise inclusive OR with another 16-bit value.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return PciExpressAndThenOr16 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 16-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciExpressBitFieldRead16 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 16-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return PciExpressBitFieldWrite16 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 16-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return PciExpressBitFieldOr16 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 16-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 16-bit register.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 16-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return PciExpressBitFieldAnd16 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 16-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT16
-EFIAPI
-PciBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return PciExpressBitFieldAndThenOr16 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a 32-bit PCI configuration register.
-
- Reads and returns the 32-bit PCI configuration register specified by Address.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
-
- @return The read value from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciRead32 (
- IN UINTN Address
- )
-{
- return PciExpressRead32 (Address);
-}
-
-/**
- Writes a 32-bit PCI configuration register.
-
- Writes the 32-bit PCI configuration register specified by Address with the
- value specified by Value. Value is returned. This function must guarantee
- that all PCI read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param Value The value to write.
-
- @return The value written to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciWrite32 (
- IN UINTN Address,
- IN UINT32 Data
- )
-{
- return PciExpressWrite32 (Address, Data);
-}
-
-/**
- Performs a bitwise inclusive OR of a 32-bit PCI configuration register with
- a 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- return PciExpressOr32 (Address, OrData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- return PciExpressAnd32 (Address, AndData);
-}
-
-/**
- Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit
- value, followed a bitwise inclusive OR with another 32-bit value.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData,
- performs a bitwise inclusive OR between the result of the AND operation and
- the value specified by OrData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized.
-
- If Address > 0x0FFFFFFF, then ASSERT().
-
- @param Address Address that encodes the PCI Bus, Device, Function and
- Register.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return PciExpressAndThenOr32 (Address, AndData, OrData);
-}
-
-/**
- Reads a bit field of a PCI configuration register.
-
- Reads the bit field in a 32-bit PCI configuration register. The bit field is
- specified by the StartBit and the EndBit. The value of the bit field is
- returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value of the bit field read from the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return PciExpressBitFieldRead32 (Address, StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a PCI configuration register.
-
- Writes Value to the bit field of the PCI configuration register. The bit
- field is specified by the StartBit and the EndBit. All other bits in the
- destination PCI configuration register are preserved. The new value of the
- 32-bit register is returned.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return PciExpressBitFieldWrite32 (Address, StartBit, EndBit, Value);
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise inclusive OR between the read result and the value specified by
- OrData, and writes the result to the 32-bit PCI configuration register
- specified by Address. The value written to the PCI configuration register is
- returned. This function must guarantee that all PCI read and write operations
- are serialized. Extra left bits in OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return PciExpressBitFieldOr32 (Address, StartBit, EndBit, OrData);
-}
-
-/**
- Reads a bit field in a 32-bit PCI configuration register, performs a bitwise
- AND, and writes the result back to the bit field in the 32-bit register.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND between the read result and the value specified by AndData, and
- writes the result to the 32-bit PCI configuration register specified by
- Address. The value written to the PCI configuration register is returned.
- This function must guarantee that all PCI read and write operations are
- serialized. Extra left bits in AndData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return PciExpressBitFieldAnd32 (Address, StartBit, EndBit, AndData);
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit PCI configuration register specified by Address, performs a
- bitwise AND followed by a bitwise inclusive OR between the read result and
- the value specified by AndData, and writes the result to the 32-bit PCI
- configuration register specified by Address. The value written to the PCI
- configuration register is returned. This function must guarantee that all PCI
- read and write operations are serialized. Extra left bits in both AndData and
- OrData are stripped.
-
- If Address > 0x0FFFFFFF, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address PCI configuration register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the PCI configuration register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the PCI configuration register.
-
-**/
-UINT32
-EFIAPI
-PciBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return PciExpressBitFieldAndThenOr32 (Address, StartBit, EndBit, AndData, OrData);
-}
-
-/**
- Reads a range of PCI configuration registers into a caller supplied buffer.
-
- Reads the range of PCI configuration registers specified by StartAddress and
- Size into the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be read. Size is
- returned. When possible 32-bit PCI configuration read cycles are used to read
- from StartAdress to StartAddress + Size. Due to alignment restrictions, 8-bit
- and 16-bit PCI configuration read cycles may be used at the beginning and the
- end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer receiving the data read.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciReadBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- OUT VOID *Buffer
- )
-{
- return PciExpressReadBuffer (StartAddress, Size, Buffer);
-}
-
-/**
- Copies the data in a caller supplied buffer to a specified range of PCI
- configuration space.
-
- Writes the range of PCI configuration registers specified by StartAddress and
- Size from the buffer specified by Buffer. This function only allows the PCI
- configuration registers from a single PCI function to be written. Size is
- returned. When possible 32-bit PCI configuration write cycles are used to
- write from StartAdress to StartAddress + Size. Due to alignment restrictions,
- 8-bit and 16-bit PCI configuration write cycles may be used at the beginning
- and the end of the range.
-
- If StartAddress > 0x0FFFFFFF, then ASSERT().
- If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
- If Size > 0 and Buffer is NULL, then ASSERT().
-
- @param StartAddress Starting address that encodes the PCI Bus, Device,
- Function and Register.
- @param Size Size in bytes of the transfer.
- @param Buffer Pointer to a buffer containing the data to write.
-
- @return Size
-
-**/
-UINTN
-EFIAPI
-PciWriteBuffer (
- IN UINTN StartAddress,
- IN UINTN Size,
- IN VOID *Buffer
- )
-{
- return PciExpressWriteBuffer (StartAddress, Size, Buffer);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
deleted file mode 100644
index c2f46fd3ba..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
+++ /dev/null
@@ -1,84 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePeCoffGetEntryPointLib.inf
-#
-# Abstract:
-#
-# Component description file for BasePeCoffGetEntryPointLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePeCoffGetEntryPointLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeCoffGetEntryPoint.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
- $(EDK_SOURCE)/Foundation/Efi/Include
-
-
-[libraries.common]
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/PeCoffGetEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
deleted file mode 100644
index 4351697565..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffGetEntryPointLib/PeCoffGetEntryPoint.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeCoffGetEntryPoint.c
-
-Abstract:
-
- Pe/Coff loader
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded
- into system memory with the PE/COFF Loader Library functions.
-
- Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry
- point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then
- return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.
- If Pe32Data is NULL, then ASSERT().
- If EntryPoint is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system memory.
- @param EntryPoint Pointer to entry point to the PE/COFF image to return.
-
- @retval RETURN_SUCCESS EntryPoint was returned.
- @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.
-
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderGetEntryPoint (
- IN VOID *Pe32Data,
- OUT VOID **EntryPoint
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHeader;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Header;
-
- ASSERT (Pe32Data != NULL);
- ASSERT (EntryPoint != NULL);
-
- DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Header.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Header.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- //
- // Calculate the entry point relative to the start of the image.
- // AddressOfEntryPoint is common for PE32 & PE32+
- //
- *EntryPoint = (VOID *)((UINTN)Pe32Data + (UINTN)(Header.Pe32->OptionalHeader.AddressOfEntryPoint & 0x0ffffffff));
- return RETURN_SUCCESS;
-}
-
-
-/**
- Returns the machine type of a PE/COFF image.
-
- Returns the machine type from the PE/COFF image specified by Pe32Data.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return Machine type or zero if not a valid iamge.
-
-**/
-UINT16
-EFIAPI
-PeCoffLoaderGetMachineType (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DOS_HEADER *DosHdr;
-
- DosHdr = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + DosHdr->e_lfanew);
- } else {
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data);
- }
-
- if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- return Hdr.Pe32->FileHeader.Machine;
- }
-
- return 0x0000;
-}
-
-/**
- Returns a pointer to the PDB file name for a PE/COFF image that has been
- loaded into system memory with the PE/COFF Loader Library functions.
-
- Returns the PDB file name for the PE/COFF image specified by Pe32Data. If
- the PE/COFF image specified by Pe32Data is not a valid, then NULL is
- returned. If the PE/COFF image specified by Pe32Data does not contain a
- debug directory entry, then NULL is returned. If the debug directory entry
- in the PE/COFF image specified by Pe32Data does not contain a PDB file name,
- then NULL is returned.
- If Pe32Data is NULL, then ASSERT().
-
- @param Pe32Data Pointer to the PE/COFF image that is loaded in system
- memory.
-
- @return The PDB file name for the PE/COFF image specified by Pe32Data or NULL
- if it cannot be retrieved.
-
-**/
-VOID *
-EFIAPI
-PeCoffLoaderGetPdbPointer (
- IN VOID *Pe32Data
- )
-{
- EFI_IMAGE_DOS_HEADER *DosHeader;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN DirCount;
- VOID *CodeViewEntryPointer;
- INTN TEImageAdjust;
- UINT32 NumberOfRvaAndSizes;
-
- ASSERT (Pe32Data != NULL);
-
- TEImageAdjust = 0;
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- NumberOfRvaAndSizes = 0;
-
- DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
- }
-
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- if (Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
- DirectoryEntry = &Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
- TEImageAdjust = sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) Hdr.Te +
- Hdr.Te->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
- TEImageAdjust);
- }
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- } else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // Use PE32+ offset get Debug Directory Entry
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) Pe32Data + DirectoryEntry->VirtualAddress);
- }
-
- if (NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
- DirectoryEntry = NULL;
- DebugEntry = NULL;
- }
- } else {
- return NULL;
- }
-
- if (DebugEntry == NULL || DirectoryEntry == NULL) {
- return NULL;
- }
-
- for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount++, DebugEntry++) {
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- if (DebugEntry->SizeOfData > 0) {
- CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + ((UINTN)Pe32Data) + (UINTN)TEImageAdjust);
- switch (* (UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY));
- case CODEVIEW_SIGNATURE_RSDS:
- return (VOID *) ((CHAR8 *)CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY));
- default:
- break;
- }
- }
- }
- }
-
- return NULL;
-}
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoff.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoff.c
deleted file mode 100644
index f99c23e5ee..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoff.c
+++ /dev/null
@@ -1,1357 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EdkIIGlueDxeDriverEntryPoint.c
-
-Abstract:
-
- Pe/Coff loader
-
---*/
-
-#include "BasePeCoffLibInternals.h"
-
-/**
- Retrieves the magic value from the PE/COFF header.
-
- @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
-
- @return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32
- @return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+
-
-**/
-UINT16
-PeCoffLoaderGetPeHeaderMagicValue (
- IN EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- )
-{
- //
- // NOTE: Some versions of Linux ELILO for Itanium have an incorrect magic value
- // in the PE/COFF Header. If the MachineType is Itanium(IA64) and the
- // Magic value in the OptionalHeader is EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
- // then override the returned value to EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
- //
- if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- }
- //
- // Return the magic value from the PC/COFF Optional Header
- //
- return Hdr.Pe32->OptionalHeader.Magic;
-}
-
-
-/**
- Retrieves the PE or TE Header from a PE/COFF or TE image.
-
- @param ImageContext The context of the image being loaded.
- @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
-
- @retval RETURN_SUCCESS The PE or TE Header is read.
- @retval Other The error status from reading the PE/COFF or TE image using the ImageRead function.
-
-**/
-RETURN_STATUS
-GluePeCoffLoaderGetPeHeader (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- )
-{
- RETURN_STATUS Status;
- EFI_IMAGE_DOS_HEADER DosHdr;
- UINTN Size;
- UINT16 Magic;
-
- //
- // Read the DOS image header to check for it's existance
- //
- Size = sizeof (EFI_IMAGE_DOS_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &Size,
- &DosHdr
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- ImageContext->PeCoffHeaderOffset = 0;
- if (DosHdr.e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image
- // header
- //
- ImageContext->PeCoffHeaderOffset = DosHdr.e_lfanew;
- }
-
- //
- // Read the PE/COFF Header. For PE32 (32-bit) this will read in too much
- // data, but that should not hurt anythine. Hdr.Pe32->OptionalHeader.Magic
- // determins if this is a PE32 or PE32+ image. The magic is in the same
- // location in both images.
- //
- Size = sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- ImageContext->PeCoffHeaderOffset,
- &Size,
- Hdr.Pe32
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- //
- // Use Signature to figure out if we understand the image format
- //
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- ImageContext->IsTeImage = TRUE;
- ImageContext->Machine = Hdr.Te->Machine;
- ImageContext->ImageType = (UINT16)(Hdr.Te->Subsystem);
- ImageContext->ImageSize = 0;
- ImageContext->SectionAlignment = 4096;
- ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;
-
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- ImageContext->IsTeImage = FALSE;
- ImageContext->Machine = Hdr.Pe32->FileHeader.Machine;
-
- Magic = PeCoffLoaderGetPeHeaderMagicValue (Hdr);
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- ImageContext->ImageType = Hdr.Pe32->OptionalHeader.Subsystem;
- ImageContext->ImageSize = (UINT64)Hdr.Pe32->OptionalHeader.SizeOfImage;
- ImageContext->SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment;
- ImageContext->SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
-
- } else if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // Use PE32+ offset
- //
- ImageContext->ImageType = Hdr.Pe32Plus->OptionalHeader.Subsystem;
- ImageContext->ImageSize = (UINT64) Hdr.Pe32Plus->OptionalHeader.SizeOfImage;
- ImageContext->SectionAlignment = Hdr.Pe32Plus->OptionalHeader.SectionAlignment;
- ImageContext->SizeOfHeaders = Hdr.Pe32Plus->OptionalHeader.SizeOfHeaders;
- } else {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_MACHINE_TYPE;
- return RETURN_UNSUPPORTED;
- }
- } else {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_MACHINE_TYPE;
- return RETURN_UNSUPPORTED;
- }
-
- if (!PeCoffLoaderImageFormatSupported (ImageContext->Machine)) {
- //
- // If the PE/COFF loader does not support the image type return
- // unsupported. This library can suport lots of types of images
- // this does not mean the user of this library can call the entry
- // point of the image.
- //
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-
-/**
- Retrieves information about a PE/COFF image.
-
- Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, CodeView,
- PdbPointer, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva
- fields of the ImageContext structure. If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.
- If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not
- a supported PE/COFF image type, then return RETURN_UNSUPPORTED. If any errors occur while
- computing the fields of ImageContext, then the error status is returned in the ImageError field of
- ImageContext.
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that needs to be examined by this function.
-
- @retval RETURN_SUCCESS The information on the PE/COFF image was collected.
- @retval RETURN_INVALID_PARAMETER ImageContext is NULL.
- @retval RETURN_UNSUPPORTED The PE/COFF image is not supported.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderGetImageInfo (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_UNION HdrData;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *DebugDirectoryEntry;
- UINTN Size;
- UINTN Index;
- UINTN DebugDirectoryEntryRva;
- UINTN DebugDirectoryEntryFileOffset;
- UINTN SectionHeaderOffset;
- EFI_IMAGE_SECTION_HEADER SectionHeader;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY DebugEntry;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-
- if (NULL == ImageContext) {
- return RETURN_INVALID_PARAMETER;
- }
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- Hdr.Union = &HdrData;
- Status = PeCoffLoaderGetPeHeader (ImageContext, Hdr);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- Magic = PeCoffLoaderGetPeHeaderMagicValue (Hdr);
-
- //
- // Retrieve the base address of the image
- //
- if (!(ImageContext->IsTeImage)) {
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- ImageContext->ImageAddress = Hdr.Pe32->OptionalHeader.ImageBase;
- } else {
- //
- // Use PE32+ offset
- //
- ImageContext->ImageAddress = Hdr.Pe32Plus->OptionalHeader.ImageBase;
- }
- } else {
- ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));
- }
-
- //
- // Initialize the alternate destination address to 0 indicating that it
- // should not be used.
- //
- ImageContext->DestinationAddress = 0;
-
- //
- // Initialize the codeview pointer.
- //
- ImageContext->CodeView = NULL;
- ImageContext->PdbPointer = NULL;
-
- //
- // Three cases with regards to relocations:
- // - Image has base relocs, RELOCS_STRIPPED==0 => image is relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==1 => Image is not relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==0 => Image is relocatable but
- // has no base relocs to apply
- // Obviously having base relocations with RELOCS_STRIPPED==1 is invalid.
- //
- // Look at the file header to determine if relocations have been stripped, and
- // save this info in the image context for later use.
- //
- if ((!(ImageContext->IsTeImage)) && ((Hdr.Pe32->FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0)) {
- ImageContext->RelocationsStripped = TRUE;
- } else {
- ImageContext->RelocationsStripped = FALSE;
- }
-
- if (!(ImageContext->IsTeImage)) {
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- } else {
- //
- // Use PE32+ offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- }
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
-
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
-
- //
- // Determine the file offset of the debug directory... This means we walk
- // the sections to find which section contains the RVA of the debug
- // directory
- //
- DebugDirectoryEntryFileOffset = 0;
-
- SectionHeaderOffset = (UINTN)(
- ImageContext->PeCoffHeaderOffset +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- Hdr.Pe32->FileHeader.SizeOfOptionalHeader
- );
-
- for (Index = 0; Index < Hdr.Pe32->FileHeader.NumberOfSections; Index++) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
-
- DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva - SectionHeader.VirtualAddress + SectionHeader.PointerToRawData;
- break;
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset,
- &Size,
- &DebugEntry
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
- if (DebugEntry.RVA == 0 && DebugEntry.FileOffset != 0) {
- ImageContext->ImageSize += DebugEntry.SizeOfData;
- }
-
- return RETURN_SUCCESS;
- }
- }
- }
- }
- } else {
-
- DebugDirectoryEntry = &Hdr.Te->DataDirectory[1];
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
- SectionHeaderOffset = (UINTN)(sizeof (EFI_TE_IMAGE_HEADER));
-
- DebugDirectoryEntryFileOffset = 0;
-
- for (Index = 0; Index < Hdr.Te->NumberOfSections;) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva -
- SectionHeader.VirtualAddress +
- SectionHeader.PointerToRawData +
- sizeof (EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize;
-
- //
- // File offset of the debug directory was found, if this is not the last
- // section, then skip to the last section for calculating the image size.
- //
- if (Index < (UINTN) Hdr.Te->NumberOfSections - 1) {
- SectionHeaderOffset += (Hdr.Te->NumberOfSections - 1 - Index) * sizeof (EFI_IMAGE_SECTION_HEADER);
- Index = Hdr.Te->NumberOfSections - 1;
- continue;
- }
- }
-
- //
- // In Te image header there is not a field to describe the ImageSize.
- // Actually, the ImageSize equals the RVA plus the VirtualSize of
- // the last section mapped into memory (Must be rounded up to
- // a mulitple of Section Alignment). Per the PE/COFF specification, the
- // section headers in the Section Table must appear in order of the RVA
- // values for the corresponding sections. So the ImageSize can be determined
- // by the RVA and the VirtualSize of the last section header in the
- // Section Table.
- //
- if ((++Index) == (UINTN)Hdr.Te->NumberOfSections) {
- ImageContext->ImageSize = (SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize +
- ImageContext->SectionAlignment - 1) & ~(ImageContext->SectionAlignment - 1);
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index += sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset,
- &Size,
- &DebugEntry
- );
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
- return RETURN_SUCCESS;
- }
- }
- }
- }
-
- return RETURN_SUCCESS;
-}
-
-
-/**
- Converts an image address to the loaded address.
-
- @param ImageContext The context of the image being loaded.
- @param Address The address to be converted to the loaded address.
-
- @return The converted address or NULL if the address can not be converted.
-
-**/
-VOID *
-GluePeCoffLoaderImageAddress (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- )
-{
- //
- // @bug Check to make sure ImageSize is correct for the relocated image.
- // it may only work for the file we start with and not the relocated image
- //
- if (Address >= ImageContext->ImageSize) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return NULL;
- }
-
- return (CHAR8 *)((UINTN) ImageContext->ImageAddress + Address);
-}
-
-/**
- Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage().
-
- If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of
- ImageContext as the relocation base address. Otherwise, use the DestinationAddress field
- of ImageContext as the relocation base address. The caller must allocate the relocation
- fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being relocated.
-
- @retval RETURN_SUCCESS The PE/COFF image was relocated.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The image in not a valid PE/COFF image.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_UNSUPPORTED A relocation record type is not supported.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderRelocateImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *RelocDir;
- UINT64 Adjust;
- EFI_IMAGE_BASE_RELOCATION *RelocBase;
- EFI_IMAGE_BASE_RELOCATION *RelocBaseEnd;
- UINT16 *Reloc;
- UINT16 *RelocEnd;
- CHAR8 *Fixup;
- CHAR8 *FixupBase;
- UINT16 *F16;
- UINT32 *F32;
- UINT64 *F64;
- CHAR8 *FixupData;
- PHYSICAL_ADDRESS BaseAddress;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-
- ASSERT (ImageContext != NULL);
-
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- //
- // If there are no relocation entries, then we are done
- //
- if (ImageContext->RelocationsStripped) {
- return RETURN_SUCCESS;
- }
-
- //
- // If the destination address is not 0, use that rather than the
- // image address as the relocation target.
- //
- if (ImageContext->DestinationAddress != 0) {
- BaseAddress = ImageContext->DestinationAddress;
- } else if (!(ImageContext->IsTeImage)) {
- BaseAddress = ImageContext->ImageAddress;
- } else {
- Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
- BaseAddress = ImageContext->ImageAddress + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize;
- }
-
- if (!(ImageContext->IsTeImage)) {
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset);
-
- Magic = PeCoffLoaderGetPeHeaderMagicValue (Hdr);
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- Adjust = (UINT64)BaseAddress - Hdr.Pe32->OptionalHeader.ImageBase;
- Hdr.Pe32->OptionalHeader.ImageBase = (UINT32)BaseAddress;
-
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- RelocDir = &Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- } else {
- //
- // Use PE32+ offset
- //
- Adjust = (UINT64) BaseAddress - Hdr.Pe32Plus->OptionalHeader.ImageBase;
- Hdr.Pe32Plus->OptionalHeader.ImageBase = (UINT64)BaseAddress;
-
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- RelocDir = &Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- }
-
- //
- // Find the relocation block
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC && RelocDir->Size > 0) {
- RelocBase = PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress);
- RelocBaseEnd = PeCoffLoaderImageAddress (
- ImageContext,
- RelocDir->VirtualAddress + RelocDir->Size - 1
- );
- if ((RelocBase == NULL) || (RelocBaseEnd == NULL)) {
- //
- // If the base start or end address resolved to 0, then fail.
- //
- return RETURN_LOAD_ERROR;
- }
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = RelocBaseEnd = 0;
- }
- } else {
- Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
- Adjust = (UINT64) (BaseAddress - Hdr.Te->ImageBase);
- Hdr.Te->ImageBase = (UINT64) (BaseAddress);
-
- //
- // Find the relocation block
- //
- RelocDir = &Hdr.Te->DataDirectory[0];
- if (RelocDir->Size > 0) {
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(
- ImageContext->ImageAddress +
- RelocDir->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *) ((UINTN) RelocBase + (UINTN) RelocDir->Size - 1);
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = NULL;
- RelocBaseEnd = NULL;
- }
- }
-
- //
- // Run the relocation information and apply the fixups
- //
- FixupData = ImageContext->FixupData;
- while (RelocBase < RelocBaseEnd) {
-
- Reloc = (UINT16 *) ((CHAR8 *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
- RelocEnd = (UINT16 *) ((CHAR8 *) RelocBase + RelocBase->SizeOfBlock);
- if (!(ImageContext->IsTeImage)) {
- FixupBase = PeCoffLoaderImageAddress (ImageContext, RelocBase->VirtualAddress);
-
- if (FixupBase == NULL) {
- //
- // If the FixupBase address resolved to 0, then fail.
- //
- return RETURN_LOAD_ERROR;
- }
- } else {
- FixupBase = (CHAR8 *)(UINTN)(ImageContext->ImageAddress +
- RelocBase->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- }
-
- if ((CHAR8 *) RelocEnd < (CHAR8 *) ((UINTN) ImageContext->ImageAddress) ||
- (CHAR8 *) RelocEnd > (CHAR8 *)((UINTN)ImageContext->ImageAddress +
- (UINTN)ImageContext->ImageSize)) {
- ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION;
- return RETURN_LOAD_ERROR;
- }
-
- //
- // Run this relocation record
- //
- while (Reloc < RelocEnd) {
-
- Fixup = FixupBase + (*Reloc & 0xFFF);
- switch ((*Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_ABSOLUTE:
- break;
-
- case EFI_IMAGE_REL_BASED_HIGH:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + ((UINT16) ((UINT32) Adjust >> 16)));
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_LOW:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + (UINT16) Adjust);
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHLOW:
- F32 = (UINT32 *) Fixup;
- *F32 = *F32 + (UINT32) Adjust;
- if (FixupData != NULL) {
- FixupData = ALIGN_POINTER (FixupData, sizeof (UINT32));
- *(UINT32 *)FixupData = *F32;
- FixupData = FixupData + sizeof (UINT32);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *) Fixup;
- *F64 = *F64 + (UINT64) Adjust;
- if (FixupData != NULL) {
- FixupData = ALIGN_POINTER (FixupData, sizeof(UINT64));
- *(UINT64 *)(FixupData) = *F64;
- FixupData = FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- //
- // The common code does not handle some of the stranger IPF relocations
- // PeCoffLoaderRelocateImageEx () addes support for these complex fixups
- // on IPF and is a No-Op on other archtiectures.
- //
- Status = PeCoffLoaderRelocateImageEx (Reloc, Fixup, &FixupData, Adjust);
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_FAILED_RELOCATION;
- return Status;
- }
- }
-
- //
- // Next relocation record
- //
- Reloc += 1;
- }
-
- //
- // Next reloc block
- //
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Loads a PE/COFF image into memory.
-
- Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer
- specified by the ImageAddress and ImageSize fields of ImageContext. The caller must allocate
- the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.
- The EntryPoint, FixupDataSize, CodeView, and PdbPointer fields of ImageContext are computed.
- If ImageContext is NULL, then ASSERT().
-
- @param ImageContext Pointer to the image context structure that describes the PE/COFF
- image that is being loaded.
-
- @retval RETURN_SUCCESS The PE/COFF image was loaded into the buffer specified by
- the ImageAddress and ImageSize fields of ImageContext.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_BUFFER_TOO_SMALL The caller did not provide a large enough buffer.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_LOAD_ERROR The PE/COFF image is an EFI Runtime image with no relocations.
- Extended status information is in the ImageError field of ImageContext.
- @retval RETURN_INVALID_PARAMETER The image address is invalid.
- Extended status information is in the ImageError field of ImageContext.
-
-**/
-RETURN_STATUS
-EFIAPI
-GluePeCoffLoaderLoadImage (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-{
- RETURN_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- PE_COFF_LOADER_IMAGE_CONTEXT CheckContext;
- EFI_IMAGE_SECTION_HEADER *FirstSection;
- EFI_IMAGE_SECTION_HEADER *Section;
- UINTN NumberOfSections;
- UINTN Index;
- CHAR8 *Base;
- CHAR8 *End;
- CHAR8 *MaxEnd;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN Size;
- UINT32 TempDebugEntryRva;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-
- ASSERT (ImageContext != NULL);
-
- //
- // Assume success
- //
- ImageContext->ImageError = IMAGE_ERROR_SUCCESS;
-
- //
- // Copy the provided context info into our local version, get what we
- // can from the original image, and then use that to make sure everything
- // is legit.
- //
- CopyMem (&CheckContext, ImageContext, sizeof (PE_COFF_LOADER_IMAGE_CONTEXT));
-
- Status = PeCoffLoaderGetImageInfo (&CheckContext);
- if (RETURN_ERROR (Status)) {
- return Status;
- }
-
- //
- // Make sure there is enough allocated space for the image being loaded
- //
- if (ImageContext->ImageSize < CheckContext.ImageSize) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_SIZE;
- return RETURN_BUFFER_TOO_SMALL;
- }
- if (ImageContext->ImageAddress == 0) {
- //
- // Image cannot be loaded into 0 address.
- //
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return RETURN_INVALID_PARAMETER;
- }
- //
- // If there's no relocations, then make sure it's not a runtime driver,
- // and that it's being loaded at the linked address.
- //
- if (CheckContext.RelocationsStripped) {
- //
- // If the image does not contain relocations and it is a runtime driver
- // then return an error.
- //
- if (CheckContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_SUBSYSTEM;
- return RETURN_LOAD_ERROR;
- }
- //
- // If the image does not contain relocations, and the requested load address
- // is not the linked address, then return an error.
- //
- if (CheckContext.ImageAddress != ImageContext->ImageAddress) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return RETURN_INVALID_PARAMETER;
- }
- }
- //
- // Make sure the allocated space has the proper section alignment
- //
- if (!(ImageContext->IsTeImage)) {
- if ((ImageContext->ImageAddress & (CheckContext.SectionAlignment - 1)) != 0) {
- ImageContext->ImageError = IMAGE_ERROR_INVALID_SECTION_ALIGNMENT;
- return RETURN_INVALID_PARAMETER;
- }
- }
- //
- // Read the entire PE/COFF or TE header into memory
- //
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (VOID *) (UINTN) ImageContext->ImageAddress
- );
-
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- ImageContext->PeCoffHeaderOffset +
- sizeof(UINT32) +
- sizeof(EFI_IMAGE_FILE_HEADER) +
- Hdr.Pe32->FileHeader.SizeOfOptionalHeader
- );
- NumberOfSections = (UINTN) (Hdr.Pe32->FileHeader.NumberOfSections);
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (void *)(UINTN)ImageContext->ImageAddress
- );
-
- Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- sizeof(EFI_TE_IMAGE_HEADER)
- );
- NumberOfSections = (UINTN) (Hdr.Te->NumberOfSections);
-
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- //
- // Load each section of the image
- //
- Section = FirstSection;
- for (Index = 0, MaxEnd = NULL; Index < NumberOfSections; Index++) {
-
- //
- // Compute sections address
- //
- Base = PeCoffLoaderImageAddress (ImageContext, Section->VirtualAddress);
- End = PeCoffLoaderImageAddress (
- ImageContext,
- Section->VirtualAddress + Section->Misc.VirtualSize - 1
- );
- if (ImageContext->IsTeImage) {
- Base = (CHAR8 *)((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize);
- End = (CHAR8 *)((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize);
- }
-
- if (End > MaxEnd) {
- MaxEnd = End;
- }
- //
- // If the base start or end address resolved to 0, then fail.
- //
- if ((Base == NULL) || (End == NULL)) {
- ImageContext->ImageError = IMAGE_ERROR_SECTION_NOT_LOADED;
- return RETURN_LOAD_ERROR;
- }
-
- //
- // Read the section
- //
- Size = (UINTN) Section->Misc.VirtualSize;
- if ((Size == 0) || (Size > Section->SizeOfRawData)) {
- Size = (UINTN) Section->SizeOfRawData;
- }
-
- if (Section->SizeOfRawData) {
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData,
- &Size,
- Base
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize,
- &Size,
- Base
- );
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
- }
-
- //
- // If raw size is less then virt size, zero fill the remaining
- //
-
- if (Size < Section->Misc.VirtualSize) {
- ZeroMem (Base + Size, Section->Misc.VirtualSize - Size);
- }
-
- //
- // Next Section
- //
- Section += 1;
- }
-
- //
- // Get image's entry point
- //
- Magic = PeCoffLoaderGetPeHeaderMagicValue (Hdr);
- if (!(ImageContext->IsTeImage)) {
- //
- // Sizes of AddressOfEntryPoint are different so we need to do this safely
- //
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- ImageContext->EntryPoint = (PHYSICAL_ADDRESS)(UINTN)PeCoffLoaderImageAddress (
- ImageContext,
- (UINTN)Hdr.Pe32->OptionalHeader.AddressOfEntryPoint
- );
- } else {
- //
- // Use PE32+ offset
- //
- ImageContext->EntryPoint = (PHYSICAL_ADDRESS)(UINTN)PeCoffLoaderImageAddress (
- ImageContext,
- (UINTN)Hdr.Pe32Plus->OptionalHeader.AddressOfEntryPoint
- );
- }
- } else {
- ImageContext->EntryPoint = (PHYSICAL_ADDRESS) (
- (UINTN)ImageContext->ImageAddress +
- (UINTN)Hdr.Te->AddressOfEntryPoint +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
- (UINTN)Hdr.Te->StrippedSize
- );
- }
-
- //
- // Determine the size of the fixup data
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (!(ImageContext->IsTeImage)) {
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- } else {
- //
- // Use PE32+ offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- }
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- } else {
- ImageContext->FixupDataSize = 0;
- }
- } else {
- DirectoryEntry = &Hdr.Te->DataDirectory[0];
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- }
- //
- // Consumer must allocate a buffer for the relocation fixup log.
- // Only used for runtime drivers.
- //
- ImageContext->FixupData = NULL;
-
- //
- // Load the Codeview info if present
- //
- if (ImageContext->DebugDirectoryEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- DebugEntry = PeCoffLoaderImageAddress (
- ImageContext,
- ImageContext->DebugDirectoryEntryRva
- );
- } else {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)(UINTN)(
- ImageContext->ImageAddress +
- ImageContext->DebugDirectoryEntryRva +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- }
-
- if (DebugEntry != NULL) {
- TempDebugEntryRva = DebugEntry->RVA;
- if (DebugEntry->RVA == 0 && DebugEntry->FileOffset != 0) {
- Section--;
- if ((UINTN)Section->SizeOfRawData < Section->Misc.VirtualSize) {
- TempDebugEntryRva = Section->VirtualAddress + Section->Misc.VirtualSize;
- } else {
- TempDebugEntryRva = Section->VirtualAddress + Section->SizeOfRawData;
- }
- }
-
- if (TempDebugEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva);
- } else {
- ImageContext->CodeView = (VOID *)(
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TempDebugEntryRva +
- (UINTN)sizeof (EFI_TE_IMAGE_HEADER) -
- (UINTN) Hdr.Te->StrippedSize
- );
- }
-
- if (ImageContext->CodeView == NULL) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- if (DebugEntry->RVA == 0) {
- Size = DebugEntry->SizeOfData;
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset,
- &Size,
- ImageContext->CodeView
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize,
- &Size,
- ImageContext->CodeView
- );
- //
- // Should we apply fix up to this field according to the size difference between PE and TE?
- // Because now we maintain TE header fields unfixed, this field will also remain as they are
- // in original PE image.
- //
- }
-
- if (RETURN_ERROR (Status)) {
- ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
- return RETURN_LOAD_ERROR;
- }
-
- DebugEntry->RVA = TempDebugEntryRva;
- }
-
- switch (*(UINT32 *) ImageContext->CodeView) {
- case CODEVIEW_SIGNATURE_NB10:
- ImageContext->PdbPointer = (CHAR8 *)ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- ImageContext->PdbPointer = (CHAR8 *)ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- default:
- break;
- }
- }
- }
- }
-
- return Status;
-}
-
-
-/**
- Reapply fixups on a fixed up PE32/PE32+ image to allow virutal calling at EFI
- runtime.
-
- PE_COFF_LOADER_IMAGE_CONTEXT.FixupData stores information needed to reapply
- the fixups with a virtual mapping.
-
-
- @param ImageBase Base address of relocated image
- @param VirtImageBase Virtual mapping for ImageBase
- @param ImageSize Size of the image to relocate
- @param RelocationData Location to place results of read
-
-**/
-VOID
-EFIAPI
-PeCoffLoaderRelocateImageForRuntime (
- IN PHYSICAL_ADDRESS ImageBase,
- IN PHYSICAL_ADDRESS VirtImageBase,
- IN UINTN ImageSize,
- IN VOID *RelocationData
- )
-{
- CHAR8 *OldBase;
- CHAR8 *NewBase;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- UINT32 NumberOfRvaAndSizes;
- EFI_IMAGE_DATA_DIRECTORY *DataDirectory;
- EFI_IMAGE_DATA_DIRECTORY *RelocDir;
- EFI_IMAGE_BASE_RELOCATION *RelocBase;
- EFI_IMAGE_BASE_RELOCATION *RelocBaseEnd;
- UINT16 *Reloc;
- UINT16 *RelocEnd;
- CHAR8 *Fixup;
- CHAR8 *FixupBase;
- UINT16 *F16;
- UINT32 *F32;
- UINT64 *F64;
- CHAR8 *FixupData;
- UINTN Adjust;
- RETURN_STATUS Status;
- UINT16 Magic;
-
- OldBase = (CHAR8 *)((UINTN)ImageBase);
- NewBase = (CHAR8 *)((UINTN)VirtImageBase);
- Adjust = (UINTN) NewBase - (UINTN) OldBase;
-
- //
- // Find the image's relocate dir info
- //
- DosHdr = (EFI_IMAGE_DOS_HEADER *)OldBase;
- if (DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // Valid DOS header so get address of PE header
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)(((CHAR8 *)DosHdr) + DosHdr->e_lfanew);
- } else {
- //
- // No Dos header so assume image starts with PE header.
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)OldBase;
- }
-
- if (Hdr.Pe32->Signature != EFI_IMAGE_NT_SIGNATURE) {
- //
- // Not a valid PE image so Exit
- //
- return ;
- }
-
- Magic = PeCoffLoaderGetPeHeaderMagicValue (Hdr);
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DataDirectory = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[0]);
- } else {
- //
- // Use PE32+ offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DataDirectory = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[0]);
- }
-
- //
- // Find the relocation block
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- RelocDir = DataDirectory + EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC;
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(ImageBase + RelocDir->VirtualAddress);
- RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(ImageBase + RelocDir->VirtualAddress + RelocDir->Size);
- } else {
- //
- // Cannot find relocations, cannot continue
- //
- ASSERT (FALSE);
- return ;
- }
-
- ASSERT (RelocBase != NULL && RelocBaseEnd != NULL);
-
- //
- // Run the whole relocation block. And re-fixup data that has not been
- // modified. The FixupData is used to see if the image has been modified
- // since it was relocated. This is so data sections that have been updated
- // by code will not be fixed up, since that would set them back to
- // defaults.
- //
- FixupData = RelocationData;
- while (RelocBase < RelocBaseEnd) {
-
- Reloc = (UINT16 *) ((UINT8 *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
- RelocEnd = (UINT16 *) ((UINT8 *) RelocBase + RelocBase->SizeOfBlock);
- FixupBase = (CHAR8 *) ((UINTN)ImageBase) + RelocBase->VirtualAddress;
-
- //
- // Run this relocation record
- //
- while (Reloc < RelocEnd) {
-
- Fixup = FixupBase + (*Reloc & 0xFFF);
- switch ((*Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_ABSOLUTE:
- break;
-
- case EFI_IMAGE_REL_BASED_HIGH:
- F16 = (UINT16 *) Fixup;
- if (*(UINT16 *) FixupData == *F16) {
- *F16 = (UINT16) (*F16 + ((UINT16) ((UINT32) Adjust >> 16)));
- }
-
- FixupData = FixupData + sizeof (UINT16);
- break;
-
- case EFI_IMAGE_REL_BASED_LOW:
- F16 = (UINT16 *) Fixup;
- if (*(UINT16 *) FixupData == *F16) {
- *F16 = (UINT16) (*F16 + ((UINT16) Adjust & 0xffff));
- }
-
- FixupData = FixupData + sizeof (UINT16);
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHLOW:
- F32 = (UINT32 *) Fixup;
- FixupData = ALIGN_POINTER (FixupData, sizeof (UINT32));
- if (*(UINT32 *) FixupData == *F32) {
- *F32 = *F32 + (UINT32) Adjust;
- }
-
- FixupData = FixupData + sizeof (UINT32);
- break;
-
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *)Fixup;
- FixupData = ALIGN_POINTER (FixupData, sizeof (UINT64));
- if (*(UINT64 *) FixupData == *F64) {
- *F64 = *F64 + (UINT64)Adjust;
- }
-
- FixupData = FixupData + sizeof (UINT64);
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHADJ:
- //
- // Not implemented, but not used in EFI 1.0
- //
- ASSERT (FALSE);
- break;
-
- default:
- //
- // Only Itanium requires ConvertPeImage_Ex
- //
- Status = PeHotRelocateImageEx (Reloc, Fixup, &FixupData, Adjust);
- if (RETURN_ERROR (Status)) {
- return ;
- }
- }
- //
- // Next relocation record
- //
- Reloc += 1;
- }
- //
- // next reloc block
- //
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
- }
-}
-
-
-/**
- ImageRead function that operates on a memory buffer whos base is passed into
- FileHandle.
-
- @param FileHandle Ponter to baes of the input stream
- @param FileOffset Offset to the start of the buffer
- @param ReadSize Number of bytes to copy into the buffer
- @param Buffer Location to place results of read
-
- @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into
- the buffer.
-**/
-RETURN_STATUS
-EFIAPI
-PeCoffLoaderImageReadFromMemory (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
- )
-{
- CopyMem (Buffer, ((UINT8 *)FileHandle) + FileOffset, *ReadSize);
- return RETURN_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLib.inf
deleted file mode 100644
index d3390b9c92..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLib.inf
+++ /dev/null
@@ -1,83 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePeCoffLib.inf
-#
-# Abstract:
-#
-# Component description file for BasePeCoffLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePeCoffLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- BasePeCoff.c
-
-[sources.ia32]
- Ia32/PeCoffLoaderEx.c
-
-[sources.x64]
- X64/PeCoffLoaderEx.c
-
-[sources.ipf]
- Ipf/PeCoffLoaderEx.c
-
-[sources.ebc]
- Ebc/PeCoffLoaderEx.c
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Guid/PeiPeCoffLoader
-
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLibInternals.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLibInternals.h
deleted file mode 100644
index 81fd555a27..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/BasePeCoffLibInternals.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- BasePeCoffLibInternals.h
-
-Abstract:
-
- Header file for Base PeCoff Library
-
---*/
-
-#ifndef __BASE_PECOFF_LIB_INTERNALS__
-#define __BASE_PECOFF_LIB_INTERNALS__
-
-#include "EdkIIGlueBase.h"
-
-/**
- Performs an Itanium-based specific relocation fixup and is a no-op on other
- instruction sets.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-
-/**
- Performs an Itanium-based specific re-relocation fixup and is a no-op on other
- instruction sets. This is used to re-relocated the image into the EFI virtual
- space for runtime calls.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeHotRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- );
-
-
-/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- @param Machine Machine type from the PE Header.
-
- @return TRUE if this PE/COFF loader can load the image
-
-**/
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- );
-
-/**
- Retrieves the magic value from the PE/COFF header.
-
- @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
-
- @return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32
- @return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+
-
-**/
-UINT16
-PeCoffLoaderGetPeHeaderMagicValue (
- IN EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- );
-
-/**
- Retrieves the PE or TE Header from a PE/COFF or TE image.
-
- @param ImageContext The context of the image being loaded.
- @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
-
- @retval RETURN_SUCCESS The PE or TE Header is read.
- @retval Other The error status from reading the PE/COFF or TE image using the ImageRead function.
-
-**/
-RETURN_STATUS
-PeCoffLoaderGetPeHeader (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- );
-
-/**
- Converts an image address to the loaded address.
-
- @param ImageContext The context of the image being loaded.
- @param Address The address to be converted to the loaded address.
-
- @return The converted address or NULL if the address can not be converted.
-
-**/
-VOID *
-PeCoffLoaderImageAddress (
- IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ebc/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ebc/PeCoffLoaderEx.c
deleted file mode 100644
index 89c317a2c1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ebc/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- EBC Specific relocation fixups.
-
---*/
-
-#include "BasePeCoffLibInternals.h"
-
-/**
- Performs an EBC specific relocation fixup.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @retval EFI_UNSUPPORTED Unsupported now.
-
-**/
-RETURN_STATUS
-GluePeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
- @param Machine Machine type from the PE Header.
-
- @return TRUE if this PE/COFF loader can load the image
-
-**/
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
- (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/**
- Performs an Itanium-based specific re-relocation fixup and is a no-op on other
- instruction sets. This is used to re-relocated the image into the EFI virtual
- space for runtime calls.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeHotRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ia32/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ia32/PeCoffLoaderEx.c
deleted file mode 100644
index e274010415..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ia32/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- IA-32 Specific relocation fixups.
-
---*/
-
-#include "BasePeCoffLibInternals.h"
-
-/**
- Performs an IA-32 specific relocation fixup.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @retval EFI_UNSUPPORTED Unsupported now.
-
-**/
-RETURN_STATUS
-GluePeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
- @param Machine Machine type from the PE Header.
-
- @return TRUE if this PE/COFF loader can load the image
-
-**/
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
- (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Performs an Itanium-based specific re-relocation fixup and is a no-op on other
- instruction sets. This is used to re-relocated the image into the EFI virtual
- space for runtime calls.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeHotRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c
deleted file mode 100644
index f9b264c8e5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/Ipf/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- IA-32 Specific relocation fixups.
-
---*/
-
-#include "BasePeCoffLibInternals.h"
-
-#define EFI_IMAGE_MACHINE_IPF EFI_IMAGE_MACHINE_IA64
-
-#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) \
- Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)
-
-#define INS_IMM64(Value, Address, Size, InstPos, ValPos) \
- *(UINT32*)Address = (*(UINT32*)Address & ~(((1 << Size) - 1) << InstPos)) | \
- ((UINT32)((((UINT64)Value >> ValPos) & (((UINT64)1 << Size) - 1))) << InstPos)
-
-#define IMM64_IMM7B_INST_WORD_X 3
-#define IMM64_IMM7B_SIZE_X 7
-#define IMM64_IMM7B_INST_WORD_POS_X 4
-#define IMM64_IMM7B_VAL_POS_X 0
-
-#define IMM64_IMM9D_INST_WORD_X 3
-#define IMM64_IMM9D_SIZE_X 9
-#define IMM64_IMM9D_INST_WORD_POS_X 18
-#define IMM64_IMM9D_VAL_POS_X 7
-
-#define IMM64_IMM5C_INST_WORD_X 3
-#define IMM64_IMM5C_SIZE_X 5
-#define IMM64_IMM5C_INST_WORD_POS_X 13
-#define IMM64_IMM5C_VAL_POS_X 16
-
-#define IMM64_IC_INST_WORD_X 3
-#define IMM64_IC_SIZE_X 1
-#define IMM64_IC_INST_WORD_POS_X 12
-#define IMM64_IC_VAL_POS_X 21
-
-#define IMM64_IMM41a_INST_WORD_X 1
-#define IMM64_IMM41a_SIZE_X 10
-#define IMM64_IMM41a_INST_WORD_POS_X 14
-#define IMM64_IMM41a_VAL_POS_X 22
-
-#define IMM64_IMM41b_INST_WORD_X 1
-#define IMM64_IMM41b_SIZE_X 8
-#define IMM64_IMM41b_INST_WORD_POS_X 24
-#define IMM64_IMM41b_VAL_POS_X 32
-
-#define IMM64_IMM41c_INST_WORD_X 2
-#define IMM64_IMM41c_SIZE_X 23
-#define IMM64_IMM41c_INST_WORD_POS_X 0
-#define IMM64_IMM41c_VAL_POS_X 40
-
-#define IMM64_SIGN_INST_WORD_X 3
-#define IMM64_SIGN_SIZE_X 1
-#define IMM64_SIGN_INST_WORD_POS_X 27
-#define IMM64_SIGN_VAL_POS_X 63
-
-/**
- Performs an Itanium-based specific relocation fixup.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- UINT64 *F64;
- UINT64 FixupVal;
-
- switch ((*Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_IA64_IMM64:
-
- //
- // Align it to bundle address before fixing up the
- // 64-bit immediate value of the movl instruction.
- //
-
- Fixup = (CHAR8 *)((UINTN) Fixup & (UINTN) ~(15));
- FixupVal = (UINT64)0;
-
- //
- // Extract the lower 32 bits of IMM64 from bundle
- //
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X,
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X,
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X,
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IC_INST_WORD_X,
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X,
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- //
- // Update 64-bit address
- //
- FixupVal += Adjust;
-
- //
- // Insert IMM64 into bundle
- //
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X),
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X),
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X),
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IC_INST_WORD_X),
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X),
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41b_INST_WORD_X),
- IMM64_IMM41b_SIZE_X,
- IMM64_IMM41b_INST_WORD_POS_X,
- IMM64_IMM41b_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41c_INST_WORD_X),
- IMM64_IMM41c_SIZE_X,
- IMM64_IMM41c_INST_WORD_POS_X,
- IMM64_IMM41c_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_SIGN_INST_WORD_X),
- IMM64_SIGN_SIZE_X,
- IMM64_SIGN_INST_WORD_POS_X,
- IMM64_SIGN_VAL_POS_X
- );
-
- F64 = (UINT64 *) Fixup;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library. This version also supports the special relocations
- for Itanium.
-
- @param Machine Machine type from the PE Header.
-
- @return TRUE if this PE/COFF loader can load the image
-
-**/
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-{
- if ((Machine == EFI_IMAGE_MACHINE_IPF) || (Machine == EFI_IMAGE_MACHINE_IA32) ||
- (Machine == EFI_IMAGE_MACHINE_EBC) || (Machine == EFI_IMAGE_MACHINE_X64)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/**
- ImageRead function that operates on a memory buffer whos base is passed into
- FileHandle.
-
- @param Reloc Ponter to baes of the input stream
- @param Fixup Offset to the start of the buffer
- @param FixupData Number of bytes to copy into the buffer
- @param Adjust Location to place results of read
-
- @retval RETURN_SUCCESS Data is read from FileOffset from the Handle into
- the buffer.
-**/
-RETURN_STATUS
-GluePeHotRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- UINT64 *F64;
- UINT64 FixupVal;
-
- switch ((*Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_DIR64:
- F64 = (UINT64 *) Fixup;
- *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));
- if (*(UINT64 *) (*FixupData) == *F64) {
- *F64 = *F64 + (UINT64) Adjust;
- }
-
- *FixupData = *FixupData + sizeof (UINT64);
- break;
-
- case EFI_IMAGE_REL_BASED_IA64_IMM64:
- F64 = (UINT64 *) Fixup;
- *FixupData = ALIGN_POINTER (*FixupData, sizeof (UINT64));
- if (*(UINT64 *) (*FixupData) == *F64) {
- //
- // Align it to bundle address before fixing up the
- // 64-bit immediate value of the movl instruction.
- //
- //
- Fixup = (CHAR8 *) ((UINT64) Fixup & (UINT64)~(15));
- FixupVal = (UINT64) 0;
-
- //
- // Extract the lower 32 bits of IMM64 from bundle
- //
- EXT_IMM64 (
- FixupVal,
- (UINT32 *) Fixup + IMM64_IMM7B_INST_WORD_X,
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- EXT_IMM64 (
- FixupVal,
- (UINT32 *) Fixup + IMM64_IMM9D_INST_WORD_X,
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- EXT_IMM64 (
- FixupVal,
- (UINT32 *) Fixup + IMM64_IMM5C_INST_WORD_X,
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- EXT_IMM64 (
- FixupVal,
- (UINT32 *) Fixup + IMM64_IC_INST_WORD_X,
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- EXT_IMM64 (
- FixupVal,
- (UINT32 *) Fixup + IMM64_IMM41a_INST_WORD_X,
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- //
- // Update 64-bit address
- //
- FixupVal += Adjust;
-
- //
- // Insert IMM64 into bundle
- //
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM7B_INST_WORD_X),
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM9D_INST_WORD_X),
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM5C_INST_WORD_X),
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IC_INST_WORD_X),
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM41a_INST_WORD_X),
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM41b_INST_WORD_X),
- IMM64_IMM41b_SIZE_X,
- IMM64_IMM41b_INST_WORD_POS_X,
- IMM64_IMM41b_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_IMM41c_INST_WORD_X),
- IMM64_IMM41c_SIZE_X,
- IMM64_IMM41c_INST_WORD_POS_X,
- IMM64_IMM41c_VAL_POS_X
- );
-
- INS_IMM64 (
- FixupVal,
- ((UINT32 *) Fixup + IMM64_SIGN_INST_WORD_X),
- IMM64_SIGN_SIZE_X,
- IMM64_SIGN_INST_WORD_POS_X,
- IMM64_SIGN_VAL_POS_X
- );
-
- *(UINT64 *) (*FixupData) = *F64;
- }
-
- *FixupData = *FixupData + sizeof (UINT64);
- break;
-
- default:
- DEBUG ((EFI_D_ERROR, "PeHotRelocateEx:unknown fixed type\n"));
- return RETURN_UNSUPPORTED;
- }
-
- return RETURN_SUCCESS;
-}
-
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/X64/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/X64/PeCoffLoaderEx.c
deleted file mode 100644
index e18a8dab54..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePeCoffLib/X64/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- x64 Specific relocation fixups.
-
---*/
-
-#include "BasePeCoffLibInternals.h"
-
-
-/**
- Performs an x64 specific relocation fixup.
-
- @param Reloc Pointer to the relocation record
- @param Fixup Pointer to the address to fix up
- @param FixupData Pointer to a buffer to log the fixups
- @param Adjust The offset to adjust the fixup
-
- @retval RETURN_SUCCESS Success to perform relocation
- @retval RETURN_UNSUPPORTED Unsupported.
-**/
-RETURN_STATUS
-GluePeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
-
-/**
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
- @param Machine Machine type from the PE Header.
-
- @return TRUE if this PE/COFF loader can load the image
-
-**/
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
- (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-/**
- Performs an X64 specific re-relocation fixup and is a no-op on other
- instruction sets. This is used to re-relocated the image into the EFI virtual
- space for runtime calls.
-
- @param Reloc Pointer to the relocation record.
- @param Fixup Pointer to the address to fix up.
- @param FixupData Pointer to a buffer to log the fixups.
- @param Adjust The offset to adjust the fixup.
-
- @return Status code.
-
-**/
-RETURN_STATUS
-GluePeHotRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-{
- return RETURN_UNSUPPORTED;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf
deleted file mode 100644
index d7e762382c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/BasePostCodeLibDebug.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePostCodeLibDebug.inf
-#
-# Abstract:
-#
-# Component description file for BasePostCodeLibDebug
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePostCodeLibDebug
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PostCode.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Guid/PeiPeCoffLoader
-
-
-[libraries.common]
-# A DebugLib instance
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/PostCode.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/PostCode.c
deleted file mode 100644
index b5ca9257fd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/PostCode.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PostCode.c
-
-Abstract:
-
- Post Code functions
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Sends an 32-bit value to a POST card.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- Some implementations of this library function may perform I/O operations
- directly to a POST card device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
- display the 32-bit value on the status reporting device.
-
- PostCode() must actively prevent recursion. If PostCode() is called while
- processing another any other Report Status Code Library function, then
- PostCode() must return Value immediately.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCode (
- IN UINT32 Value
- )
-{
- DEBUG((EFI_D_INFO, "POST %08x\n", Value));
- return Value;
-}
-
-
-/**
- Sends an 32-bit value to a POST and associated ASCII string.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- If Description is not NULL, then the ASCII string specified by Description is
- also passed to the handler that displays the POST card value. Some
- implementations of this library function may perform I/O operations directly
- to a POST card device. Other implementations may send Value to ReportStatusCode(),
- and the status code reporting mechanism will eventually display the 32-bit
- value on the status reporting device.
-
- PostCodeWithDescription()must actively prevent recursion. If
- PostCodeWithDescription() is called while processing another any other Report
- Status Code Library function, then PostCodeWithDescription() must return Value
- immediately.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value. This is an optional parameter that may
- be NULL.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCodeWithDescription (
- IN UINT32 Value,
- IN CONST CHAR8 *Description OPTIONAL
- )
-{
- DEBUG((EFI_D_INFO, "POST %08x - %s\n", Value, Description));
- return Value;
-}
-
-
-/**
- Returns TRUE if POST Codes are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if POST code descriptions are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeDescriptionEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
deleted file mode 100644
index 5aa9cad78d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
+++ /dev/null
@@ -1,84 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePostCodeLibPort80.inf
-#
-# Abstract:
-#
-# Component description file for BasePostCodeLibPort80
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePostCodeLibPort80
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PostCode.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Guid/PeiPeCoffLoader
-
-
-[libraries.common]
-
-[libraries.ia32]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.x64]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.ebc]
- EdkIIGlueDxeIoLibCpuIo
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c
deleted file mode 100644
index 2cab981250..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibPort80/PostCode.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PostCode.c
-
-Abstract:
-
- Post Code functions
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- Sends an 32-bit value to a POST card.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- Some implementations of this library function may perform I/O operations
- directly to a POST card device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
- display the 32-bit value on the status reporting device.
-
- PostCode() must actively prevent recursion. If PostCode() is called while
- processing another any other Report Status Code Library function, then
- PostCode() must return Value immediately.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCode (
- IN UINT32 Value
- )
-{
- IoWrite8 (0x80, (UINT8)(Value));
- return Value;
-}
-
-
-/**
- Sends an 32-bit value to a POST and associated ASCII string.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- If Description is not NULL, then the ASCII string specified by Description is
- also passed to the handler that displays the POST card value. Some
- implementations of this library function may perform I/O operations directly
- to a POST card device. Other implementations may send Value to ReportStatusCode(),
- and the status code reporting mechanism will eventually display the 32-bit
- value on the status reporting device.
-
- PostCodeWithDescription()must actively prevent recursion. If
- PostCodeWithDescription() is called while processing another any other Report
- Status Code Library function, then PostCodeWithDescription() must return Value
- immediately.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value. This is an optional parameter that may
- be NULL.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCodeWithDescription (
- IN UINT32 Value,
- IN CONST CHAR8 *Description OPTIONAL
- )
-{
- IoWrite8 (0x80, (UINT8)(Value));
- return Value;
-}
-
-
-/**
- Returns TRUE if POST Codes are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if POST code descriptions are enabled.
-
- This function returns TRUE if the
- POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeDescriptionEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/BasePrintLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/BasePrintLib.inf
deleted file mode 100644
index 1494a1d8e3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/BasePrintLib.inf
+++ /dev/null
@@ -1,82 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BasePrintLib.inf
-#
-# Abstract:
-#
-# Component description file for BasePrintLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBasePrintLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PrintLib.c
- PrintLibInternal.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Guid/PeiPeCoffLoader
-
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c
deleted file mode 100644
index 4a2168c24d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLib.c
+++ /dev/null
@@ -1,1108 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PrintLib.c
-
-Abstract:
-
- Print Library.
-
---*/
-
-#include "PrintLibInternal.h"
-
-#define WARNING_STATUS_NUMBER 4
-#define ERROR_STATUS_NUMBER 31
-#define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)
-
-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *StatusString [] = {
- "Success", // RETURN_SUCCESS = 0
- "Warning Unknown Glyph", // RETURN_WARN_UNKNOWN_GLYPH = 1
- "Warning Delete Failure", // RETURN_WARN_DELETE_FAILURE = 2
- "Warning Write Failure", // RETURN_WARN_WRITE_FAILURE = 3
- "Warning Buffer Too Small", // RETURN_WARN_BUFFER_TOO_SMALL = 4
- "Load Error", // RETURN_LOAD_ERROR = 1 | MAX_BIT
- "Invalid Parameter", // RETURN_INVALID_PARAMETER = 2 | MAX_BIT
- "Unsupported", // RETURN_UNSUPPORTED = 3 | MAX_BIT
- "Bad Buffer Size", // RETURN_BAD_BUFFER_SIZE = 4 | MAX_BIT
- "Buffer Too Small", // RETURN_BUFFER_TOO_SMALL, = 5 | MAX_BIT
- "Not Ready", // RETURN_NOT_READY = 6 | MAX_BIT
- "Device Error", // RETURN_DEVICE_ERROR = 7 | MAX_BIT
- "Write Protected", // RETURN_WRITE_PROTECTED = 8 | MAX_BIT
- "Out of Resources", // RETURN_OUT_OF_RESOURCES = 9 | MAX_BIT
- "Volume Corrupt", // RETURN_VOLUME_CORRUPTED = 10 | MAX_BIT
- "Volume Full", // RETURN_VOLUME_FULL = 11 | MAX_BIT
- "No Media", // RETURN_NO_MEDIA = 12 | MAX_BIT
- "Media changed", // RETURN_MEDIA_CHANGED = 13 | MAX_BIT
- "Not Found", // RETURN_NOT_FOUND = 14 | MAX_BIT
- "Access Denied", // RETURN_ACCESS_DENIED = 15 | MAX_BIT
- "No Response", // RETURN_NO_RESPONSE = 16 | MAX_BIT
- "No mapping", // RETURN_NO_MAPPING = 17 | MAX_BIT
- "Time out", // RETURN_TIMEOUT = 18 | MAX_BIT
- "Not started", // RETURN_NOT_STARTED = 19 | MAX_BIT
- "Already started", // RETURN_ALREADY_STARTED = 20 | MAX_BIT
- "Aborted", // RETURN_ABORTED = 21 | MAX_BIT
- "ICMP Error", // RETURN_ICMP_ERROR = 22 | MAX_BIT
- "TFTP Error", // RETURN_TFTP_ERROR = 23 | MAX_BIT
- "Protocol Error", // RETURN_PROTOCOL_ERROR = 24 | MAX_BIT
- "Incompatible Version", // RETURN_INCOMPATIBLE_VERSION = 25 | MAX_BIT
- "Security Violation", // RETURN_SECURITY_VIOLATION = 26 | MAX_BIT
- "CRC Error", // RETURN_CRC_ERROR = 27 | MAX_BIT
- "End of Media", // RETURN_END_OF_MEDIA = 28 | MAX_BIT
- "Reserved (29)", // RESERVED = 29 | MAX_BIT
- "Reserved (30)", // RESERVED = 30 | MAX_BIT
- "End of File" // RETURN_END_OF_FILE = 31 | MAX_BIT
-};
-
-/**
- Worker function that produces a Null-terminated string in an output buffer
- based on a Null-terminated format string and a VA_LIST argument list.
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine.
-
- @param Buffer Character buffer to print the results of the parsing
- of Format into.
- @param BufferSize Maximum number of characters to put into buffer.
- @param Flags Intial flags value.
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.
- @param Format Null-terminated format string.
- @param Marker Vararg list consumed by processing Format.
-
- @return Number of characters printed not including the Null-terminator.
-
-**/
-UINTN
-BasePrintLibVSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN CONST CHAR8 *Format,
- IN VA_LIST Marker
- )
-{
- CHAR8 *OriginalBuffer;
- CHAR8 *EndBuffer;
- CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];
- UINTN BytesPerOutputCharacter;
- UINTN BytesPerFormatCharacter;
- UINTN FormatMask;
- UINTN FormatCharacter;
- UINTN Width;
- UINTN Precision;
- INT64 Value;
- CONST CHAR8 *ArgumentString;
- UINTN Character;
- GUID *TmpGuid;
- TIME *TmpTime;
- UINTN Count;
- UINTN ArgumentMask;
- INTN BytesPerArgumentCharacter;
- UINTN ArgumentCharacter;
- BOOLEAN Done;
- UINTN Index;
- CHAR8 Prefix;
- BOOLEAN ZeroPad;
- BOOLEAN Comma;
- UINTN Digits;
- UINTN Radix;
- RETURN_STATUS Status;
-
- if (BufferSize == 0) {
- return 0;
- }
- ASSERT (Buffer != NULL);
-
- if ((Flags & OUTPUT_UNICODE) != 0) {
- BytesPerOutputCharacter = 2;
- } else {
- BytesPerOutputCharacter = 1;
- }
-
- //
- // Reserve space for the Null terminator.
- //
- BufferSize--;
- OriginalBuffer = Buffer;
- //
- // Set the tag for the end of the input Buffer.
- //
- EndBuffer = Buffer + BufferSize * BytesPerOutputCharacter;
-
- if ((Flags & FORMAT_UNICODE) != 0) {
- //
- // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength
- // Unicode characters if PcdMaximumUnicodeStringLength is not zero.
- //
- ASSERT (StrSize ((CHAR16 *) Format) != 0);
- BytesPerFormatCharacter = 2;
- FormatMask = 0xffff;
- } else {
- //
- // Make sure format string cannot contain more than PcdMaximumAsciiStringLength
- // Ascii characters if PcdMaximumAsciiStringLength is not zero.
- //
- ASSERT (AsciiStrSize (Format) != 0);
- BytesPerFormatCharacter = 1;
- FormatMask = 0xff;
- }
-
-
-
- //
- // Get the first character from the format string
- //
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
-
- //
- // Loop until the end of the format string is reached or the output buffer is full
- //
- while (FormatCharacter != 0 && Buffer < EndBuffer) {
- //
- // Clear all the flag bits except those that may have been passed in
- //
- Flags &= (OUTPUT_UNICODE | FORMAT_UNICODE);
-
- //
- // Set the default width to zero, and the default precision to 1
- //
- Width = 0;
- Precision = 1;
- Prefix = 0;
- Comma = FALSE;
- ZeroPad = FALSE;
- Count = 0;
- Digits = 0;
-
- switch (FormatCharacter) {
- case '%':
- //
- // Parse Flags and Width
- //
- for (Done = FALSE; !Done; ) {
- Format += BytesPerFormatCharacter;
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
- switch (FormatCharacter) {
- case '.':
- Flags |= PRECISION;
- break;
- case '-':
- Flags |= LEFT_JUSTIFY;
- break;
- case '+':
- Flags |= PREFIX_SIGN;
- break;
- case ' ':
- Flags |= PREFIX_BLANK;
- break;
- case ',':
- Flags |= COMMA_TYPE;
- break;
- case 'L':
- case 'l':
- Flags |= LONG_TYPE;
- break;
- case '*':
- if ((Flags & PRECISION) == 0) {
- Flags |= PAD_TO_WIDTH;
- Width = VA_ARG (Marker, UINTN);
- } else {
- Precision = VA_ARG (Marker, UINTN);
- }
- break;
- case '0':
- if ((Flags & PRECISION) == 0) {
- Flags |= PREFIX_ZERO;
- }
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- for (Count = 0; ((FormatCharacter >= '0') && (FormatCharacter <= '9')); ){
- Count = (Count * 10) + FormatCharacter - '0';
- Format += BytesPerFormatCharacter;
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
- }
- Format -= BytesPerFormatCharacter;
- if ((Flags & PRECISION) == 0) {
- Flags |= PAD_TO_WIDTH;
- Width = Count;
- } else {
- Precision = Count;
- }
- break;
-
- case '\0':
- //
- // Make no output if Format string terminates unexpectedly when
- // looking up for flag, width, precision and type.
- //
- Format -= BytesPerFormatCharacter;
- Precision = 0;
- //
- // break skipped on purpose.
- //
- default:
- Done = TRUE;
- break;
- }
- }
-
- //
- // Handle each argument type
- //
- switch (FormatCharacter) {
- case 'p':
- //
- // Flag space, +, 0, L & l are invalid for type p.
- //
- Flags &= ~(PREFIX_BLANK | PREFIX_SIGN | PREFIX_ZERO | LONG_TYPE);
- if (sizeof (VOID *) > 4) {
- Flags |= LONG_TYPE;
- }
- case 'X':
- Flags |= PREFIX_ZERO;
- //
- // break skipped on purpose
- //
- case 'x':
- Flags |= RADIX_HEX;
- //
- // break skipped on purpose
- //
- case 'd':
- if ((Flags & LONG_TYPE) == 0) {
- Value = (VA_ARG (Marker, int));
- } else {
- Value = VA_ARG (Marker, INT64);
- }
- if ((Flags & PREFIX_BLANK) != 0) {
- Prefix = ' ';
- }
- if ((Flags & PREFIX_SIGN) != 0) {
- Prefix = '+';
- }
- if ((Flags & COMMA_TYPE) != 0) {
- Comma = TRUE;
- }
- if ((Flags & RADIX_HEX) == 0) {
- Radix = 10;
- if (Comma) {
- Flags &= (~PREFIX_ZERO);
- Precision = 1;
- }
- if (Value < 0) {
- Flags |= PREFIX_SIGN;
- Prefix = '-';
- Value = -Value;
- }
- } else {
- Radix = 16;
- Comma = FALSE;
- if ((Flags & LONG_TYPE) == 0 && Value < 0) {
- Value = (unsigned int)Value;
- }
- }
- //
- // Convert Value to a reversed string
- //
- Count = BasePrintLibValueToString (ValueBuffer, Value, Radix);
- if (Value == 0 && Precision == 0) {
- Count = 0;
- }
- ArgumentString = (CHAR8 *)ValueBuffer + Count;
-
- Digits = Count % 3;
- if (Digits != 0) {
- Digits = 3 - Digits;
- }
- if (Comma && Count != 0) {
- Count += ((Count - 1) / 3);
- }
- if (Prefix != 0) {
- Count++;
- Precision++;
- }
- Flags |= ARGUMENT_REVERSED;
- ZeroPad = TRUE;
- if ((Flags & PREFIX_ZERO) != 0) {
- if ((Flags & LEFT_JUSTIFY) == 0) {
- if ((Flags & PAD_TO_WIDTH) != 0) {
- if ((Flags & PRECISION) == 0) {
- Precision = Width;
- }
- }
- }
- }
- break;
-
- case 's':
- case 'S':
- Flags |= ARGUMENT_UNICODE;
- //
- // break skipped on purpose
- //
- case 'a':
- ArgumentString = (CHAR8 *)VA_ARG (Marker, CHAR8 *);
- if (ArgumentString == NULL) {
- Flags &= (~ARGUMENT_UNICODE);
- ArgumentString = "<null string>";
- }
- break;
-
- case 'c':
- Character = VA_ARG (Marker, UINTN) & 0xffff;
- ArgumentString = (CHAR8 *)&Character;
- Flags |= ARGUMENT_UNICODE;
- break;
-
- case 'g':
- TmpGuid = VA_ARG (Marker, GUID *);
- if (TmpGuid == NULL) {
- ArgumentString = "<null guid>";
- } else {
- BasePrintLibSPrint (
- ValueBuffer,
- MAXIMUM_VALUE_CHARACTERS,
- 0,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- TmpGuid->Data1,
- TmpGuid->Data2,
- TmpGuid->Data3,
- TmpGuid->Data4[0],
- TmpGuid->Data4[1],
- TmpGuid->Data4[2],
- TmpGuid->Data4[3],
- TmpGuid->Data4[4],
- TmpGuid->Data4[5],
- TmpGuid->Data4[6],
- TmpGuid->Data4[7]
- );
- ArgumentString = ValueBuffer;
- }
- break;
-
- case 't':
- TmpTime = VA_ARG (Marker, TIME *);
- if (TmpTime == NULL) {
- ArgumentString = "<null time>";
- } else {
- BasePrintLibSPrint (
- ValueBuffer,
- MAXIMUM_VALUE_CHARACTERS,
- 0,
- "%02d/%02d/%04d %02d:%02d",
- TmpTime->Month,
- TmpTime->Day,
- TmpTime->Year,
- TmpTime->Hour,
- TmpTime->Minute
- );
- ArgumentString = ValueBuffer;
- }
- break;
-
- case 'r':
- Status = VA_ARG (Marker, RETURN_STATUS);
- ArgumentString = ValueBuffer;
- if (RETURN_ERROR (Status)) {
- //
- // Clear error bit
- //
- Index = Status & ~MAX_BIT;
- if (Index > 0 && Index <= ERROR_STATUS_NUMBER) {
- ArgumentString = StatusString [Index + WARNING_STATUS_NUMBER];
- }
- } else {
- Index = (UINTN) Status;
- if (Index <= WARNING_STATUS_NUMBER) {
- ArgumentString = StatusString [Index];
- }
- }
- if (ArgumentString == ValueBuffer) {
- BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);
- }
- break;
-
- case '\n':
- ArgumentString = "\n\r";
- break;
-
- case '%':
- default:
- //
- // if the type is '%' or unknown, then print it to the screen
- //
- ArgumentString = (CHAR8 *)&FormatCharacter;
- Flags |= ARGUMENT_UNICODE;
- break;
- }
- break;
-
- case '\n':
- ArgumentString = "\n\r";
- break;
-
- default:
- ArgumentString = (CHAR8 *)&FormatCharacter;
- Flags |= ARGUMENT_UNICODE;
- break;
- }
-
- //
- // Retrieve the ArgumentString attriubutes
- //
- if ((Flags & ARGUMENT_UNICODE) != 0) {
- ArgumentMask = 0xffff;
- BytesPerArgumentCharacter = 2;
- } else {
- ArgumentMask = 0xff;
- BytesPerArgumentCharacter = 1;
- }
- if ((Flags & ARGUMENT_REVERSED) != 0) {
- BytesPerArgumentCharacter = -BytesPerArgumentCharacter;
- } else {
- //
- // Compute the number of characters in ArgumentString and store it in Count
- // ArgumentString is either null-terminated, or it contains Precision characters
- //
- for (Count = 0; Count < Precision || ((Flags & PRECISION) == 0); Count++) {
- ArgumentCharacter = ((ArgumentString[Count * BytesPerArgumentCharacter] & 0xff) | ((ArgumentString[Count * BytesPerArgumentCharacter + 1]) << 8)) & ArgumentMask;
- if (ArgumentCharacter == 0) {
- break;
- }
- }
- }
-
- if (Precision < Count) {
- Precision = Count;
- }
-
- //
- // Pad before the string
- //
- if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
- }
-
- if (ZeroPad) {
- if (Prefix != 0) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
- }
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);
- } else {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);
- if (Prefix != 0) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);
- }
- }
-
- //
- // Output the Prefix character if it is present
- //
- Index = 0;
- if (Prefix != 0) {
- Index++;
- }
-
- //
- // Copy the string into the output buffer performing the required type conversions
- //
- while (Index < Count) {
- ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;
-
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);
- ArgumentString += BytesPerArgumentCharacter;
- Index++;
- if (Comma) {
- Digits++;
- if (Digits == 3) {
- Digits = 0;
- Index++;
- if (Index < Count) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);
- }
- }
- }
- }
-
- //
- // Pad after the string
- //
- if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);
- }
-
- //
- // Get the next character from the format string
- //
- Format += BytesPerFormatCharacter;
-
- //
- // Get the next character from the format string
- //
- FormatCharacter = (*Format | (*(Format + 1) << 8)) & FormatMask;
- }
-
- //
- // Null terminate the Unicode or ASCII string
- //
- BasePrintLibFillBuffer (Buffer, EndBuffer + BytesPerOutputCharacter, 1, 0, BytesPerOutputCharacter);
- //
- // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength
- // Unicode characters if PcdMaximumUnicodeStringLength is not zero.
- //
- ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));
- //
- // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength
- // ASCII characters if PcdMaximumAsciiStringLength is not zero.
- //
- ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));
-
- return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);
-}
-
-/**
- Worker function that produces a Null-terminated string in an output buffer
- based on a Null-terminated format string and variable argument list.
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine.
-
- @param Buffer Character buffer to print the results of the parsing
- of Format into.
- @param BufferSize Maximum number of characters to put into buffer.
- Zero means no limit.
- @param Flags Intial flags value.
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set
- @param FormatString Null-terminated format string.
-
- @return Number of characters printed not including the Null-terminator.
-
-**/
-UINTN
-BasePrintLibSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN CONST CHAR8 *FormatString,
- ...
- )
-{
- VA_LIST Marker;
- UINTN NumberOfPrinted;
-
- VA_START (Marker, FormatString);
- NumberOfPrinted = BasePrintLibVSPrint (StartOfBuffer, BufferSize, Flags, FormatString, Marker);
- VA_END (Marker);
- return NumberOfPrinted;
-}
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on
- a Null-terminated Unicode format string and a VA_LIST argument list
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-{
- ASSERT_UNICODE_BUFFER(StartOfBuffer);
- ASSERT_UNICODE_BUFFER(FormatString);
- return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);
-}
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- Unicode format string and variable argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrint (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- )
-{
- VA_LIST Marker;
- UINTN NumberOfPrinted;
-
- VA_START (Marker, FormatString);
- NumberOfPrinted = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
- VA_END (Marker);
- return NumberOfPrinted;
-}
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on the
- contents of the format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeVSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-{
- ASSERT_UNICODE_BUFFER(StartOfBuffer);
- return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);
-}
-
-/**
- Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The Unicode string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of Unicode characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
- If BufferSize > 1 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string
- contains more than PcdMaximumUnicodeStringLength Unicode characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of Unicode characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeSPrintAsciiFormat (
- OUT CHAR16 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- )
-{
- VA_LIST Marker;
- UINTN NumberOfPrinted;
-
- VA_START (Marker, FormatString);
- NumberOfPrinted = UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);
- VA_END (Marker);
- return NumberOfPrinted;
-}
-
-/**
- Converts a decimal value to a Null-terminated Unicode string.
-
- Converts the decimal number specified by Value to a Null-terminated Unicode
- string specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed. If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of Unicode characters in Buffer is returned not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
- required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
-
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 16-bit boundary, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- Unicode string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of Unicode characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of Unicode characters in Buffer not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-UnicodeValueToString (
- IN OUT CHAR16 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- )
-{
- ASSERT_UNICODE_BUFFER(Buffer);
- return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);
-}
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-{
- return BasePrintLibVSPrint (StartOfBuffer, BufferSize, 0, FormatString, Marker);
-}
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
- PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- ...
- )
-{
- VA_LIST Marker;
- UINTN NumberOfPrinted;
-
- VA_START (Marker, FormatString);
- NumberOfPrinted = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
- VA_END (Marker);
- return NumberOfPrinted;
-}
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and a VA_LIST argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list specified by Marker based on
- the contents of the format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
- @param Marker VA_LIST marker for the variable argument list.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiVSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- IN VA_LIST Marker
- )
-{
- ASSERT_UNICODE_BUFFER (FormatString);
- return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);
-}
-
-/**
- Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated
- ASCII format string and variable argument list.
-
- Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer
- and BufferSize.
- The ASCII string is produced by parsing the format string specified by FormatString.
- Arguments are pulled from the variable argument list based on the contents of the
- format string.
- The number of ASCII characters in the produced output buffer is returned not including
- the Null-terminator.
- If BufferSize is 0, then no output buffer is produced and 0 is returned.
-
- If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is NULL, then ASSERT().
- If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
- If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
- PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
- ASSERT().
- If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string
- contains more than PcdMaximumAsciiStringLength ASCII characters not including the
- Null-terminator, then ASSERT().
-
- @param StartOfBuffer A pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
- @param FormatString Null-terminated Unicode format string.
-
- @return The number of ASCII characters in the produced output buffer not including the
- Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiSPrintUnicodeFormat (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR16 *FormatString,
- ...
- )
-{
- VA_LIST Marker;
- UINTN NumberOfPrinted;
-
- VA_START (Marker, FormatString);
- NumberOfPrinted = AsciiVSPrintUnicodeFormat (StartOfBuffer, BufferSize, FormatString, Marker);
- VA_END (Marker);
- return NumberOfPrinted;
-}
-
-
-/**
- Converts a decimal value to a Null-terminated ASCII string.
-
- Converts the decimal number specified by Value to a Null-terminated ASCII string
- specified by Buffer containing at most Width characters. No padding of spaces
- is ever performed.
- If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of ASCII characters in Buffer is returned not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first Width
- characters are returned, and the total number of characters required to perform
- the conversion is returned.
- Additional conversion parameters are specified in Flags.
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be
- formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
-
- If Buffer is NULL, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- ASCII string.
- @param Flags The bitmask of flags that specify left justification, zero pad, and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of ASCII characters to place in Buffer, not including
- the Null-terminator.
-
- @return The number of ASCII characters in Buffer not including the Null-terminator.
-
-**/
-UINTN
-EFIAPI
-AsciiValueToString (
- IN OUT CHAR8 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width
- )
-{
- return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.c
deleted file mode 100644
index 727c229e35..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PrintLibInternal.c
-
-Abstract:
-
- Print Library worker functions.
-
---*/
-
-#include "PrintLibInternal.h"
-
-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 mHexStr[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
-
-
-/**
- Internal function that places the character into the Buffer.
-
- Internal function that places ASCII or Unicode character into the Buffer.
-
- @param Buffer Buffer to place the Unicode or ASCII string.
- @param EndBuffer The end of the input Buffer. No characters will be
- placed after that.
- @param Length Count of character to be placed into Buffer.
- @param Character Character to be placed into Buffer.
- @param Increment Character increment in Buffer.
-
- @return Number of characters printed.
-
-**/
-CHAR8 *
-BasePrintLibFillBuffer (
- CHAR8 *Buffer,
- CHAR8 *EndBuffer,
- INTN Length,
- UINTN Character,
- INTN Increment
- )
-{
- INTN Index;
-
- for (Index = 0; Index < Length && Buffer < EndBuffer; Index++) {
- *Buffer = (CHAR8) Character;
- *(Buffer + 1) = (CHAR8) (Character >> 8);
- Buffer += Increment;
- }
- return Buffer;
-}
-
-/**
- Internal function that convert a decimal number to a string in Buffer.
-
- Print worker function that convert a decimal number to a string in Buffer.
-
- @param Buffer Location to place the Unicode or ASCII string of Value.
- @param Value Value to convert to a Decimal or Hexidecimal string in Buffer.
- @param Radix Radix of the value
-
- @return Number of characters printed.
-
-**/
-UINTN
-EFIAPI
-BasePrintLibValueToString (
- IN OUT CHAR8 *Buffer,
- IN INT64 Value,
- IN UINTN Radix
- )
-{
- UINTN Digits;
- UINT32 Remainder;
-
- //
- // Loop to convert one digit at a time in reverse order
- //
- *(Buffer++) = 0;
- Digits = 0;
- do {
- Value = (INT64)DivU64x32Remainder ((UINT64)Value, (UINT32)Radix, &Remainder);
- *(Buffer++) = mHexStr[Remainder];
- Digits++;
- } while (Value != 0);
- return Digits;
-}
-
-/**
- Internal function that converts a decimal value to a Null-terminated string.
-
- Converts the decimal number specified by Value to a Null-terminated
- string specified by Buffer containing at most Width characters.
- If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The number of characters in Buffer is returned not including the Null-terminator.
- If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
- required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If RADIX_HEX is set in Flags, then the output buffer will be formatted in hexadecimal format.
- If Value is < 0 and RADIX_HEX is not set in Flags, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
- If both COMMA_TYPE and RADIX_HEX are set in Flags, then ASSERT().
-
- If Buffer is NULL, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- string.
- @param Flags The bitmask of flags that specify left justification, zero pad,
- and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of characters to place in Buffer, not including
- the Null-terminator.
- @param Increment Character increment in Buffer.
-
- @return The number of characters in Buffer not including the Null-terminator.
-
-**/
-UINTN
-BasePrintLibConvertValueToString (
- IN OUT CHAR8 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width,
- IN UINTN Increment
- )
-{
- CHAR8 *OriginalBuffer;
- CHAR8 *EndBuffer;
- CHAR8 ValueBuffer[MAXIMUM_VALUE_CHARACTERS];
- UINTN Count;
- UINTN Digits;
- UINTN Index;
- UINTN Radix;
-
- ASSERT (Buffer != NULL);
- ASSERT (Width < MAXIMUM_VALUE_CHARACTERS);
- //
- // Make sure Flags can only contain supported bits.
- //
- ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO | RADIX_HEX)) == 0);
-
- //
- // If both COMMA_TYPE and RADIX_HEX are set, then ASSERT ()
- //
- ASSERT (((Flags & COMMA_TYPE) != 0 && (Flags & RADIX_HEX) != 0) == FALSE);
-
- OriginalBuffer = Buffer;
-
- if (Width == 0 || (Flags & COMMA_TYPE) != 0) {
- Flags &= (~PREFIX_ZERO);
- }
-
- if (Width == 0) {
- Width = MAXIMUM_VALUE_CHARACTERS - 1;
- }
- //
- // Set the tag for the end of the input Buffer.
- //
- EndBuffer = Buffer + Width * Increment;
-
- if ((Value < 0) && ((Flags & RADIX_HEX) == 0)) {
- Value = -Value;
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, '-', Increment);
- Width--;
- }
-
- Radix = ((Flags & RADIX_HEX) == 0)? 10 : 16;
- Count = BasePrintLibValueToString (ValueBuffer, Value, Radix);
-
- if ((Flags & PREFIX_ZERO) != 0) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Count, '0', Increment);
- }
-
- Digits = Count % 3;
- if (Digits != 0) {
- Digits = 3 - Digits;
- }
- for (Index = 0; Index < Count; Index++) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ValueBuffer[Count - Index], Increment);
- if ((Flags & COMMA_TYPE) != 0) {
- Digits++;
- if (Digits == 3) {
- Digits = 0;
- if ((Index + 1) < Count) {
- Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', Increment);
- }
- }
- }
- }
-
- BasePrintLibFillBuffer (Buffer, EndBuffer + Increment, 1, 0, Increment);
-
- return ((Buffer - OriginalBuffer) / Increment);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.h
deleted file mode 100644
index 38f9211f35..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePrintLib/PrintLibInternal.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PrintLibInternal.h
-
-Abstract:
-
- Print Library.
-
---*/
-
-#ifndef __PRINT_LIB_INTERNAL_H__
-#define __PRINT_LIB_INTERNAL_H__
-
-#include "EdkIIGlueBase.h"
-
-//
-// Print primitives
-//
-//#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-//#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-//#define PREFIX_ZERO 0x20
-#define OUTPUT_UNICODE 0x40
-//#define RADIX_HEX 0x80
-#define FORMAT_UNICODE 0x100
-#define PAD_TO_WIDTH 0x200
-#define ARGUMENT_UNICODE 0x400
-#define PRECISION 0x800
-#define ARGUMENT_REVERSED 0x1000
-
-//
-// Record date and time information
-//
-typedef struct {
- UINT16 Year;
- UINT8 Month;
- UINT8 Day;
- UINT8 Hour;
- UINT8 Minute;
- UINT8 Second;
- UINT8 Pad1;
- UINT32 Nanosecond;
- INT16 TimeZone;
- UINT8 Daylight;
- UINT8 Pad2;
-} TIME;
-
-/**
- Worker function that produces a Null-terminated string in an output buffer
- based on a Null-terminated format string and a VA_LIST argument list.
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine.
-
- @param Buffer Character buffer to print the results of the parsing
- of Format into.
- @param BufferSize Maximum number of characters to put into buffer.
- @param Flags Intial flags value.
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.
- @param Format Null-terminated format string.
- @param Marker Vararg list consumed by processing Format.
-
- @return Number of characters printed not including the Null-terminator.
-
-**/
-UINTN
-BasePrintLibVSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN CONST CHAR8 *Format,
- IN VA_LIST Marker
- );
-
-/**
- Worker function that produces a Null-terminated string in an output buffer
- based on a Null-terminated format string and variable argument list.
-
- VSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
- @param Buffer Character buffer to print the results of the parsing
- of Format into.
- @param BufferSize Maximum number of characters to put into buffer.
- Zero means no limit.
- @param Flags Intial flags value.
- Can only have FORMAT_UNICODE and OUTPUT_UNICODE set
- @param FormatString Null-terminated format string.
-
- @return Number of characters printed.
-
-**/
-UINTN
-BasePrintLibSPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN UINTN Flags,
- IN CONST CHAR8 *FormatString,
- ...
- );
-
-/**
- Internal function that places the character into the Buffer.
-
- Internal function that places ASCII or Unicode character into the Buffer.
-
- @param Buffer Buffer to place the Unicode or ASCII string.
- @param EndBuffer The end of the input Buffer. No characters will be
- placed after that.
- @param Length Count of character to be placed into Buffer.
- @param Character Character to be placed into Buffer.
- @param Increment Character increment in Buffer.
-
- @return Number of characters printed.
-
-**/
-CHAR8 *
-BasePrintLibFillBuffer (
- CHAR8 *Buffer,
- CHAR8 *EndBuffer,
- INTN Length,
- UINTN Character,
- INTN Increment
- );
-
-/**
- Internal function that convert a decimal number to a string in Buffer.
-
- Print worker function that convert a decimal number to a string in Buffer.
-
- @param Buffer Location to place the Unicode or ASCII string of Value.
- @param Value Value to convert to a Decimal or Hexidecimal string in Buffer.
- @param Radix Radix of the value
-
- @return Number of characters printed.
-
-**/
-UINTN
-EFIAPI
-BasePrintLibValueToString (
- IN OUT CHAR8 *Buffer,
- IN INT64 Value,
- IN UINTN Radix
- );
-
-/**
- Internal function that converts a decimal value to a Null-terminated string.
-
- Converts the decimal number specified by Value to a Null-terminated
- string specified by Buffer containing at most Width characters.
- If Width is 0 then a width of MAXIMUM_VALUE_CHARACTERS is assumed.
- The total number of characters placed in Buffer is returned.
- If the conversion contains more than Width characters, then only the first
- Width characters are returned, and the total number of characters
- required to perform the conversion is returned.
- Additional conversion parameters are specified in Flags.
- The Flags bit LEFT_JUSTIFY is always ignored.
- All conversions are left justified in Buffer.
- If Width is 0, PREFIX_ZERO is ignored in Flags.
- If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas
- are inserted every 3rd digit starting from the right.
- If Value is < 0, then the fist character in Buffer is a '-'.
- If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored,
- then Buffer is padded with '0' characters so the combination of the optional '-'
- sign character, '0' characters, digit characters for Value, and the Null-terminator
- add up to Width characters.
-
- If Buffer is NULL, then ASSERT().
- If unsupported bits are set in Flags, then ASSERT().
- If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
-
- @param Buffer Pointer to the output buffer for the produced Null-terminated
- string.
- @param Flags The bitmask of flags that specify left justification, zero pad,
- and commas.
- @param Value The 64-bit signed value to convert to a string.
- @param Width The maximum number of characters to place in Buffer, not including
- the Null-terminator.
- @param Increment Character increment in Buffer.
-
- @return Total number of characters required to perform the conversion.
-
-**/
-UINTN
-BasePrintLibConvertValueToString (
- IN OUT CHAR8 *Buffer,
- IN UINTN Flags,
- IN INT64 Value,
- IN UINTN Width,
- IN UINTN Increment
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/BaseTimerLibLocalApic.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/BaseTimerLibLocalApic.inf
deleted file mode 100644
index 526fe058fb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/BaseTimerLibLocalApic.inf
+++ /dev/null
@@ -1,85 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseTimerLibLocalApic.inf
-#
-# Abstract:
-#
-# Component description file for BaseTimerLibLocalApic.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseTimerLibLocalApic
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-[sources.ia32]
- X86TimerLib.c
- Ia32/X86LocalApicTimerInitialize.asm
-
-[sources.x64]
- X86TimerLib.c
- X64/X86LocalApicTimerInitialize.asm
-
-[sources.ipf]
- Ipf/IpfTimerLib.c
-
-[sources.ebc]
- Ebc/EbcTimerLib.c
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.x64]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.ebc]
- EdkIIGlueDxeIoLibCpuIo
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ebc/EbcTimerLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ebc/EbcTimerLib.c
deleted file mode 100644
index fb61915fdd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ebc/EbcTimerLib.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EbcTimerLib.c
-
-Abstract:
-
- Timer Library functions built upon local APIC on IA32/x64.
-
- @bug Should use PCD to retrieve all the constants including index of
- the IA32_APIC_BASE MSR, the offsets of InitialCount, CorrentCount
- and DivideConfiguration.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-/**
- 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 MicroSeconds
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- )
-{
- //
- // EBC architecture does not support local APIC timer.
- //
- ASSERT (FALSE);
- 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 NanoSeconds
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- )
-{
- //
- // EBC architecture does not support local APIC timer.
- //
- ASSERT (FALSE);
- return NanoSeconds;
-}
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- 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
- )
-{
- //
- // EBC architecture does not support local APIC timer.
- //
- ASSERT (FALSE);
- return 0;
-}
-
-/**
- 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
- )
-{
- //
- // EBC architecture does not support local APIC timer.
- //
- ASSERT (FALSE);
- return 0;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ia32/X86LocalApicTimerInitialize.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ia32/X86LocalApicTimerInitialize.asm
deleted file mode 100644
index 918f99abd9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ia32/X86LocalApicTimerInitialize.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-; 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.
-;
-; Module Name:
-;
-; x86LocalApicTimerInitialize.Asm
-;
-; Abstract:
-;
-; Initialize Local Apic Timer
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .386
- .model flat,C
- .code
-
-InternalX86GetApicBase PROTO C
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuInitLocalApicTimer (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuInitLocalApicTimer PROC
- call InternalX86GetApicBase
- mov dword ptr ds:[eax + 3e0h], 0ah
- bts dword ptr ds:[eax + 320h], 17
- mov dword ptr ds:[eax + 380h], -1
- ret
-CpuInitLocalApicTimer ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ipf/IpfTimerLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ipf/IpfTimerLib.c
deleted file mode 100644
index a68439eef3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/Ipf/IpfTimerLib.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IpfTimerLib.c
-
-Abstract:
-
- Timer Library functions built upon local APIC on IA32/x64.
-
- @bug Should use PCD to retrieve all the constants including index of
- the IA32_APIC_BASE MSR, the offsets of InitialCount, CorrentCount
- and DivideConfiguration.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-
-/**
- Performs a delay measured as number of ticks.
-
- An internal function to perform a delay measured as number of ticks. It's
- invoked by MicroSecondDelay() and NanoSecondDelay().
-
- @param Delay Number of ticks to delay.
-
-**/
-STATIC
-VOID
-InternalIpfDelay (
- IN INT64 Delay
- )
-{
- INT64 Ticks;
-
- //
- // The target timer count is calculated here
- //
- Ticks = (INT64)AsmReadItc () + Delay;
-
- //
- // Wait until time out
- // Delay > 2^63 could not be handled by this function
- // Timer wrap-arounds are handled correctly by this function
- //
- while (Ticks - (INT64)AsmReadItc() >= 0);
-}
-
-/**
- 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 MicroSeconds
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- )
-{
- InternalIpfDelay (
- GetPerformanceCounterProperties (NULL, NULL) *
- MicroSeconds /
- 1000000
- );
- 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 NanoSeconds
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- )
-{
- InternalIpfDelay (
- GetPerformanceCounterProperties (NULL, NULL) *
- NanoSeconds /
- 1000000000
- );
- return NanoSeconds;
-}
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- 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
- )
-{
- return AsmReadItc ();
-}
-
-/**
- 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
- )
-{
- PAL_CALL_RETURN PalRet;
- UINT64 BaseFrequence;
-
- PalRet = PalCallStatic (NULL, 13, 0, 0, 0);
- ASSERT (PalRet.Status == 0);
- BaseFrequence = PalRet.r9;
-
- PalRet = PalCallStatic (NULL, 14, 0, 0, 0);
- ASSERT (PalRet.Status == 0);
-
- if (StartValue != NULL) {
- *StartValue = 0;
- }
-
- if (EndValue != NULL) {
- *EndValue = (UINT64)(-1);
- }
-
- return BaseFrequence * (PalRet.r11 >> 32) / (UINT32)PalRet.r11;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X64/X86LocalApicTimerInitialize.asm b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X64/X86LocalApicTimerInitialize.asm
deleted file mode 100644
index b5e47e52c2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X64/X86LocalApicTimerInitialize.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-; 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.
-;
-; Module Name:
-;
-; x86LocalApicTimerInitialize.Asm
-;
-; Abstract:
-;
-; Initialize Local Apic Timer
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-EXTERNDEF InternalX86GetApicBase:PROC
-
-;------------------------------------------------------------------------------
-; VOID
-; EFIAPI
-; CpuInitLocalApicTimer (
-; VOID
-; );
-;------------------------------------------------------------------------------
-CpuInitLocalApicTimer PROC
- sub rsp, 28h ;Reserve home addresses and make RSP 16-byte aligned
- call InternalX86GetApicBase
- add rsp, 28h
- mov dword ptr [rax + 3e0h], 0ah
- bts dword ptr [rax + 320h], 17
- mov dword ptr [rax + 380h], -1
- ret
-CpuInitLocalApicTimer ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X86TimerLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X86TimerLib.c
deleted file mode 100644
index 1f54fbfd02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseTimerLibLocalApic/X86TimerLib.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- x86TimerLib.c
-
-Abstract:
-
- Timer Library functions built upon local APIC on IA32/x64.
-
- @bug Should use PCD to retrieve all the constants including index of
- the IA32_APIC_BASE MSR, the offsets of InitialCount, CorrentCount
- and DivideConfiguration.
-
---*/
-
-#include "EdkIIGlueBase.h"
-
-//
-// The following array is used in calculating the frequency of local APIC
-// timer. Refer to IA-32 developers' manual for more details.
-//
-GLOBAL_REMOVE_IF_UNREFERENCED
-CONST UINT8 mTimerLibLocalApicDivisor[] = {
- 0x02, 0x04, 0x08, 0x10,
- 0x02, 0x04, 0x08, 0x10,
- 0x20, 0x40, 0x80, 0x01,
- 0x20, 0x40, 0x80, 0x01
-};
-
-VOID
-CpuInitLocalApicTimer (
- VOID
- );
-
-/**
- Local Apic Timer Initialize
- Local Apic Timer needs to be initialized before being used
- **/
-EFI_STATUS
-EFIAPI
-BaseTimerLibLocalApicInit (
- VOID
- )
-{
- CpuInitLocalApicTimer();
-
- return EFI_SUCCESS;
-}
-
-/**
- Internal function to retrieve the base address of local APIC.
-
- Internal function to retrieve the base address of local APIC.
-
- @return The base address of local APIC
-
-**/
-UINTN
-InternalX86GetApicBase (
- VOID
- )
-{
- return (UINTN)AsmMsrBitFieldRead64 (27, 12, 35) << 12;
-}
-
-/**
- Internal function to return the frequency of the local APIC timer.
-
- Internal function to return the frequency of the local APIC timer.
-
- @param ApicBase The base address of memory mapped registers of local APIC.
-
- @return The frequency of the timer in Hz.
-
-**/
-STATIC
-UINT32
-InternalX86GetTimerFrequency (
- IN UINTN ApicBase
- )
-{
- return
- PcdGet32(PcdFSBClock) /
- mTimerLibLocalApicDivisor[MmioBitFieldRead32 (ApicBase + 0x3e0, 0, 3)];
-}
-
-/**
- Internal function to read the current tick counter of local APIC.
-
- Internal function to read the current tick counter of local APIC.
-
- @param ApicBase The base address of memory mapped registers of local APIC.
-
- @return The tick counter read.
-
-**/
-STATIC
-INT32
-InternalX86GetTimerTick (
- IN UINTN ApicBase
- )
-{
- return MmioRead32 (ApicBase + 0x390);
-}
-
-/**
- Stalls the CPU for at least the given number of ticks.
-
- Stalls the CPU for at least the given number of ticks. It's invoked by
- MicroSecondDelay() and NanoSecondDelay().
-
- @param ApicBase The base address of memory mapped registers of local APIC.
- @param Delay A period of time to delay in ticks.
-
-**/
-STATIC
-VOID
-InternalX86Delay (
- IN UINTN ApicBase,
- IN UINT32 Delay
- )
-{
- INT32 Ticks;
-
- //
- // The target timer count is calculated here
- //
- Ticks = InternalX86GetTimerTick (ApicBase) - Delay;
-
- //
- // Wait until time out
- // Delay > 2^31 could not be handled by this function
- // Timer wrap-arounds are handled correctly by this function
- //
- while (InternalX86GetTimerTick (ApicBase) - Ticks >= 0);
-}
-
-/**
- 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 MicroSeconds
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- )
-{
- UINTN ApicBase;
-
- ApicBase = InternalX86GetApicBase ();
- InternalX86Delay (
- ApicBase,
- (UINT32)DivU64x32 (
- MultU64x64 (
- InternalX86GetTimerFrequency (ApicBase),
- MicroSeconds
- ),
- 1000000u
- )
- );
- 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 NanoSeconds
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- )
-{
- UINTN ApicBase;
-
- ApicBase = InternalX86GetApicBase ();
- InternalX86Delay (
- ApicBase,
- (UINT32)DivU64x32 (
- MultU64x64 (
- InternalX86GetTimerFrequency (ApicBase),
- NanoSeconds
- ),
- 1000000000u
- )
- );
- return NanoSeconds;
-}
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- 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
- )
-{
- return (UINT64)(UINT32)InternalX86GetTimerTick (InternalX86GetApicBase ());
-}
-
-/**
- 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
- )
-{
- UINTN ApicBase;
-
- ApicBase = InternalX86GetApicBase ();
-
- if (StartValue != NULL) {
- *StartValue = MmioRead32 (ApicBase + 0x380);
- }
-
- if (EndValue != NULL) {
- *EndValue = 0;
- }
-
- return (UINT64) InternalX86GetTimerFrequency (ApicBase);;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
deleted file mode 100644
index a57b0b9e37..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- BaseUefiDecompressLib.c
-
-Abstract:
-
- UEFI Decompress Library.
-
---*/
-
-#include "BaseUefiDecompressLibInternals.h"
-
-/**
- Read NumOfBit of bits from source into mBitBuf
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
- @param Sd The global scratch data
- @param NumOfBits The number of bits to shift and read.
-
-**/
-VOID
-GlueFillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-{
- //
- // Left shift NumOfBits of bits in advance
- //
- Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
-
- //
- // Copy data needed in bytes into mSbuBitBuf
- //
- while (NumOfBits > Sd->mBitCount) {
-
- Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
-
- if (Sd->mCompSize > 0) {
- //
- // Get 1 byte into SubBitBuf
- //
- Sd->mCompSize--;
- Sd->mSubBitBuf = Sd->mSrcBase[Sd->mInBuf++];
- Sd->mBitCount = 8;
-
- } else {
- //
- // No more bits from the source, just pad zero bit.
- //
- Sd->mSubBitBuf = 0;
- Sd->mBitCount = 8;
-
- }
- }
-
- //
- // Caculate additional bit count read to update mBitCount
- //
- Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);
-
- //
- // Copy NumOfBits of bits from mSubBitBuf into mBitBuf
- //
- Sd->mBitBuf |= Sd->mSubBitBuf >> Sd->mBitCount;
-}
-
-/**
- Get NumOfBits of bits out from mBitBuf
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
- @param Sd The global scratch data.
- @param NumOfBits The number of bits to pop and read.
-
- @return The bits that are popped out.
-
-**/
-UINT32
-GlueGetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-{
- UINT32 OutBits;
-
- //
- // Pop NumOfBits of Bits from Left
- //
- OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));
-
- //
- // Fill up mBitBuf from source
- //
- FillBuf (Sd, NumOfBits);
-
- return OutBits;
-}
-
-/**
- Creates Huffman Code mapping table according to code length array.
-
- Creates Huffman Code mapping table for Extra Set, Char&Len Set
- and Position Set according to code length array.
-
- @param Sd The global scratch data
- @param NumOfChar Number of symbols in the symbol set
- @param BitLen Code length array
- @param TableBits The width of the mapping table
- @param Table The table
-
- @retval 0 OK.
- @retval BAD_TABLE The table is corrupted.
-
-**/
-UINT16
-GlueMakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- )
-{
- UINT16 Count[17];
- UINT16 Weight[17];
- UINT16 Start[18];
- UINT16 *Pointer;
- UINT16 Index3;
- UINT16 Index;
- UINT16 Len;
- UINT16 Char;
- UINT16 JuBits;
- UINT16 Avail;
- UINT16 NextCode;
- UINT16 Mask;
- UINT16 WordOfStart;
- UINT16 WordOfCount;
-
- //
- // TableBits should not be greater than 16.
- //
- if (TableBits >= (sizeof (Count)/sizeof (UINT16))) {
- return (UINT16) BAD_TABLE;
- }
-
- //
- // Initialize Count array starting from Index 0, as there is a possibility of Count array being uninitialized.
- //
- for (Index = 0; Index <= 16; Index++) {
- Count[Index] = 0;
- }
-
- for (Index = 0; Index < NumOfChar; Index++) {
- //
- // Count array index should not be greater than or equal to its size.
- //
- if (BitLen[Index] < (sizeof (Count)/sizeof (UINT16))) {
- Count[BitLen[Index]]++;
- } else {
- return (UINT16) BAD_TABLE;
- }
- }
-
- Start[0] = 0;
- Start[1] = 0;
-
- for (Index = 1; Index <= 16; Index++) {
- WordOfStart = Start[Index];
- WordOfCount = Count[Index];
- Start[Index + 1] = (UINT16) (WordOfStart + (WordOfCount << (16 - Index)));
- }
-
- if (Start[17] != 0) {
- /*(1U << 16)*/
- return (UINT16) BAD_TABLE;
- }
-
- JuBits = (UINT16) (16 - TableBits);
-
- for (Index = 1; Index <= TableBits; Index++) {
- Start[Index] >>= JuBits;
- Weight[Index] = (UINT16) (1U << (TableBits - Index));
- }
-
- while (Index <= 16) {
- Weight[Index] = (UINT16) (1U << (16 - Index));
- Index++;
- }
-
- Index = (UINT16) (Start[TableBits + 1] >> JuBits);
-
- if (Index != 0) {
- Index3 = (UINT16) (1U << TableBits);
- while (Index != Index3) {
- Table[Index++] = 0;
- }
- }
-
- Avail = NumOfChar;
- Mask = (UINT16) (1U << (15 - TableBits));
-
- for (Char = 0; Char < NumOfChar; Char++) {
-
- Len = BitLen[Char];
- if (Len == 0 || Len >= 17) {
- continue;
- }
-
- NextCode = (UINT16) (Start[Len] + Weight[Len]);
-
- if (Len <= TableBits) {
-
- for (Index = Start[Len]; Index < NextCode; Index++) {
- Table[Index] = Char;
- }
-
- } else {
-
- Index3 = Start[Len];
- Pointer = &Table[Index3 >> JuBits];
- Index = (UINT16) (Len - TableBits);
-
- while (Index != 0) {
- //
- // Avail should be lesser than size of mRight and mLeft to prevent buffer overflow.
- //
- if ((*Pointer == 0) && (Avail < sizeof (Sd->mRight)/sizeof (UINT16)) && (Avail < sizeof (Sd->mLeft)/sizeof (UINT16))) {
- Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;
- *Pointer = Avail++;
- }
-
- //
- // *Pointer should be lesser than size of mRight and mLeft to prevent buffer overflow.
- //
- if ((Index3 & Mask) && (*Pointer < (sizeof (Sd->mRight)/sizeof (UINT16)))) {
- Pointer = &Sd->mRight[*Pointer];
- } else if (*Pointer < (sizeof (Sd->mLeft)/sizeof (UINT16))) {
- Pointer = &Sd->mLeft[*Pointer];
- }
-
- Index3 <<= 1;
- Index--;
- }
-
- *Pointer = Char;
-
- }
-
- Start[Len] = NextCode;
- }
- //
- // Succeeds
- //
- return 0;
-}
-
-/**
- Decodes a position value.
-
- Get a position value according to Position Huffman Table.
-
- @param Sd the global scratch data
-
- @return The position value decoded.
-
-**/
-UINT32
-GlueDecodeP (
- IN SCRATCH_DATA *Sd
- )
-{
- UINT16 Val;
- UINT32 Mask;
- UINT32 Pos;
-
- Val = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
-
- if (Val >= MAXNP) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Sd->mBitBuf & Mask) {
- Val = Sd->mRight[Val];
- } else {
- Val = Sd->mLeft[Val];
- }
-
- Mask >>= 1;
- } while (Val >= MAXNP);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[Val]);
-
- Pos = Val;
- if (Val > 1) {
- Pos = (UINT32) ((1U << (Val - 1)) + GetBits (Sd, (UINT16) (Val - 1)));
- }
-
- return Pos;
-}
-
-/**
- Reads code lengths for the Extra Set or the Position Set.
-
- Read in the Extra Set or Pointion Set Length Arrary, then
- generate the Huffman code mapping for them.
-
- @param Sd The global scratch data.
- @param nn Number of symbols.
- @param nbit Number of bits needed to represent nn.
- @param Special The special symbol that needs to be taken care of.
-
- @retval 0 OK.
- @retval BAD_TABLE Table is corrupted.
-
-**/
-UINT16
-GlueReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- )
-{
- UINT16 Number;
- UINT16 CharC;
- volatile UINT16 Index;
- UINT32 Mask;
-
- //
- // Read Extra Set Code Length Array size
- //
- Number = (UINT16) GetBits (Sd, nbit);
-
- if ((Number > sizeof (Sd->mPTLen)) || (nn > sizeof (Sd->mPTLen))) {
- //
- // Fail if Number or nn is greater than size of mPTLen
- //
- return (UINT16) BAD_TABLE;
- }
-
- if (Number == 0) {
- //
- // This represents only Huffman code used
- //
- CharC = (UINT16) GetBits (Sd, nbit);
-
- for (Index = 0; Index < 256; Index++) {
- Sd->mPTTable[Index] = CharC;
- }
-
- for (Index = 0; Index < nn; Index++) {
- Sd->mPTLen[Index] = 0;
- }
-
- return 0;
- }
-
- Index = 0;
-
- while (Index < Number) {
-
- CharC = (UINT16) (Sd->mBitBuf >> (BITBUFSIZ - 3));
-
- //
- // If a code length is less than 7, then it is encoded as a 3-bit
- // value. Or it is encoded as a series of "1"s followed by a
- // terminating "0". The number of "1"s = Code length - 4.
- //
- if (CharC == 7) {
- Mask = 1U << (BITBUFSIZ - 1 - 3);
- while (Mask & Sd->mBitBuf) {
- Mask >>= 1;
- CharC += 1;
- }
- }
-
- FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3));
-
- Sd->mPTLen[Index++] = (UINT8) CharC;
-
- //
- // For Code&Len Set,
- // After the third length of the code length concatenation,
- // a 2-bit value is used to indicated the number of consecutive
- // zero lengths after the third length.
- //
- if (Index == Special) {
- CharC = (UINT16) GetBits (Sd, 2);
- while ((INT16) (--CharC) >= 0) {
- if (Index >= sizeof (Sd->mPTLen)) {
- //
- // Fail if Index is greater than or equal to mPTLen
- //
- return (UINT16) BAD_TABLE;
- }
- Sd->mPTLen[Index++] = 0;
- }
- }
- }
-
- while (Index < nn) {
- Sd->mPTLen[Index++] = 0;
- }
-
- return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable);
-}
-
-/**
- Reads code lengths for Char&Len Set.
-
- Read in and decode the Char&Len Set Code Length Array, then
- generate the Huffman Code mapping table for the Char&Len Set.
-
- @param Sd the global scratch data
-
-**/
-VOID
-GlueReadCLen (
- SCRATCH_DATA *Sd
- )
-{
- UINT16 Number;
- UINT16 CharC;
- volatile UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, CBIT);
-
- if (Number == 0) {
- //
- // This represents only Huffman code used
- //
- CharC = (UINT16) GetBits (Sd, CBIT);
-
- for (Index = 0; Index < NC; Index++) {
- Sd->mCLen[Index] = 0;
- }
-
- for (Index = 0; Index < 4096; Index++) {
- Sd->mCTable[Index] = CharC;
- }
-
- return ;
- }
-
- Index = 0;
- while (Index < Number) {
- CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
- if (CharC >= NT) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Mask & Sd->mBitBuf) {
- CharC = Sd->mRight[CharC];
- } else {
- CharC = Sd->mLeft[CharC];
- }
-
- Mask >>= 1;
-
- } while (CharC >= NT);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[CharC]);
-
- if (CharC <= 2) {
-
- if (CharC == 0) {
- CharC = 1;
- } else if (CharC == 1) {
- CharC = (UINT16) (GetBits (Sd, 4) + 3);
- } else if (CharC == 2) {
- CharC = (UINT16) (GetBits (Sd, CBIT) + 20);
- }
-
- while ((INT16) (--CharC) >= 0) {
- Sd->mCLen[Index++] = 0;
- }
-
- } else {
-
- Sd->mCLen[Index++] = (UINT8) (CharC - 2);
-
- }
- }
-
- while (Index < NC) {
- Sd->mCLen[Index++] = 0;
- }
-
- MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
-
- return ;
-}
-
-/**
- Decode a character/length value.
-
- Read one value from mBitBuf, Get one code from mBitBuf. If it is at block boundary, generates
- Huffman code mapping table for Extra Set, Code&Len Set and
- Position Set.
-
- @param Sd The global scratch data.
-
- @return The value decoded.
-
-**/
-UINT16
-GlueDecodeC (
- SCRATCH_DATA *Sd
- )
-{
- UINT16 Index2;
- UINT32 Mask;
-
- if (Sd->mBlockSize == 0) {
- //
- // Starting a new block
- // Read BlockSize from block header
- //
- Sd->mBlockSize = (UINT16) GetBits (Sd, 16);
-
- //
- // Read in the Extra Set Code Length Arrary,
- // Generate the Huffman code mapping table for Extra Set.
- //
- Sd->mBadTableFlag = ReadPTLen (Sd, NT, TBIT, 3);
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
-
- //
- // Read in and decode the Char&Len Set Code Length Arrary,
- // Generate the Huffman code mapping table for Char&Len Set.
- //
- ReadCLen (Sd);
-
- //
- // Read in the Position Set Code Length Arrary,
- // Generate the Huffman code mapping table for the Position Set.
- //
- Sd->mBadTableFlag = ReadPTLen (Sd, MAXNP, Sd->mPBit, (UINT16) (-1));
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
- }
-
- //
- // Get one code according to Code&Set Huffman Table
- //
- Sd->mBlockSize--;
- Index2 = Sd->mCTable[Sd->mBitBuf >> (BITBUFSIZ - 12)];
-
- if (Index2 >= NC) {
- Mask = 1U << (BITBUFSIZ - 1 - 12);
-
- do {
- if (Sd->mBitBuf & Mask) {
- Index2 = Sd->mRight[Index2];
- } else {
- Index2 = Sd->mLeft[Index2];
- }
-
- Mask >>= 1;
- } while (Index2 >= NC);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mCLen[Index2]);
-
- return Index2;
-}
-
-/**
- Decode the source data and put the resulting data into the destination buffer.
-
- Decode the source data and put the resulting data into the destination buffer.
-
- @param Sd The global scratch data
-
-**/
-VOID
-GlueDecode (
- SCRATCH_DATA *Sd
- )
-{
- UINT16 BytesRemain;
- UINT32 DataIdx;
- UINT16 CharC;
-
- BytesRemain = (UINT16) (-1);
-
- DataIdx = 0;
-
- for (;;) {
- //
- // Get one code from mBitBuf
- //
- CharC = DecodeC (Sd);
- if (Sd->mBadTableFlag != 0) {
- goto Done;
- }
-
- if (CharC < 256) {
- //
- // Process an Original character
- //
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- goto Done;
- } else {
- //
- // Write orignal character into mDstBase
- //
- Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;
- }
-
- } else {
- //
- // Process a Pointer
- //
- CharC = (UINT16) (CharC - (UINT8_MAX + 1 - THRESHOLD));
-
- //
- // Get string length
- //
- BytesRemain = CharC;
-
- //
- // Locate string position
- //
- DataIdx = Sd->mOutBuf - DecodeP (Sd) - 1;
-
- //
- // Write BytesRemain of bytes into mDstBase
- //
- BytesRemain--;
- while ((INT16) (BytesRemain) >= 0) {
- Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- goto Done;
- }
-
- BytesRemain--;
- }
- }
- }
-
-Done:
- return ;
-}
-
-/**
- Retrieves the size of the uncompressed buffer and the size of the scratch buffer.
-
- Retrieves the size of the uncompressed buffer and the temporary scratch buffer
- required to decompress the buffer specified by Source and SourceSize.
- If the size of the uncompressed buffer or the size of the scratch buffer cannot
- be determined from the compressed data specified by Source and SourceData,
- then RETURN_INVALID_PARAMETER is returned. Otherwise, the size of the uncompressed
- buffer is returned in DestinationSize, the size of the scratch buffer is returned
- in ScratchSize, and RETURN_SUCCESS is returned.
- This function does not have scratch buffer available to perform a thorough
- checking of the validity of the source data. It just retrieves the "Original Size"
- field from the beginning bytes of the source data and output it as DestinationSize.
- And ScratchSize is specific to the decompression implementation.
-
- If Source is NULL, then ASSERT().
- If DestinationSize is NULL, then ASSERT().
- If ScratchSize is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param SourceSize The size, in bytes, of the source buffer.
- @param DestinationSize A pointer to the size, in bytes, of the uncompressed buffer
- that will be generated when the compressed buffer specified
- by Source and SourceSize is decompressed..
- @param ScratchSize A pointer to the size, in bytes, of the scratch buffer that
- is required to decompress the compressed buffer specified
- by Source and SourceSize.
-
- @retval RETURN_SUCCESS The size of destination buffer and the size of scratch
- buffer are successull retrieved.
- @retval RETURN_INVALID_PARAMETER The source data is corrupted
-
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompressGetInfo (
- IN CONST VOID *Source,
- IN UINT32 SourceSize,
- OUT UINT32 *DestinationSize,
- OUT UINT32 *ScratchSize
- )
-{
- UINT32 CompressedSize;
-
- ASSERT (Source != NULL);
- ASSERT (DestinationSize != NULL);
- ASSERT (ScratchSize != NULL);
-
- *ScratchSize = sizeof (SCRATCH_DATA);
-
- if (SourceSize < 8) {
- return RETURN_INVALID_PARAMETER;
- }
-
- CopyMem (&CompressedSize, Source, sizeof (UINT32));
- CopyMem (DestinationSize, (VOID *)((UINT8 *)Source + 4), sizeof (UINT32));
-
- if (SourceSize < (CompressedSize + 8)) {
- return RETURN_INVALID_PARAMETER;
- }
-
- return RETURN_SUCCESS;
-}
-
-/**
- Decompresses a compressed source buffer.
-
- This function is designed so that the decompression algorithm can be implemented
- without using any memory services. As a result, this function is not allowed to
- call any memory allocation services in its implementation. It is the caller's r
- esponsibility to allocate and free the Destination and Scratch buffers.
- If the compressed source data specified by Source is sucessfully decompressed
- into Destination, then RETURN_SUCCESS is returned. If the compressed source data
- specified by Source is not in a valid compressed data format,
- then RETURN_INVALID_PARAMETER is returned.
-
- If Source is NULL, then ASSERT().
- If Destination is NULL, then ASSERT().
- If the required scratch buffer size > 0 and Scratch is NULL, then ASSERT().
-
- @param Source The source buffer containing the compressed data.
- @param Destination The destination buffer to store the decompressed data
- @param Scratch A temporary scratch buffer that is used to perform the decompression.
- This is an optional parameter that may be NULL if the
- required scratch buffer size is 0.
-
- @retval RETURN_SUCCESS Decompression is successfull
- @retval RETURN_INVALID_PARAMETER The source data is corrupted
-
-**/
-RETURN_STATUS
-EFIAPI
-UefiDecompress (
- IN CONST VOID *Source,
- IN OUT VOID *Destination,
- IN OUT VOID *Scratch
- )
-{
- volatile UINT32 Index;
- UINT32 CompSize;
- UINT32 OrigSize;
- SCRATCH_DATA *Sd;
- CONST UINT8 *Src;
- UINT8 *Dst;
-
- ASSERT (Source != NULL);
- ASSERT (Destination != NULL);
- ASSERT (Scratch != NULL);
-
- Src = Source;
- Dst = Destination;
-
- Sd = (SCRATCH_DATA *) Scratch;
-
- CompSize = Src[0] + (Src[1] << 8) + (Src[2] << 16) + (Src[3] << 24);
- OrigSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
-
- //
- // If compressed file size is 0, return
- //
- if (OrigSize == 0) {
- return RETURN_SUCCESS;
- }
-
- Src = Src + 8;
-
- for (Index = 0; Index < sizeof (SCRATCH_DATA); Index++) {
- ((UINT8 *) Sd)[Index] = 0;
- }
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm(Version 1), mPBit = 4
- // For Tiano de/compression algorithm(Version 2), mPBit = 5
- //
- Sd->mPBit = 4;
- Sd->mSrcBase = (UINT8 *)Src;
- Sd->mDstBase = Dst;
- //
- // CompSize and OrigSize are caculated in bytes
- //
- Sd->mCompSize = CompSize;
- Sd->mOrigSize = OrigSize;
-
- //
- // Fill the first BITBUFSIZ bits
- //
- FillBuf (Sd, BITBUFSIZ);
-
- //
- // Decompress it
- //
- Decode (Sd);
-
- if (Sd->mBadTableFlag != 0) {
- //
- // Something wrong with the source
- //
- return RETURN_INVALID_PARAMETER;
- }
-
- return RETURN_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
deleted file mode 100644
index a135ae61b1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
+++ /dev/null
@@ -1,78 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# BaseUefiDecompressLib.inf
-#
-# Abstract:
-#
-# Component description file for BaseUefiDecompressLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueBaseUefiDecompressLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- BaseUefiDecompressLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLibInternals.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLibInternals.h
deleted file mode 100644
index eb7f20b9bc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseUefiDecompressLib/BaseUefiDecompressLibInternals.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- BaseUefiDecompressLibInternals.h
-
-Abstract:
-
- Header file for Base Uefi Decompress Library.
-
---*/
-
-#ifndef __BASE_UEFI_DECOMPRESS_LIB_INTERNALS_H__
-#define __BASE_UEFI_DECOMPRESS_LIB_INTERNALS_H__
-
-#include "EdkIIGlueBase.h"
-
-//
-// Decompression algorithm begins here
-//
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#define BAD_TABLE - 1
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; ///< Starting address of compressed data
- UINT8 *mDstBase; ///< Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-
- ///
- /// The length of the field 'Position Set Code Length Array Size' in Block Header.
- /// For EFI 1.1 de/compression algorithm, mPBit = 4
- /// For Tiano de/compression algorithm, mPBit = 5
- ///
- UINT8 mPBit;
-} SCRATCH_DATA;
-
-/**
- Read NumOfBit of bits from source into mBitBuf
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
- @param Sd The global scratch data
- @param NumOfBits The number of bits to shift and read.
-
-**/
-VOID
-GlueFillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- );
-
-/**
- Get NumOfBits of bits out from mBitBuf
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
- @param Sd The global scratch data.
- @param NumOfBits The number of bits to pop and read.
-
- @return The bits that are popped out.
-
-**/
-UINT32
-GlueGetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- );
-
-/**
- Creates Huffman Code mapping table according to code length array.
-
- Creates Huffman Code mapping table for Extra Set, Char&Len Set
- and Position Set according to code length array.
-
- @param Sd The global scratch data
- @param NumOfChar Number of symbols in the symbol set
- @param BitLen Code length array
- @param TableBits The width of the mapping table
- @param Table The table
-
- @retval 0 OK.
- @retval BAD_TABLE The table is corrupted.
-
-**/
-UINT16
-GlueMakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- );
-
-/**
- Decodes a position value.
-
- Get a position value according to Position Huffman Table.
-
- @param Sd the global scratch data
-
- @return The position value decoded.
-
-**/
-UINT32
-GlueDecodeP (
- IN SCRATCH_DATA *Sd
- );
-
-/**
- Reads code lengths for the Extra Set or the Position Set.
-
- Read in the Extra Set or Pointion Set Length Arrary, then
- generate the Huffman code mapping for them.
-
- @param Sd The global scratch data.
- @param nn Number of symbols.
- @param nbit Number of bits needed to represent nn.
- @param Special The special symbol that needs to be taken care of.
-
- @retval 0 OK.
- @retval BAD_TABLE Table is corrupted.
-
-**/
-UINT16
-GlueReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- );
-
-/**
- Reads code lengths for Char&Len Set.
-
- Read in and decode the Char&Len Set Code Length Array, then
- generate the Huffman Code mapping table for the Char&Len Set.
-
- @param Sd the global scratch data
-
-**/
-VOID
-GlueReadCLen (
- SCRATCH_DATA *Sd
- );
-
-/**
- Decode a character/length value.
-
- Read one value from mBitBuf, Get one code from mBitBuf. If it is at block boundary, generates
- Huffman code mapping table for Extra Set, Code&Len Set and
- Position Set.
-
- @param Sd The global scratch data.
-
- @return The value decoded.
-
-**/
-UINT16
-GlueDecodeC (
- SCRATCH_DATA *Sd
- );
-
-/**
- Decode the source data and put the resulting data into the destination buffer.
-
- Decode the source data and put the resulting data into the destination buffer.
-
- @param Sd The global scratch data
-
-**/
-VOID
-GlueDecode (
- SCRATCH_DATA *Sd
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/DxeHobLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/DxeHobLib.inf
deleted file mode 100644
index 9141bfcad3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/DxeHobLib.inf
+++ /dev/null
@@ -1,84 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# DxeHobLib.inf
-#
-# Abstract:
-#
-# Component description file for DxeHobLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeHobLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- HobLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiLib
-#
-# EDK Library, GUID needed: gEfiHobListGuid
-#
- EdkFrameworkGuidLib
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/HobLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/HobLib.c
deleted file mode 100644
index 01d1857d5a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeHobLib/HobLib.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- HobLib.c
-
-Abstract:
-
- HOB Library.
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-
-STATIC VOID *mHobList = NULL;
-
-/**
- The constructor function caches the pointer to HOB list.
-
- The constructor function gets the start address of HOB list from system configuration table.
- It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
-
- @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
-HobLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &mHobList);
- ASSERT_EFI_ERROR (Status);
- ASSERT (mHobList != NULL);
- return Status;
-}
-
-/**
- Returns the pointer to the HOB list.
-
- This function returns the pointer to first HOB in the list.
-
- @return The pointer to the HOB list.
-
-**/
-VOID *
-EFIAPI
-GetHobList (
- VOID
- )
-{
- return mHobList;
-}
-
-/**
- Returns the next instance of a HOB type from the starting HOB.
-
- This function searches the first instance of a HOB type from the starting HOB pointer.
- If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If HobStart is NULL, then ASSERT().
-
- @param Type The HOB type to return.
- @param HobStart The starting HOB pointer to search from.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetNextHob (
- IN UINT16 Type,
- IN CONST VOID *HobStart
- )
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- ASSERT (HobStart != NULL);
-
- Hob.Raw = (UINT8 *) HobStart;
- //
- // Parse the HOB list until end of list or matching type is found.
- //
- while (!END_OF_HOB_LIST (Hob)) {
- if (Hob.Header->HobType == Type) {
- return Hob.Raw;
- }
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
- return NULL;
-}
-
-/**
- Returns the first instance of a HOB type among the whole HOB list.
-
- This function searches the first instance of a HOB type among the whole HOB list.
- If there does not exist such HOB type in the HOB list, it will return NULL.
-
- @param Type The HOB type to return.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetFirstHob (
- IN UINT16 Type
- )
-{
- VOID *HobList;
-
- HobList = GetHobList ();
- return GetNextHob (Type, HobList);
-}
-
-/**
- This function searches the first instance of a HOB from the starting HOB pointer.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If Guid is NULL, then ASSERT().
- If HobStart is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
- @param HobStart A pointer to a Guid.
-
- @return The next instance of the matched GUID HOB from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GlueGetNextGuidHob (
- IN CONST EFI_GUID *Guid,
- IN CONST VOID *HobStart
- )
-{
- EFI_PEI_HOB_POINTERS GuidHob;
-
- GuidHob.Raw = (UINT8 *) HobStart;
- while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {
- if (CompareGuid (Guid, &GuidHob.Guid->Name)) {
- break;
- }
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
- return GuidHob.Raw;
-}
-
-/**
- This function searches the first instance of a HOB among the whole HOB list.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- If Guid is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
-
- @return The first instance of the matched GUID HOB among the whole HOB list.
-
-**/
-VOID *
-EFIAPI
-GlueGetFirstGuidHob (
- IN CONST EFI_GUID *Guid
- )
-{
- VOID *HobList;
-
- HobList = GetHobList ();
- return GetNextGuidHob (Guid, HobList);
-}
-
-/**
- Get the Boot Mode from the HOB list.
-
- This function returns the system boot mode information from the
- PHIT HOB in HOB list.
-
- @param VOID
-
- @return The Boot Mode.
-
-**/
-EFI_BOOT_MODE
-EFIAPI
-GetBootModeHob (
- VOID
- )
-{
- EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;
-
- HandOffHob = (EFI_HOB_HANDOFF_INFO_TABLE *) GetHobList ();
-
- return HandOffHob->BootMode;
-}
-
-/**
- Builds a HOB for a loaded PE32 module.
-
- This function builds a HOB for a loaded PE32 module.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If ModuleName is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ModuleName The GUID File Name of the module.
- @param MemoryAllocationModule The 64 bit physical address of the module.
- @param ModuleLength The length of the module in bytes.
- @param EntryPoint The 64 bit physical address of the module's entry point.
-
-**/
-VOID
-EFIAPI
-GlueBuildModuleHob (
- IN CONST EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a HOB that describes a chunk of system memory.
-
- This function builds a HOB that describes a chunk of system memory.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ResourceType The type of resource described by this HOB.
- @param ResourceAttribute The resource attributes of the memory described by this HOB.
- @param PhysicalStart The 64 bit physical address of memory described by this HOB.
- @param NumberOfBytes The length of the memory described by this HOB in bytes.
-
-**/
-VOID
-EFIAPI
-BuildResourceDescriptorHob (
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a GUID HOB with a certain data length.
-
- This function builds a customized HOB tagged with a GUID for identification
- and returns the start address of GUID HOB data so that caller can fill the customized data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidHob (
- IN CONST EFI_GUID *Guid,
- IN UINTN DataLength
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Copies a data buffer to a newly-built HOB.
-
- This function builds a customized HOB tagged with a GUID for identification,
- copies the input data to the HOB data field and returns the start address of the GUID HOB data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If Data is NULL and DataLength > 0, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param Data The data to be copied into the data field of the GUID HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidDataHob (
- IN CONST EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
- return NULL;
-}
-
-/**
- Builds a Firmware Volume HOB.
-
- This function builds a Firmware Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Firmware Volume.
- @param Length The size of the Firmware Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a Capsule Volume HOB.
-
- This function builds a Capsule Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Capsule Volume.
- @param Length The size of the Capsule Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildCvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a HOB for the CPU.
-
- This function builds a HOB for the CPU.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
- @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
-
-**/
-VOID
-EFIAPI
-BuildCpuHob (
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a HOB for the Stack.
-
- This function builds a HOB for the stack.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the Stack.
- @param Length The length of the stack in bytes.
-
-**/
-VOID
-EFIAPI
-BuildStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a HOB for the BSP store.
-
- This function builds a HOB for BSP store.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the BSP.
- @param Length The length of the BSP store in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-BuildBspStoreHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
-
-/**
- Builds a HOB for the memory allocation.
-
- This function builds a HOB for the memory allocation.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the memory.
- @param Length The length of the memory allocation in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-GlueBuildMemoryAllocationHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-{
- //
- // PEI HOB is read only for DXE phase
- //
- ASSERT (FALSE);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
deleted file mode 100644
index 881942bbb4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DxeCpuIoLibInternal.h
-
-Abstract:
-
- Internal header file for DxeIoLibCpuIo
-
---*/
-
-#ifndef __DXE_CPUIO_LIB_INTERNAL_H__
-#define __DXE_CPUIO_LIB_INTERNAL_H__
-
-#include "EdkIIGlueDxe.h"
-
-/**
- Reads registers in the EFI CPU I/O space.
-
- Reads the I/O port specified by Port with registers width specified by Width.
- The read value is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all I/O read and write operations are serialized.
-
- @param Port The base address of the I/O operation.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI CPU I/O space.
-
-**/
-UINT64
-EFIAPI
-IoReadWorker (
- IN UINTN Port,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width
- );
-
-/**
- Writes registers in the EFI CPU I/O space.
-
- Writes the I/O port specified by Port with registers width and value specified by Width
- and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all I/O read and write operations are serialized.
-
- @param Port The base address of the I/O operation.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
- @param Data The value to write to the I/O port.
-
- @return The paramter of Data.
-
-**/
-UINT64
-EFIAPI
-IoWriteWorker (
- IN UINTN Port,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Data
- );
-
-/**
- Reads memory-mapped registers in the EFI system memory space.
-
- Reads the MMIO registers specified by Address with registers width specified by Width.
- The read value is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all MMIO read and write operations are serialized.
-
- @param Address The MMIO register to read.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI system memory space.
-
-**/
-UINT64
-EFIAPI
-MmioReadWorker (
- IN UINTN Address,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width
- );
-
-/**
- Writes memory-mapped registers in the EFI system memory space.
-
- Writes the MMIO registers specified by Address with registers width and value specified by Width
- and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all MMIO read and write operations are serialized.
-
- @param Address The MMIO register to read.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI system memory space.
-
-**/
-UINT64
-EFIAPI
-MmioWriteWorker (
- IN UINTN Address,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Data
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf
deleted file mode 100644
index feb1de8742..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf
+++ /dev/null
@@ -1,80 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# DxeIoLibCpuIo.inf
-#
-# Abstract:
-#
-# Component description file for DxeIoLibCpuIo.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeIoLibCpuIo
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- IoLib.c
- IoHighLevel.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueUefiBootServicesTableLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoHighLevel.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoHighLevel.c
deleted file mode 100644
index c9c097461f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoHighLevel.c
+++ /dev/null
@@ -1,2271 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoHighLevel.c
-
-Abstract:
-
- High-level Io/Mmio functions.
-
---*/
-
-#include "DxeCpuIoLibInternal.h"
-
-/**
- Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoOr8 (
- IN UINTN Port,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back
- to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAnd8 (
- IN UINTN Port,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));
-}
-
-/**
- Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 8-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoAndThenOr8 (
- IN UINTN Port,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in an 8-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldRead8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (IoRead8 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldWrite8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return IoWrite8 (
- Port,
- BitFieldWrite8 (IoRead8 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 8-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldOr8 (IoRead8 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 8-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAnd8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAnd8 (IoRead8 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit port.
-
- Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 8-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoBitFieldAndThenOr8 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return IoWrite8 (
- Port,
- BitFieldAndThenOr8 (IoRead8 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoOr16 (
- IN UINTN Port,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back
- to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAnd16 (
- IN UINTN Port,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));
-}
-
-/**
- Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 16-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoAndThenOr16 (
- IN UINTN Port,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 16-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldRead16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (IoRead16 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldWrite16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return IoWrite16 (
- Port,
- BitFieldWrite16 (IoRead16 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 16-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldOr16 (IoRead16 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 16-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAnd16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAnd16 (IoRead16 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit port.
-
- Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 16-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoBitFieldAndThenOr16 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return IoWrite16 (
- Port,
- BitFieldAndThenOr16 (IoRead16 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoOr32 (
- IN UINTN Port,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) | OrData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back
- to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAnd32 (
- IN UINTN Port,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (Port, IoRead32 (Port) & AndData);
-}
-
-/**
- Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 32-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoAndThenOr32 (
- IN UINTN Port,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (Port, (IoRead32 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 32-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldRead32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (IoRead32 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldWrite32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return IoWrite32 (
- Port,
- BitFieldWrite32 (IoRead32 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 32-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldOr32 (IoRead32 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 32-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAnd32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAnd32 (IoRead32 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit port.
-
- Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 32-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoBitFieldAndThenOr32 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return IoWrite32 (
- Port,
- BitFieldAndThenOr32 (IoRead32 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoOr64 (
- IN UINTN Port,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) | OrData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back
- to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAnd64 (
- IN UINTN Port,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (Port, IoRead64 (Port) & AndData);
-}
-
-/**
- Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, performs a bitwise OR
- between the result of the AND operation and the value specified by OrData,
- and writes the result to the 64-bit I/O port specified by Port. The value
- written to the I/O port is returned. This function must guarantee that all
- I/O read and write operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoAndThenOr64 (
- IN UINTN Port,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of an I/O register.
-
- Reads the bit field in a 64-bit I/O register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldRead64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (IoRead64 (Port), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to an I/O register.
-
- Writes Value to the bit field of the I/O register. The bit field is specified
- by the StartBit and the EndBit. All other bits in the destination I/O
- register are preserved. The value written to the I/O port is returned. Extra
- left bits in Value are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldWrite64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return IoWrite64 (
- Port,
- BitFieldWrite64 (IoRead64 (Port), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR
- between the read result and the value specified by OrData, and writes the
- result to the 64-bit I/O port specified by Port. The value written to the I/O
- port is returned. This function must guarantee that all I/O read and write
- operations are serialized. Extra left bits in OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldOr64 (IoRead64 (Port), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the
- result back to the bit field in the 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND between
- the read result and the value specified by AndData, and writes the result to
- the 64-bit I/O port specified by Port. The value written to the I/O port is
- returned. This function must guarantee that all I/O read and write operations
- are serialized. Extra left bits in AndData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAnd64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAnd64 (IoRead64 (Port), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit port, performs a bitwise AND followed by a
- bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit port.
-
- Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed
- by a bitwise inclusive OR between the read result and the value specified by
- AndData, and writes the result to the 64-bit I/O port specified by Port. The
- value written to the I/O port is returned. This function must guarantee that
- all I/O read and write operations are serialized. Extra left bits in both
- AndData and OrData are stripped.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Port The I/O port to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with the read value from the I/O port.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoBitFieldAndThenOr64 (
- IN UINTN Port,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return IoWrite64 (
- Port,
- BitFieldAndThenOr64 (IoRead64 (Port), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioOr8 (
- IN UINTN Address,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAnd8 (
- IN UINTN Address,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));
-}
-
-/**
- Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 8-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioAndThenOr8 (
- IN UINTN Address,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in an 8-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldRead8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead8 (MmioRead8 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 8-bit register is returned.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldWrite8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 Value
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldWrite8 (MmioRead8 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 8-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldOr8 (MmioRead8 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 8-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAnd8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAnd8 (MmioRead8 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 8-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 7, then ASSERT().
- If EndBit is greater than 7, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..7.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..7.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioBitFieldAndThenOr8 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT8 AndData,
- IN UINT8 OrData
- )
-{
- return MmioWrite8 (
- Address,
- BitFieldAndThenOr8 (MmioRead8 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioOr16 (
- IN UINTN Address,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAnd16 (
- IN UINTN Address,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));
-}
-
-/**
- Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 16-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioAndThenOr16 (
- IN UINTN Address,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 16-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldRead16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead16 (MmioRead16 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 16-bit register is returned.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldWrite16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 Value
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldWrite16 (MmioRead16 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 16-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldOr16 (MmioRead16 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 16-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAnd16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAnd16 (MmioRead16 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 16-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 15, then ASSERT().
- If EndBit is greater than 15, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..15.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..15.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioBitFieldAndThenOr16 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT16 AndData,
- IN UINT16 OrData
- )
-{
- return MmioWrite16 (
- Address,
- BitFieldAndThenOr16 (MmioRead16 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioOr32 (
- IN UINTN Address,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) | OrData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAnd32 (
- IN UINTN Address,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (Address, MmioRead32 (Address) & AndData);
-}
-
-/**
- Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 32-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioAndThenOr32 (
- IN UINTN Address,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (Address, (MmioRead32 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 32-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldRead32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead32 (MmioRead32 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 32-bit register is returned.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldWrite32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 Value
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldWrite32 (MmioRead32 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 32-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldOr32 (MmioRead32 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 32-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAnd32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAnd32 (MmioRead32 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 32-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 31, then ASSERT().
- If EndBit is greater than 31, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..31.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..31.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioBitFieldAndThenOr32 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT32 AndData,
- IN UINT32 OrData
- )
-{
- return MmioWrite32 (
- Address,
- BitFieldAndThenOr32 (MmioRead32 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the
- result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param OrData The value to OR with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioOr64 (
- IN UINTN Address,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) | OrData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result
- back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAnd64 (
- IN UINTN Address,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (Address, MmioRead64 (Address) & AndData);
-}
-
-/**
- Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise
- inclusive OR, and writes the result back to the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, performs a
- bitwise OR between the result of the AND operation and the value specified by
- OrData, and writes the result to the 64-bit MMIO register specified by
- Address. The value written to the MMIO register is returned. This function
- must guarantee that all MMIO read and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
-
- @param Address The MMIO register to write.
- @param AndData The value to AND with the read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioAndThenOr64 (
- IN UINTN Address,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (Address, (MmioRead64 (Address) & AndData) | OrData);
-}
-
-/**
- Reads a bit field of a MMIO register.
-
- Reads the bit field in a 64-bit MMIO register. The bit field is specified by
- the StartBit and the EndBit. The value of the bit field is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to read.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldRead64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit
- )
-{
- return BitFieldRead64 (MmioRead64 (Address), StartBit, EndBit);
-}
-
-/**
- Writes a bit field to a MMIO register.
-
- Writes Value to the bit field of the MMIO register. The bit field is
- specified by the StartBit and the EndBit. All other bits in the destination
- MMIO register are preserved. The new value of the 64-bit register is returned.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param Value New value of the bit field.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldWrite64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 Value
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldWrite64 (MmioRead64 (Address), StartBit, EndBit, Value)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise
- inclusive OR between the read result and the value specified by OrData, and
- writes the result to the 64-bit MMIO register specified by Address. The value
- written to the MMIO register is returned. This function must guarantee that
- all MMIO read and write operations are serialized. Extra left bits in OrData
- are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param OrData The value to OR with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldOr64 (MmioRead64 (Address), StartBit, EndBit, OrData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and
- writes the result back to the bit field in the 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- between the read result and the value specified by AndData, and writes the
- result to the 64-bit MMIO register specified by Address. The value written to
- the MMIO register is returned. This function must guarantee that all MMIO
- read and write operations are serialized. Extra left bits in AndData are
- stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAnd64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAnd64 (MmioRead64 (Address), StartBit, EndBit, AndData)
- );
-}
-
-/**
- Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed
- by a bitwise inclusive OR, and writes the result back to the bit field in the
- 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address, performs a bitwise AND
- followed by a bitwise inclusive OR between the read result and the value
- specified by AndData, and writes the result to the 64-bit MMIO register
- specified by Address. The value written to the MMIO register is returned.
- This function must guarantee that all MMIO read and write operations are
- serialized. Extra left bits in both AndData and OrData are stripped.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
- If StartBit is greater than 63, then ASSERT().
- If EndBit is greater than 63, then ASSERT().
- If EndBit is less than StartBit, then ASSERT().
-
- @param Address MMIO register to write.
- @param StartBit The ordinal of the least significant bit in the bit field.
- Range 0..63.
- @param EndBit The ordinal of the most significant bit in the bit field.
- Range 0..63.
- @param AndData The value to AND with read value from the MMIO register.
- @param OrData The value to OR with the result of the AND operation.
-
- @return The value written back to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioBitFieldAndThenOr64 (
- IN UINTN Address,
- IN UINTN StartBit,
- IN UINTN EndBit,
- IN UINT64 AndData,
- IN UINT64 OrData
- )
-{
- return MmioWrite64 (
- Address,
- BitFieldAndThenOr64 (MmioRead64 (Address), StartBit, EndBit, AndData, OrData)
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoLib.c
deleted file mode 100644
index ce8d07b84b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeIoLibCpuIo/IoLib.c
+++ /dev/null
@@ -1,600 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- IoHighLevel.c
-
-Abstract:
-
- High-level Io/Mmio functions.
-
---*/
-
-#include "DxeCpuIoLibInternal.h"
-
-//
-// Globle varible to cache pointer to CpuIo protocol.
-//
-STATIC EFI_CPU_IO_PROTOCOL *mCpuIo = NULL;
-
-/**
- The constructor function caches the pointer to CpuIo protocol.
-
- The constructor function locates CpuIo protocol from protocol database.
- It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
-
- @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
-IoLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID**) &mCpuIo);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- Reads registers in the EFI CPU I/O space.
-
- Reads the I/O port specified by Port with registers width specified by Width.
- The read value is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all I/O read and write operations are serialized.
-
- @param Port The base address of the I/O operation.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI CPU I/O space.
-
-**/
-UINT64
-EFIAPI
-IoReadWorker (
- IN UINTN Port,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width
- )
-{
- EFI_STATUS Status;
- UINT64 Data;
-
- Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data);
- ASSERT_EFI_ERROR (Status);
-
- return Data;
-}
-
-/**
- Writes registers in the EFI CPU I/O space.
-
- Writes the I/O port specified by Port with registers width and value specified by Width
- and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all I/O read and write operations are serialized.
-
- @param Port The base address of the I/O operation.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
- @param Data The value to write to the I/O port.
-
- @return The paramter of Data.
-
-**/
-UINT64
-EFIAPI
-IoWriteWorker (
- IN UINTN Port,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Data
- )
-{
- EFI_STATUS Status;
-
- Status = mCpuIo->Io.Write (mCpuIo, Width, Port, 1, &Data);
- ASSERT_EFI_ERROR (Status);
-
- return Data;
-}
-
-/**
- Reads memory-mapped registers in the EFI system memory space.
-
- Reads the MMIO registers specified by Address with registers width specified by Width.
- The read value is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all MMIO read and write operations are serialized.
-
- @param Address The MMIO register to read.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI system memory space.
-
-**/
-UINT64
-EFIAPI
-MmioReadWorker (
- IN UINTN Address,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width
- )
-{
- EFI_STATUS Status;
- UINT64 Data;
-
- Status = mCpuIo->Mem.Read (mCpuIo, Width, Address, 1, &Data);
- ASSERT_EFI_ERROR (Status);
-
- return Data;
-}
-
-/**
- Writes memory-mapped registers in the EFI system memory space.
-
- Writes the MMIO registers specified by Address with registers width and value specified by Width
- and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
- This function must guarantee that all MMIO read and write operations are serialized.
-
- @param Address The MMIO register to read.
- The caller is responsible for aligning the Address if required.
- @param Width The width of the I/O operation.
-
- @return Data read from registers in the EFI system memory space.
-
-**/
-UINT64
-EFIAPI
-MmioWriteWorker (
- IN UINTN Address,
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Data
- )
-{
- EFI_STATUS Status;
-
- Status = mCpuIo->Mem.Write (mCpuIo, Width, Address, 1, &Data);
- ASSERT_EFI_ERROR (Status);
-
- return Data;
-}
-
-/**
- Reads an 8-bit I/O port.
-
- Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-IoRead8 (
- IN UINTN Port
- )
-{
- return (UINT8)IoReadWorker (Port, EfiCpuIoWidthUint8);
-}
-
-/**
- Writes an 8-bit I/O port.
-
- Writes the 8-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 8-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT8
-EFIAPI
-IoWrite8 (
- IN UINTN Port,
- IN UINT8 Value
- )
-{
- return (UINT8)IoWriteWorker (Port, EfiCpuIoWidthUint8, Value);
-}
-
-/**
- Reads a 16-bit I/O port.
-
- Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-IoRead16 (
- IN UINTN Port
- )
-{
- //
- // Make sure Port is aligned on a 16-bit boundary.
- //
- ASSERT ((Port & 1) == 0);
- return (UINT16)IoReadWorker (Port, EfiCpuIoWidthUint16);
-}
-
-/**
- Writes a 16-bit I/O port.
-
- Writes the 16-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 16-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT16
-EFIAPI
-IoWrite16 (
- IN UINTN Port,
- IN UINT16 Value
- )
-{
- //
- // Make sure Port is aligned on a 16-bit boundary.
- //
- ASSERT ((Port & 1) == 0);
- return (UINT16)IoWriteWorker (Port, EfiCpuIoWidthUint16, Value);
-}
-
-/**
- Reads a 32-bit I/O port.
-
- Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-IoRead32 (
- IN UINTN Port
- )
-{
- //
- // Make sure Port is aligned on a 32-bit boundary.
- //
- ASSERT ((Port & 3) == 0);
- return (UINT32)IoReadWorker (Port, EfiCpuIoWidthUint32);
-}
-
-/**
- Writes a 32-bit I/O port.
-
- Writes the 32-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 32-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT32
-EFIAPI
-IoWrite32 (
- IN UINTN Port,
- IN UINT32 Value
- )
-{
- //
- // Make sure Port is aligned on a 32-bit boundary.
- //
- ASSERT ((Port & 3) == 0);
- return (UINT32)IoWriteWorker (Port, EfiCpuIoWidthUint32, Value);
-}
-
-/**
- Reads a 64-bit I/O port.
-
- Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.
- This function must guarantee that all I/O read and write operations are
- serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-IoRead64 (
- IN UINTN Port
- )
-{
- //
- // Make sure Port is aligned on a 64-bit boundary.
- //
- ASSERT ((Port & 7) == 0);
- return IoReadWorker (Port, EfiCpuIoWidthUint64);
-}
-
-/**
- Writes a 64-bit I/O port.
-
- Writes the 64-bit I/O port specified by Port with the value specified by Value
- and returns Value. This function must guarantee that all I/O read and write
- operations are serialized.
-
- If 64-bit I/O port operations are not supported, then ASSERT().
-
- @param Port The I/O port to write.
- @param Value The value to write to the I/O port.
-
- @return The value written the I/O port.
-
-**/
-UINT64
-EFIAPI
-IoWrite64 (
- IN UINTN Port,
- IN UINT64 Value
- )
-{
- //
- // Make sure Port is aligned on a 64-bit boundary.
- //
- ASSERT ((Port & 7) == 0);
- return IoWriteWorker (Port, EfiCpuIoWidthUint64, Value);
-}
-
-/**
- Reads an 8-bit MMIO register.
-
- Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT8
-EFIAPI
-MmioRead8 (
- IN UINTN Address
- )
-{
- return (UINT8)MmioReadWorker (Address, EfiCpuIoWidthUint8);
-}
-
-/**
- Writes an 8-bit MMIO register.
-
- Writes the 8-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 8-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT8
-EFIAPI
-MmioWrite8 (
- IN UINTN Address,
- IN UINT8 Value
- )
-{
- return (UINT8)MmioWriteWorker (Address, EfiCpuIoWidthUint8, Value);
-}
-
-/**
- Reads a 16-bit MMIO register.
-
- Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT16
-EFIAPI
-MmioRead16 (
- IN UINTN Address
- )
-{
- //
- // Make sure Address is aligned on a 16-bit boundary.
- //
- ASSERT ((Address & 1) == 0);
- return (UINT16)MmioReadWorker (Address, EfiCpuIoWidthUint16);
-}
-
-/**
- Writes a 16-bit MMIO register.
-
- Writes the 16-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 16-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT16
-EFIAPI
-MmioWrite16 (
- IN UINTN Address,
- IN UINT16 Value
- )
-{
- //
- // Make sure Address is aligned on a 16-bit boundary.
- //
- ASSERT ((Address & 1) == 0);
- return (UINT16)MmioWriteWorker (Address, EfiCpuIoWidthUint16, Value);
-}
-
-/**
- Reads a 32-bit MMIO register.
-
- Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT32
-EFIAPI
-MmioRead32 (
- IN UINTN Address
- )
-{
- //
- // Make sure Address is aligned on a 32-bit boundary.
- //
- ASSERT ((Address & 3) == 0);
- return (UINT32)MmioReadWorker (Address, EfiCpuIoWidthUint32);
-}
-
-/**
- Writes a 32-bit MMIO register.
-
- Writes the 32-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 32-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT32
-EFIAPI
-MmioWrite32 (
- IN UINTN Address,
- IN UINT32 Value
- )
-{
- //
- // Make sure Address is aligned on a 32-bit boundary.
- //
- ASSERT ((Address & 3) == 0);
- return (UINT32)MmioWriteWorker (Address, EfiCpuIoWidthUint32, Value);
-}
-
-/**
- Reads a 64-bit MMIO register.
-
- Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
- returned. This function must guarantee that all MMIO read and write
- operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to read.
-
- @return The value read.
-
-**/
-UINT64
-EFIAPI
-MmioRead64 (
- IN UINTN Address
- )
-{
- //
- // Make sure Address is aligned on a 64-bit boundary.
- //
- ASSERT ((Address & 7) == 0);
- return (UINT64)MmioReadWorker (Address, EfiCpuIoWidthUint64);
-}
-
-/**
- Writes a 64-bit MMIO register.
-
- Writes the 64-bit MMIO register specified by Address with the value specified
- by Value and returns Value. This function must guarantee that all MMIO read
- and write operations are serialized.
-
- If 64-bit MMIO register operations are not supported, then ASSERT().
-
- @param Address The MMIO register to write.
- @param Value The value to write to the MMIO register.
-
-**/
-UINT64
-EFIAPI
-MmioWrite64 (
- IN UINTN Address,
- IN UINT64 Value
- )
-{
- //
- // Make sure Address is aligned on a 64-bit boundary.
- //
- ASSERT ((Address & 7) == 0);
- return (UINT64)MmioWriteWorker (Address, EfiCpuIoWidthUint64, Value);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
deleted file mode 100644
index ac8ce0efd6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/DxeMemoryAllocationLib.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# DxeMemoryAllocationLib.inf
-#
-# Abstract:
-#
-# Component description file for DxeMemoryAllocationLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeMemoryAllocationLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- MemoryAllocationLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
- EfiProtocolLib
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c
deleted file mode 100644
index af4315bc5c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c
+++ /dev/null
@@ -1,1079 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MemoryAllocationLib.c
-
-Abstract:
-
- Support routines for memory allocation routines for use with drivers.
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-
-/**
- Allocates one or more 4KB pages of a certain memory type.
-
- Allocates the number of 4KB pages of a certain memory type and returns a pointer to the allocated
- buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param MemoryType The type of memory to allocate.
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocatePages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages
- )
-{
- EFI_STATUS Status;
- EFI_PHYSICAL_ADDRESS Memory;
-
- if (Pages == 0) {
- return NULL;
- }
-
- Status = (gBS->AllocatePages) (AllocateAnyPages, MemoryType, Pages, &Memory);
- if (EFI_ERROR (Status)) {
- Memory = 0;
- }
- return (VOID *) (UINTN) Memory;
-}
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData.
-
- Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiBootServicesData, Pages);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData.
-
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiRuntimeServicesData, Pages);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType.
-
- Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiReservedMemoryType, Pages);
-}
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the page allocation
- functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
- then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePages (
- IN VOID *Buffer,
- IN UINTN Pages
- )
-{
- EFI_STATUS Status;
-
- ASSERT (Pages != 0);
- Status = (gBS->FreePages) ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
- ASSERT_EFI_ERROR (Status);
-}
-
-/**
- Allocates one or more 4KB pages of a certain memory type at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of a certain memory type with an alignment
- specified by Alignment. The allocated buffer is returned. 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().
-
- @param MemoryType The type of memory to allocate.
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedPages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- EFI_STATUS Status;
- EFI_PHYSICAL_ADDRESS Memory;
- UINTN AlignedMemory;
- UINTN AlignmentMask;
- UINTN UnalignedPages;
- UINTN RealPages;
-
- //
- // Alignment must be a power of two or zero.
- //
- ASSERT ((Alignment & (Alignment - 1)) == 0);
-
- if (Pages == 0) {
- return NULL;
- }
- if (Alignment > EFI_PAGE_SIZE) {
- //
- // Caculate the total number of pages since alignment is larger than page size.
- //
- AlignmentMask = Alignment - 1;
- RealPages = Pages + EFI_SIZE_TO_PAGES (Alignment);
- //
- // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
- //
- ASSERT (RealPages > Pages);
-
- Status = (gBS->AllocatePages) (AllocateAnyPages, MemoryType, RealPages, &Memory);
- if (EFI_ERROR (Status)) {
- return NULL;
- }
- AlignedMemory = ((UINTN) Memory + AlignmentMask) & ~AlignmentMask;
- UnalignedPages = EFI_SIZE_TO_PAGES ((UINTN) Memory - AlignedMemory);
- if (UnalignedPages > 0) {
- //
- // Free first unaligned page(s).
- //
- Status = (gBS->FreePages) (Memory, UnalignedPages);
- ASSERT_EFI_ERROR (Status);
- }
- Memory = (EFI_PHYSICAL_ADDRESS) (AlignedMemory + EFI_PAGES_TO_SIZE (Pages));
- UnalignedPages = RealPages - Pages - UnalignedPages;
- if (UnalignedPages > 0) {
- //
- // Free last unaligned page(s).
- //
- Status = (gBS->FreePages) (Memory, UnalignedPages);
- ASSERT_EFI_ERROR (Status);
- }
- } else {
- //
- // Do not over-allocate pages in this case.
- //
- Status = (gBS->AllocatePages) (AllocateAnyPages, MemoryType, Pages, &Memory);
- if (EFI_ERROR (Status)) {
- return NULL;
- }
- AlignedMemory = (UINTN) Memory;
- }
- return (VOID *) AlignedMemory;
-}
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiBootServicesData, Pages, Alignment);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiRuntimeServicesData, Pages, Alignment);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiReservedMemoryType, Pages, Alignment);
-}
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the aligned page
- allocation functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the aligned page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
- Library, then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPages (
- IN VOID *Buffer,
- IN UINTN Pages
- )
-{
- EFI_STATUS Status;
-
- ASSERT (Pages != 0);
- Status = (gBS->FreePages) ((EFI_PHYSICAL_ADDRESS) (UINTN) Buffer, Pages);
- ASSERT_EFI_ERROR (Status);
-}
-
-/**
- Allocates a buffer of a certain pool type.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param MemoryType The type of memory to allocate.
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocatePool (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN AllocationSize
- )
-{
- EFI_STATUS Status;
- VOID *Memory;
-
- Status = (gBS->AllocatePool) (MemoryType, AllocationSize, &Memory);
- if (EFI_ERROR (Status)) {
- Memory = NULL;
- }
- return Memory;
-}
-
-/**
- Allocates a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocatePool (EfiBootServicesData, AllocationSize);
-}
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocatePool (EfiRuntimeServicesData, AllocationSize);
-}
-
-/**
- Allocates a buffer of type EfieservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocatePool (EfiReservedMemoryType, AllocationSize);
-}
-
-/**
- Allocates and zeros a buffer of a certian pool type.
-
- Allocates the number bytes specified by AllocationSize of a certian pool type, clears the buffer
- with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid
- buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request,
- then NULL is returned.
-
- @param PoolType The type of memory to allocate.
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateZeroPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize
- )
-{
- VOID *Memory;
-
- Memory = InternalAllocatePool (PoolType, AllocationSize);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateZeroPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocateZeroPool (EfiBootServicesData, AllocationSize);
-}
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize);
-}
-
-/**
- Allocates and zeros a buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedZeroPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize);
-}
-
-/**
- Copies a buffer to an allocated buffer of a certian pool type.
-
- Allocates the number bytes specified by AllocationSize of a certian pool type, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateCopyPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = InternalAllocatePool (PoolType, AllocationSize);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- return InternalAllocateCopyPool (EfiBootServicesData, AllocationSize, Buffer);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- return InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- return InternalAllocateCopyPool (EfiReservedMemoryType, AllocationSize, Buffer);
-}
-
-/**
- Frees a buffer that was previously allocated with one of the pool allocation functions in the
- Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
- then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePool (
- IN VOID *Buffer
- )
-{
- EFI_STATUS Status;
-
- Status = (gBS->FreePool) (Buffer);
- ASSERT_EFI_ERROR (Status);
-}
-
-/**
- Allocates a buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment. The allocated buffer is returned. If AllocationSize is 0, then a valid
- buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two. If Alignment is zero, then byte alignment is used.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *RawAddress;
- UINTN AlignedAddress;
- UINTN AlignmentMask;
- UINTN OverAllocationSize;
- UINTN RealAllocationSize;
- VOID **FreePointer;
-
- //
- // Alignment must be a power of two or zero.
- //
- ASSERT ((Alignment & (Alignment - 1)) == 0);
-
- if (Alignment == 0) {
- AlignmentMask = Alignment;
- } else {
- AlignmentMask = Alignment - 1;
- }
- //
- // Calculate the extra memory size, over-allocate memory pool and get the aligned memory address.
- //
- OverAllocationSize = sizeof (RawAddress) + AlignmentMask;
- RealAllocationSize = AllocationSize + OverAllocationSize;
- //
- // Make sure that AllocationSize plus OverAllocationSize does not overflow.
- //
- ASSERT (RealAllocationSize > AllocationSize);
-
- RawAddress = InternalAllocatePool (PoolType, RealAllocationSize);
- if (RawAddress == NULL) {
- return NULL;
- }
- AlignedAddress = ((UINTN) RawAddress + OverAllocationSize) & ~AlignmentMask;
- //
- // Save the original memory address just before the aligned address.
- //
- FreePointer = (VOID **)(AlignedAddress - sizeof (RawAddress));
- *FreePointer = RawAddress;
-
- return (VOID *) AlignedAddress;
-}
-
-/**
- Allocates a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPool (EfiBootServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPool (EfiRuntimeServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPool (EfiReservedMemoryType, AllocationSize, Alignment);
-}
-
-/**
- Allocates and zeros a buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment, clears the buffer with zeros, and returns a pointer to the allocated
- buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedZeroPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
- Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedZeroPool (EfiBootServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedZeroPool (EfiRuntimeServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates and zeros a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedZeroPool (EfiReservedMemoryType, AllocationSize, Alignment);
-}
-
-/**
- Copies a buffer to an allocated buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment. The allocated buffer is returned. If AllocationSize is 0, then a valid
- buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedCopyPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedCopyPool (EfiBootServicesData, AllocationSize, Buffer, Alignment);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer, Alignment);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedCopyPool (EfiReservedMemoryType, AllocationSize, Buffer, Alignment);
-}
-
-/**
- Frees a buffer that was previously allocated with one of the aligned pool allocation functions
- in the Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- aligned pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with an aligned pool allocation function in the Memory Allocation
- Library, then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPool (
- IN VOID *Buffer
- )
-{
- VOID *RawAddress;
- VOID **FreePointer;
- EFI_STATUS Status;
-
- //
- // Get the pre-saved original address in the over-allocate pool.
- //
- FreePointer = (VOID **)((UINTN) Buffer - sizeof (RawAddress));
- RawAddress = *FreePointer;
-
- Status = (gBS->FreePool) (RawAddress);
- ASSERT_EFI_ERROR (Status);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/DxePerformanceLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/DxePerformanceLib.inf
deleted file mode 100644
index aad357b1c8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/DxePerformanceLib.inf
+++ /dev/null
@@ -1,85 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# DxePerformanceLib.inf
-#
-# Abstract:
-#
-# Component description file for DxePerformanceLib. This library provides
-# routines used by START_PERF() and END_PERF()
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxePerformanceLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PerformanceLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueDxeMemoryAllocationLib
- EdkIIGlueDxeHobLib
- EdkIIGlueUefiBootServicesTableLib
- EdkIIGlueUefiLib
- EdkProtocolLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/PerformanceLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/PerformanceLib.c
deleted file mode 100644
index 5949025d2b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxePerformanceLib/PerformanceLib.c
+++ /dev/null
@@ -1,886 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PerformanceLib.c
-
-Abstract:
-
- Routines used by START_PERF() and END_PERF()
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-
-#define EFI_PERFORMANCE_SIGNATURE EFI_SIGNATURE_32 ('P', 'E', 'R', 'F')
-#define EFI_PERFORMANCE_DATA_SIGNATURE EFI_SIGNATURE_32 ('P', 'E', 'D', 'A')
-
-#define GAUGE_DATA_FROM_GAUGE(_GaugeData) \
- CR(_GaugeData, EFI_PERF_DATA_LIST, GaugeData, EFI_PERFORMANCE_DATA_SIGNATURE)
-
-#define GAUGE_DATA_FROM_LINK(_link) \
- CR(_link, EFI_PERF_DATA_LIST, Link, EFI_PERFORMANCE_DATA_SIGNATURE)
-
-//
-// Performace protocol instance containing record macro
-//
-#define EFI_PERFORMANCE_FROM_THIS(a) \
- CR(a, EFI_PERFORMANCE_INSTANCE, Perf, EFI_PERFORMANCE_SIGNATURE)
-
-
-typedef struct {
- UINT32 Signature;
- LIST_ENTRY Link;
- EFI_GAUGE_DATA GaugeData;
-} EFI_PERF_DATA_LIST;
-
-//
-// Performance protocol instance data structure
-//
-typedef struct {
- UINTN Signature;
- EFI_HANDLE Handle;
- EFI_PERFORMANCE_PROTOCOL Perf;
- UINT8 Phase;
-} EFI_PERFORMANCE_INSTANCE;
-
-
-LIST_ENTRY mPerfDataHead = INITIALIZE_LIST_HEAD_VARIABLE(mPerfDataHead);
-
-
-STATIC
-VOID
-InternalGetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Set TimerValue with current tick.
-
-Arguments:
-
- TimerValue - Timer value to be set
-
-Returns:
-
- EFI_SUCCESS - TimerValue is set.
-
---*/
-{
- *TimerValue = AsmReadTsc ();
-}
-
-
-STATIC
-VOID
-GetShortPdbFileName (
- CHAR8 *PdbFileName,
- CHAR8 *GaugeString
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
---*/
-{
- UINTN Index;
- UINTN Index1;
- UINTN StartIndex;
- UINTN EndIndex;
-
- if (PdbFileName == NULL) {
- AsciiStrCpy (GaugeString, " ");
- } else {
- StartIndex = 0;
- for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)
- ;
-
- for (Index = 0; PdbFileName[Index] != 0; Index++) {
- if (PdbFileName[Index] == '\\') {
- StartIndex = Index + 1;
- }
-
- if (PdbFileName[Index] == '.') {
- EndIndex = Index;
- }
- }
-
- Index1 = 0;
- for (Index = StartIndex; Index < EndIndex; Index++) {
- GaugeString[Index1] = PdbFileName[Index];
- Index1++;
- if (Index1 == EFI_PERF_PDBFILENAME_LENGTH - 1) {
- break;
- }
- }
-
- GaugeString[Index1] = 0;
- }
-
- return;
-}
-
-
-STATIC
-CHAR8 *
-GetPdbPath (
- VOID *ImageBase
- )
-/*++
-
-Routine Description:
-
- Located PDB path name in PE image
-
-Arguments:
-
- ImageBase - base of PE to search
-
-Returns:
-
- Pointer into image at offset of PDB file name if PDB file name is found,
- Otherwise a pointer to an empty string.
-
---*/
-{
- CHAR8 *PdbPath;
- UINT32 DirCount;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_NT_HEADERS *NtHdr;
- UINT16 Magic;
- EFI_IMAGE_OPTIONAL_HEADER32 *OptionalHdr32;
- EFI_IMAGE_OPTIONAL_HEADER64 *OptionalHdr64;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- VOID *CodeViewEntryPointer;
-
- CodeViewEntryPointer = NULL;
- PdbPath = NULL;
- DosHdr = ImageBase;
- if (DosHdr && DosHdr->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- NtHdr = (EFI_IMAGE_NT_HEADERS *) ((UINT8 *) DosHdr + DosHdr->e_lfanew);
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (NtHdr->FileHeader.Machine == IMAGE_FILE_MACHINE_I386) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (NtHdr->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (NtHdr->FileHeader.Machine == IMAGE_FILE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = NtHdr->OptionalHeader.Magic;
- }
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- OptionalHdr32 = (VOID *) &NtHdr->OptionalHeader;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr32->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- } else {
- OptionalHdr64 = (VOID *) &NtHdr->OptionalHeader;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(OptionalHdr64->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- }
-
- if (DirectoryEntry->VirtualAddress != 0) {
- for (DirCount = 0;
- (DirCount < DirectoryEntry->Size / sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)) && CodeViewEntryPointer == NULL;
- DirCount++
- ) {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (DirectoryEntry->VirtualAddress + (UINTN) ImageBase + DirCount * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
- if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageBase);
- switch (*(UINT32 *) CodeViewEntryPointer) {
- case CODEVIEW_SIGNATURE_NB10:
- PdbPath = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- PdbPath = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- default:
- break;
- }
- }
- }
- }
- }
-
- return PdbPath;
-}
-
-
-STATIC
-VOID
-GetNameFromHandle (
- IN EFI_HANDLE Handle,
- OUT CHAR8 *GaugeString
- )
-{
- EFI_STATUS Status;
- EFI_LOADED_IMAGE_PROTOCOL *Image;
- CHAR8 *PdbFileName;
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
-
- AsciiStrCpy (GaugeString, " ");
-
- //
- // Get handle name from image protocol
- //
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&Image
- );
-
- if (EFI_ERROR (Status)) {
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiDriverBindingProtocolGuid,
- (VOID **) &DriverBinding,
- NULL,
- NULL,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return ;
- }
- //
- // Get handle name from image protocol
- //
- Status = gBS->HandleProtocol (
- DriverBinding->ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID**)&Image
- );
- }
-
- PdbFileName = GetPdbPath (Image->ImageBase);
-
- if (PdbFileName != NULL) {
- GetShortPdbFileName (PdbFileName, GaugeString);
- }
-
- return ;
-}
-
-
-EFI_PERF_DATA_LIST *
-CreateDataNode (
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host
- )
-/*++
-
-Routine Description:
-
- Create a EFI_PERF_DATA_LIST data node.
-
-Arguments:
-
- Handle - Handle of gauge data
- Token - Token of gauge data
- Host - Host of gauge data
-
-Returns:
-
- Pointer to a data node created.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
-
- //
- // Allocate a new image structure
- //
- Node = AllocateZeroPool (sizeof (EFI_PERF_DATA_LIST));
- if (Node != NULL) {
-
- Node->Signature = EFI_PERFORMANCE_DATA_SIGNATURE;
-
- Node->GaugeData.Handle = Handle;
-
- if (Token != NULL) {
- StrCpy ((Node->GaugeData).Token, Token);
- }
-
- if (Host != NULL) {
- StrCpy ((Node->GaugeData).Host, Host);
- }
-
- if (Handle != NULL) {
- GetNameFromHandle (Handle, Node->GaugeData.PdbFileName);
- }
- }
-
- return Node;
-}
-
-
-EFI_PERF_DATA_LIST *
-GetDataNode (
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN EFI_GUID *GuidName,
- IN EFI_GAUGE_DATA *PrevGauge
- )
-/*++
-
-Routine Description:
-
- Search gauge node list to find one node with matched handle, token, host and Guid name.
-
-Arguments:
-
- Handle - Handle to match
- Token - Token to match
- Host - Host to match
- GuidName - Guid name to match
- PrevGauge - Start node, start from list head if NULL
-
-Returns:
-
- Return pointer to the node found, NULL if not found.
-
---*/
-{
- EFI_PERF_DATA_LIST *Node;
- EFI_PERF_DATA_LIST *Temp;
- EFI_PERF_DATA_LIST *Temp2;
- LIST_ENTRY *CurrentLink;
- EFI_GUID NullGuid = EFI_NULL_GUID;
-
- Node = NULL;
- Temp = NULL;
- Temp2 = NULL;
-
- if (PrevGauge == NULL) {
- CurrentLink = mPerfDataHead.ForwardLink;
- } else {
- Temp2 = GAUGE_DATA_FROM_GAUGE (PrevGauge);
- CurrentLink = (Temp2->Link).ForwardLink;
- }
-
- while (CurrentLink && CurrentLink != &mPerfDataHead) {
- Node = GAUGE_DATA_FROM_LINK (CurrentLink);
-
- if (Handle == 0 && Token == NULL && Host == NULL && GuidName == NULL) {
- return Node;
- }
-
- if (Handle != (Node->GaugeData).Handle) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (GuidName == NULL && !CompareGuid (&((Node->GaugeData).GuidName), &NullGuid)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (GuidName && !CompareGuid (&((Node->GaugeData).GuidName), GuidName)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Token == NULL && StrCmp (Node->GaugeData.Token, L"")) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Token && StrCmp (Node->GaugeData.Token, Token)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Host == NULL && StrCmp (Node->GaugeData.Host, L"")) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- if (Host && StrCmp (Node->GaugeData.Host, Host)) {
- CurrentLink = CurrentLink->ForwardLink;
- continue;
- }
-
- Temp = Node;
- break;
- }
-
- return Temp;
-}
-
-
-EFI_STATUS
-GetPeiPerformance (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Transfer PEI performance data to gauge data node.
-
-Arguments:
-
- ImageHandle - Standard entry point parameter
- SystemTable - Standard entry point parameter
- Ticker - Start tick
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough resource to create data node.
- EFI_SUCCESS - Transfer done successfully.
-
---*/
-{
- EFI_STATUS Status;
- VOID *HobList;
- EFI_HOB_GUID_TYPE *GuidHob;
- EFI_HOB_GUID_DATA_PERFORMANCE_LOG *LogHob;
- PEI_PERFORMANCE_MEASURE_LOG_ENTRY *LogEntry;
- UINT32 Index;
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- Node = CreateDataNode (0, PEI_TOK, NULL);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- InternalGetTimerValue (&TimerValue);
- }
- (Node->GaugeData).EndTick = TimerValue;
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &HobList);
- ASSERT_EFI_ERROR (Status);
-
- do {
- GuidHob = (EFI_HOB_GUID_TYPE *)GlueGetNextGuidHob (&gEfiPeiPerformanceHobGuid, &HobList);
- if (GuidHob == NULL) {
- break;
- }
- LogHob = (EFI_HOB_GUID_DATA_PERFORMANCE_LOG *)GET_GUID_HOB_DATA (GuidHob);
-
- for (Index = 0; Index < LogHob->NumberOfEntries; Index++) {
- LogEntry = &(LogHob->Log[Index]);
- Node = CreateDataNode (0, LogEntry->DescriptionString, NULL);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
- (Node->GaugeData).StartTick = LogEntry->StartTimeCount;
-
- CopyMem (&(Node->GaugeData.GuidName), &LogEntry->Name, sizeof (EFI_GUID));
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- (Node->GaugeData).EndTick = LogEntry->StopTimeCount;
- }
- } while (!EFI_ERROR (Status));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-StartGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Create a guage data node and initialized it.
-
-Arguments:
-
- This - Calling context
- Handle - Handle of gauge data
- Token - Token of gauge data
- Host - Host of gauge data
- Ticker - Set gauge data's StartTick. If 0, StartTick is current timer.
-
-Returns:
-
- EFI_SUCCESS - Successfully create and initialized a guage data node.
- EFI_OUT_OF_RESOURCES - No enough resource to create a guage data node.
-
---*/
-{
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- TimerValue = 0;
- PerfInstance = EFI_PERFORMANCE_FROM_THIS (This);
-
- Node = CreateDataNode (Handle, Token, Host);
- if (!Node) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- InternalGetTimerValue (&TimerValue);
- }
-
- Node->GaugeData.StartTick = TimerValue;
-
- if (!StrCmp (Token, DXE_TOK)) {
- PerfInstance->Phase = DXE_PHASE;
- }
-
- if (!StrCmp (Token, SHELL_TOK)) {
- PerfInstance->Phase = SHELL_PHASE;
- }
-
- Node->GaugeData.Phase = PerfInstance->Phase;
-
- InsertTailList (&mPerfDataHead, &(Node->Link));
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-EndGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- End all unfinished gauge data node that match specified handle, token and host.
-
-Arguments:
-
- This - Calling context
- Handle - Handle to stop
- Token - Token to stop
- Host - Host to stop
- Ticker - End tick, if 0 then get current timer
-
-Returns:
-
- EFI_NOT_FOUND - Node not found
- EFI_SUCCESS - Gauge data node successfully ended.
-
---*/
-{
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
- EFI_PERF_DATA_LIST *Node;
- UINT64 TimerValue;
-
- TimerValue = 0;
- PerfInstance = EFI_PERFORMANCE_FROM_THIS (This);
-
- Node = GetDataNode (Handle, Token, Host, NULL, NULL);
- if (!Node) {
- return EFI_NOT_FOUND;
- }
-
- while (Node->GaugeData.EndTick != 0) {
- Node = GetDataNode (Handle, Token, Host, NULL, &(Node->GaugeData));
- if (!Node) {
- return EFI_NOT_FOUND;
- }
- }
-
- if (Ticker != 0) {
- TimerValue = Ticker;
- } else {
- InternalGetTimerValue (&TimerValue);
- }
-
- Node->GaugeData.EndTick = TimerValue;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_GAUGE_DATA *
-EFIAPI
-GetGauge (
- IN EFI_PERFORMANCE_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN EFI_GAUGE_DATA *PrevGauge
- )
-/*++
-
-Routine Description:
- Get gauge.
-
-Arguments:
- This - A pointer to the EFI_PERFORMANCE_PROTOCOL.
- Handle - A pointer of a efi handle.
- Token - A pointer to the token.
- Host - A pointer to the host.
- PrevGauge - A pointer to the EFI_GAUGE_DATA structure.
-
-
-Returns:
- Status code.
-
---*/
-{
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
- EFI_PERF_DATA_LIST *Node;
-
- PerfInstance = EFI_PERFORMANCE_FROM_THIS (This);
-
- Node = GetDataNode (Handle, Token, Host, NULL, PrevGauge);
- if (Node != NULL) {
- return &(Node->GaugeData);
- } else {
- return NULL;
- }
-}
-
-
-//
-// Install Performance Protocol
-//
-// This is the support routine for PERF_ENABLE() which is called on
-// an user's demand. This function isn't necessary to be called
-// automatically.
-//
-EFI_STATUS
-EFIAPI
-InitializePerformanceInfrastructure (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Install gEfiPerformanceProtocolGuid protocol and transfer PEI performance to gauge data nodes.
-
-Arguments:
-
- ImageHandle - Standard driver entry point parameter
- SystemTable - Standard driver entry point parameter
- Ticker - End tick for PEI performance
-
-Returns:
-
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
- EFI_SUCCESS - Protocol installed.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_INSTANCE *PerfInstance;
-
- //
- // Allocate a new image structure
- //
- PerfInstance = AllocateZeroPool (sizeof (EFI_PERFORMANCE_INSTANCE));
- if (PerfInstance == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- PerfInstance->Signature = EFI_PERFORMANCE_SIGNATURE;
- PerfInstance->Perf.StartGauge = StartGauge;
- PerfInstance->Perf.EndGauge = EndGauge;
- PerfInstance->Perf.GetGauge = GetGauge;
-
- //
- // Install the protocol interfaces
- //
- Status = gBS->InstallProtocolInterface (
- &PerfInstance->Handle,
- &gEfiPerformanceProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &PerfInstance->Perf
- );
-
- if (!EFI_ERROR (Status)) {
- GetPeiPerformance (ImageHandle, SystemTable, Ticker);
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-StartMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- Start to gauge on a specified handle, token and host, with Ticker as start tick.
-
-Arguments:
-
- Handle - Handle to measure
- Token - Token to measure
- Host - Host to measure
- Ticker - Ticker as start tick
-
-Returns:
-
- Status code.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- return Perf->StartGauge (Perf, Handle, Token, Host, Ticker);
-
-}
-
-
-EFI_STATUS
-EFIAPI
-EndMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- IN UINT64 Ticker
- )
-/*++
-
-Routine Description:
-
- End gauging on a specified handle, token and host, with Ticker as end tick.
-
-Arguments:
-
- Handle - Handle to stop
- Token - Token to stop
- Host - Host to stop
- Ticker - Ticker as end tick
-
-Returns:
-
- Status code.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (Status != EFI_SUCCESS) {
- return Status;
- }
-
- return (Perf->EndGauge( Perf, Handle, Token, Host, Ticker)) ;
-}
-
-
-EFI_STATUS
-EFIAPI
-UpdateMeasure (
- EFI_HANDLE Handle,
- IN UINT16 *Token,
- IN UINT16 *Host,
- EFI_HANDLE HandleNew,
- IN UINT16 *TokenNew,
- IN UINT16 *HostNew
- )
-/*++
-
-Routine Description:
- Update measure.
-
-Arguments:
- Handle - A pointer of an efi handle.
- Token - A pointer to the token.
- Host - A pointer to the host.
- HandleNew - A pointer of an new efi handle.
- TokenNew - A pointer to the new token.
- HostNew - A pointer to the new host.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - The speicified gauge data node not found.
-
- EFI_SUCCESS - Update successfully.
-
---*/
-{
- EFI_STATUS Status;
- EFI_GAUGE_DATA *GaugeData;
- EFI_PERFORMANCE_PROTOCOL *Perf;
-
- Status = gBS->LocateProtocol (&gEfiPerformanceProtocolGuid, NULL, (VOID **) &Perf);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- GaugeData = Perf->GetGauge (Perf, Handle, Token, Host, NULL);
- if (!GaugeData) {
- return EFI_NOT_FOUND;
- }
-
- GaugeData->Handle = HandleNew;
- if (HostNew != NULL) {
- StrCpy (GaugeData->Host, HostNew);
- } else {
- StrCpy (GaugeData->Host, L"");
- }
-
- if (TokenNew != NULL) {
- StrCpy (GaugeData->Token, TokenNew);
- } else {
- StrCpy (GaugeData->Token, L"");
- }
-
- return EFI_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
deleted file mode 100644
index cc82863210..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+++ /dev/null
@@ -1,97 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# DxeReportStatusCodeLib.inf
-#
-# Abstract:
-#
-# Component description file for DxeReportStatusCodeLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeReportStatusCodeLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- ReportStatusCodeLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
- $(EDK_SOURCE)/Foundation/Core/Dxe/ArchProtocol/StatusCode
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
-#
-# when EFI_SPECIFICATION_VERSION < 0x00020000, gRT is used
-#
- EdkIIGlueUefiRuntimeServicesTableLib
-# EDK lib
- EfiProtocolLib
-# Possibly, gEfiCallerIdGuid might be used.
- EdkGuidLib
- ArchProtocolLib
-
-
-[libraries.ia32]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.x64]
- EdkIIGlueBaseIoLibIntrinsic
-
-[libraries.ebc]
- EdkIIGlueDxeIoLibCpuIo
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
deleted file mode 100644
index a1c232dea0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
+++ /dev/null
@@ -1,612 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ReportStatusCodeLib.c
-
-Abstract:
-
- Report Status Code Library for DXE Phase.
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-//
-// Global pointer to the Status Code Protocol
-//
-static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
-
-
-/**
- Internal worker function that reports a status code through the Status Code Protocol
-
- This function checks to see if a Status Code Protocol is present in the handle
- database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
- returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
- and the ReportStatusCode() service of the Status Code Protocol is called passing in
- Type, Value, Instance, CallerId, and Data. The result of this call is returned.
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. This is an optional parameter that may be
- NULL.
- @param Data Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
- @retval EFI_UNSUPPORTED Status Code Protocol is not available.
-
-**/
-STATIC
-EFI_STATUS
-InternalReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- EFI_STATUS Status;
-
- if (gRT == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- if (gRT->Hdr.Revision >= 0x00020000) {
- //
- // If gStatusCode is NULL, then see if a Status Code Protocol instance is present
- // in the handle database.
- //
- if (gStatusCode == NULL) {
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
- return EFI_UNSUPPORTED;
- }
- }
-
- //
- // A Status Code Protocol is present in the handle database, so pass in all the
- // parameters to the ReportStatusCode() service of the Status Code Protocol
- //
- return (gStatusCode->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
- } else {
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
- return (gRT->ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
-#else
- return EFI_UNSUPPORTED;
-#endif
- }
-
-}
-
-
-/**
- Computes and returns the size, in bytes, of a device path.
-
- @param DevicePath A pointer to a device path.
-
- @return The size, in bytes, of DevicePath.
-
-**/
-STATIC
-UINTN
-InternalReportStatusCodeDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Start;
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Subtract the start node from the end node and add in the size of the end node
- //
- return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);
-}
-
-
-/**
- Converts a status code to an 8-bit POST code value.
-
- Converts the status code specified by CodeType and Value to an 8-bit POST code
- and returns the 8-bit POST code in PostCode. If CodeType is an
- EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
- are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
- 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
-
- If PostCode is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param PostCode A pointer to the 8-bit POST code value to return.
-
- @retval TRUE The status code specified by CodeType and Value was converted
- to an 8-bit POST code and returned in PostCode.
- @retval FALSE The status code specified by CodeType and Value could not be
- converted to an 8-bit POST code value.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- )
-{
- //
- // If PostCode is NULL, then ASSERT()
- //
- ASSERT (PostCode != NULL);
-
- //
- // Convert Value to an 8 bit post code
- //
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ) {
- *PostCode = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
- (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts ASSERT() information from a status code structure.
-
- Converts the status code specified by CodeType, Value, and Data to the ASSERT()
- arguments specified by Filename, Description, and LineNumber. If CodeType is
- an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
- Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
- Filename, Description, and LineNumber from the optional data area of the
- status code buffer specified by Data. The optional data area of Data contains
- a Null-terminated ASCII string for the FileName, followed by a Null-terminated
- ASCII string for the Description, followed by a 32-bit LineNumber. If the
- ASSERT() information could be extracted from Data, then return TRUE.
- Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If Filename is NULL, then ASSERT().
- If Description is NULL, then ASSERT().
- If LineNumber is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param Data Pointer to status code data buffer.
- @param Filename Pointer to the source file name that generated the ASSERT().
- @param Description Pointer to the description of the ASSERT().
- @param LineNumber Pointer to source line number that generated the ASSERT().
-
- @retval TRUE The status code specified by CodeType, Value, and Data was
- converted ASSERT() arguments specified by Filename, Description,
- and LineNumber.
- @retval FALSE The status code specified by CodeType, Value, and Data could
- not be converted to ASSERT() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- )
-{
- EFI_DEBUG_ASSERT_DATA *AssertData;
-
- ASSERT (Data != NULL);
- ASSERT (Filename != NULL);
- ASSERT (Description != NULL);
- ASSERT (LineNumber != NULL);
-
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
- ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&
- ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {
- AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
- *Filename = (CHAR8 *)(AssertData + 1);
- *Description = *Filename + AsciiStrLen (*Filename) + 1;
- *LineNumber = AssertData->LineNumber;
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts DEBUG() information from a status code structure.
-
- Converts the status code specified by Data to the DEBUG() arguments specified
- by ErrorLevel, Marker, and Format. If type GUID in Data is
- EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
- Format from the optional data area of the status code buffer specified by Data.
- The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
- which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
- the Format. If the DEBUG() information could be extracted from Data, then
- return TRUE. Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If ErrorLevel is NULL, then ASSERT().
- If Marker is NULL, then ASSERT().
- If Format is NULL, then ASSERT().
-
- @param Data Pointer to status code data buffer.
- @param ErrorLevel Pointer to error level mask for a debug message.
- @param Marker Pointer to the variable argument list associated with Format.
- @param Format Pointer to a Null-terminated ASCII format string of a
- debug message.
-
- @retval TRUE The status code specified by Data was converted DEBUG() arguments
- specified by ErrorLevel, Marker, and Format.
- @retval FALSE The status code specified by Data could not be converted to
- DEBUG() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractDebugInfo (
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- )
-{
- EFI_DEBUG_INFO *DebugInfo;
-
- ASSERT (Data != NULL);
- ASSERT (ErrorLevel != NULL);
- ASSERT (Marker != NULL);
- ASSERT (Format != NULL);
-
- //
- // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE
- //
- if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {
- return FALSE;
- }
-
- //
- // Retrieve the debug information from the status code record
- //
- DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);
-
- *ErrorLevel = DebugInfo->ErrorLevel;
-
-#ifdef __APPLE__
- // This is non portable C code you can't assume VA_LIST is pointer
- return FALSE;
-#else
- //
- // The first 12 * UINTN bytes of the string are really an
- // argument stack to support varargs on the Format string.
- //
- *Marker = (VA_LIST) (DebugInfo + 1);
-#endif
- *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
-
- return TRUE;
-}
-
-
-/**
- Reports a status code.
-
- Reports the status code specified by the parameters Type and Value. Status
- code also require an instance, caller ID, and extended data. This function
- passed in a zero instance, NULL extended data, and a caller ID of
- gEfiCallerIdGuid, which is the GUID for the module.
-
- ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCode() must return immediately.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a
- device error.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value
- )
-{
- return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);
-}
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data.
-
- Allocates and fills in the extended data section of a status code with the
- Device Path Protocol specified by DevicePath. This function is responsible
- for allocating a buffer large enough for the standard header and the device
- path. The standard header is filled in with a GUID of
- gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
- instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithDevicePath()must actively prevent recursion. If
- ReportStatusCodeWithDevicePath() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithDevicePath()
- must return EFI_DEVICE_ERROR immediately.
-
- If DevicePath is NULL, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- ASSERT (DevicePath != NULL);
- return ReportStatusCodeWithExtendedData (
- Type,
- Value,
- (VOID *)DevicePath,
- InternalReportStatusCodeDevicePathSize (DevicePath)
- );
-}
-
-
-/**
- Reports a status code with an extended data buffer.
-
- Allocates and fills in the extended data section of a status code with the
- extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
- is assumed to be one of the data structures specified in Related Definitions.
- These data structure do not have the standard header, so this function is
- responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled
- in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
- with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithExtendedData()must actively prevent recursion. If
- ReportStatusCodeWithExtendedData() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithExtendedData()
- must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL, then ASSERT().
- If ExtendedDataSize is 0, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param ExtendedData Pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithExtendedData (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST VOID *ExtendedData,
- IN UINTN ExtendedDataSize
- )
-{
- ASSERT (ExtendedData != NULL);
- ASSERT (ExtendedDataSize != 0);
- return ReportStatusCodeEx (
- Type,
- Value,
- 0,
- NULL,
- NULL,
- ExtendedData,
- ExtendedDataSize
- );
-}
-
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- )
-{
- EFI_STATUS Status;
- EFI_STATUS_CODE_DATA *StatusCodeData;
-
- ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
- ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
-
- //
- // Allocate space for the Status Code Header and its buffer
- //
- StatusCodeData = NULL;
- (gBS->AllocatePool) (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);
- if (StatusCodeData == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Fill in the extended data header
- //
- StatusCodeData->HeaderSize = (UINT16) sizeof (EFI_STATUS_CODE_DATA);
- StatusCodeData->Size = (UINT16)ExtendedDataSize;
- if (ExtendedDataGuid == NULL) {
- ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
- }
- CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
-
- //
- // Fill in the extended data buffer
- //
- CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
-
- //
- // Report the status code
- //
- if (CallerId == NULL) {
- CallerId = &gEfiCallerIdGuid;
- }
- Status = InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);
-
- //
- // Free the allocated buffer
- //
- (gBS->FreePool) (StatusCodeData);
-
- return Status;
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportProgressCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportErrorCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportDebugCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c
deleted file mode 100644
index e96134cf51..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DxeServicesTableLib.c
-
-Abstract:
-
- Dxe Services Table Lib
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-//
-// Cache copy of the DXE Services Table
-//
-EFI_DXE_SERVICES *gDS = NULL;
-
-/**
- The constructor function caches the pointer of DXE Services Table.
-
- The constructor function caches the pointer of DXE Services Table.
- It will ASSERT() if that operation fails.
- It will ASSERT() if the pointer of DXE Services Table is NULL.
- It will always return EFI_SUCCESS.
-
- @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
-DxeServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- //
- // Cache copy of the DXE Services Table
- //
- Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- ASSERT_EFI_ERROR (Status);
- ASSERT (gDS != NULL);
-
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.inf
deleted file mode 100644
index c449ca77ad..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeServicesTableLib/DxeServicesTableLib.inf
+++ /dev/null
@@ -1,79 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# DxeServicesTableLib.inf
-#
-# Abstract:
-#
-# Component description file for DxeServicesTableLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeServicesTableLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- DxeServicesTableLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
- EdkIIGlueUefiLib
- EfiProtocolLib
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.c
deleted file mode 100644
index 42bfa25ec6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DxeSmbusLib.c
-
-Abstract:
-
- Dxe Smbus Lib internal functions
-
---*/
-
-#include "DxeSmbusLibInternal.h"
-
-//
-// Globle varible to cache pointer to Smbus protocol.
-//
-STATIC EFI_SMBUS_HC_PROTOCOL *mSmbus = NULL;
-
-/**
- The constructor function caches the pointer to Smbus protocol.
-
- The constructor function locates Smbus protocol from protocol database.
- It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
-
- @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
-SmbusLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol (&gEfiSmbusProtocolGuid, NULL, (VOID**) &mSmbus);
- ASSERT_EFI_ERROR (Status);
- ASSERT (mSmbus != NULL);
-
- return Status;
-}
-
-/**
- Executes an SMBus operation to an SMBus controller.
-
- This function provides a standard way to execute Smbus script
- as defined in the SmBus Specification. The data can either be of
- the Length byte, word, or a block of data.
-
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The actual number of bytes that are executed for this operation..
-
-**/
-UINTN
-InternalSmBusExec (
- IN EFI_SMBUS_OPERATION SmbusOperation,
- IN UINTN SmBusAddress,
- IN UINTN Length,
- IN OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- RETURN_STATUS ReturnStatus;
- EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
-
- SmbusDeviceAddress.SmbusDeviceAddress = SMBUS_LIB_SLAVE_ADDRESS (SmBusAddress);
-
- ReturnStatus = mSmbus->Execute (
- mSmbus,
- SmbusDeviceAddress,
- SMBUS_LIB_COMMAND (SmBusAddress),
- SmbusOperation,
- SMBUS_LIB_PEC (SmBusAddress),
- &Length,
- Buffer
- );
- if (Status != NULL) {
- *Status = ReturnStatus;
- }
-
- return Length;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.inf
deleted file mode 100644
index 11c87cb9d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLib.inf
+++ /dev/null
@@ -1,82 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# DxeSmbusLib.inf
-#
-# Abstract:
-#
-# Component description file for DxeSmbusLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueDxeSmbusLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- DxeSmbusLib.c
- SmbusLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
- EfiProtocolLib
- EdkFrameworkProtocolLib
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLibInternal.h
deleted file mode 100644
index c6d1dc1d27..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/DxeSmbusLibInternal.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DxeSmbusLibInternal.h
-
-Abstract:
-
- Declarations of internal functions in DxeSmbusLib.
-
---*/
-
-#ifndef __DXE_SMBUS_LIB_INTERNAL_H__
-#define __DXE_SMBUS_LIB_INTERNAL_H__
-
-#include "EdkIIGlueDxe.h"
-
-#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
-#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
-#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
-#define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))
-#define SMBUS_LIB_RESEARVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))
-
-//
-// Declaration for internal functions
-//
-/**
- Executes an SMBus operation to an SMBus controller.
-
- This function provides a standard way to execute Smbus script
- as defined in the SmBus Specification. The data can either be of
- the Length byte, word, or a block of data.
-
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The actual number of bytes that are executed for this operation.
-
-**/
-UINTN
-InternalSmBusExec (
- IN EFI_SMBUS_OPERATION SmbusOperation,
- IN UINTN SmBusAddress,
- IN UINTN Length,
- IN OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/SmbusLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/SmbusLib.c
deleted file mode 100644
index d754b58210..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/DxeSmbusLib/SmbusLib.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DxeSmbus.c
-
-Abstract:
-
- Dxe Smbus Lib Interfaces
-
---*/
-
-#include "DxeSmbusLibInternal.h"
-
-/**
- Executes an SMBUS quick read command.
-
- Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickRead (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (!SMBUS_LIB_PEC (SmBusAddress));
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusQuickRead, SmBusAddress, 0, NULL, Status);
-}
-
-/**
- Executes an SMBUS quick write command.
-
- Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickWrite (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (!SMBUS_LIB_PEC (SmBusAddress));
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusQuickWrite, SmBusAddress, 0, NULL, Status);
-}
-
-/**
- Executes an SMBUS receive byte command.
-
- Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- The byte received from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte received from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReceiveByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReceiveByte, SmBusAddress, 1, &Byte, Status);
-
- return Byte;
-}
-
-/**
- Executes an SMBUS send byte command.
-
- Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.
- The byte specified by Value is sent.
- Only the SMBUS slave address field of SmBusAddress is required. Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to send.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusSendByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Byte = Value;
- InternalSmBusExec (EfiSmbusSendByte, SmBusAddress, 1, &Byte, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read data byte command.
-
- Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 8-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReadDataByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReadByte, SmBusAddress, 1, &Byte, Status);
-
- return Byte;
-}
-
-/**
- Executes an SMBUS write data byte command.
-
- Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.
- The 8-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusWriteDataByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Byte = Value;
- InternalSmBusExec (EfiSmbusWriteByte, SmBusAddress, 1, &Byte, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read data word command.
-
- Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT16
-EFIAPI
-SmBusReadDataWord (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT16 Word;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReadWord, SmBusAddress, 2, &Word, Status);
-
- return Word;
-}
-
-/**
- Executes an SMBUS write data word command.
-
- Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-SmBusWriteDataWord (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT16 Word;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Word = Value;
- InternalSmBusExec (EfiSmbusWriteWord, SmBusAddress, 2, &Word, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS process call command.
-
- Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value returned by the process call command is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The 16-bit value returned by the process call command.
-
-**/
-UINT16
-EFIAPI
-SmBusProcessCall (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusProcessCall, SmBusAddress, 2, &Value, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read block command.
-
- Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Bytes are read from the SMBUS and stored in Buffer.
- The number of bytes read is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is not zero, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes read.
-
-**/
-UINTN
-EFIAPI
-SmBusReadBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- return InternalSmBusExec (EfiSmbusReadBlock, SmBusAddress, 0x20, Buffer, Status);
-}
-
-/**
- Executes an SMBUS write block command.
-
- Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from Buffer.
- The number of bytes written is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusWriteBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINTN Length;
-
- ASSERT (Buffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Length = SMBUS_LIB_LENGTH (SmBusAddress);
- return InternalSmBusExec (EfiSmbusWriteBlock, SmBusAddress, Length, Buffer, Status);
-}
-
-/**
- Executes an SMBUS block process call command.
-
- Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If WriteBuffer is NULL, then ASSERT().
- If ReadBuffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS.
- @param ReadBuffer Pointer to the buffer of bytes to read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusBlockProcessCall (
- IN UINTN SmBusAddress,
- IN VOID *WriteBuffer,
- OUT VOID *ReadBuffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINTN Length;
-
- ASSERT (WriteBuffer != NULL);
- ASSERT (ReadBuffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Length = SMBUS_LIB_LENGTH (SmBusAddress);
- //
- // Assuming that ReadBuffer is large enough to save another memory copy.
- //
- ReadBuffer = CopyMem (ReadBuffer, WriteBuffer, Length);
- return InternalSmBusExec (EfiSmbusBWBRProcessCall, SmBusAddress, Length, ReadBuffer, Status);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
deleted file mode 100644
index 387a6835a6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RuntimeLib.c
-
-Abstract:
-
- Runtime lib
-
---*/
-
-#include "../RuntimeLibInternal.h"
-
-//
-// Driver Lib Module Globals
-//
-
-STATIC EFI_EVENT mEfiVirtualNotifyEvent;
-STATIC BOOLEAN mEfiGoneVirtual = FALSE;
-STATIC BOOLEAN mEfiAtRuntime = FALSE;
-EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
-
-/**
- Set AtRuntime flag as TRUE after ExitBootServices
-
- @param[in] Event The Event that is being processed
- @param[in] Context Event Context
-**/
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- //
- // Clear out BootService globals
- //
- gBS = NULL;
-
- mEfiAtRuntime = TRUE;
-}
-
-/**
- Fixup internal data so that EFI can be call in virtual mode.
- Call the passed in Child Notify event and convert any pointers in
- lib to virtual mode.
-
- @param[in] Event The Event that is being processed
- @param[in] Context Event Context
-**/
-STATIC
-VOID
-EFIAPI
-RuntimeLibVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- UINTN Index;
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
-
- for (Index = 0;
- _gDriverSetVirtualAddressMapEvent[Index] != NULL;
- Index++) {
- ChildNotifyEventHandler = _gDriverSetVirtualAddressMapEvent[Index];
- ChildNotifyEventHandler (Event, NULL);
- }
-
- //
- // Update global for Runtime Services Table and IO
- //
- EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
-
- mEfiGoneVirtual = TRUE;
-}
-
-/**
- Intialize runtime Driver Lib if it has not yet been initialized.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @return EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-**/
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibConstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- ASSERT (SystemTable != NULL);
- mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
- ASSERT (mRTEdkDxeRuntimeDriverLib != NULL);
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- ASSERT (gBS != NULL);
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- RuntimeLibVirtualNotifyEvent,
- NULL,
- &mEfiVirtualNotifyEvent
- );
-
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
- @retval EFI_SUCCESS Shutdown the Runtime Driver Lib successfully
- @retval EFI_UNSUPPORTED Runtime Driver lib was not initialized at all
-**/
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibDeconstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- //
- // Close SetVirtualAddressMap () notify function
- //
- ASSERT (gBS != NULL);
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- Return TRUE if ExitBootServices () has been called
-
- @retval TRUE If ExitBootServices () has been called
-**/
-BOOLEAN
-EFIAPI
-EfiAtRuntime (
- VOID
- )
-{
- return mEfiAtRuntime;
-}
-
-/**
- Return TRUE if SetVirtualAddressMap () has been called
-
- @retval TRUE If SetVirtualAddressMap () has been called
-**/
-BOOLEAN
-EFIAPI
-EfiGoneVirtual (
- VOID
- )
-{
- return mEfiGoneVirtual;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
deleted file mode 100644
index c57588c770..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
+++ /dev/null
@@ -1,471 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RuntimeService.c
-
-Abstract:
-
- Runtime Lib
-
---*/
-
-#include "../RuntimeLibInternal.h"
-
-VOID
-EFIAPI
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-{
- mRTEdkDxeRuntimeDriverLib->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
-}
-
-//
-// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
-// runtime service in the EFI system table.
-//
-EFI_STATUS
-EFIAPI
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->GetTime (Time, Capabilities);
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetTime (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->SetTime (Time);
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->GetWakeupTime (Enabled, Pending, Time);
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->SetWakeupTime (Enable, Time);
-}
-
-
-
-
-EFI_STATUS
-EFIAPI
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->GetNextHighMonotonicCount (HighCount);
-}
-
-EFI_STATUS
-EFIAPI
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID **Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
-}
-
-EFI_STATUS
-EFIAPI
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT LIST_ENTRY *ListHead
- )
-/*++
-
-Routine Description:
-
- Conver the standard Lib double linked list to a virtual mapping.
-
-Arguments:
-
- DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
-
- ListHead - Head of linked list to convert
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- LIST_ENTRY *Link;
- LIST_ENTRY *NextLink;
-
- //
- // Convert all the ForwardLink & BackLink pointers in the list
- //
- Link = ListHead;
- do {
- NextLink = Link->ForwardLink;
-
- EfiConvertPointer (
- Link->ForwardLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->ForwardLink
- );
-
- EfiConvertPointer (
- Link->BackLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->BackLink
- );
-
- Link = NextLink;
- } while (Link != ListHead);
- return EFI_SUCCESS;
-}
-
-
-/**
- Change the runtime addressing mode of EFI firmware from physical to virtual.
-
- @param MemoryMapSize The size in bytes of VirtualMap.
- @param DescriptorSize The size in bytes of an entry in the VirtualMap.
- @param DescriptorVersion The version of the structure entries in VirtualMap.
- @param VirtualMap An array of memory descriptors which contain new virtual
- address mapping information for all runtime ranges. Type
- EFI_MEMORY_DESCRIPTOR is defined in the
- GetMemoryMap() function description.
-
- @retval EFI_SUCCESS The virtual address map has been applied.
- @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
- virtual address mapped mode.
- @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
- invalid.
- @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
- map that requires a mapping.
- @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
- in the memory map.
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVirtualAddressMap (
- IN UINTN MemoryMapSize,
- IN UINTN DescriptorSize,
- IN UINT32 DescriptorVersion,
- IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
- )
-{
- return mRTEdkDxeRuntimeDriverLib->SetVirtualAddressMap (
- MemoryMapSize,
- DescriptorSize,
- DescriptorVersion,
- (EFI_MEMORY_DESCRIPTOR *) VirtualMap
- );
-}
-
-
-EFI_STATUS
-EFIAPI
-EfiUpdateCapsule (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
- )
-{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRTEdkDxeRuntimeDriverLib->UpdateCapsule (
- CapsuleHeaderArray,
- CapsuleCount,
- ScatterGatherList
- );
-#else
- return EFI_UNSUPPORTED;
-#endif
-}
-
-EFI_STATUS
-EFIAPI
-EfiQueryCapsuleCapabilities (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- OUT UINT64 *MaximumCapsuleSize,
- OUT EFI_RESET_TYPE *ResetType
- )
-{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRTEdkDxeRuntimeDriverLib->QueryCapsuleCapabilities (
- CapsuleHeaderArray,
- CapsuleCount,
- MaximumCapsuleSize,
- ResetType
- );
-#else
- return EFI_UNSUPPORTED;
-#endif
-}
-
-
-EFI_STATUS
-EFIAPI
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRTEdkDxeRuntimeDriverLib->QueryVariableInfo (
- Attributes,
- MaximumVariableStorageSize,
- RemainingVariableStorageSize,
- MaximumVariableSize
- );
-#else
- return EFI_UNSUPPORTED;
-#endif
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.inf
deleted file mode 100644
index 7a2e1365c4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.inf
+++ /dev/null
@@ -1,96 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# EdkDxeRuntimeDriverLib.inf
-#
-# Abstract:
-#
-# Component description file for EdkDxeRuntimeDriverLib.
-# This is the one whose name is EdkUefiRuntimeLib in EdkModulePkg in EdkII.
-# For backward compatibility, we don't change the library name.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueEdkDxeRuntimeDriverLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ia32]
- Common/RuntimeLib.c
- Common/RuntimeService.c
-
-[sources.x64]
- Common/RuntimeLib.c
- Common/RuntimeService.c
-
-[sources.ipf]
- Ipf/RuntimeLib.c
- Ipf/RuntimeService.c
-
-[sources.ebc]
- Common/RuntimeLib.c
- Common/RuntimeService.c
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
- EdkIIGlueUefiLib
- EdkIIGlueBaseLib
- EdkIIGlueUefiBootServicesTableLib
-#
-# EDK Library
-#
- EfiProtocolLib
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[libraries.ipf]
- EdkIIGlueEdkDxeSalLib
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
deleted file mode 100644
index e0f4deb6ce..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RuntimeLib.c
-
-Abstract:
-
- Runtime lib
-
---*/
-
-#include "../RuntimeLibInternal.h"
-
-//
-// Driver Lib Module Globals
-//
-static EFI_EVENT mEfiVirtualNotifyEvent;
-EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
-
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Set AtRuntime flag as TRUE after ExitBootServices
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- if (EfiAtRuntime()) {
- return;
- }
-}
-
-STATIC
-VOID
-EFIAPI
-RuntimeLibVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Fixup internal data so that EFI can be call in virtual mode.
- Call the passed in Child Notify event and convert any pointers in
- lib to virtual mode.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- UINTN Index;
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
-
- for (Index = 0; _gDriverSetVirtualAddressMapEvent[Index] != NULL; Index++) {
- ChildNotifyEventHandler = _gDriverSetVirtualAddressMapEvent[Index];
- ChildNotifyEventHandler (Event, NULL);
- }
-
- //
- // Update global for Runtime Services Table
- //
- EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
-}
-
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibConstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
-
- mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- RuntimeLibVirtualNotifyEvent,
- NULL,
- &mEfiVirtualNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-RuntimeDriverLibDeconstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Close SetVirtualAddressMap () notify function
- //
- if (_gDriverSetVirtualAddressMapEvent[0] != NULL) {
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-EFIAPI
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if ExitBootService () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If ExitBootService () has been called
-
---*/
-{
- EFI_GUID Guid;
- SAL_RETURN_REGS ReturnReg;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, IsEfiRuntime, 0, 0, 0, 0, 0, 0, 0);
-
- return (BOOLEAN) (ReturnReg.r9 == 1);
-}
-
-BOOLEAN
-EFIAPI
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
-
---*/
-{
- EFI_GUID Guid;
- SAL_RETURN_REGS ReturnReg;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, IsVirtual, 0, 0, 0, 0, 0, 0, 0);
-
- return (BOOLEAN) (ReturnReg.r9 == 1);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
deleted file mode 100644
index a270fc5508..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
+++ /dev/null
@@ -1,557 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RuntimeService.c
-
-Abstract:
-
- Runtime Lib
-
---*/
-
-#include "../RuntimeLibInternal.h"
-
-VOID
-EFIAPI
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-{
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID_HI;
-
- EfiCallEsalService (
- &Guid,
- ResetSystem,
- (UINT64) ResetType,
- (UINT64) ResetStatus,
- (UINT64) DataSize,
- (UINT64) ResetData,
- 0,
- 0,
- 0
- );
-}
-
-
-//
-// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
-// runtime service in the EFI system table.
-//
-EFI_STATUS
-EFIAPI
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, GetTime, (UINT64) Time, (UINT64) Capabilities, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetTime (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, SetTime, (UINT64) Time, 0, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, GetWakeupTime, (UINT64) Enabled, (UINT64) Pending, (UINT64) Time, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, SetWakeupTime, (UINT64) Enable, (UINT64) Time, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalGetVariable,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- (UINT64) Attributes,
- (UINT64) DataSize,
- (UINT64) Data,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalGetNextVariableName,
- (UINT64) VariableNameSize,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- 0,
- 0,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalSetVariable,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- (UINT64) Attributes,
- (UINT64) DataSize,
- (UINT64) Data,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (&Guid, GetNextHighMonotonicCount, (UINT64) HighCount, 0, 0, 0, 0, 0, 0);
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID **Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
-}
-
-EFI_STATUS
-EFIAPI
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT LIST_ENTRY *ListHead
- )
-/*++
-
-Routine Description:
-
- Conver the standard Lib double linked list to a virtual mapping.
-
-Arguments:
-
- DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
-
- ListHead - Head of linked list to convert
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- LIST_ENTRY *Link;
- LIST_ENTRY *NextLink;
-
- //
- // Convert all the ForwardLink & BackLink pointers in the list
- //
- Link = ListHead;
- do {
- NextLink = Link->ForwardLink;
-
- EfiConvertPointer (
- Link->ForwardLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->ForwardLink
- );
-
- EfiConvertPointer (
- Link->BackLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->BackLink
- );
-
- Link = NextLink;
- } while (Link != ListHead);
- return EFI_SUCCESS;
-}
-
-
-/**
- Change the runtime addressing mode of EFI firmware from physical to virtual.
-
- @param MemoryMapSize The size in bytes of VirtualMap.
- @param DescriptorSize The size in bytes of an entry in the VirtualMap.
- @param DescriptorVersion The version of the structure entries in VirtualMap.
- @param VirtualMap An array of memory descriptors which contain new virtual
- address mapping information for all runtime ranges. Type
- EFI_MEMORY_DESCRIPTOR is defined in the
- GetMemoryMap() function description.
-
- @retval EFI_SUCCESS The virtual address map has been applied.
- @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
- virtual address mapped mode.
- @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is
- invalid.
- @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
- map that requires a mapping.
- @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
- in the memory map.
-**/
-EFI_STATUS
-EFIAPI
-EfiSetVirtualAddressMap (
- IN UINTN MemoryMapSize,
- IN UINTN DescriptorSize,
- IN UINT32 DescriptorVersion,
- IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
- )
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid;
-
- *((UINT64 *) &Guid) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_LO;
- *(((UINT64 *)&Guid) + 1) = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID_HI;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- SetVirtualAddress,
- (UINT64) MemoryMapSize,
- (UINT64) DescriptorSize,
- (UINT64) DescriptorVersion,
- (UINT64) VirtualMap,
- 0,
- 0,
- 0
- );
-
- return ReturnReg.Status;
-}
-
-
-EFI_STATUS
-EFIAPI
-EfiUpdateCapsule (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-EFIAPI
-EfiQueryCapsuleCapabilities (
- IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
- IN UINTN CapsuleCount,
- OUT UINT64 *MaximumCapsuleSize,
- OUT EFI_RESET_TYPE *ResetType
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-EFI_STATUS
-EFIAPI
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-{
- return EFI_UNSUPPORTED;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
deleted file mode 100644
index 287f525cb9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- RuntimeLibInternal.h
-
-Abstract:
-
- Runtime Lib internal header file
-
---*/
-
-#ifndef __RUNTIMELIBINTERNAL_H__
-#define __RUNTIMELIBINTERNAL_H__
-
-#include "EdkIIGlueDxe.h"
-
-extern EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
-
-#endif //__RUNTIMELIBINTERNAL_H__
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/EdkDxeSalLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/EdkDxeSalLib.inf
deleted file mode 100644
index 370082d2bd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/EdkDxeSalLib.inf
+++ /dev/null
@@ -1,83 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EdkDxeSalLib.inf
-#
-# Abstract:
-#
-# SAL library for BS/RT drivers
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueEdkDxeSalLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
- Ipf/EsalServiceLib.c
- Ipf/AsmEsalServiceLib.s
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[libraries.ipf]
- EdkIIGlueBaseLib
- EdkIIGlueUefiBootServicesTableLib
- EdkProtocolLib
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/AsmEsalServiceLib.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/AsmEsalServiceLib.s
deleted file mode 100644
index 43b9ae2bdf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/AsmEsalServiceLib.s
+++ /dev/null
@@ -1,149 +0,0 @@
-//++
-// 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.
-//
-// Module Name:
-//
-// EsalLib.s
-//
-// Abstract:
-//
-//
-// Revision History:
-//
-//--
-
-.file "EsalLib.s"
-
-#include "IpfMacro.i"
-
-//
-// Exports
-//
-.globl GetEsalEntryPoint
-
-
-//-----------------------------------------------------------------------------
-//++
-// GetEsalEntryPoint
-//
-// Return Esal global and PSR register.
-//
-// On Entry :
-//
-//
-// Return Value:
-// r8 = EFI_SAL_SUCCESS
-// r9 = Physical Plabel
-// r10 = Virtual Plabel
-// r11 = psr
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (GetEsalEntryPoint)
-
- NESTED_SETUP (0,8,0,0)
-
-EsalCalcStart:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart), r8;;
- mov r9 = r8;;
- add r10 = 0x10, r8;;
- mov r11 = psr;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (GetEsalEntryPoint)
-
-
-
-
-
-//-----------------------------------------------------------------------------
-//++
-// SetEsalPhysicalEntryPoint
-//
-// Set the dispatcher entry point
-//
-// On Entry:
-// in0 = Physical address of Esal Dispatcher
-// in1 = Physical GP
-//
-// Return Value:
-// r8 = EFI_SAL_SUCCESS
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint)
-
- NESTED_SETUP (2,8,0,0)
-
-EsalCalcStart1:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart1), r8;;
- st8 [r8] = in0;;
- add r8 = 0x08, r8;;
- st8 [r8] = in1;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (SetEsalPhysicalEntryPoint)
-
-
-//-----------------------------------------------------------------------------
-//++
-// SetEsalVirtualEntryPoint
-//
-// Register physical address of Esal globals.
-//
-// On Entry :
-// in0 = Virtual address of Esal Dispatcher
-// in1 = Virtual GP
-//
-// Return Value:
-// r8 = EFI_SAL_ERROR
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (SetEsalVirtualEntryPoint)
-
- NESTED_SETUP (2,8,0,0)
-
-EsalCalcStart2:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart2), r8;;
- add r8 = 0x10, r8;;
- st8 [r8] = in0;;
- add r8 = 0x08, r8;;
- st8 [r8] = in1;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (SetEsalVirtualEntryPoint)
-
-
-
-
-.align 32
-EsalEntryPoint:
- data8 0 // Physical Entry
- data8 0 // GP
- data8 0 // Virtual Entry
- data8 0 // GP
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/EsalServiceLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/EsalServiceLib.c
deleted file mode 100644
index c347bf2948..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeSalLib/Ipf/EsalServiceLib.c
+++ /dev/null
@@ -1,251 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- EsalServiceLib.c
-
-Abstract:
-
---*/
-
-#include <Ipf/IpfDefines.h>
-
-#include "EdkIIGlueDxe.h"
-
-EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService = NULL;
-EFI_PLABEL mPlabel;
-
-STATIC
-EFI_STATUS
-EFIAPI
-DxeSalLibInitialize (
- VOID
- )
-{
- EFI_PLABEL *Plabel;
- EFI_STATUS Status;
-
- if (mEsalBootService != NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // The protocol contains a function pointer, which is an indirect procedure call.
- // An indirect procedure call goes through a plabel, and pointer to a function is
- // a pointer to a plabel. To implement indirect procedure calls that can work in
- // both physical and virtual mode, two plabels are required (one physical and one
- // virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it
- // away. We cache it in a module global, so we can register the vitrual version.
- //
- Status = gBS->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid, NULL, (VOID **) &mEsalBootService);
- if (EFI_ERROR (Status)) {
- mEsalBootService = NULL;
- return EFI_SUCCESS;
- }
-
- Plabel = (EFI_PLABEL *) (UINTN) mEsalBootService->ExtendedSalProc;
-
- mPlabel.EntryPoint = Plabel->EntryPoint;
- mPlabel.GP = Plabel->GP;
- SetEsalPhysicalEntryPoint (mPlabel.EntryPoint, mPlabel.GP);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class Function and it's asociated global.
- This function is boot service only!
-
-Arguments:
- FunctionId - ID of function to register
- ClassGuid - GUID of function class
- Function - Function to register under ClassGuid/FunctionId pair
- ModuleGlobal - Module global for Function.
-
-Returns:
- EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
-
---*/
-{
- DxeSalLibInitialize ();
- return mEsalBootService->AddExtendedSalProc (
- mEsalBootService,
- ClassGuid,
- FunctionId,
- Function,
- ModuleGlobal
- );
-}
-
-EFI_STATUS
-EFIAPI
-RegisterEsalClass (
- IN EFI_GUID *ClassGuid,
- IN VOID *ModuleGlobal,
- ...
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class and it's asociated global.
- This function is boot service only!
-
-Arguments:
- ClassGuid - GUID of function class
- ModuleGlobal - Module global for Function.
- ... - SAL_INTERNAL_EXTENDED_SAL_PROC and FunctionId pairs. NULL
- indicates the end of the list.
-
-Returns:
- EFI_SUCCESS - All members of ClassGuid registered
-
---*/
-{
- VA_LIST Args;
- EFI_STATUS Status;
- SAL_INTERNAL_EXTENDED_SAL_PROC Function;
- UINT64 FunctionId;
- EFI_HANDLE NewHandle;
-
- VA_START (Args, ModuleGlobal);
-
- Status = EFI_SUCCESS;
- while (!EFI_ERROR (Status)) {
- Function = (SAL_INTERNAL_EXTENDED_SAL_PROC) VA_ARG (Args, SAL_INTERNAL_EXTENDED_SAL_PROC);
- if (Function == NULL) {
- break;
- }
-
- FunctionId = VA_ARG (Args, UINT64);
-
- Status = RegisterEsalFunction (FunctionId, ClassGuid, Function, ModuleGlobal);
- }
-
- VA_END (Args);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- NewHandle = NULL;
- return gBS->InstallProtocolInterface (
- &NewHandle,
- ClassGuid,
- EFI_NATIVE_INTERFACE,
- NULL
- );
-}
-
-SAL_RETURN_REGS
-EFIAPI
-EfiCallEsalService (
- IN EFI_GUID *ClassGuid,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- )
-/*++
-
-Routine Description:
-
- Call module that is not linked direclty to this module. This code is IP
- relative and hides the binding issues of virtual or physical calling. The
- function that gets dispatched has extra arguments that include the registered
- module global and a boolean flag to indicate if the system is in virutal mode.
-
-Arguments:
- ClassGuid - GUID of function
- FunctionId - Function in ClassGuid to call
- Arg2 - Argument 2 ClassGuid/FunctionId defined
- Arg3 - Argument 3 ClassGuid/FunctionId defined
- Arg4 - Argument 4 ClassGuid/FunctionId defined
- Arg5 - Argument 5 ClassGuid/FunctionId defined
- Arg6 - Argument 6 ClassGuid/FunctionId defined
- Arg7 - Argument 7 ClassGuid/FunctionId defined
- Arg8 - Argument 8 ClassGuid/FunctionId defined
-
-Returns:
- Status of ClassGuid/FuncitonId
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- SAL_EXTENDED_SAL_PROC EsalProc;
-
- ReturnReg = GetEsalEntryPoint ();
- if (ReturnReg.Status != EFI_SAL_SUCCESS) {
- return ReturnReg;
- }
-
- //
- // Look at the physical mode ESAL entry point to determine of the ESAL entry point has been initialized
- //
- if (*(UINT64 *)ReturnReg.r9 == 0 && *(UINT64 *)(ReturnReg.r9 + 8) == 0) {
- //
- // Both the function ponter and the GP value are zero, so attempt to initialize the ESAL Entry Point
- //
- DxeSalLibInitialize ();
- ReturnReg = GetEsalEntryPoint ();
- if (ReturnReg.Status != EFI_SAL_SUCCESS) {
- return ReturnReg;
- }
- if (*(UINT64 *)ReturnReg.r9 == 0 && *(UINT64 *)(ReturnReg.r9 + 8) == 0) {
- //
- // The ESAL Entry Point could not be initialized
- //
- ReturnReg.Status = EFI_SAL_ERROR;
- return ReturnReg;
- }
- }
-
- if (ReturnReg.r11 & PSR_IT_MASK) {
- //
- // Virtual mode plabel to entry point
- //
- EsalProc = (SAL_EXTENDED_SAL_PROC) ReturnReg.r10;
- } else {
- //
- // Physical mode plabel to entry point
- //
- EsalProc = (SAL_EXTENDED_SAL_PROC) ReturnReg.r9;
- }
-
- return EsalProc (
- ClassGuid,
- FunctionId,
- Arg2,
- Arg3,
- Arg4,
- Arg5,
- Arg6,
- Arg7,
- Arg8
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.c
deleted file mode 100644
index 77634d906c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- HiiLib.c
-
-Abstract:
-
- HII Library implementation that uses DXE protocols and services.
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-/**
- This function allocates pool for an EFI_HII_PACKAGES structure
- with enough space for the variable argument list of package pointers.
- The allocated structure is initialized using NumberOfPackages, Guid,
- and the variable length argument list of package pointers.
-
- @param NumberOfPackages The number of HII packages to prepare.
- @param Guid Package GUID.
-
- @return The allocated and initialized packages.
-
-**/
-EFI_HII_PACKAGES *
-EFIAPI
-GluePreparePackages (
- IN UINTN NumberOfPackages,
- IN CONST EFI_GUID *Guid OPTIONAL,
- ...
- )
-{
- VA_LIST Args;
- EFI_HII_PACKAGES *HiiPackages;
- VOID **Package;
- UINTN Index;
-
- ASSERT (NumberOfPackages > 0);
-
- HiiPackages = AllocateZeroPool (sizeof (EFI_HII_PACKAGES) + NumberOfPackages * sizeof (VOID *));
- ASSERT (HiiPackages != NULL);
- if (HiiPackages == NULL) {
- return NULL;
- }
-
- HiiPackages->GuidId = (EFI_GUID *) Guid;
- HiiPackages->NumberOfPackages = NumberOfPackages;
- Package = (VOID **) (((UINT8 *) HiiPackages) + sizeof (EFI_HII_PACKAGES));
-
- VA_START (Args, Guid);
-
- for (Index = 0; Index < NumberOfPackages; Index++) {
- *Package = VA_ARG (Args, VOID *);
- Package++;
- }
-
- VA_END (Args);
-
- return HiiPackages;
-
-}
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.inf
deleted file mode 100644
index 4fc4f8a949..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/HiiLib/HiiLib.inf
+++ /dev/null
@@ -1,79 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# HiiLib.inf
-#
-# Abstract:
-#
-# Component description file for HiiLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueHiiLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- HiiLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Framework/Protocol/Hii
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/EfiIfrSupportLib
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueDxeMemoryAllocationLib
- EfiProtocolLib
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
deleted file mode 100644
index d4f4471aac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- DebugLib.c
-
-Abstract:
-
- Debug Library that fowards all messages to ReportStatusCode()
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-/**
-
- Prints a debug message to the debug output device if the specified error level is enabled.
-
- If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
- the message specified by Format and the associated variable argument list to
- the debug output device.
-
- If Format is NULL, then ASSERT().
-
- @param ErrorLevel The error level of the debug message.
- @param Format Format string for the debug message to print.
-
-**/
-VOID
-EFIAPI
-DebugPrint (
- IN UINTN ErrorLevel,
- IN CONST CHAR8 *Format,
- ...
- )
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];
- EFI_DEBUG_INFO *DebugInfo;
- UINTN TotalSize;
- UINTN Index;
- VA_LIST Marker;
- UINT64 *ArgumentPointer;
-
- //
- // If Format is NULL, then ASSERT().
- //
- ASSERT (Format != NULL);
-
- //
- // Check driver Debug Level value and global debug level
- //
- if ((ErrorLevel & PcdGet32(PcdDebugPrintErrorLevel)) == 0) {
- return;
- }
-
- TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrLen (Format) + 1;
- if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
- return;
- }
-
- //
- // Then EFI_DEBUG_INFO
- //
- DebugInfo = (EFI_DEBUG_INFO *)Buffer;
- DebugInfo->ErrorLevel = (UINT32)ErrorLevel;
-
- //
- // 256 byte mini Var Arg stack. That is followed by the format string.
- //
- VA_START (Marker, Format);
- for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {
- WriteUnaligned64(ArgumentPointer, VA_ARG (Marker, UINT64));
- }
- VA_END (Marker);
- AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);
-
- REPORT_STATUS_CODE_EX (
- EFI_DEBUG_CODE,
- (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),
- 0,
- NULL,
- &gEfiStatusCodeDataTypeDebugGuid,
- DebugInfo,
- TotalSize
- );
-}
-
-
-/**
-
- Prints an assert message containing a filename, line number, and description.
- This may be followed by a breakpoint or a dead loop.
-
- Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"
- to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
- PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
- DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
- CpuDeadLoop() is called. If neither of these bits are set, then this function
- returns immediately after the message is printed to the debug output device.
- DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
- processing another DebugAssert(), then DebugAssert() must return immediately.
-
- If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.
-
- If Description is NULL, then a <Description> string of "(NULL) Description" is printed.
-
- @param FileName Pointer to the name of the source file that generated the assert condition.
- @param LineNumber The line number in the source file that generated the assert condition
- @param Description Pointer to the description of the assert condition.
-
-**/
-VOID
-EFIAPI
-DebugAssert (
- IN CONST CHAR8 *FileName,
- IN UINTN LineNumber,
- IN CONST CHAR8 *Description
- )
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];
- EFI_DEBUG_ASSERT_DATA *AssertData;
- UINTN TotalSize;
- CHAR8 *Temp;
- UINTN FileNameLength;
- UINTN DescriptionLength;
-
- //
- // Make sure it will all fit in the passed in buffer
- //
- FileNameLength = AsciiStrLen (FileName);
- DescriptionLength = AsciiStrLen (Description);
- TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + FileNameLength + 1 + DescriptionLength + 1;
- if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {
- //
- // Fill in EFI_DEBUG_ASSERT_DATA
- //
- AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;
- AssertData->LineNumber = (UINT32)LineNumber;
-
- //
- // Copy Ascii FileName including NULL.
- //
- Temp = AsciiStrCpy ((CHAR8 *)(AssertData + 1), FileName);
-
- //
- // Copy Ascii Description
- //
- AsciiStrCpy (Temp + AsciiStrLen (FileName) + 1, Description);
-
- REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
- (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
- (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),
- AssertData,
- TotalSize
- );
- }
-
- //
- // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings
- //
- if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
- CpuBreakpoint ();
- } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
- CpuDeadLoop ();
- }
-}
-
-
-/**
-
- Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
-
- This function fills Length bytes of Buffer with the value specified by
- PcdDebugClearMemoryValue, and returns Buffer.
-
- If Buffer is NULL, then ASSERT().
-
- If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
- @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
-
- @return Buffer
-
-**/
-VOID *
-EFIAPI
-DebugClearMemory (
- OUT VOID *Buffer,
- IN UINTN Length
- )
-{
- //
- // If Buffer is NULL, then ASSERT().
- //
- ASSERT (Buffer != NULL);
-
- //
- // SetMem() checks for the the ASSERT() condition on Length and returns Buffer
- //
- return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
deleted file mode 100644
index be7e735a9b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+++ /dev/null
@@ -1,89 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# PeiDxeDebugLibReportStatusCode.inf
-#
-# Abstract:
-#
-# Component description file for PeiDxeDebugLibReportStatusCode.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiDxeDebugLibReportStatusCode
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- DebugLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Framework/Protocol/Hii
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/EfiIfrSupportLib
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
-#
-# EDK Library
-#
- EdkFrameworkGuidLib
-#
-#
-# An user must specify a PEI or DXE ReportStatusCodeLib instance in module's .inf
-#
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf
deleted file mode 100644
index 1ce741e5b5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf
+++ /dev/null
@@ -1,83 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiDxePostCodeLibReportStatusCode.inf
-#
-# Abstract:
-#
-# Component description file for PeiDxePostCodeLibReportStatusCode.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiDxePostCodeLibReportStatusCode
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PostCode.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Framework/Protocol/Hii
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/EfiIfrSupportLib
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
-#
-# An user must specify a PEI or DXE ReportStatusCodeLib instance in module's .inf
-#
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c
deleted file mode 100644
index 738f4cc2cd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiDxePostCodeLibReportStatusCode/PostCode.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PostCode.c
-
-Abstract:
-
- Post Code Lib
-
---*/
-
-#include "EdkIIGlueDxe.h"
-
-/**
- Converts POST code value to status code value.
-
- This macro converts the post code to status code value. Bits 0..4 of PostCode
- are mapped to bits 16..20 of status code value, and bits 5..7 of PostCode are mapped to bits
- 24..26 of status code value.
-
- @param PostCode POST code value.
-
- @return The converted status code value.
-
-**/
-#define POST_CODE_TO_STATUS_CODE_VALUE(PostCode) \
- ((EFI_STATUS_CODE_VALUE) (((PostCode & 0x1f) << 16) | ((PostCode & 0x3) << 19)))
-
-/**
- Sends an 32-bit value to a POST card.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- Some implementations of this library function may perform I/O operations
- directly to a POST card device. Other implementations may send Value to
- ReportStatusCode(), and the status code reporting mechanism will eventually
- display the 32-bit value on the status reporting device.
-
- PostCode() must actively prevent recursion. If PostCode() is called while
- processing another any other Report Status Code Library function, then
- PostCode() must return Value immediately.
-
- @param Value The 32-bit value to write to the POST card.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCode (
- IN UINT32 Value
- )
-{
- REPORT_STATUS_CODE (EFI_PROGRESS_CODE, POST_CODE_TO_STATUS_CODE_VALUE (Value));
- return Value;
-}
-
-
-/**
- Sends an 32-bit value to a POST and associated ASCII string.
-
- Sends the 32-bit value specified by Value to a POST card, and returns Value.
- If Description is not NULL, then the ASCII string specified by Description is
- also passed to the handler that displays the POST card value. Some
- implementations of this library function may perform I/O operations directly
- to a POST card device. Other implementations may send Value to ReportStatusCode(),
- and the status code reporting mechanism will eventually display the 32-bit
- value on the status reporting device.
-
- PostCodeWithDescription()must actively prevent recursion. If
- PostCodeWithDescription() is called while processing another any other Report
- Status Code Library function, then PostCodeWithDescription() must return Value
- immediately.
-
- @param Value The 32-bit value to write to the POST card.
- @param Description Pointer to an ASCII string that is a description of the
- POST code value. This is an optional parameter that may
- be NULL.
-
- @return Value
-
-**/
-UINT32
-EFIAPI
-GluePostCodeWithDescription (
- IN UINT32 Value,
- IN CONST CHAR8 *Description OPTIONAL
- )
-{
- if (Description == NULL) {
- REPORT_STATUS_CODE (
- EFI_PROGRESS_CODE,
- POST_CODE_TO_STATUS_CODE_VALUE (Value)
- );
- } else {
- REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
- EFI_PROGRESS_CODE,
- POST_CODE_TO_STATUS_CODE_VALUE (Value),
- Description,
- AsciiStrSize (Description)
- );
- }
-
- return Value;
-}
-
-
-/**
- Returns TRUE if POST Codes are enabled.
-
- This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if POST code descriptions are enabled.
-
- This function returns TRUE if the
- POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
- PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is set.
- @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED
- bit of PcdPostCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GluePostCodeDescriptionEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/HobLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/HobLib.c
deleted file mode 100644
index f7a7d0991e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/HobLib.c
+++ /dev/null
@@ -1,614 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- HobLib.c
-
-Abstract:
-
- HOB Library.
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-/**
- Returns the pointer to the HOB list.
-
- This function returns the pointer to first HOB in the list.
-
- @return The pointer to the HOB list.
-
-**/
-VOID *
-EFIAPI
-GetHobList (
- VOID
- )
-{
- EFI_STATUS Status;
- VOID *HobList;
-
- Status = PeiServicesGetHobList (&HobList);
- ASSERT_EFI_ERROR (Status);
- ASSERT (HobList != NULL);
-
- return HobList;
-}
-
-/**
- Returns the next instance of a HOB type from the starting HOB.
-
- This function searches the first instance of a HOB type from the starting HOB pointer.
- If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If HobStart is NULL, then ASSERT().
-
- @param Type The HOB type to return.
- @param HobStart The starting HOB pointer to search from.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetNextHob (
- IN UINT16 Type,
- IN CONST VOID *HobStart
- )
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- ASSERT (HobStart != NULL);
-
- Hob.Raw = (UINT8 *) HobStart;
- //
- // Parse the HOB list until end of list or matching type is found.
- //
- while (!END_OF_HOB_LIST (Hob)) {
- if (Hob.Header->HobType == Type) {
- return Hob.Raw;
- }
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
- return NULL;
-}
-
-/**
- Returns the first instance of a HOB type among the whole HOB list.
-
- This function searches the first instance of a HOB type among the whole HOB list.
- If there does not exist such HOB type in the HOB list, it will return NULL.
-
- @param Type The HOB type to return.
-
- @return The next instance of a HOB type from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GetFirstHob (
- IN UINT16 Type
- )
-{
- VOID *HobList;
-
- HobList = GetHobList ();
- return GetNextHob (Type, HobList);
-}
-
-/**
- This function searches the first instance of a HOB from the starting HOB pointer.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer
- unconditionally: it returns HobStart back if HobStart itself meets the requirement;
- caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart.
- If Guid is NULL, then ASSERT().
- If HobStart is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
- @param HobStart A pointer to a Guid.
-
- @return The next instance of the matched GUID HOB from the starting HOB.
-
-**/
-VOID *
-EFIAPI
-GlueGetNextGuidHob (
- IN CONST EFI_GUID *Guid,
- IN CONST VOID *HobStart
- )
-{
- EFI_PEI_HOB_POINTERS GuidHob;
-
- GuidHob.Raw = (UINT8 *) HobStart;
- while ((GuidHob.Raw = GetNextHob (EFI_HOB_TYPE_GUID_EXTENSION, GuidHob.Raw)) != NULL) {
- if (CompareGuid (Guid, &GuidHob.Guid->Name)) {
- break;
- }
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
- return GuidHob.Raw;
-}
-
-/**
- This function searches the first instance of a HOB among the whole HOB list.
- Such HOB should satisfy two conditions:
- its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
- If there does not exist such HOB from the starting HOB pointer, it will return NULL.
- Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE ()
- to extract the data section and its size info respectively.
- If Guid is NULL, then ASSERT().
-
- @param Guid The GUID to match with in the HOB list.
-
- @return The first instance of the matched GUID HOB among the whole HOB list.
-
-**/
-VOID *
-EFIAPI
-GlueGetFirstGuidHob (
- IN CONST EFI_GUID *Guid
- )
-{
- VOID *HobList;
-
- HobList = GetHobList ();
- return GetNextGuidHob (Guid, HobList);
-}
-
-/**
- Get the Boot Mode from the HOB list.
-
- This function returns the system boot mode information from the
- PHIT HOB in HOB list.
-
- @param VOID
-
- @return The Boot Mode.
-
-**/
-EFI_BOOT_MODE
-EFIAPI
-GetBootModeHob (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_BOOT_MODE BootMode;
-
- Status = PeiServicesGetBootMode (&BootMode);
- ASSERT_EFI_ERROR (Status);
-
- return BootMode;
-}
-
-/**
- Adds a new HOB to the HOB List.
-
- This internal function enables PEIMs to create various types of HOBs.
-
- @param Type Type of the new HOB.
- @param Length Length of the new HOB to allocate.
-
- @retval NULL The HOB could not be allocated.
- @retval others The address of new HOB.
-
-**/
-STATIC
-VOID *
-InternalPeiCreateHob (
- IN UINT16 Type,
- IN UINT16 Length
- )
-{
- EFI_STATUS Status;
- VOID *Hob;
-
- Status = PeiServicesCreateHob (Type, Length, &Hob);
- if (EFI_ERROR (Status)) {
- Hob = NULL;
- }
- //
- // Assume the process of HOB building is always successful.
- //
- ASSERT (Hob != NULL);
- return Hob;
-}
-
-/**
- Builds a HOB for a loaded PE32 module.
-
- This function builds a HOB for a loaded PE32 module.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If ModuleName is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ModuleName The GUID File Name of the module.
- @param MemoryAllocationModule The 64 bit physical address of the module.
- @param ModuleLength The length of the module in bytes.
- @param EntryPoint The 64 bit physical address of the module's entry point.
-
-**/
-VOID
-EFIAPI
-GlueBuildModuleHob (
- IN CONST EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-{
- EFI_HOB_MEMORY_ALLOCATION_MODULE *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE));
- if (Hob == NULL) {
- return;
- }
-
- CopyGuid (&(Hob->MemoryAllocationHeader.Name), &gEfiHobMemoryAllocModuleGuid);
- Hob->MemoryAllocationHeader.MemoryBaseAddress = MemoryAllocationModule;
- Hob->MemoryAllocationHeader.MemoryLength = ModuleLength;
- Hob->MemoryAllocationHeader.MemoryType = EfiBootServicesCode;
-
- //
- // Zero the reserved space to match HOB spec
- //
- ZeroMem (Hob->MemoryAllocationHeader.Reserved, sizeof (Hob->MemoryAllocationHeader.Reserved));
-
- CopyGuid (&Hob->ModuleName, ModuleName);
- Hob->EntryPoint = EntryPoint;
-}
-
-/**
- Builds a HOB that describes a chunk of system memory.
-
- This function builds a HOB that describes a chunk of system memory.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param ResourceType The type of resource described by this HOB.
- @param ResourceAttribute The resource attributes of the memory described by this HOB.
- @param PhysicalStart The 64 bit physical address of memory described by this HOB.
- @param NumberOfBytes The length of the memory described by this HOB in bytes.
-
-**/
-VOID
-EFIAPI
-BuildResourceDescriptorHob (
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-{
- EFI_HOB_RESOURCE_DESCRIPTOR *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, (UINT16) sizeof (EFI_HOB_RESOURCE_DESCRIPTOR));
- if (Hob == NULL) {
- return;
- }
-
- Hob->ResourceType = ResourceType;
- Hob->ResourceAttribute = ResourceAttribute;
- Hob->PhysicalStart = PhysicalStart;
- Hob->ResourceLength = NumberOfBytes;
-}
-
-/**
- Builds a GUID HOB with a certain data length.
-
- This function builds a customized HOB tagged with a GUID for identification
- and returns the start address of GUID HOB data so that caller can fill the customized data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidHob (
- IN CONST EFI_GUID *Guid,
- IN UINTN DataLength
- )
-{
- EFI_HOB_GUID_TYPE *Hob;
-
- //
- // Make sure Guid is valid
- //
- ASSERT (Guid != NULL);
-
- //
- // Make sure that data length is not too long.
- //
- ASSERT (DataLength <= (0xffff - sizeof (EFI_HOB_GUID_TYPE)));
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_GUID_EXTENSION, (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + DataLength));
- if (Hob == NULL) {
- return Hob;
- }
- CopyGuid (&Hob->Name, Guid);
- return Hob + 1;
-}
-
-/**
- Copies a data buffer to a newly-built HOB.
-
- This function builds a customized HOB tagged with a GUID for identification,
- copies the input data to the HOB data field and returns the start address of the GUID HOB data.
- The HOB Header and Name field is already stripped.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If Guid is NULL, then ASSERT().
- If Data is NULL and DataLength > 0, then ASSERT().
- If there is no additional space for HOB creation, then ASSERT().
- If DataLength >= (0x10000 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT().
-
- @param Guid The GUID to tag the customized HOB.
- @param Data The data to be copied into the data field of the GUID HOB.
- @param DataLength The size of the data payload for the GUID HOB.
-
- @retval NULL The GUID HOB could not be allocated.
- @retval others The start address of GUID HOB data.
-
-**/
-VOID *
-EFIAPI
-BuildGuidDataHob (
- IN CONST EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-{
- VOID *HobData;
-
- ASSERT (Data != NULL || DataLength == 0);
-
- HobData = BuildGuidHob (Guid, DataLength);
- if (HobData == NULL) {
- return HobData;
- }
-
- return CopyMem (HobData, Data, DataLength);
-}
-
-/**
- Builds a Firmware Volume HOB.
-
- This function builds a Firmware Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Firmware Volume.
- @param Length The size of the Firmware Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- EFI_HOB_FIRMWARE_VOLUME *Hob;
-
- //
- // Check FV Signature
- //
- ASSERT (((EFI_FIRMWARE_VOLUME_HEADER*)((UINTN)BaseAddress))->Signature == EFI_FVH_SIGNATURE);
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_FV, (UINT16) sizeof (EFI_HOB_FIRMWARE_VOLUME));
- if (Hob == NULL) {
- return;
- }
-
- Hob->BaseAddress = BaseAddress;
- Hob->Length = Length;
-}
-
-/**
- Builds a Capsule Volume HOB.
-
- This function builds a Capsule Volume HOB.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The base address of the Capsule Volume.
- @param Length The size of the Capsule Volume in bytes.
-
-**/
-VOID
-EFIAPI
-BuildCvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- EFI_HOB_CAPSULE_VOLUME *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_CV, (UINT16) sizeof (EFI_HOB_CAPSULE_VOLUME));
- if (Hob == NULL) {
- return;
- }
-
- Hob->BaseAddress = BaseAddress;
- Hob->Length = Length;
-}
-
-/**
- Builds a HOB for the CPU.
-
- This function builds a HOB for the CPU.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param SizeOfMemorySpace The maximum physical memory addressability of the processor.
- @param SizeOfIoSpace The maximum physical I/O addressability of the processor.
-
-**/
-VOID
-EFIAPI
-BuildCpuHob (
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-{
- EFI_HOB_CPU *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_CPU, (UINT16) sizeof (EFI_HOB_CPU));
- if (Hob == NULL) {
- return;
- }
-
- Hob->SizeOfMemorySpace = SizeOfMemorySpace;
- Hob->SizeOfIoSpace = SizeOfIoSpace;
-
- //
- // Zero the reserved space to match HOB spec
- //
- ZeroMem (Hob->Reserved, sizeof (Hob->Reserved));
-}
-
-/**
- Builds a HOB for the Stack.
-
- This function builds a HOB for the stack.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the Stack.
- @param Length The length of the stack in bytes.
-
-**/
-VOID
-EFIAPI
-BuildStackHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-{
- EFI_HOB_MEMORY_ALLOCATION_STACK *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK));
- if (Hob == NULL) {
- return;
- }
-
- CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocStackGuid);
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = EfiBootServicesData;
-
- //
- // Zero the reserved space to match HOB spec
- //
- ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));
-}
-
-/**
- Builds a HOB for the BSP store.
-
- This function builds a HOB for BSP store.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the BSP.
- @param Length The length of the BSP store in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-BuildBspStoreHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-{
- EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_BSP_STORE));
- if (Hob == NULL) {
- return;
- }
-
- CopyGuid (&(Hob->AllocDescriptor.Name), &gEfiHobMemoryAllocBspStoreGuid);
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = MemoryType;
-
- //
- // Zero the reserved space to match HOB spec
- //
- ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));
-}
-
-/**
- Builds a HOB for the memory allocation.
-
- This function builds a HOB for the memory allocation.
- It can only be invoked during PEI phase;
- for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase.
- If there is no additional space for HOB creation, then ASSERT().
-
- @param BaseAddress The 64 bit physical address of the memory.
- @param Length The length of the memory allocation in bytes.
- @param MemoryType Type of memory allocated by this HOB.
-
-**/
-VOID
-EFIAPI
-GlueBuildMemoryAllocationHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-{
- EFI_HOB_MEMORY_ALLOCATION *Hob;
-
- Hob = InternalPeiCreateHob (EFI_HOB_TYPE_MEMORY_ALLOCATION, (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION));
- if (Hob == NULL) {
- return;
- }
-
- ZeroMem (&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID));
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = MemoryType;
- //
- // Zero the reserved space to match HOB spec
- //
- ZeroMem (Hob->AllocDescriptor.Reserved, sizeof (Hob->AllocDescriptor.Reserved));
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/PeiHobLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/PeiHobLib.inf
deleted file mode 100644
index ef411c2069..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiHobLib/PeiHobLib.inf
+++ /dev/null
@@ -1,83 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiHobLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiHobLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiHobLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- HobLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGluePeiServicesLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
deleted file mode 100644
index 5998578626..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
+++ /dev/null
@@ -1,1075 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- MemoryAllocationLib.c
-
-Abstract:
-
- Support routines for memory allocation routines for use with drivers.
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-/**
- Allocates one or more 4KB pages of a certain memory type.
-
- Allocates the number of 4KB pages of a certain memory type and returns a pointer to the allocated
- buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL is returned.
- If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param MemoryType The type of memory to allocate.
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocatePages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages
- )
-{
- EFI_STATUS Status;
- EFI_PHYSICAL_ADDRESS Memory;
-
- if (Pages == 0) {
- return NULL;
- }
-
- Status = PeiServicesAllocatePages (MemoryType, Pages, &Memory);
- if (EFI_ERROR (Status)) {
- Memory = 0;
- }
- return (VOID *) (UINTN) Memory;
-}
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData.
-
- Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiBootServicesData, Pages);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData.
-
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiRuntimeServicesData, Pages);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType.
-
- Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is
- returned.
-
- @param Pages The number of 4 KB pages to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPages (
- IN UINTN Pages
- )
-{
- return InternalAllocatePages (EfiReservedMemoryType, Pages);
-}
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the page allocation
- functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with a page allocation function in the Memory Allocation Library,
- then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePages (
- IN VOID *Buffer,
- IN UINTN Pages
- )
-{
- //
- // PEI phase does not support to free pages, so leave it as NOP.
- //
-}
-
-/**
- Allocates one or more 4KB pages of a certain memory type at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of a certain memory type with an alignment
- specified by Alignment. The allocated buffer is returned. 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().
-
- @param MemoryType The type of memory to allocate.
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedPages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
- UINTN AlignmentMask;
-
- //
- // Alignment must be a power of two or zero.
- //
- ASSERT ((Alignment & (Alignment - 1)) == 0);
-
- if (Pages == 0) {
- return NULL;
- }
- //
- // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
- //
- ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment)));
- //
- // We would rather waste some memory to save PEI code size.
- //
- Memory = InternalAllocatePages (MemoryType, Pages + EFI_SIZE_TO_PAGES (Alignment));
- if (Alignment == 0) {
- AlignmentMask = Alignment;
- } else {
- AlignmentMask = Alignment - 1;
- }
- return (VOID *) (UINTN) (((UINTN) Memory + AlignmentMask) & ~AlignmentMask);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiBootServicesData, Pages, Alignment);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiRuntimeServicesData, Pages, Alignment);
-}
-
-/**
- Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. 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().
-
- @param Pages The number of 4 KB pages to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPages (
- IN UINTN Pages,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPages (EfiReservedMemoryType, Pages, Alignment);
-}
-
-/**
- Frees one or more 4KB pages that were previously allocated with one of the aligned page
- allocation functions in the Memory Allocation Library.
-
- Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer
- must have been allocated on a previous call to the aligned page allocation services of the Memory
- Allocation Library.
- If Buffer was not allocated with an aligned page allocation function in the Memory Allocation
- Library, then ASSERT().
- If Pages is zero, then ASSERT().
-
- @param Buffer Pointer to the buffer of pages to free.
- @param Pages The number of 4 KB pages to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPages (
- IN VOID *Buffer,
- IN UINTN Pages
- )
-{
- //
- // PEI phase does not support to free pages, so leave it as NOP.
- //
-}
-
-/**
- Allocates a buffer of a certain pool type.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param MemoryType The type of memory to allocate.
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocatePool (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN AllocationSize
- )
-{
- //
- // If we need lots of small runtime/reserved memory type from PEI in the future,
- // we can consider providing a more complex algorithm that allocates runtime pages and
- // provide pool allocations from those pages.
- //
- return InternalAllocatePages (MemoryType, EFI_SIZE_TO_PAGES (AllocationSize));
-}
-
-/**
- Allocates a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
- pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocatePool (
- IN UINTN AllocationSize
- )
-{
- EFI_STATUS Status;
- VOID *Buffer;
-
- Status = PeiServicesAllocatePool (AllocationSize, &Buffer);
- if (EFI_ERROR (Status)) {
- Buffer = NULL;
- }
- return Buffer;
-}
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimePool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocatePool (EfiRuntimeServicesData, AllocationSize);
-}
-
-/**
- Allocates a buffer of type EfieservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns
- a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
- returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocatePool (EfiReservedMemoryType, AllocationSize);
-}
-
-/**
- Allocates and zeros a buffer of a certian pool type.
-
- Allocates the number bytes specified by AllocationSize of a certian pool type, clears the buffer
- with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid
- buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request,
- then NULL is returned.
-
- @param PoolType The type of memory to allocate.
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateZeroPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize
- )
-{
- VOID *Memory;
-
- Memory = InternalAllocatePool (PoolType, AllocationSize);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateZeroPool (
- IN UINTN AllocationSize
- )
-{
- VOID *Memory;
-
- Memory = AllocatePool (AllocationSize);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeZeroPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocateZeroPool (EfiRuntimeServicesData, AllocationSize);
-}
-
-/**
- Allocates and zeros a buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the
- buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a
- valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the
- request, then NULL is returned.
-
- @param AllocationSize The number of bytes to allocate and zero.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedZeroPool (
- IN UINTN AllocationSize
- )
-{
- return InternalAllocateZeroPool (EfiReservedMemoryType, AllocationSize);
-}
-
-/**
- Copies a buffer to an allocated buffer of a certian pool type.
-
- Allocates the number bytes specified by AllocationSize of a certian pool type, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateCopyPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = InternalAllocatePool (PoolType, AllocationSize);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-GlueAllocateCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = AllocatePool (AllocationSize);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- return InternalAllocateCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies
- AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there
- is not enough memory remaining to satisfy the request, then NULL is returned.
- If Buffer is NULL, then ASSERT().
- If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT().
-
- @param AllocationSize The number of bytes to allocate and zero.
- @param Buffer The buffer to copy to the allocated buffer.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer
- )
-{
- return InternalAllocateCopyPool (EfiReservedMemoryType, AllocationSize, Buffer);
-}
-
-/**
- Frees a buffer that was previously allocated with one of the pool allocation functions in the
- Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
- then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-GlueFreePool (
- IN VOID *Buffer
- )
-{
- //
- // PEI phase does not support to free pool, so leave it as NOP.
- //
-}
-
-/**
- Allocates a buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment. The allocated buffer is returned. If AllocationSize is 0, then a valid
- buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two. If Alignment is zero, then byte alignment is used.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *RawAddress;
- UINTN AlignedAddress;
- UINTN AlignmentMask;
-
- //
- // Alignment must be a power of two or zero.
- //
- ASSERT ((Alignment & (Alignment - 1)) == 0);
-
- if (Alignment == 0) {
- AlignmentMask = Alignment;
- } else {
- AlignmentMask = Alignment - 1;
- }
- //
- // Make sure that AllocationSize plus AlignmentMask does not overflow.
- //
- ASSERT (AllocationSize <= (MAX_ADDRESS - AlignmentMask));
-
- RawAddress = InternalAllocatePool (PoolType, AllocationSize + AlignmentMask);
-
- AlignedAddress = ((UINTN) RawAddress + AlignmentMask) & ~AlignmentMask;
-
- return (VOID *) AlignedAddress;
-}
-
-/**
- Allocates a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *RawAddress;
- UINTN AlignedAddress;
- UINTN AlignmentMask;
-
- //
- // Alignment must be a power of two or zero.
- //
- ASSERT ((Alignment & (Alignment - 1)) == 0);
-
- if (Alignment == 0) {
- AlignmentMask = Alignment;
- } else {
- AlignmentMask = Alignment - 1;
- }
-
- //
- // Make sure that AllocationSize plus AlignmentMask does not overflow.
- //
- ASSERT (AllocationSize <= (MAX_ADDRESS - AlignmentMask));
-
- RawAddress = AllocatePool (AllocationSize + AlignmentMask);
-
- AlignedAddress = ((UINTN) RawAddress + AlignmentMask) & ~AlignmentMask;
-
- return (VOID *) AlignedAddress;
-}
-
-/**
- Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimePool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPool (EfiRuntimeServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedPool (EfiReservedMemoryType, AllocationSize, Alignment);
-}
-
-/**
- Allocates and zeros a buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment, clears the buffer with zeros, and returns a pointer to the allocated
- buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedZeroPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
-
- Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
-
- Memory = AllocateAlignedPool (AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = ZeroMem (Memory, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedZeroPool (EfiRuntimeServicesData, AllocationSize, Alignment);
-}
-
-/**
- Allocates and zeros a buffer of type EfieservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an
- alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the
- allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedZeroPool (
- IN UINTN AllocationSize,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedZeroPool (EfiReservedMemoryType, AllocationSize, Alignment);
-}
-
-/**
- Copies a buffer to an allocated buffer of a certain pool type at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of a certain pool type with an alignment
- specified by Alignment. The allocated buffer is returned. If AllocationSize is 0, then a valid
- buffer of 0 size 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().
-
- @param PoolType The type of pool to allocate.
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-InternalAllocateAlignedCopyPool (
- IN EFI_MEMORY_TYPE PoolType,
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = InternalAllocateAlignedPool (PoolType, AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiBootServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- VOID *Memory;
-
- ASSERT (Buffer != NULL);
- ASSERT (AllocationSize <= (MAX_ADDRESS - (UINTN) Buffer + 1));
-
- Memory = AllocateAlignedPool (AllocationSize, Alignment);
- if (Memory != NULL) {
- Memory = CopyMem (Memory, Buffer, AllocationSize);
- }
- return Memory;
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedRuntimeCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedCopyPool (EfiRuntimeServicesData, AllocationSize, Buffer, Alignment);
-}
-
-/**
- Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
-
- Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType type with an
- alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,
- then a valid buffer of 0 size 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().
-
- @param AllocationSize The number of bytes to allocate.
- @param Buffer The buffer to copy to the allocated buffer.
- @param Alignment The requested alignment of the allocation. Must be a power of two.
- If Alignment is zero, then byte alignment is used.
-
- @return A pointer to the allocated buffer or NULL if allocation fails.
-
-**/
-VOID *
-EFIAPI
-AllocateAlignedReservedCopyPool (
- IN UINTN AllocationSize,
- IN CONST VOID *Buffer,
- IN UINTN Alignment
- )
-{
- return InternalAllocateAlignedCopyPool (EfiReservedMemoryType, AllocationSize, Buffer, Alignment);
-}
-
-/**
- Frees a buffer that was previously allocated with one of the aligned pool allocation functions
- in the Memory Allocation Library.
-
- Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
- aligned pool allocation services of the Memory Allocation Library.
- If Buffer was not allocated with an aligned pool allocation function in the Memory Allocation
- Library, then ASSERT().
-
- @param Buffer Pointer to the buffer to free.
-
-**/
-VOID
-EFIAPI
-FreeAlignedPool (
- IN VOID *Buffer
- )
-{
- //
- // PEI phase does not support to free pool, so leave it as NOP.
- //
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
deleted file mode 100644
index 8abf04e552..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
+++ /dev/null
@@ -1,87 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiMemoryAllocationLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiMemoryAllocationLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiMemoryAllocationLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- MemoryAllocationLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGluePeiServicesTablePointerLibMm7
-#
-# If necessary, EdkIIGluePeiSerivcesTablePointerLib can be used to
-# replaced EdkIIGluePeiServicesTablePointerLibMm7
-#
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PeiPerformanceLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PeiPerformanceLib.inf
deleted file mode 100644
index f5261623f7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PeiPerformanceLib.inf
+++ /dev/null
@@ -1,93 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiPerformanceLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiPerformanceLib
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiPerformanceLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PerformanceLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGluePeiServicesLib
-
-[libraries.ia32]
-
-
-
-[libraries.x64]
-
-
-[libraries.ipf]
-
-
-[libraries.ebc]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PerformanceLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PerformanceLib.c
deleted file mode 100644
index ff7db463fe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiPerformanceLib/PerformanceLib.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PerformanceLib.c
-
-Abstract:
-
- Support routines used by PEI_PERF_START() and PEI_PERF_END()
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-
-#define MAX_PEI_PERF_LOG_ENTRIES 28
-
-
-STATIC
-VOID
-InternalGetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Set TimerValue with current tick.
-
-Arguments:
-
- TimerValue - Timer value to be set
-
-Returns:
-
- EFI_SUCCESS - TimerValue is set.
-
---*/
-{
- *TimerValue = AsmReadTsc ();
-}
-
-
-VOID
-EFIAPI
-PeiPerfMeasure (
- EFI_PEI_SERVICES **PeiServices,
- IN UINT16 *Token,
- IN EFI_FFS_FILE_HEADER *FileHeader,
- IN BOOLEAN EntryExit,
- IN UINT64 Value
- )
-/*++
-
-Routine Description:
-
- Log a timestamp count.
-
-Arguments:
-
- PeiServices - Pointer to the PEI Core Services table
-
- Token - Pointer to Token Name
-
- FileHeader - Pointer to the file header
-
- EntryExit - Indicates start or stop measurement
-
- Value - The start time or the stop time
-
-Returns:
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_GUID_TYPE *Hob;
- EFI_HOB_GUID_DATA_PERFORMANCE_LOG *PerfHobData;
- PEI_PERFORMANCE_MEASURE_LOG_ENTRY *Log;
- EFI_PEI_PPI_DESCRIPTOR *PerfHobDescriptor;
- UINT64 TimeCount;
- INTN Index;
- UINTN Index2;
- EFI_GUID *Guid;
- EFI_GUID *CheckGuid;
-
- TimeCount = 0;
- //
- // Get the END time as early as possible to make it more accurate.
- //
- if (EntryExit) {
- InternalGetTimerValue (&TimeCount);
- }
-
- //
- // Locate the Pei Performance Log Hob.
- //
- Status = PeiServicesLocatePpi (
- &gEfiPeiPerformanceHobGuid,
- 0,
- &PerfHobDescriptor,
- NULL
- );
-
- //
- // If the Performance Hob was not found, build and install one.
- //
- if (EFI_ERROR(Status)) {
- Hob = BuildGuidHob (
- &gEfiPeiPerformanceHobGuid,
- (sizeof(EFI_HOB_GUID_DATA_PERFORMANCE_LOG) +
- ((MAX_PEI_PERF_LOG_ENTRIES-1) *
- sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY)) +
- sizeof(EFI_PEI_PPI_DESCRIPTOR)
- ));
- Hob = (VOID *)((UINTN)Hob - sizeof (EFI_HOB_GUID_TYPE));
- ASSERT_EFI_ERROR (Status);
-
- PerfHobData = (EFI_HOB_GUID_DATA_PERFORMANCE_LOG *)(Hob+1);
- PerfHobData->NumberOfEntries = 0;
-
- PerfHobDescriptor = (EFI_PEI_PPI_DESCRIPTOR *)((UINT8 *)(PerfHobData+1) +
- (sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY) *
- (MAX_PEI_PERF_LOG_ENTRIES-1)
- )
- );
- PerfHobDescriptor->Flags = (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST);
- PerfHobDescriptor->Guid = &gEfiPeiPerformanceHobGuid;
- PerfHobDescriptor->Ppi = NULL;
-
- (*PeiServices)->InstallPpi (
- PeiServices,
- PerfHobDescriptor
- );
- }
-
- PerfHobData = (EFI_HOB_GUID_DATA_PERFORMANCE_LOG *)(((UINT8 *)(PerfHobDescriptor)) -
- ((sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY) *
- (MAX_PEI_PERF_LOG_ENTRIES-1)
- )
- + sizeof(EFI_HOB_GUID_DATA_PERFORMANCE_LOG)
- )
- );
-
- if (PerfHobData->NumberOfEntries >= MAX_PEI_PERF_LOG_ENTRIES) {
- return;
- }
-
- if (!EntryExit) {
- Log = &(PerfHobData->Log[PerfHobData->NumberOfEntries]);
- ((*PeiServices)->SetMem) (Log, sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY), 0);
-
- //
- // If not NULL pointer, copy the file name
- //
- if (FileHeader != NULL) {
- Log->Name = FileHeader->Name;
- }
-
- //
- // Copy the description string
- //
- ((*PeiServices)->CopyMem) (
- &(Log->DescriptionString),
- Token,
- (PEI_PERF_MAX_DESC_STRING-1) * sizeof(UINT16)
- );
-
- //
- // Get the start time as late as possible to make it more accurate.
- //
- InternalGetTimerValue (&TimeCount);
-
- //
- // Record the time stamp.
- //
- if (Value != 0) {
- Log->StartTimeCount = Value;
- } else {
- Log->StartTimeCount = TimeCount;
- }
- Log->StopTimeCount = 0;
-
- //
- // Increment the number of valid log entries.
- //
- PerfHobData->NumberOfEntries++;
-
- } else {
-
- for (Index = PerfHobData->NumberOfEntries-1; Index >= 0; Index--) {
- Log = NULL;
- for (Index2 = 0; Index2 < PEI_PERF_MAX_DESC_STRING; Index2++) {
- if (PerfHobData->Log[Index].DescriptionString[Index2] == 0) {
- Log = &(PerfHobData->Log[Index]);
- break;
- }
- if (PerfHobData->Log[Index].DescriptionString[Index2] !=
- Token[Index2]) {
- break;
- }
- }
- if (Log != NULL) {
- if (FileHeader != NULL) {
- Guid = &(Log->Name);
- CheckGuid = &(FileHeader->Name);
- if ((((INT32 *)Guid)[0] == ((INT32 *)CheckGuid)[0]) &&
- (((INT32 *)Guid)[1] == ((INT32 *)CheckGuid)[1]) &&
- (((INT32 *)Guid)[2] == ((INT32 *)CheckGuid)[2]) &&
- (((INT32 *)Guid)[3] == ((INT32 *)CheckGuid)[3])) {
- if (Value != 0) {
- Log->StopTimeCount = Value;
- } else {
- Log->StopTimeCount = TimeCount;
- }
- break;
- }
- } else {
- if (Value != 0) {
- Log->StopTimeCount = Value;
- } else {
- Log->StopTimeCount = TimeCount;
- }
- break;
- }
- }
- }
-
- }
-
- return;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
deleted file mode 100644
index 376d703cfc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
+++ /dev/null
@@ -1,108 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiReportStatusCodeLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiReportStatusCodeLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiReportStatusCodeLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- ReportStatusCodeLib.c
-
-[sources.ia32]
-
-
-[sources.x64]
-
-
-[sources.ipf]
-
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueBaseIoLibIntrinsic
- EdkFrameworkGuidLib
-# Possibly, gEfiCallerIdGuid might be used.
- EdkGuidLib
-
-[libraries.ia32]
- EdkIIGluePeiServicesTablePointerLibMm7
-#
-# If necessary, EdkIIGluePeiServicesTablePointerLib can be used
-# to replace EdkIIGluePeiServicesTablePointerLibMm7
-#
-
-
-[libraries.x64]
- EdkIIGluePeiServicesTablePointerLibMm7
-#
-# If necessary, EdkIIGluePeiServicesTablePointerLib can be used
-# to replace EdkIIGluePeiServicesTablePointerLibMm7
-#
-
-[libraries.ipf]
- EdkIIGluePeiServicesTablePointerLibKr1
-#
-# If necessary, EdkIIGluePeiServicesTablePointerLib can be used
-# to replace EdkIIGluePeiServicesTablePointerLibKr1
-#
-
-[libraries.ebc]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
deleted file mode 100644
index 29207e0f5b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
+++ /dev/null
@@ -1,532 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ReportStatusCodeLib.c
-
-Abstract:
-
- Report Status Code Lib
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-//
-// Define the maximum extended data size that is supported in the PEI phase
-//
-#define MAX_EXTENDED_DATA_SIZE 0x200
-
-/**
- Internal worker function that reports a status code through the Status Code Protocol
-
- This function checks to see if a Status Code Protocol is present in the handle
- database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
- returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
- and the ReportStatusCode() service of the Status Code Protocol is called passing in
- Type, Value, Instance, CallerId, and Data. The result of this call is returned.
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. This is an optional parameter that may be
- NULL.
- @param Data Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
- @retval EFI_UNSUPPORTED Status Code Protocol is not available.
-
-**/
-STATIC
-EFI_STATUS
-InternalReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->PeiReportStatusCode (
- PeiServices,
- Type,
- Value,
- Instance,
- (EFI_GUID *)CallerId,
- Data
- );
-}
-
-
-/**
- Converts a status code to an 8-bit POST code value.
-
- Converts the status code specified by CodeType and Value to an 8-bit POST code
- and returns the 8-bit POST code in PostCode. If CodeType is an
- EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
- are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
- 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
-
- If PostCode is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param PostCode A pointer to the 8-bit POST code value to return.
-
- @retval TRUE The status code specified by CodeType and Value was converted
- to an 8-bit POST code and returned in PostCode.
- @retval FALSE The status code specified by CodeType and Value could not be
- converted to an 8-bit POST code value.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- )
-{
- //
- // If PostCode is NULL, then ASSERT()
- //
- ASSERT (PostCode != NULL);
-
- //
- // Convert Value to an 8 bit post code
- //
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ) {
- *PostCode = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
- (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts ASSERT() information from a status code structure.
-
- Converts the status code specified by CodeType, Value, and Data to the ASSERT()
- arguments specified by Filename, Description, and LineNumber. If CodeType is
- an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
- Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
- Filename, Description, and LineNumber from the optional data area of the
- status code buffer specified by Data. The optional data area of Data contains
- a Null-terminated ASCII string for the FileName, followed by a Null-terminated
- ASCII string for the Description, followed by a 32-bit LineNumber. If the
- ASSERT() information could be extracted from Data, then return TRUE.
- Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If Filename is NULL, then ASSERT().
- If Description is NULL, then ASSERT().
- If LineNumber is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param Data Pointer to status code data buffer.
- @param Filename Pointer to the source file name that generated the ASSERT().
- @param Description Pointer to the description of the ASSERT().
- @param LineNumber Pointer to source line number that generated the ASSERT().
-
- @retval TRUE The status code specified by CodeType, Value, and Data was
- converted ASSERT() arguments specified by Filename, Description,
- and LineNumber.
- @retval FALSE The status code specified by CodeType, Value, and Data could
- not be converted to ASSERT() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- )
-{
- EFI_DEBUG_ASSERT_DATA *AssertData;
-
- ASSERT (Data != NULL);
- ASSERT (Filename != NULL);
- ASSERT (Description != NULL);
- ASSERT (LineNumber != NULL);
-
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
- ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&
- ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {
- AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
- *Filename = (CHAR8 *)(AssertData + 1);
- *Description = *Filename + AsciiStrLen (*Filename) + 1;
- *LineNumber = AssertData->LineNumber;
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts DEBUG() information from a status code structure.
-
- Converts the status code specified by Data to the DEBUG() arguments specified
- by ErrorLevel, Marker, and Format. If type GUID in Data is
- EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
- Format from the optional data area of the status code buffer specified by Data.
- The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
- which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
- the Format. If the DEBUG() information could be extracted from Data, then
- return TRUE. Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If ErrorLevel is NULL, then ASSERT().
- If Marker is NULL, then ASSERT().
- If Format is NULL, then ASSERT().
-
- @param Data Pointer to status code data buffer.
- @param ErrorLevel Pointer to error level mask for a debug message.
- @param Marker Pointer to the variable argument list associated with Format.
- @param Format Pointer to a Null-terminated ASCII format string of a
- debug message.
-
- @retval TRUE The status code specified by Data was converted DEBUG() arguments
- specified by ErrorLevel, Marker, and Format.
- @retval FALSE The status code specified by Data could not be converted to
- DEBUG() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractDebugInfo (
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- )
-{
- EFI_DEBUG_INFO *DebugInfo;
-
- ASSERT (Data != NULL);
- ASSERT (ErrorLevel != NULL);
- ASSERT (Marker != NULL);
- ASSERT (Format != NULL);
-
- //
- // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE
- //
- if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {
- return FALSE;
- }
-
- //
- // Retrieve the debug information from the status code record
- //
- DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);
-
- *ErrorLevel = DebugInfo->ErrorLevel;
-
- //
- // The first 12 * UINTN bytes of the string are really an
- // argument stack to support varargs on the Format string.
- //
-#ifdef __APPLE__
- // This is non portable C code you can't assume VA_LIST is pointer
- return FALSE;
-#else
- *Marker = (VA_LIST) (DebugInfo + 1);
-#endif
- *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
-
- return TRUE;
-}
-
-
-/**
- Reports a status code.
-
- Reports the status code specified by the parameters Type and Value. Status
- code also require an instance, caller ID, and extended data. This function
- passed in a zero instance, NULL extended data, and a caller ID of
- gEfiCallerIdGuid, which is the GUID for the module.
-
- ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCode() must return immediately.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a
- device error.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value
- )
-{
- return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);
-}
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data.
-
- Allocates and fills in the extended data section of a status code with the
- Device Path Protocol specified by DevicePath. This function is responsible
- for allocating a buffer large enough for the standard header and the device
- path. The standard header is filled in with a GUID of
- gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
- instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithDevicePath()must actively prevent recursion. If
- ReportStatusCodeWithDevicePath() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithDevicePath()
- must return EFI_DEVICE_ERROR immediately.
-
- If DevicePath is NULL, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- ASSERT (DevicePath != NULL);
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Reports a status code with an extended data buffer.
-
- Allocates and fills in the extended data section of a status code with the
- extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
- is assumed to be one of the data structures specified in Related Definitions.
- These data structure do not have the standard header, so this function is
- responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled
- in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
- with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithExtendedData()must actively prevent recursion. If
- ReportStatusCodeWithExtendedData() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithExtendedData()
- must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL, then ASSERT().
- If ExtendedDataSize is 0, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param ExtendedData Pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithExtendedData (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST VOID *ExtendedData,
- IN UINTN ExtendedDataSize
- )
-{
- ASSERT (ExtendedData != NULL);
- ASSERT (ExtendedDataSize != 0);
- return ReportStatusCodeEx (
- Type,
- Value,
- 0,
- NULL,
- NULL,
- ExtendedData,
- ExtendedDataSize
- );
-}
-
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- )
-{
- EFI_STATUS_CODE_DATA *StatusCodeData;
- UINT64 Buffer[MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)];
-
- ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
- ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
-
- if (ExtendedDataSize > (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) {
- return EFI_OUT_OF_RESOURCES;
- }
- StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer;
- StatusCodeData->HeaderSize = (UINT16) sizeof (EFI_STATUS_CODE_DATA);
- StatusCodeData->Size = (UINT16)ExtendedDataSize;
- if (ExtendedDataGuid == NULL) {
- ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
- }
- CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);
- CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);
- if (CallerId == NULL) {
- CallerId = &gEfiCallerIdGuid;
- }
- return InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportProgressCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportErrorCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportDebugCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
deleted file mode 100644
index 05a31f6464..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiResourcePublicationLib.c
-
-Abstract:
-
- Resource Publication Library that uses PEI Core Services to publish system memory.
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-/**
-
- Declares the presence of permanent system memory in the platform.
-
- Declares that the system memory buffer specified by MemoryBegin and MemoryLength
- as permanent memory that may be used for general purpose use by software.
- The amount of memory available to software may be less than MemoryLength
- if published memory has alignment restrictions.
-
- @param MemoryBegin The start address of the memory being declared.
- @param MemoryLength The number of bytes of memory being declared.
-
- @retval RETURN_SUCCESS The memory buffer was published.
- @retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer
-
-**/
-RETURN_STATUS
-EFIAPI
-PublishSystemMemory (
- IN PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- )
-{
- EFI_STATUS Status;
-
- ASSERT (MemoryLength > 0);
- ASSERT (MemoryLength <= (MAX_ADDRESS - MemoryBegin + 1));
-
- Status = PeiServicesInstallPeiMemory (MemoryBegin, MemoryLength);
-
- return (RETURN_STATUS) Status;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
deleted file mode 100644
index c3dfa84525..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiResourcePublication.inf
-#
-# Abstract:
-#
-# Component description file for PeiResourcePublication.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiResourcePublicationLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiResourcePublicationLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGluePeiServicesLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.c
deleted file mode 100644
index f356e3d3de..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.c
+++ /dev/null
@@ -1,470 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiServicesLib.c
-
-Abstract:
-
- PEI Services Lib
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-/**
- This service enables a given PEIM to register an interface into the PEI Foundation.
-
- @param PpiList A pointer to the list of interfaces that the caller shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPpi (
- IN EFI_PEI_PPI_DESCRIPTOR *PpiList
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->InstallPpi (PeiServices, PpiList);
-}
-
-/**
- This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
-
- @param OldPpi Pointer to the old PEI PPI Descriptors.
- @param NewPpi Pointer to the new PEI PPI Descriptors.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
- @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been
- installed.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesReInstallPpi (
- IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
- IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->ReInstallPpi (PeiServices, OldPpi, NewPpi);
-}
-
-/**
- This service enables PEIMs to discover a given instance of an interface.
-
- @param Guid A pointer to the GUID whose corresponding interface needs to be
- found.
- @param Instance The N-th instance of the interface that is required.
- @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
- @param Ppi A pointer to the instance of the interface.
-
- @retval EFI_SUCCESS The interface was successfully returned.
- @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesLocatePpi (
- IN EFI_GUID *Guid,
- IN UINTN Instance,
- IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
- IN OUT VOID **Ppi
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->LocatePpi (PeiServices, Guid, Instance, PpiDescriptor, Ppi);
-}
-
-/**
- This service enables PEIMs to register a given service to be invoked when another service is
- installed or reinstalled.
-
- @param NotifyList A pointer to the list of notification interfaces that the caller
- shall install.
-
- @retval EFI_SUCCESS The interface was successfully installed.
- @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
- @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the
- EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
- @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesNotifyPpi (
- IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->NotifyPpi (PeiServices, NotifyList);
-}
-
-/**
- This service enables PEIMs to ascertain the present value of the boot mode.
-
- @param BootMode A pointer to contain the value of the boot mode.
-
- @retval EFI_SUCCESS The boot mode was returned successfully.
- @retval EFI_INVALID_PARAMETER BootMode is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetBootMode (
- IN OUT EFI_BOOT_MODE *BootMode
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->GetBootMode (PeiServices, BootMode);
-}
-
-/**
- This service enables PEIMs to update the boot mode variable.
-
- @param BootMode The value of the boot mode to set.
-
- @retval EFI_SUCCESS The value was successfully updated
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesSetBootMode (
- IN EFI_BOOT_MODE BootMode
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->SetBootMode (PeiServices, BootMode);
-}
-
-/**
- This service enables a PEIM to ascertain the address of the list of HOBs in memory.
-
- @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
-
- @retval EFI_SUCCESS The list was successfully returned.
- @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesGetHobList (
- IN OUT VOID **HobList
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->GetHobList (PeiServices, HobList);
-}
-
-/**
- This service enables PEIMs to create various types of HOBs.
-
- @param Type The type of HOB to be installed.
- @param Length The length of the HOB to be added.
- @param Hob The address of a pointer that will contain the HOB header.
-
- @retval EFI_SUCCESS The HOB was successfully created.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesCreateHob (
- IN UINT16 Type,
- IN UINT16 Length,
- IN OUT VOID **Hob
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->CreateHob (PeiServices, Type, Length, Hob);
-}
-
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
-/**
- This service enables PEIMs to discover additional firmware volumes.
-
- @param Instance This instance of the firmware volume to find. The value 0 is the
- Boot Firmware Volume (BFV).
- @param FwVolHeader Pointer to the firmware volume header of the volume to return.
-
- @retval EFI_SUCCESS The volume was found.
- @retval EFI_NOT_FOUND The volume was not found.
- @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->FfsFindNextVolume (PeiServices, Instance, FwVolHeader);
-}
-
-/**
- This service enables PEIMs to discover additional firmware files.
-
- @param SearchType A filter to find files only of this type.
- @param FwVolHeader Pointer to the firmware volume header of the volume to search.
- This parameter must point to a valid FFS volume.
- @param FileHeader Pointer to the current file from which to begin searching.
-
- @retval EFI_SUCCESS The file was found.
- @retval EFI_NOT_FOUND The file was not found.
- @retval EFI_NOT_FOUND The header checksum was not zero.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
- IN OUT EFI_FFS_FILE_HEADER **FileHeader
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, FwVolHeader, FileHeader);
-}
-
-/**
- This service enables PEIMs to discover sections of a given type within a valid FFS file.
-
- @param SearchType The value of the section type to find.
- @param FfsFileHeader A pointer to the file header that contains the set of sections to
- be searched.
- @param SectionData A pointer to the discovered section, if successful.
-
- @retval EFI_SUCCESS The section was found.
- @retval EFI_NOT_FOUND The section was not found.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, FfsFileHeader, SectionData);
-}
-
-#endif
-
-/**
- This service enables PEIMs to register the permanent memory configuration
- that has been initialized with the PEI Foundation.
-
- @param MemoryBegin The value of a region of installed memory.
- @param MemoryLength The corresponding length of a region of installed memory.
-
- @retval EFI_SUCCESS The region was successfully installed in a HOB.
- @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
- @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesInstallPeiMemory (
- IN EFI_PHYSICAL_ADDRESS MemoryBegin,
- IN UINT64 MemoryLength
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->InstallPeiMemory (PeiServices, MemoryBegin, MemoryLength);
-}
-
-/**
- This service enables PEIMs to allocate memory after the permanent memory has been installed by a
- PEIM.
-
- @param MemoryType Type of memory to allocate.
- @param Pages Number of pages to allocate.
- @param Memory Pointer of memory allocated.
-
- @retval EFI_SUCCESS The memory range was successfully allocated.
- @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
- @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
- @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePages (
- IN EFI_MEMORY_TYPE MemoryType,
- IN UINTN Pages,
- IN OUT EFI_PHYSICAL_ADDRESS *Memory
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return ((*PeiServices)->AllocatePages) (PeiServices, MemoryType, Pages, Memory);
-}
-
-/**
- This service allocates memory from the Hand-Off Block (HOB) heap.
-
- @param Size The number of bytes to allocate from the pool.
- @param Buffer If the call succeeds, a pointer to a pointer to the allocate
- buffer; undefined otherwise.
-
- @retval EFI_SUCCESS The allocation was successful
- @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesAllocatePool (
- IN UINTN Size,
- OUT VOID **Buffer
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return ((*PeiServices)->AllocatePool) (PeiServices, Size, Buffer);
-}
-
-/**
- This service resets the entire platform, including all processors and devices, and reboots the
- system.
-
- @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesResetSystem (
- VOID
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer ();
- return (*PeiServices)->PeiResetSystem (PeiServices);
-}
-/**
- PCI read-modify-write operations.
-
- PIWG's PI specification replaces Inte's EFI Specification 1.10.
- EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by
- EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function in these two PPI are not
- compatibile with each other.
-
- For Framework code that make the following call:
- PciCfg->Modify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
- it will be updated to the following code which call this library API:
- PeiLibPciCfgModify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
-
- @param PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- @param PciCfg A pointer to the this pointer of EFI_PEI_PCI_CFG_PPI.
- This parameter is unused as a place holder to make
- the parameter list identical to PEI_PCI_CFG_PPI_RW.
- @param Width The width of the access. Enumerated in bytes. Type
- EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
- @param Address The physical address of the access.
- @param SetBits Points to value to bitwise-OR with the read configuration value.
- The size of the value is determined by Width.
- @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
- The size of the value is determined by Width.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_DEVICE_ERROR There was a problem with the transaction.
-**/
-EFI_STATUS
-EFIAPI
-PeiLibPciCfgModify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_PCI_CFG_PPI *PciCfg,
- IN PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN UINTN SetBits,
- IN UINTN ClearBits
- )
-{
- EFI_STATUS Status;
- EFI_PEI_PCI_CFG2_PPI *PciCfg2;
-
- Status = (*PeiServices)->LocatePpi (
- PeiServices,
- &gPeiPciCfg2PpiGuid,
- 0,
- NULL,
- (VOID **) &PciCfg2
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = PciCfg2->Modify (
- (CONST EFI_PEI_SERVICES **) PeiServices,
- PciCfg2,
- (EFI_PEI_PCI_CFG_PPI_WIDTH) Width,
- Address,
- &SetBits,
- &ClearBits
- );
-
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.inf
deleted file mode 100644
index 761bff6265..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesLib/PeiServicesLib.inf
+++ /dev/null
@@ -1,87 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiServicesLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiServicesLib
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiServicesLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiServicesLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
-#
-# If necessary, EdkIIGluePeiServicesTablePointerLib can be
-# used to replace EdkIIGluePeiServicesTablePointerLibMm7 or
-# EdkIIGluePeiServicesTablePointerLibKr1
-#
- EdkFrameworkPpiLib
-
-[libraries.ia32]
- EdkIIGluePeiServicesTablePointerLibMm7
-
-[libraries.x64]
- EdkIIGluePeiServicesTablePointerLibMm7
-
-[libraries.ipf]
- EdkIIGluePeiServicesTablePointerLibKr1
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
deleted file mode 100644
index 31558c2a11..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiServicesTablePointer.c
-
-Abstract:
-
- PEI Services Table Pointer Library.
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-static EFI_PEI_SERVICES **gPeiServices;
-
-/**
- The function returns the pointer to PEI services.
-
- The function returns the pointer to PEI services.
- It will ASSERT() if the pointer to PEI services is NULL.
-
- @retval The pointer to PeiServices.
-
-**/
-EFI_PEI_SERVICES **
-EFIAPI
-GetPeiServicesTablePointer (
- VOID
- )
-{
- ASSERT (gPeiServices != NULL);
- return gPeiServices;
-}
-
-
-/**
- The constructor function caches the pointer to PEI services.
-
- The constructor function caches the pointer to PEI services.
- It will always return EFI_SUCCESS.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
- gPeiServices = PeiServices;
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
deleted file mode 100644
index d433d953b7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
+++ /dev/null
@@ -1,79 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiServiceTablePointerLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiServicesTablePointerLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiServicesTablePointerLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiServicesTablePointer.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
-
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/ReadKr1.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/ReadKr1.s
deleted file mode 100644
index 4683e7d373..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/ReadKr1.s
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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.
-//
-// Module Name:
-//
-// ReadKr1.s
-//
-// Abstract:
-//
-// Contains assembly code for read Kr1.
-//
-//--
-
- .file "ReadKr1.s"
-
-#include "IpfMacro.i"
-
-//---------------------------------------------------------------------------------
-//++
-// AsmReadKr1
-//
-// This routine is used to get KR1. KR1 is used to store Pei Service Table
-// Pointer in archeture.
-//
-// Arguments :
-//
-// On Entry : None.
-//
-// Return Value: Pei Services Table.
-//
-//--
-//----------------------------------------------------------------------------------
-PROCEDURE_ENTRY (AsmReadKr1)
-
- mov r8 = ar.k1;; // Pei Services Table Pointer
- br.ret.dpnt b0;;
-
-PROCEDURE_EXIT (AsmReadKr1)
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/WriteKr1.s b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/WriteKr1.s
deleted file mode 100644
index f2e0c04822..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/Ipf/WriteKr1.s
+++ /dev/null
@@ -1,45 +0,0 @@
-// 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.
-//
-// Module Name:
-//
-// WriteKr1.s
-//
-// Abstract:
-//
-// Contains assembly code for write Kr1.
-//
-//--
-
- .file "WriteKr1.s"
-
-#include "IpfMacro.i"
-
-//---------------------------------------------------------------------------------
-//++
-// AsmWriteKr1
-//
-// This routine is used to Write KR1. KR1 is used to store Pei Service Table
-// Pointer in archeture.
-//
-// Arguments : r32 Pei Services Table Pointer
-//
-// On Entry : None.
-//
-// Return Value: None.
-//
-//--
-//----------------------------------------------------------------------------------
-PROCEDURE_ENTRY (AsmWriteKr1)
-
- mov ar.k1 = r32;; // Pei Services Table Pointer
- br.ret.dpnt b0;;
-
-PROCEDURE_EXIT (AsmWriteKr1)
- \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointer.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointer.c
deleted file mode 100644
index 2f2e87e8c9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointer.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiServicesTablePointer.c
-
-Abstract:
-
- PEI Services Table Pointer Library.
-
---*/
-
-#include "PeiServicesTablePointerLibInternals.h"
-
-/**
- The function returns the pointer to PeiServices.
-
- The function returns the pointer to PeiServices.
- It will ASSERT() if the pointer to PeiServices is NULL.
-
- @retval The pointer to PeiServices.
-
-**/
-EFI_PEI_SERVICES **
-EFIAPI
-GetPeiServicesTablePointer (
- VOID
- )
-{
- EFI_PEI_SERVICES **PeiServices;
-
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadKr1 ();
-#else
- PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadKr7 ();
-#endif
- ASSERT (PeiServices != NULL);
- return PeiServices;
-}
-
-/**
- The constructor function caches the pointer to PEI services.
-
- The constructor function caches the pointer to PEI services.
- It will always return EFI_SUCCESS.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- AsmWriteKr1 ((UINT64)(UINTN)PeiServices);
-#endif
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibInternals.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibInternals.h
deleted file mode 100644
index 6e6b934714..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibInternals.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiServicesTablePointerLibInternals.h
-
-Abstract:
-
- Declarations of internal functions in PeiServicesTableLibKr1.
-
---*/
-
-#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_INTERTALS_H__
-#define __PEI_SERVICES_TABLE_POINTER_LIB_INTERTALS_H__
-
-#include "EdkIIGluePeim.h"
-
-/**
- Reads the current value of Kr1.
-
- @return The current value of Kr1.
-
-**/
-UINT64
-EFIAPI
-AsmReadKr1 (
- VOID
- );
-
-/**
- Writes the current value of Kr1.
-
- @param Value The 64-bit value to write to Kr1.
-
-**/
-UINT64
-EFIAPI
-AsmWriteKr1 (
- IN UINT64 Value
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibKr1.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibKr1.inf
deleted file mode 100644
index ffb253c570..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointerLibKr1.inf
+++ /dev/null
@@ -1,74 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiServiceTablePointerLibKr1.inf
-#
-# Abstract:
-#
-# Component description file for PeiServicesTablePointerLibKr1.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiServicesTablePointerLibKr1
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ipf]
- PeiServicesTablePointer.c
- Ipf/ReadKr1.s
- Ipf/WriteKr1.s
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c
deleted file mode 100644
index 622f8b9c69..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiServicesTablePointer.c
-
-Abstract:
-
- PEI Services Table Pointer Library.
-
---*/
-
-#include "EdkIIGluePeim.h"
-
-/**
- The function returns the pointer to PeiServices.
-
- The function returns the pointer to PeiServices.
- It will ASSERT() if the pointer to PeiServices is NULL.
-
- @retval The pointer to PeiServices.
-
-**/
-EFI_PEI_SERVICES **
-EFIAPI
-GetPeiServicesTablePointer (
- VOID
- )
-{
- IA32_DESCRIPTOR Idtr;
- EFI_PEI_SERVICES **PeiServices;
-
- AsmReadIdtr (&Idtr);
- PeiServices = (EFI_PEI_SERVICES **)(UINTN)(*(UINTN*)(Idtr.Base - sizeof (UINTN)));
-
- if ((*PeiServices)->Hdr.Signature == PEI_SERVICES_SIGNATURE) {
- return PeiServices;
- } else {
- PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadMm7 ();
- ASSERT (PeiServices != NULL);
- return PeiServices;
- }
-}
-
-/**
- The constructor function caches the pointer to PEI services.
-
- The constructor function caches the pointer to PEI services.
- It will always return EFI_SUCCESS.
-
- @param FfsHeader Pointer to FFS header the loaded driver.
- @param PeiServices Pointer to the PEI services.
-
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-PeiServicesTablePointerLibConstructor (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
- IN EFI_PEI_SERVICES **PeiServices
- )
-{
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- AsmWriteMm7 ((UINT64)(UINTN)PeiServices);
-#endif
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointerLibMm7.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointerLibMm7.inf
deleted file mode 100644
index f9d216f59e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointerLibMm7.inf
+++ /dev/null
@@ -1,78 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiServiceTablePointerLibMm7.inf
-#
-# Abstract:
-#
-# Component description file for PeiServicesTablePointerLibMm7.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiServicesTablePointerLibMm7
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
-
-[sources.ia32]
- PeiServicesTablePointer.c
-[sources.x64]
- PeiServicesTablePointer.c
-
-[sources.ipf]
-
-[sources.ebc]
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[libraries.common]
- EdkIIGlueBaseLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.c
deleted file mode 100644
index ffe4a5d3cb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiSmbusLib.c
-
-Abstract:
-
- PEI Smbus Lib internal functions
-
---*/
-
-#include "PeiSmbusLibInternal.h"
-
-/**
- Gets Smbus PPIs.
-
- This internal function retrieves Smbus PPI from PPI database.
-
- @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
-
- @return The pointer to Smbus PPI.
-
-**/
-EFI_PEI_SMBUS_PPI *
-InternalGetSmbusPpi (
- EFI_PEI_SERVICES **PeiServices
- )
-{
- EFI_STATUS Status;
- EFI_PEI_SMBUS_PPI *SmbusPpi;
-
- Status = (*PeiServices)->LocatePpi (PeiServices, &gEfiPeiSmbusPpiGuid, 0, NULL, (VOID **) &SmbusPpi);
- ASSERT_EFI_ERROR (Status);
- ASSERT (SmbusPpi != NULL);
-
- return SmbusPpi;
-}
-
-/**
- Executes an SMBus operation to an SMBus controller.
-
- This function provides a standard way to execute Smbus script
- as defined in the SmBus Specification. The data can either be of
- the Length byte, word, or a block of data.
-
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The actual number of bytes that are executed for this operation..
-
-**/
-UINTN
-InternalSmBusExec (
- IN EFI_SMBUS_OPERATION SmbusOperation,
- IN UINTN SmBusAddress,
- IN UINTN Length,
- IN OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- EFI_PEI_SMBUS_PPI *SmbusPpi;
- EFI_PEI_SERVICES **PeiServices;
- RETURN_STATUS ReturnStatus;
- EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
-
- PeiServices = GetPeiServicesTablePointer ();
- SmbusPpi = InternalGetSmbusPpi (PeiServices);
- SmbusDeviceAddress.SmbusDeviceAddress = SMBUS_LIB_SLAVE_ADDRESS (SmBusAddress);
-
- ReturnStatus = SmbusPpi->Execute (
- PeiServices,
- SmbusPpi,
- SmbusDeviceAddress,
- SMBUS_LIB_COMMAND (SmBusAddress),
- SmbusOperation,
- SMBUS_LIB_PEC (SmBusAddress),
- &Length,
- Buffer
- );
- if (Status != NULL) {
- *Status = ReturnStatus;
- }
-
- return Length;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.inf
deleted file mode 100644
index d00f46a00d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLib.inf
+++ /dev/null
@@ -1,86 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiSmbusLib.inf
-#
-# Abstract:
-#
-# Component description file for PeiSmbusLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGluePeiSmbusLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiSmbusLib.c
- SmbusLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
- $(EDK_SOURCE)/Foundation/Include/Pei
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGluePeiServicesTablePointerLibMm7
-#
-# If necessary, EdkIIGluePeiServicesTablePointerLib can be
-# used to replace EdkIIGluePeiServicesTablePointerLibMm7
-#
-
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLibInternal.h
deleted file mode 100644
index 0baa4cad21..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/PeiSmbusLibInternal.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiSmbusLibInternal.h
-
-Abstract:
-
- Declarations of internal functions in PeiSmbusLib.
-
---*/
-
-#ifndef __PEI_SMBUS_LIB_INTERNAL_H__
-#define __PEI_SMBUS_LIB_INTERNAL_H__
-
-#include "EdkIIGluePeim.h"
-
-
-#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
-#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
-#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
-#define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))
-#define SMBUS_LIB_RESEARVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))
-
-//
-// Declaration for internal functions
-//
-
-/**
- Gets Smbus PPIs.
-
- This internal function retrieves Smbus PPI from PPI database.
-
- @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
-
- @return The pointer to Smbus PPI.
-
-**/
-EFI_PEI_SMBUS_PPI *
-InternalGetSmbusPpi (
- EFI_PEI_SERVICES **PeiServices
- );
-
-/**
- Executes an SMBus operation to an SMBus controller.
-
- This function provides a standard way to execute Smbus script
- as defined in the SmBus Specification. The data can either be of
- the Length byte, word, or a block of data.
-
- @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to
- execute the SMBus transactions.
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Length Signifies the number of bytes that this operation will do. The maximum number of
- bytes can be revision specific and operation specific.
- @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations
- require this argument. The length of this buffer is identified by Length.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The actual number of bytes that are executed for this operation.
-
-**/
-UINTN
-InternalSmBusExec (
- IN EFI_SMBUS_OPERATION SmbusOperation,
- IN UINTN SmBusAddress,
- IN UINTN Length,
- IN OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- );
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/SmbusLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/SmbusLib.c
deleted file mode 100644
index 106bea9b66..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/PeiSmbusLib/SmbusLib.c
+++ /dev/null
@@ -1,475 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- PeiSmbus.c
-
-Abstract:
-
- Pei Smbus Lib Interfaces
-
---*/
-
-#include "PeiSmbusLibInternal.h"
-
-/**
- Executes an SMBUS quick read command.
-
- Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickRead (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (!SMBUS_LIB_PEC (SmBusAddress));
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusQuickRead, SmBusAddress, 0, NULL, Status);
-}
-
-/**
- Executes an SMBUS quick write command.
-
- Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If PEC is set in SmBusAddress, then ASSERT().
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
-**/
-VOID
-EFIAPI
-SmBusQuickWrite (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (!SMBUS_LIB_PEC (SmBusAddress));
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusQuickWrite, SmBusAddress, 0, NULL, Status);
-}
-
-/**
- Executes an SMBUS receive byte command.
-
- Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address field of SmBusAddress is required.
- The byte received from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte received from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReceiveByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReceiveByte, SmBusAddress, 1, &Byte, Status);
-
- return Byte;
-}
-
-/**
- Executes an SMBUS send byte command.
-
- Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.
- The byte specified by Value is sent.
- Only the SMBUS slave address field of SmBusAddress is required. Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Command in SmBusAddress is not zero, then ASSERT().
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to send.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusSendByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_COMMAND (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Byte = Value;
- InternalSmBusExec (EfiSmbusSendByte, SmBusAddress, 1, &Byte, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read data byte command.
-
- Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 8-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT8
-EFIAPI
-SmBusReadDataByte (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReadByte, SmBusAddress, 1, &Byte, Status);
-
- return Byte;
-}
-
-/**
- Executes an SMBUS write data byte command.
-
- Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.
- The 8-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 8-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT8
-EFIAPI
-SmBusWriteDataByte (
- IN UINTN SmBusAddress,
- IN UINT8 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT8 Byte;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Byte = Value;
- InternalSmBusExec (EfiSmbusWriteByte, SmBusAddress, 1, &Byte, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read data word command.
-
- Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value read from the SMBUS is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The byte read from the SMBUS.
-
-**/
-UINT16
-EFIAPI
-SmBusReadDataWord (
- IN UINTN SmBusAddress,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT16 Word;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusReadWord, SmBusAddress, 2, &Word, Status);
-
- return Word;
-}
-
-/**
- Executes an SMBUS write data word command.
-
- Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Value is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The parameter of Value.
-
-**/
-UINT16
-EFIAPI
-SmBusWriteDataWord (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINT16 Word;
-
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Word = Value;
- InternalSmBusExec (EfiSmbusWriteWord, SmBusAddress, 2, &Word, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS process call command.
-
- Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.
- The 16-bit value specified by Value is written.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- The 16-bit value returned by the process call command is returned.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is not zero, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Value The 16-bit value to write.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The 16-bit value returned by the process call command.
-
-**/
-UINT16
-EFIAPI
-SmBusProcessCall (
- IN UINTN SmBusAddress,
- IN UINT16 Value,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- InternalSmBusExec (EfiSmbusProcessCall, SmBusAddress, 2, &Value, Status);
-
- return Value;
-}
-
-/**
- Executes an SMBUS read block command.
-
- Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.
- Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.
- Bytes are read from the SMBUS and stored in Buffer.
- The number of bytes read is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is not zero, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes read.
-
-**/
-UINTN
-EFIAPI
-SmBusReadBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- ASSERT (Buffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- return InternalSmBusExec (EfiSmbusReadBlock, SmBusAddress, 0x20, Buffer, Status);
-}
-
-/**
- Executes an SMBUS write block command.
-
- Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from Buffer.
- The number of bytes written is returned, and will never return a value larger than 32-bytes.
- If Status is not NULL, then the status of the executed command is returned in Status.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If Buffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param Buffer Pointer to the buffer to store the bytes read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusWriteBlock (
- IN UINTN SmBusAddress,
- OUT VOID *Buffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINTN Length;
-
- ASSERT (Buffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Length = SMBUS_LIB_LENGTH (SmBusAddress);
- return InternalSmBusExec (EfiSmbusWriteBlock, SmBusAddress, Length, Buffer, Status);
-}
-
-/**
- Executes an SMBUS block process call command.
-
- Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.
- The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.
- Bytes are written to the SMBUS from WriteBuffer. Bytes are then read from the SMBUS into ReadBuffer.
- If Status is not NULL, then the status of the executed command is returned in Status.
- It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.
- SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.
- If Length in SmBusAddress is zero or greater than 32, then ASSERT().
- If WriteBuffer is NULL, then ASSERT().
- If ReadBuffer is NULL, then ASSERT().
- If any reserved bits of SmBusAddress are set, then ASSERT().
-
- @param SmBusAddress Address that encodes the SMBUS Slave Address,
- SMBUS Command, SMBUS Data Length, and PEC.
- @param WriteBuffer Pointer to the buffer of bytes to write to the SMBUS.
- @param ReadBuffer Pointer to the buffer of bytes to read from the SMBUS.
- @param Status Return status for the executed command.
- This is an optional parameter and may be NULL.
-
- @return The number of bytes written.
-
-**/
-UINTN
-EFIAPI
-SmBusBlockProcessCall (
- IN UINTN SmBusAddress,
- IN VOID *WriteBuffer,
- OUT VOID *ReadBuffer,
- OUT RETURN_STATUS *Status OPTIONAL
- )
-{
- UINTN Length;
-
- ASSERT (WriteBuffer != NULL);
- ASSERT (ReadBuffer != NULL);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);
- ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);
- ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);
-
- Length = SMBUS_LIB_LENGTH (SmBusAddress);
- //
- // Assuming that ReadBuffer is large enough to save another memory copy.
- //
- ReadBuffer = CopyMem (ReadBuffer, WriteBuffer, Length);
- return InternalSmBusExec (EfiSmbusBWBRProcessCall, SmBusAddress, Length, ReadBuffer, Status);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c
deleted file mode 100644
index ef16d4010d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLib.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ReportStatusCodeLib.c
-
-Abstract:
-
- Report Status Code Library for SMM Runtime driver.
-
---*/
-
-#include "ReportStatusCodeLibInternal.h"
-
-
-EFI_REPORT_STATUS_CODE mReportStatusCode = NULL;
-
-/**
- Internal worker function that reports a status code through the Status Code Protocol
-
- This function checks to see if a Status Code Protocol is present in the handle
- database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
- returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
- and the ReportStatusCode() service of the Status Code Protocol is called passing in
- Type, Value, Instance, CallerId, and Data. The result of this call is returned.
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. This is an optional parameter that may be
- NULL.
- @param Data Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
- @retval EFI_UNSUPPORTED Status Code Protocol is not available.
-
-**/
-EFI_STATUS
-InternalReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- //
- // If gStatusCode is NULL, then see if a Status Code Protocol instance is present
- // in the handle database.
- //
- if (mReportStatusCode == NULL) {
- mReportStatusCode = InternalGetReportStatusCode ();
- if (mReportStatusCode == NULL) {
- return EFI_UNSUPPORTED;
- }
- }
-
- //
- // A Status Code Protocol is present in the handle database, so pass in all the
- // parameters to the ReportStatusCode() service of the Status Code Protocol
- //
- return (*mReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);
-}
-
-
-/**
- Computes and returns the size, in bytes, of a device path.
-
- @param DevicePath A pointer to a device path.
-
- @return The size, in bytes, of DevicePath.
-
-**/
-UINTN
-InternalReportStatusCodeDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Start;
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!IsDevicePathEnd (DevicePath)) {
- DevicePath = NextDevicePathNode (DevicePath);
- }
-
- //
- // Subtract the start node from the end node and add in the size of the end node
- //
- return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);
-}
-
-
-/**
- Converts a status code to an 8-bit POST code value.
-
- Converts the status code specified by CodeType and Value to an 8-bit POST code
- and returns the 8-bit POST code in PostCode. If CodeType is an
- EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
- are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
- 24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
-
- If PostCode is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param PostCode A pointer to the 8-bit POST code value to return.
-
- @retval TRUE The status code specified by CodeType and Value was converted
- to an 8-bit POST code and returned in PostCode.
- @retval FALSE The status code specified by CodeType and Value could not be
- converted to an 8-bit POST code value.
-
-**/
-BOOLEAN
-EFIAPI
-GlueCodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- )
-{
- //
- // If PostCode is NULL, then ASSERT()
- //
- ASSERT (PostCode != NULL);
-
- //
- // Convert Value to an 8 bit post code
- //
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ) {
- *PostCode = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |
- (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts ASSERT() information from a status code structure.
-
- Converts the status code specified by CodeType, Value, and Data to the ASSERT()
- arguments specified by Filename, Description, and LineNumber. If CodeType is
- an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
- Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
- Filename, Description, and LineNumber from the optional data area of the
- status code buffer specified by Data. The optional data area of Data contains
- a Null-terminated ASCII string for the FileName, followed by a Null-terminated
- ASCII string for the Description, followed by a 32-bit LineNumber. If the
- ASSERT() information could be extracted from Data, then return TRUE.
- Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If Filename is NULL, then ASSERT().
- If Description is NULL, then ASSERT().
- If LineNumber is NULL, then ASSERT().
-
- @param CodeType The type of status code being converted.
- @param Value The status code value being converted.
- @param Data Pointer to status code data buffer.
- @param Filename Pointer to the source file name that generated the ASSERT().
- @param Description Pointer to the description of the ASSERT().
- @param LineNumber Pointer to source line number that generated the ASSERT().
-
- @retval TRUE The status code specified by CodeType, Value, and Data was
- converted ASSERT() arguments specified by Filename, Description,
- and LineNumber.
- @retval FALSE The status code specified by CodeType, Value, and Data could
- not be converted to ASSERT() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- )
-{
- EFI_DEBUG_ASSERT_DATA *AssertData;
-
- ASSERT (Data != NULL);
- ASSERT (Filename != NULL);
- ASSERT (Description != NULL);
- ASSERT (LineNumber != NULL);
-
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
- ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED) &&
- ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {
- AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
- *Filename = (CHAR8 *)(AssertData + 1);
- *Description = *Filename + AsciiStrLen (*Filename) + 1;
- *LineNumber = AssertData->LineNumber;
- return TRUE;
- }
- return FALSE;
-}
-
-
-/**
- Extracts DEBUG() information from a status code structure.
-
- Converts the status code specified by Data to the DEBUG() arguments specified
- by ErrorLevel, Marker, and Format. If type GUID in Data is
- EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
- Format from the optional data area of the status code buffer specified by Data.
- The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
- which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
- the Format. If the DEBUG() information could be extracted from Data, then
- return TRUE. Otherwise, FALSE is returned.
-
- If Data is NULL, then ASSERT().
- If ErrorLevel is NULL, then ASSERT().
- If Marker is NULL, then ASSERT().
- If Format is NULL, then ASSERT().
-
- @param Data Pointer to status code data buffer.
- @param ErrorLevel Pointer to error level mask for a debug message.
- @param Marker Pointer to the variable argument list associated with Format.
- @param Format Pointer to a Null-terminated ASCII format string of a
- debug message.
-
- @retval TRUE The status code specified by Data was converted DEBUG() arguments
- specified by ErrorLevel, Marker, and Format.
- @retval FALSE The status code specified by Data could not be converted to
- DEBUG() arguments.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportStatusCodeExtractDebugInfo (
- IN CONST EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- )
-{
- EFI_DEBUG_INFO *DebugInfo;
-
- ASSERT (Data != NULL);
- ASSERT (ErrorLevel != NULL);
- ASSERT (Marker != NULL);
- ASSERT (Format != NULL);
-
- //
- // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE
- //
- if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {
- return FALSE;
- }
-
- //
- // Retrieve the debug information from the status code record
- //
- DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);
-
- *ErrorLevel = DebugInfo->ErrorLevel;
-
- //
- // The first 12 * UINTN bytes of the string are really an
- // argument stack to support varargs on the Format string.
- //
-#ifdef __APPLE__
- // This is non portable C code you can't assume VA_LIST is pointer
- return FALSE;
-#else
- *Marker = (VA_LIST) (DebugInfo + 1);
-#endif
- *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
-
- return TRUE;
-}
-
-
-/**
- Reports a status code.
-
- Reports the status code specified by the parameters Type and Value. Status
- code also require an instance, caller ID, and extended data. This function
- passed in a zero instance, NULL extended data, and a caller ID of
- gEfiCallerIdGuid, which is the GUID for the module.
-
- ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCode() must return immediately.
-
- @param Type Status code type.
- @param Value Status code value.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_DEVICE_ERROR There status code could not be reported due to a
- device error.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value
- )
-{
- return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);
-}
-
-
-/**
- Reports a status code with a Device Path Protocol as the extended data.
-
- Allocates and fills in the extended data section of a status code with the
- Device Path Protocol specified by DevicePath. This function is responsible
- for allocating a buffer large enough for the standard header and the device
- path. The standard header is filled in with a GUID of
- gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
- instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithDevicePath()must actively prevent recursion. If
- ReportStatusCodeWithDevicePath() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithDevicePath()
- must return EFI_DEVICE_ERROR immediately.
-
- If DevicePath is NULL, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param DevicePath Pointer to the Device Path Protocol to be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by DevicePath.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithDevicePath (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- ASSERT (DevicePath != NULL);
- return ReportStatusCodeWithExtendedData (
- Type,
- Value,
- (VOID *)DevicePath,
- InternalReportStatusCodeDevicePathSize (DevicePath)
- );
-}
-
-
-/**
- Reports a status code with an extended data buffer.
-
- Allocates and fills in the extended data section of a status code with the
- extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
- is assumed to be one of the data structures specified in Related Definitions.
- These data structure do not have the standard header, so this function is
- responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled
- in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
- with a zero instance and a caller ID of gEfiCallerIdGuid.
-
- ReportStatusCodeWithExtendedData()must actively prevent recursion. If
- ReportStatusCodeWithExtendedData() is called while processing another any other
- Report Status Code Library function, then ReportStatusCodeWithExtendedData()
- must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL, then ASSERT().
- If ExtendedDataSize is 0, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param ExtendedData Pointer to the extended data buffer to be reported.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer to
- be reported.
-
- @retval EFI_SUCCESS The status code was reported with the extended
- data specified by ExtendedData and ExtendedDataSize.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
- extended data section.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeWithExtendedData (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN CONST VOID *ExtendedData,
- IN UINTN ExtendedDataSize
- )
-{
- ASSERT (ExtendedData != NULL);
- ASSERT (ExtendedDataSize != 0);
- return ReportStatusCodeEx (
- Type,
- Value,
- 0,
- NULL,
- NULL,
- ExtendedData,
- ExtendedDataSize
- );
-}
-
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If
- ReportStatusCodeEx() is called while processing another any
- other Report Status Code Library function, then
- ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-GlueReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- )
-{
- EFI_STATUS Status;
-
- Status = InternalReportStatusCodeEx (
- Type,
- Value,
- Instance,
- CallerId,
- ExtendedDataGuid,
- ExtendedData,
- ExtendedDataSize
- );
-
- return Status;
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportProgressCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportErrorCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);
-}
-
-
-/**
- Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
-
- This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
- bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
-
- @retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is set.
- @retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
- PcdReportStatusCodeProperyMask is clear.
-
-**/
-BOOLEAN
-EFIAPI
-GlueReportDebugCodeEnabled (
- VOID
- )
-{
- return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
deleted file mode 100644
index 6d42c97810..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- ReportStatusCodeLibInternal.h
-
-Abstract:
-
- Internal Header file of Report Status Code Library for RUNTIME
- DXE Phase.
-
---*/
-
-#ifndef __REPORT_STATUS_CODE_LIB_INTERNAL__H
-#define __REPORT_STATUS_CODE_LIB_INTERNAL__H
-
-#include "EdkIIGlueDxe.h"
-
-/**
- Locatet he report status code service.
-
- @return EFI_REPORT_STATUS_CODE function point to
- ReportStatusCode.
-**/
-EFI_REPORT_STATUS_CODE
-InternalGetReportStatusCode (
- VOID
- );
-
-/**
- Internal worker function that reports a status code through the Status Code Protocol
-
- This function checks to see if a Status Code Protocol is present in the handle
- database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
- returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
- and the ReportStatusCode() service of the Status Code Protocol is called passing in
- Type, Value, Instance, CallerId, and Data. The result of this call is returned.
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. This is an optional parameter that may be
- NULL.
- @param Data Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
- @retval EFI_UNSUPPORTED Status Code Protocol is not available.
-
-**/
-EFI_STATUS
-InternalReportStatusCode (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- );
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-InternalReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- );
-
-extern EFI_REPORT_STATUS_CODE mReportStatusCode;
-
-#endif // __REPORT_STATUS_CODE_LIB_INTERNAL__H
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeReportStatusCodeLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeReportStatusCodeLib.inf
deleted file mode 100644
index 4137bb6367..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeReportStatusCodeLib.inf
+++ /dev/null
@@ -1,96 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 2011, 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.
-#
-# Module Name:
-#
-# SmmRuntimeDxeReportStatusCodeLib.inf
-#
-# Abstract:
-#
-# Component description file for SmmRuntimeDxeReportStatusCodeLib
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueSmmRuntimeDxeReportStatusCodeLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- ReportStatusCodeLib.c
- SmmRuntimeDxeSupport.c
- ReportStatusCodeLibInternal.h
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Framework/Guid/DataHubRecords
- $(EDK_SOURCE)/Foundation/Framework/Guid/StatusCodeDataTypeId
- $(EDK_SOURCE)/Foundation/Core/Dxe/ArchProtocol/StatusCode
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
-#
-# when EFI_SPECIFICATION_VERSION < 0x00020000, gRT is used
-#
- EdkIIGlueUefiRuntimeServicesTableLib
-# EDK lib
- EfiProtocolLib
-# Possibly, gEfiCallerIdGuid might be used.
- EdkGuidLib
- ArchProtocolLib
-
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[libraries.ebc]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeSupport.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeSupport.c
deleted file mode 100644
index 70ae09228d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/SmmRuntimeDxeReportStatusCodeLib/SmmRuntimeDxeSupport.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-
-Module Name:
-
- SmmRuntimeDxeSupport.c
-
-Abstract:
-
- Report Status Code Library for DXE Phase.
-
---*/
-
-#include "ReportStatusCodeLibInternal.h"
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
-
-EFI_EVENT mVirtualAddressChangeEvent;
-
-EFI_EVENT mExitBootServicesEvent;
-
-EFI_STATUS_CODE_DATA *mStatusCodeData;
-
-BOOLEAN mInSmm;
-
-EFI_SMM_BASE_PROTOCOL *mSmmBase;
-
-EFI_RUNTIME_SERVICES *mRTSmmRuntimeDxeReportStatusCodeLib;
-
-BOOLEAN mHaveExitedBootServices = FALSE;
-
-EFI_SMM_STATUS_CODE_PROTOCOL *mSmmStatusCode;
-
-VOID
-SmmStatusCodeInitialize (
- VOID
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, (VOID **) &mSmmStatusCode);
- if (EFI_ERROR (Status)) {
- mSmmStatusCode = NULL;
- }
-}
-
-EFI_STATUS
-SmmStatusCodeReport (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-{
- if (mSmmStatusCode != NULL) {
- (mSmmStatusCode->ReportStatusCode) (mSmmStatusCode, Type, Value, Instance, CallerId, Data);
- }
- return EFI_SUCCESS;
-}
-
-/**
- Locate he report status code service.
-
- @return EFI_REPORT_STATUS_CODE function point to
- ReportStatusCode.
-**/
-EFI_REPORT_STATUS_CODE
-InternalGetReportStatusCode (
- VOID
- )
-{
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- EFI_STATUS_CODE_PROTOCOL *StatusCodeProtocol;
- EFI_STATUS Status;
-#endif
-
- if (mInSmm) {
- return (EFI_REPORT_STATUS_CODE) SmmStatusCodeReport;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- } else if (!mHaveExitedBootServices) {
- //
- // Check gBS just in case. ReportStatusCode is called before gBS is initialized.
- //
- if (gBS != NULL) {
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);
- if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {
- return StatusCodeProtocol->ReportStatusCode;
- }
- }
- }
-#elif (TIANO_RELEASE_VERSION != 0)
- } else if (mRTSmmRuntimeDxeReportStatusCodeLib != NULL) {
- return mRTSmmRuntimeDxeReportStatusCodeLib->ReportStatusCode;
- }
-#endif
-
- return NULL;
-}
-
-
-/**
- Fixup internal report status code protocol interface.
-
- @param[in] Event The Event that is being processed
- @param[in] Context Event Context
-**/
-VOID
-EFIAPI
-ReportStatusCodeLibVirtualAddressChange (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- if (NULL != mReportStatusCode) {
- mRTSmmRuntimeDxeReportStatusCodeLib->ConvertPointer (0, (VOID **) &mReportStatusCode);
- }
- mRTSmmRuntimeDxeReportStatusCodeLib->ConvertPointer (0, (VOID **) &mStatusCodeData);
- mRTSmmRuntimeDxeReportStatusCodeLib->ConvertPointer (0, (VOID **) &mRTSmmRuntimeDxeReportStatusCodeLib);
-}
-
-/**
- Update the In Runtime Indicator.
-
- @param[in] Event The Event that is being processed
- @param[in] Context Event Context
-**/
-VOID
-EFIAPI
-ReportStatusCodeLibExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- //
- // If mReportStatusCode is NULL, then see if a Status Code Protocol instance is present
- // in the handle database.
- //
- if (mReportStatusCode == NULL) {
- mReportStatusCode = InternalGetReportStatusCode ();
- }
-
- mHaveExitedBootServices = TRUE;
-}
-
-/**
- Intialize Report Status Code Lib.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @return EFI_STATUS always returns EFI_SUCCESS.
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCodeLibConstruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- //
- // SMM driver depends on the SMM BASE protocol.
- // the SMM driver must be success to locate protocol.
- //
- Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID **) &mSmmBase);
- if (!EFI_ERROR (Status)) {
- mSmmBase->InSmm (mSmmBase, &mInSmm);
- if (mInSmm) {
- Status = mSmmBase->SmmAllocatePool (
- mSmmBase,
- EfiRuntimeServicesData,
- sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE,
- (VOID **) &mStatusCodeData
- );
- ASSERT_EFI_ERROR (Status);
- SmmStatusCodeInitialize ();
- return EFI_SUCCESS;
- }
- }
-
- //
- // Library should not use the gRT directly, since it
- // may be converted by other library instance.
- //
- mRTSmmRuntimeDxeReportStatusCodeLib = gRT;
- mInSmm = FALSE;
-
- (gBS->AllocatePool) (EfiRuntimeServicesData, sizeof (EFI_STATUS_CODE_DATA) + EFI_STATUS_CODE_DATA_MAX_SIZE, (VOID **)&mStatusCodeData);
- ASSERT (NULL != mStatusCodeData);
- //
- // Cache the report status code service
- //
- mReportStatusCode = InternalGetReportStatusCode ();
-
- //
- // Register the call back of virtual address change
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- TPL_NOTIFY,
- ReportStatusCodeLibVirtualAddressChange,
- NULL,
- &mVirtualAddressChangeEvent
- );
- ASSERT_EFI_ERROR (Status);
-
-
- //
- // Register the call back of exit boot services
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- TPL_NOTIFY,
- ReportStatusCodeLibExitBootServices,
- NULL,
- &mExitBootServicesEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
-
-/**
- Desctructor of library will close events.
-
- @param ImageHandle callder module's image handle
- @param SystemTable pointer to EFI system table.
- @return the status of close event.
-**/
-EFI_STATUS
-EFIAPI
-ReportStatusCodeLibDestruct (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- if (!mInSmm) {
- //
- // Close SetVirtualAddressMap () notify function
- //
- ASSERT (gBS != NULL);
- Status = gBS->CloseEvent (mVirtualAddressChangeEvent);
- ASSERT_EFI_ERROR (Status);
- Status = gBS->CloseEvent (mExitBootServicesEvent);
- ASSERT_EFI_ERROR (Status);
-
- (gBS->FreePool) (mStatusCodeData);
- } else {
- mSmmBase->SmmFreePool (mSmmBase, mStatusCodeData);
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Reports a status code with full parameters.
-
- The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
- is 0, then an extended data buffer is not reported. If ExtendedData is not
- NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
- ExtendedData is assumed not have the standard status code header, so this function
- is responsible for allocating a buffer large enough for the standard header and
- the extended data passed into this function. The standard header is filled in
- with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
- GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
- an instance specified by Instance and a caller ID specified by CallerId. If
- CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
-
- ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
- is called while processing another any other Report Status Code Library function,
- then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
-
- If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
- If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
-
- @param Type Status code type.
- @param Value Status code value.
- @param Instance Status code instance number.
- @param CallerId Pointer to a GUID that identifies the caller of this
- function. If this parameter is NULL, then a caller
- ID of gEfiCallerIdGuid is used.
- @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
- If this parameter is NULL, then a the status code
- standard header is filled in with
- gEfiStatusCodeSpecificDataGuid.
- @param ExtendedData Pointer to the extended data buffer. This is an
- optional parameter that may be NULL.
- @param ExtendedDataSize The size, in bytes, of the extended data buffer.
-
- @retval EFI_SUCCESS The status code was reported.
- @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
- the extended data section if it was specified.
- @retval EFI_UNSUPPORTED Report status code is not supported
-
-**/
-EFI_STATUS
-EFIAPI
-InternalReportStatusCodeEx (
- IN EFI_STATUS_CODE_TYPE Type,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN CONST EFI_GUID *CallerId OPTIONAL,
- IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
- IN CONST VOID *ExtendedData OPTIONAL,
- IN UINTN ExtendedDataSize
- )
-{
- ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));
- ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
-
- if (ExtendedDataSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Fill in the extended data header
- //
- mStatusCodeData->HeaderSize = (UINT16) sizeof (EFI_STATUS_CODE_DATA);
- mStatusCodeData->Size = (UINT16)ExtendedDataSize;
- if (ExtendedDataGuid == NULL) {
- ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;
- }
- CopyGuid (&mStatusCodeData->Type, ExtendedDataGuid);
-
- //
- // Fill in the extended data buffer
- //
- CopyMem (mStatusCodeData + 1, ExtendedData, ExtendedDataSize);
-
- //
- // Report the status code
- //
- if (CallerId == NULL) {
- CallerId = &gEfiCallerIdGuid;
- }
- return InternalReportStatusCode (Type, Value, Instance, CallerId, mStatusCodeData);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
deleted file mode 100644
index 52e593dcd1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- UefiBootServicesTableLib.c
-
-Abstract:
-
- UEFI Boot Services Table Library.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-
-EFI_SYSTEM_TABLE *gST;
-EFI_BOOT_SERVICES *gBS;
-
-/**
- The constructor function caches the pointer of Boot Services Table.
-
- The constructor function caches the pointer of Boot Services Table through System Table.
- It will ASSERT() if the pointer of System Table is NULL.
- It will ASSERT() if the pointer of Boot Services Table is NULL.
- It will always return EFI_SUCCESS.
-
- @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
-UefiBootServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // Cache pointer to the EFI System Table
- //
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- //
- // Cache pointer to the EFI Boot Services Table
- //
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
deleted file mode 100644
index af32aea277..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+++ /dev/null
@@ -1,77 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# UefiBootServicesTableLib.inf
-#
-# Abstract:
-#
-# Component description file for UefiBootServicesTableLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueUefiBootServicesTableLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiBootServicesTableLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
- $(EDK_SOURCE)/Foundation/Efi/Protocol/DevicePath
-
-[libraries.common]
-
-[libraries.ia32]
-
-[libraries.x64]
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.c
deleted file mode 100644
index 97ec84ca2d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- UefiDevicePathLib.c
-
-Abstract:
-
- Device Path services. The thing to remember is device paths are built out of
- nodes. The device path is terminated by an end node that is length
- sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
- all over this file.
-
- The only place where multi-instance device paths are supported is in
- environment varibles. Multi-instance device paths should never be placed
- on a Handle.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-#include "Library/EdkIIGlueMemoryAllocationLib.h"
-
-/**
- Returns the size of a device path in bytes.
-
- This function returns the size, in bytes, of the device path data structure specified by
- DevicePath including the end of device path node. If DevicePath is NULL, then 0 is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @return The size of a device path in bytes.
-
-**/
-UINTN
-EFIAPI
-GlueGetDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Start;
-
- if (DevicePath == NULL) {
- return 0;
- }
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Compute the size and add back in the size of the end device path structure
- //
- return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
-}
-
-/**
- Creates a new device path by appending a second device path to a first device path.
-
- This function allocates space for a new copy of the device path specified by DevicePath. If
- DevicePath is NULL, then NULL is returned. If the memory is successfully allocated, then the
- contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer
- is returned. Otherwise, NULL is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @return A pointer to the duplicated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueDuplicateDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN Size;
-
- //
- // Compute the size
- //
- Size = GetDevicePathSize (DevicePath);
- if (Size == 0) {
- return NULL;
- }
-
- //
- // Allocate space for duplicate device path
- //
- NewDevicePath = AllocateCopyPool (Size, DevicePath);
-
- return NewDevicePath;
-}
-
-/**
- Creates a new device path by appending a second device path to a first device path.
-
- This function creates a new device path by appending a copy of SecondDevicePath to a copy of
- FirstDevicePath in a newly allocated buffer. Only the end-of-device-path device node from
- SecondDevicePath is retained. The newly created device path is returned.
- If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.
- If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.
- If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.
- If there is not enough memory for the newly allocated buffer, then NULL is returned.
- The memory for the new device path is allocated from EFI boot services memory. It is the
- responsibility of the caller to free the memory allocated.
-
- @param FirstDevicePath A pointer to a device path data structure.
- @param SecondDevicePath A pointer to a device path data structure.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePath (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath OPTIONAL
- )
-{
- UINTN Size;
- UINTN Size1;
- UINTN Size2;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath2;
-
- //
- // If there's only 1 path, just duplicate it.
- //
- if (FirstDevicePath == NULL) {
- return DuplicateDevicePath (SecondDevicePath);
- }
-
- if (SecondDevicePath == NULL) {
- return DuplicateDevicePath (FirstDevicePath);
- }
-
- //
- // Allocate space for the combined device path. It only has one end node of
- // length EFI_DEVICE_PATH_PROTOCOL.
- //
- Size1 = GetDevicePathSize (FirstDevicePath);
- Size2 = GetDevicePathSize (SecondDevicePath);
- Size = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL);
-
- NewDevicePath = AllocatePool (Size);
-
- if (NewDevicePath != NULL) {
- NewDevicePath = CopyMem (NewDevicePath, FirstDevicePath, Size1);
- //
- // Over write FirstDevicePath EndNode and do the copy
- //
- DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath +
- (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));
- CopyMem (DevicePath2, SecondDevicePath, Size2);
- }
-
- return NewDevicePath;
-}
-
-/**
- Creates a new path by appending the device node to the device path.
-
- This function creates a new device path by appending a copy of the device node specified by
- DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device node.
- If DevicePath is NULL, then NULL is returned.
- If DevicePathNode is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathNode A pointer to a single device path node.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePathNode (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathNode OPTIONAL
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *NextNode;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN NodeLength;
-
- if (DevicePath == NULL || DevicePathNode == NULL) {
- return NULL;
- }
- //
- // Build a Node that has a terminator on it
- //
- NodeLength = DevicePathNodeLength (DevicePathNode);
-
- TempDevicePath = AllocatePool (NodeLength + sizeof (EFI_DEVICE_PATH_PROTOCOL));
- if (TempDevicePath == NULL) {
- return NULL;
- }
- TempDevicePath = CopyMem (TempDevicePath, DevicePathNode, NodeLength);
- //
- // Add and end device path node to convert Node to device path
- //
- NextNode = NextDevicePathNode (TempDevicePath);
- SetDevicePathEndNode (NextNode);
- //
- // Append device paths
- //
- NewDevicePath = AppendDevicePath (DevicePath, TempDevicePath);
-
- FreePool (TempDevicePath);
-
- return NewDevicePath;
-}
-
-/**
- Creates a new device path by appending the specified device path instance to the specified device
- path.
-
- This function creates a new device path by appending a copy of the device path instance specified
- by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.
- The end-of-device-path device node is moved after the end of the appended device path instance
- and a new end-of-device-path-instance node is inserted between.
- If DevicePath is NULL, then a copy if DevicePathInstance is returned.
- If DevicePathInstance is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param DevicePath A pointer to a device path data structure.
- @param DevicePathInstance A pointer to a device path instance.
-
- @return A pointer to the new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueAppendDevicePathInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, OPTIONAL
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance OPTIONAL
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
- UINTN SrcSize;
- UINTN InstanceSize;
-
- if (DevicePath == NULL) {
- return DuplicateDevicePath (DevicePathInstance);
- }
-
- if (DevicePathInstance == NULL) {
- return NULL;
- }
-
- SrcSize = GetDevicePathSize (DevicePath);
- InstanceSize = GetDevicePathSize (DevicePathInstance);
-
- NewDevicePath = AllocatePool (SrcSize + InstanceSize);
- if (NewDevicePath != NULL) {
-
- TempDevicePath = CopyMem (NewDevicePath, DevicePath, SrcSize);;
-
- while (!IsDevicePathEnd (TempDevicePath)) {
- TempDevicePath = NextDevicePathNode (TempDevicePath);
- }
-
- TempDevicePath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE;
- TempDevicePath = NextDevicePathNode (TempDevicePath);
- CopyMem (TempDevicePath, DevicePathInstance, InstanceSize);
- }
-
- return NewDevicePath;
-}
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- This function creates a copy of the current device path instance. It also updates DevicePath to
- point to the next device path instance in the device path (or NULL if no more) and updates Size
- to hold the size of the device path instance copy.
- If DevicePath is NULL, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
- If Size is NULL, then ASSERT().
-
- @param DevicePath On input, this holds the pointer to the current device path
- instance. On output, this holds the pointer to the next device
- path instance or NULL if there are no more device path
- instances in the device path pointer to a device path data
- structure.
- @param Size On output, this holds the size of the device path instance, in
- bytes or zero, if DevicePath is NULL.
-
- @return A pointer to the current device path instance.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueGetNextDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *ReturnValue;
- UINT8 Temp;
-
- ASSERT (Size != NULL);
-
- if (DevicePath == NULL || *DevicePath == NULL) {
- *Size = 0;
- return NULL;
- }
-
- //
- // Find the end of the device path instance
- //
- DevPath = *DevicePath;
- while (!IsDevicePathEndType (DevPath)) {
- DevPath = NextDevicePathNode (DevPath);
- }
-
- //
- // Compute the size of the device path instance
- //
- *Size = ((UINTN) DevPath - (UINTN) (*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
-
- //
- // Make a copy and return the device path instance
- //
- Temp = DevPath->SubType;
- DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- ReturnValue = DuplicateDevicePath (*DevicePath);
- DevPath->SubType = Temp;
-
- //
- // If DevPath is the end of an entire device path, then another instance
- // does not follow, so *DevicePath is set to NULL.
- //
- if (DevicePathSubType (DevPath) == END_ENTIRE_DEVICE_PATH_SUBTYPE) {
- *DevicePath = NULL;
- } else {
- *DevicePath = NextDevicePathNode (DevPath);
- }
-
- return ReturnValue;
-}
-
-/**
- Creates a copy of the current device path instance and returns a pointer to the next device path
- instance.
-
- This function creates a new device node in a newly allocated buffer of size NodeLength and
- initializes the device path node header with NodeType and NodeSubType. The new device path node
- is returned.
- If NodeLength is smaller than a device path header, then NULL is returned.
- If there is not enough memory to allocate space for the new device path, then NULL is returned.
- The memory is allocated from EFI boot services memory. It is the responsibility of the caller to
- free the memory allocated.
-
- @param NodeType The device node type for the new device node.
- @param NodeSubType The device node sub-type for the new device node.
- @param NodeLength The length of the new device node.
-
- @return The new device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-CreateDeviceNode (
- IN UINT8 NodeType,
- IN UINT8 NodeSubType,
- IN UINT16 NodeLength
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- if (NodeLength < sizeof (EFI_DEVICE_PATH_PROTOCOL)) {
- //
- // NodeLength is less than the size of the header.
- //
- return NULL;
- }
-
- DevicePath = AllocatePool (NodeLength);
- if (DevicePath != NULL) {
- DevicePath->Type = NodeType;
- DevicePath->SubType = NodeSubType;
- SetDevicePathNodeLength (DevicePath, NodeLength);
- }
-
- return DevicePath;
-}
-
-/**
- Determines if a device path is single or multi-instance.
-
- This function returns TRUE if the device path specified by DevicePath is multi-instance.
- Otherwise, FALSE is returned. If DevicePath is NULL, then FALSE is returned.
-
- @param DevicePath A pointer to a device path data structure.
-
- @retval TRUE DevicePath is multi-instance.
- @retval FALSE DevicePath is not multi-instance or DevicePath is NULL.
-
-**/
-BOOLEAN
-EFIAPI
-GlueIsDevicePathMultiInstance (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Node;
-
- if (DevicePath == NULL) {
- return FALSE;
- }
-
- Node = DevicePath;
- while (!EfiIsDevicePathEnd (Node)) {
- if (EfiIsDevicePathEndInstance (Node)) {
- return TRUE;
- }
-
- Node = EfiNextDevicePathNode (Node);
- }
-
- return FALSE;
-}
-
-
-/**
- Retrieves the device path protocol from a handle.
-
- This function returns the device path protocol from the handle specified by Handle. If Handle is
- NULL or Handle does not contain a device path protocol, then NULL is returned.
-
- @param Handle The handle from which to retrieve the device path protocol.
-
- @return The device path protocol from the handle specified by Handle.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueDevicePathFromHandle (
- IN EFI_HANDLE Handle
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiDevicePathProtocolGuid,
- (VOID *) &DevicePath
- );
- if (EFI_ERROR (Status)) {
- DevicePath = NULL;
- }
- return DevicePath;
-}
-
-/**
- Allocates a device path for a file and appends it to an existing device path.
-
- If Device is a valid device handle that contains a device path protocol, then a device path for
- the file specified by FileName is allocated and appended to the device path associated with the
- handle Device. The allocated device path is returned. If Device is NULL or Device is a handle
- that does not support the device path protocol, then a device path containing a single device
- path node for the file specified by FileName is allocated and returned.
- If FileName is NULL, then ASSERT().
-
- @param Device A pointer to a device handle. This parameter is optional and
- may be NULL.
- @param FileName A pointer to a Null-terminated Unicode string.
-
- @return The allocated device path.
-
-**/
-EFI_DEVICE_PATH_PROTOCOL *
-EFIAPI
-GlueFileDevicePath (
- IN EFI_HANDLE Device, OPTIONAL
- IN CONST CHAR16 *FileName
- )
-{
- UINTN Size;
- FILEPATH_DEVICE_PATH *FilePath;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *FileDevicePath;
-
- DevicePath = NULL;
-
- Size = StrSize (FileName);
- FileDevicePath = AllocatePool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + EFI_END_DEVICE_PATH_LENGTH);
- if (FileDevicePath != NULL) {
- FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePath;
- FilePath->Header.Type = MEDIA_DEVICE_PATH;
- FilePath->Header.SubType = MEDIA_FILEPATH_DP;
- CopyMem (&FilePath->PathName, FileName, Size);
- SetDevicePathNodeLength (&FilePath->Header, Size + SIZE_OF_FILEPATH_DEVICE_PATH);
- SetDevicePathEndNode (NextDevicePathNode (&FilePath->Header));
-
- if (Device != NULL) {
- DevicePath = DevicePathFromHandle (Device);
- }
-
- DevicePath = AppendDevicePath (DevicePath, FileDevicePath);
- FreePool (FileDevicePath);
- }
-
- return DevicePath;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.inf
deleted file mode 100644
index 7ddee305a7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+++ /dev/null
@@ -1,85 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# UefiDevicePathLib.inf
-#
-# Abstract:
-#
-# Component description file for UefiDevicePathLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueUefiDevicePathLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiDevicePathLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
- $(EDK_SOURCE)/Foundation/Efi/Protocol/DevicePath
-
-[libraries.common]
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
-#
-# MemoryAllocationLib instance
-#
- EdkIIGlueDxeMemoryAllocationLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
deleted file mode 100644
index d5af3d69cc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/*++
-
-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
-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:
-
- UefiDriverModelLib.c
-
-Abstract:
-
- UEFI Driver Model Library.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-
-
-/**
- The constructor function installs the standard EFI Driver Model Protocols.
-
- @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 constructor always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-UefiDriverModelLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status = EFI_UNSUPPORTED;
- EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
-
- //
- // The Driver Binding Protocol must never be NULL
- //
- DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *) _gDriverModelProtocolList[0].DriverBinding;
- ASSERT(DriverBinding != NULL);
-
- //
- // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
- // Install the first Driver Bindng Protocol onto ImageHandle
- //
- DriverBinding->ImageHandle = ImageHandle;
- DriverBinding->DriverBindingHandle = ImageHandle;
-
- //
- // See if onle one Driver Binding Protocol is advertised by the driver
- // EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
- //
-
-
- //
- // Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
- // These are all checks against const pointers, so the optimizing compiler will only select one of the
- // calls to InstallMultipleProtocolInterfaces()
- //
- if ((_gEdkIIGlueDriverModelProtocolSelection == 1) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
- if (_gDriverModelProtocolList[0].DriverDiagnostics == NULL) {
- if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- NULL
- );
- }
- }
- } else {
- if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- }
- }
- }
- } // selection == 1 or 3
-
- if ((_gEdkIIGlueDriverModelProtocolSelection == 2) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
- if (_gDriverModelProtocolList[0].DriverDiagnostics2== NULL) {
- if (_gDriverModelProtocolList[0].DriverConfiguration2== NULL) {
- if (_gDriverModelProtocolList[0].ComponentName2== NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- NULL
- );
- }
- }
- } else {
- if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- } else {
- Status = gBS->InstallMultipleProtocolInterfaces (
- &DriverBinding->DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- }
- }
- }
- } // selection == 2 or 3
-
- //
- // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
- //
- ASSERT_EFI_ERROR (Status);
- return Status;
-}
-
-/**
- The destructor function uninstalls the standard EFI Driver Model Protocols.
-
- @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 destructor always return EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-UefiDriverModelLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status = EFI_UNSUPPORTED;
- EFI_HANDLE DriverBindingHandle;
-
- //
- // See if onle one Driver Binding Protocol is advertised by the driver
- // EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
- //
-
- //
- // The Driver Binding Protocol must never be NULL
- //
- ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
-
- //
- // Retrieve the DriverBindingHandle from the Driver Binding Protocol
- //
- DriverBindingHandle = _gDriverModelProtocolList[0].DriverBinding->DriverBindingHandle;
-
- //
- // Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
- // These are all checks against const pointers, so the optimizing compiler will only select one of the
- // calls to InstallMultipleProtocolInterfaces()
- //
- if ((_gEdkIIGlueDriverModelProtocolSelection == 1) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
- if (_gDriverModelProtocolList[0].DriverDiagnostics == NULL) {
- if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- NULL
- );
- }
- }
- } else {
- if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
- &gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
- &gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
- NULL
- );
- }
- }
- }
- } // selection == 1 or 3
-
- if ((_gEdkIIGlueDriverModelProtocolSelection == 2) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
- if (_gDriverModelProtocolList[0].DriverDiagnostics2 == NULL) {
- if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- NULL
- );
- }
- }
- } else {
- if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- }
- } else {
- if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- } else {
- Status = gBS->UninstallMultipleProtocolInterfaces (
- &DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
- &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
- &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
- NULL
- );
- }
- }
- }
- } // selection == 2 or 3
-
- //
- // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
- //
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.inf
deleted file mode 100644
index 2fe34d5382..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.inf
+++ /dev/null
@@ -1,67 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# UefiDriverModelLib.inf
-#
-# Abstract:
-#
-# Component description file for UefiDriverModelLib.inf
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueUefiDriverModelLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiDriverModelLib.c
-
-[sources.ia32]
-
-[sources.ipf,sources.x64]
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/EdkIIGlueLib/Include
- $(EDK_SOURCE)/Foundation/Core
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
-
-[libraries.common]
- EdkIIGlueUefiBootServicesTableLib
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/Console.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/Console.c
deleted file mode 100644
index 50005709f8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/Console.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- Console.c
-
-Abstract:
-
- UEFI library functions.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-
-typedef struct {
- CHAR16 WChar;
- UINT32 Width;
-} UNICODE_WIDTH_ENTRY;
-
-UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {
- //
- // General script area
- //
- {(CHAR16)0x1FFF, 1},
- /*
- * Merge the blocks and replace them with the above entry as they fall to
- * the same category and they are all narrow glyph. This will reduce search
- * time and table size. The merge will omit the reserved code.
- *
- * Remove the above item if below is un-commented.
- *
- {(CHAR16)0x007F, 1}, // C0 controls and basic Latin. 0x0000-0x007F
- {(CHAR16)0x00FF, 1}, // C1 controls and Latin-1 support. 0x0080-0x00FF
- {(CHAR16)0x017F, 1}, // Latin extended-A. 0x0100-0x017F
- {(CHAR16)0x024F, 1}, // Latin extended-B. 0x0180-0x024F
- {(CHAR16)0x02AF, 1}, // IPA extensions. 0x0250-0x02AF
- {(CHAR16)0x02FF, 1}, // Spacing modifier letters. 0x02B0-0x02FF
- {(CHAR16)0x036F, 1}, // Combining diacritical marks. 0x0300-0x036F
- {(CHAR16)0x03FF, 1}, // Greek. 0x0370-0x03FF
- {(CHAR16)0x04FF, 1}, // Cyrillic. 0x0400-0x04FF
- {(CHAR16)0x052F, 0}, // Unassigned. As Armenian in ver3.0. 0x0500-0x052F
- {(CHAR16)0x058F, 1}, // Armenian. 0x0530-0x058F
- {(CHAR16)0x05FF, 1}, // Hebrew. 0x0590-0x05FF
- {(CHAR16)0x06FF, 1}, // Arabic. 0x0600-0x06FF
- {(CHAR16)0x08FF, 0}, // Unassigned. 0x0700-0x08FF
- {(CHAR16)0x097F, 1}, // Devanagari. 0x0900-0x097F
- {(CHAR16)0x09FF, 1}, // Bengali. 0x0980-0x09FF
- {(CHAR16)0x0A7F, 1}, // Gurmukhi. 0x0A00-0x0A7F
- {(CHAR16)0x0AFF, 1}, // Gujarati. 0x0A80-0x0AFF
- {(CHAR16)0x0B7F, 1}, // Oriya. 0x0B00-0x0B7F
- {(CHAR16)0x0BFF, 1}, // Tamil. (See page 7-92). 0x0B80-0x0BFF
- {(CHAR16)0x0C7F, 1}, // Telugu. 0x0C00-0x0C7F
- {(CHAR16)0x0CFF, 1}, // Kannada. (See page 7-100). 0x0C80-0x0CFF
- {(CHAR16)0x0D7F, 1}, // Malayalam (See page 7-104). 0x0D00-0x0D7F
- {(CHAR16)0x0DFF, 0}, // Unassigned. 0x0D80-0x0DFF
- {(CHAR16)0x0E7F, 1}, // Thai. 0x0E00-0x0E7F
- {(CHAR16)0x0EFF, 1}, // Lao. 0x0E80-0x0EFF
- {(CHAR16)0x0FBF, 1}, // Tibetan. 0x0F00-0x0FBF
- {(CHAR16)0x109F, 0}, // Unassigned. 0x0FC0-0x109F
- {(CHAR16)0x10FF, 1}, // Georgian. 0x10A0-0x10FF
- {(CHAR16)0x11FF, 1}, // Hangul Jamo. 0x1100-0x11FF
- {(CHAR16)0x1DFF, 0}, // Unassigned. 0x1200-0x1DFF
- {(CHAR16)0x1EFF, 1}, // Latin extended additional. 0x1E00-0x1EFF
- {(CHAR16)0x1FFF, 1}, // Greek extended. 0x1F00-0x1FFF
- *
- */
-
- //
- // Symbol area
- //
- {(CHAR16)0x2FFF, 1},
- /*
- * Merge the blocks and replace them with the above entry as they fall to
- * the same category and they are all narrow glyph. This will reduce search
- * time and table size. The merge will omit the reserved code.
- *
- * Remove the above item if below is un-commented.
- *
- {(CHAR16)0x206F, 1}, // General punctuation. (See page7-154). 0x200-0x206F
- {(CHAR16)0x209F, 1}, // Superscripts and subscripts. 0x2070-0x209F
- {(CHAR16)0x20CF, 1}, // Currency symbols. 0x20A0-0x20CF
- {(CHAR16)0x20FF, 1}, // Combining diacritical marks for symbols. 0x20D0-0x20FF
- {(CHAR16)0x214F, 1}, // Letterlike sympbols. 0x2100-0x214F
- {(CHAR16)0x218F, 1}, // Number forms. 0x2150-0x218F
- {(CHAR16)0x21FF, 1}, // Arrows. 0x2190-0x21FF
- {(CHAR16)0x22FF, 1}, // Mathematical operators. 0x2200-0x22FF
- {(CHAR16)0x23FF, 1}, // Miscellaneous technical. 0x2300-0x23FF
- {(CHAR16)0x243F, 1}, // Control pictures. 0x2400-0x243F
- {(CHAR16)0x245F, 1}, // Optical character recognition. 0x2440-0x245F
- {(CHAR16)0x24FF, 1}, // Enclosed alphanumerics. 0x2460-0x24FF
- {(CHAR16)0x257F, 1}, // Box drawing. 0x2500-0x257F
- {(CHAR16)0x259F, 1}, // Block elements. 0x2580-0x259F
- {(CHAR16)0x25FF, 1}, // Geometric shapes. 0x25A0-0x25FF
- {(CHAR16)0x26FF, 1}, // Miscellaneous symbols. 0x2600-0x26FF
- {(CHAR16)0x27BF, 1}, // Dingbats. 0x2700-0x27BF
- {(CHAR16)0x2FFF, 0}, // Reserved. 0x27C0-0x2FFF
- *
- */
-
- //
- // CJK phonetics and symbol area
- //
- {(CHAR16)0x33FF, 2},
- /*
- * Merge the blocks and replace them with the above entry as they fall to
- * the same category and they are all wide glyph. This will reduce search
- * time and table size. The merge will omit the reserved code.
- *
- * Remove the above item if below is un-commented.
- *
- {(CHAR16)0x303F, 2}, // CJK symbols and punctuation. 0x3000-0x303F
- {(CHAR16)0x309F, 2}, // Hiragana. 0x3040-0x309F
- {(CHAR16)0x30FF, 2}, // Katakana. 0x30A0-0x30FF
- {(CHAR16)0x312F, 2}, // Bopomofo. 0x3100-0x312F
- {(CHAR16)0x318F, 2}, // Hangul compatibility jamo. 0x3130-0x318F
- {(CHAR16)0x319F, 2}, // Kanbun. 0x3190-0x319F
- {(CHAR16)0x31FF, 0}, // Reserved. As Bopomofo extended in ver3.0. 0x31A0-0x31FF
- {(CHAR16)0x32FF, 2}, // Enclosed CJK letters and months. 0x3200-0x32FF
- {(CHAR16)0x33FF, 2}, // CJK compatibility. 0x3300-0x33FF
- *
- */
-
- //
- // CJK ideograph area
- //
- {(CHAR16)0x9FFF, 2},
- /*
- * Merge the blocks and replace them with the above entry as they fall to
- * the same category and they are all wide glyph. This will reduce search
- * time and table size. The merge will omit the reserved code.
- *
- * Remove the above item if below is un-commented.
- *
- {(CHAR16)0x4DFF, 0}, // Reserved. 0x3400-0x4DBF as CJK unified ideographs
- // extension A in ver3.0. 0x3400-0x4DFF
- {(CHAR16)0x9FFF, 2}, // CJK unified ideographs. 0x4E00-0x9FFF
- *
- */
-
- //
- // Reserved
- //
- {(CHAR16)0xABFF, 0}, // Reserved. 0xA000-0xA490 as Yi syllables. 0xA490-0xA4D0
- // as Yi radicals in ver3.0. 0xA000-0xABFF
- //
- // Hangul syllables
- //
- {(CHAR16)0xD7FF, 2},
- /*
- * Merge the blocks and replace them with the above entry as they fall to
- * the same category and they are all wide glyph. This will reduce search
- * time and table size. The merge will omit the reserved code.
- *
- * Remove the above item if below is un-commented.
- *
- {(CHAR16)0xD7A3, 2}, // Hangul syllables. 0xAC00-0xD7A3
- {(CHAR16)0xD7FF, 0}, // Reserved. 0xD7A3-0xD7FF
- *
- */
-
- //
- // Surrogates area
- //
- {(CHAR16)0xDFFF, 0}, // Surrogates, not used now. 0xD800-0xDFFF
-
- //
- // Private use area
- //
- {(CHAR16)0xF8FF, 0}, // Private use area. 0xE000-0xF8FF
-
- //
- // Compatibility area and specials
- //
- {(CHAR16)0xFAFF, 2}, // CJK compatibility ideographs. 0xF900-0xFAFF
- {(CHAR16)0xFB4F, 1}, // Alphabetic presentation forms. 0xFB00-0xFB4F
- {(CHAR16)0xFDFF, 1}, // Arabic presentation forms-A. 0xFB50-0xFDFF
- {(CHAR16)0xFE1F, 0}, // Reserved. As variation selectors in ver3.0. 0xFE00-0xFE1F
- {(CHAR16)0xFE2F, 1}, // Combining half marks. 0xFE20-0xFE2F
- {(CHAR16)0xFE4F, 2}, // CJK compatibility forms. 0xFE30-0xFE4F
- {(CHAR16)0xFE6F, 1}, // Small Form Variants. 0xFE50-0xFE6F
- {(CHAR16)0xFEFF, 1}, // Arabic presentation forms-B. 0xFE70-0xFEFF
- {(CHAR16)0xFFEF, 1}, // Half width and full width forms. 0xFF00-0xFFEF
- {(CHAR16)0xFFFF, 0}, // Speicials. 0xFFF0-0xFFFF
-};
-
-/**
- This function computes and returns the width of the Unicode character
- specified by UnicodeChar.
-
- @param UnicodeChar A Unicode character.
-
- @retval 0 The width if UnicodeChar could not be determined.
- @retval 1 UnicodeChar is a narrow glyph.
- @retval 2 UnicodeChar is a wide glyph.
-
-**/
-UINTN
-EFIAPI
-GlueGetGlyphWidth (
- IN CHAR16 UnicodeChar
- )
-{
- UINTN Index;
- UINTN Low;
- UINTN High;
- UNICODE_WIDTH_ENTRY *Item;
-
- Item = NULL;
- Low = 0;
- High = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;
- while (Low <= High) {
- Index = (Low + High) >> 1;
- Item = &(mUnicodeWidthTable[Index]);
- if (Index == 0) {
- if (UnicodeChar <= Item->WChar) {
- break;
- }
-
- return 0;
- }
-
- if (UnicodeChar > Item->WChar) {
- Low = Index + 1;
- } else if (UnicodeChar <= mUnicodeWidthTable[Index - 1].WChar) {
- High = Index - 1;
- } else {
- //
- // Index - 1 < UnicodeChar <= Index. Found
- //
- break;
- }
- }
-
- if (Low <= High) {
- return Item->Width;
- }
-
- return 0;
-}
-
-/**
- This function computes and returns the display length of
- the Null-terminated Unicode string specified by String.
- If String is NULL, then 0 is returned.
- If any of the widths of the Unicode characters in String
- can not be determined, then 0 is returned.
-
- @param String A pointer to a Null-terminated Unicode string.
-
- @return The display length of the Null-terminated Unicode string specified by String.
-
-**/
-UINTN
-EFIAPI
-UnicodeStringDisplayLength (
- IN CONST CHAR16 *String
- )
-{
- UINTN Length;
- UINTN Width;
-
- if (String == NULL) {
- return 0;
- }
-
- Length = 0;
- while (*String != 0) {
- Width = GetGlyphWidth (*String);
- if (Width == 0) {
- return 0;
- }
-
- Length += Width;
- String++;
- }
-
- return Length;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
deleted file mode 100644
index cdfea2daf3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
+++ /dev/null
@@ -1,911 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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 "EdkIIGlueUefi.h"
-#include "Library/EdkIIGlueMemoryAllocationLib.h"
-
-
-/**
- This function searches the list of configuration tables stored in the EFI System
- Table for a table with a GUID that matches TableGuid. If a match is found,
- then a pointer to the configuration table is returned in Table, and EFI_SUCCESS
- is returned. If a matching GUID is not found, then EFI_NOT_FOUND is returned.
-
- @param TableGuid Pointer to table's GUID type..
- @param Table Pointer to the table associated with TableGuid in the EFI System Table.
-
- @retval EFI_SUCCESS A configuration table matching TableGuid was found.
- @retval EFI_NOT_FOUND A configuration table matching TableGuid could not be found.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- OUT VOID **Table
- )
-{
- EFI_SYSTEM_TABLE *SystemTable;
- UINTN Index;
-
- ASSERT (TableGuid != NULL);
- ASSERT (Table != NULL);
-
- SystemTable = gST;
- *Table = NULL;
- for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {
- if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {
- *Table = SystemTable->ConfigurationTable[Index].VendorTable;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-/**
- This function causes the notification function to be executed for every protocol
- of type ProtocolGuid instance that exists in the system when this function is
- invoked. In addition, every time a protocol of type ProtocolGuid instance is
- installed or reinstalled, the notification function is also executed.
-
- @param ProtocolGuid Supplies GUID of the protocol upon whose installation the event is fired.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
-
- @return The notification event that was created.
-
-**/
-EFI_EVENT
-EFIAPI
-EfiCreateProtocolNotifyEvent(
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext, OPTIONAL
- OUT VOID **Registration
- )
-{
- EFI_STATUS Status;
- EFI_EVENT Event;
-
- //
- // Create the event
- //
-
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &Event
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Register for protocol notifactions on this event
- //
-
- Status = gBS->RegisterProtocolNotify (
- ProtocolGuid,
- Event,
- Registration
- );
-
- ASSERT_EFI_ERROR (Status);
-
- //
- // Kick the event so we will perform an initial pass of
- // current installed drivers
- //
-
- gBS->SignalEvent (Event);
- return Event;
-}
-
-/**
- This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.
- This event is signaled with EfiNamedEventSignal(). This provide the ability for
- one or more listeners on the same event named by the GUID specified by Name.
-
- @param Name Supplies GUID name of the event.
- @param NotifyTpl Supplies the task priority level of the event notifications.
- @param NotifyFunction Supplies the function to notify when the event is signaled.
- @param NotifyContext The context parameter to pass to NotifyFunction.
- @param Registration A pointer to a memory location to receive the registration value.
-
- @retval EFI_SUCCESS A named event was created.
- @retval EFI_OUT_OF_RESOURCES There are not enough resource to create the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventListen (
- IN CONST EFI_GUID *Name,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN CONST VOID *NotifyContext, OPTIONAL
- OUT VOID *Registration OPTIONAL
- )
-{
- EFI_STATUS Status;
- EFI_EVENT Event;
- VOID *RegistrationLocal;
-
- //
- // Create event
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- (VOID *) NotifyContext,
- &Event
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // The Registration is not optional to RegisterProtocolNotify().
- // To make it optional to EfiNamedEventListen(), may need to substitute with a local.
- //
- if (Registration != NULL) {
- RegistrationLocal = Registration;
- } else {
- RegistrationLocal = &RegistrationLocal;
- }
-
- //
- // Register for an installation of protocol interface
- //
-
- Status = gBS->RegisterProtocolNotify (
- (EFI_GUID *) Name,
- Event,
- RegistrationLocal
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-/**
- This function signals the named event specified by Name. The named event must
- have been created with EfiNamedEventListen().
-
- @param Name Supplies GUID name of the event.
-
- @retval EFI_SUCCESS A named event was signaled.
- @retval EFI_OUT_OF_RESOURCES There are not enough resource to signal the named event.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiNamedEventSignal (
- IN CONST EFI_GUID *Name
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE Handle;
-
- Handle = NULL;
- Status = gBS->InstallProtocolInterface (
- &Handle,
- (EFI_GUID *) Name,
- EFI_NATIVE_INTERFACE,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->UninstallProtocolInterface (
- Handle,
- (EFI_GUID *) Name,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-/**
- Returns the current TPL.
-
- This function returns the current TPL. There is no EFI service to directly
- retrieve the current TPL. Instead, the RaiseTPL() function is used to raise
- the TPL to TPL_HIGH_LEVEL. This will return the current TPL. The TPL level
- can then immediately be restored back to the current TPL level with a call
- to RestoreTPL().
-
- @param VOID
-
- @retvale EFI_TPL The current TPL.
-
-**/
-EFI_TPL
-EFIAPI
-EfiGetCurrentTpl (
- VOID
- )
-{
- EFI_TPL Tpl;
-
- Tpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);
- gBS->RestoreTPL (Tpl);
-
- return Tpl;
-}
-
-
-/**
- This function initializes a basic mutual exclusion lock to the released state
- and returns the lock. Each lock provides mutual exclusion access at its task
- priority level. Since there is no preemption or multiprocessor support in EFI,
- acquiring the lock only consists of raising to the locks TPL.
-
- @param Lock A pointer to the lock data structure to initialize.
- @param Priority EFI TPL associated with the lock.
-
- @return The lock.
-
-**/
-EFI_LOCK *
-EFIAPI
-GlueEfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-{
- ASSERT (Lock != NULL);
- ASSERT (Priority <= EFI_TPL_HIGH_LEVEL);
-
- Lock->Tpl = Priority;
- Lock->OwnerTpl = EFI_TPL_APPLICATION;
- Lock->Lock = EfiLockReleased ;
- return Lock;
-}
-
-/**
- This function raises the system's current task priority level to the task
- priority level of the mutual exclusion lock. Then, it places the lock in the
- acquired state.
-
- @param Priority The task priority level of the lock.
-
-**/
-VOID
-EFIAPI
-GlueEfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-{
- ASSERT (Lock != NULL);
- ASSERT (Lock->Lock == EfiLockReleased);
-
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
- Lock->Lock = EfiLockAcquired;
-}
-
-/**
- This function raises the system's current task priority level to the task
- priority level of the mutual exclusion lock. Then, it attempts to place the
- lock in the acquired state.
-
- @param Lock A pointer to the lock to acquire.
-
- @retval EFI_SUCCESS The lock was acquired.
- @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-{
-
- ASSERT (Lock != NULL);
- ASSERT (Lock->Lock != EfiLockUninitialized);
-
- if (Lock->Lock == EfiLockAcquired) {
- //
- // Lock is already owned, so bail out
- //
- return EFI_ACCESS_DENIED;
- }
-
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
-
- Lock->Lock = EfiLockAcquired;
-
- return EFI_SUCCESS;
-}
-
-/**
- This function transitions a mutual exclusion lock from the acquired state to
- the released state, and restores the system's task priority level to its
- previous level.
-
- @param Lock A pointer to the lock to release.
-
-**/
-VOID
-EFIAPI
-GlueEfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-{
- EFI_TPL Tpl;
-
- ASSERT (Lock != NULL);
- ASSERT (Lock->Lock == EfiLockAcquired);
-
- Tpl = Lock->OwnerTpl;
-
- Lock->Lock = EfiLockReleased;
-
- gBS->RestoreTPL (Tpl);
-}
-
-/**
- Tests whether a controller handle is being managed by a specific 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 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
- specifed by DriverBindingHandle.
- @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
- specifed by DriverBindingHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestManagedDevice (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE DriverBindingHandle,
- IN CONST EFI_GUID *ProtocolGuid
- )
-{
- EFI_STATUS Status;
- VOID *ManagedInterface;
-
- ASSERT (ProtocolGuid != NULL);
-
- Status = gBS->OpenProtocol (
- ControllerHandle,
- (EFI_GUID *) ProtocolGuid,
- &ManagedInterface,
- DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- ControllerHandle,
- (EFI_GUID *) ProtocolGuid,
- DriverBindingHandle,
- ControllerHandle
- );
- return EFI_UNSUPPORTED;
- }
-
- if (Status != EFI_ALREADY_STARTED) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- Tests whether a child handle is a child device of the controller.
-
- This function tests whether ChildHandle is one of the children of
- ControllerHandle. This test is performed by checking to see if the protocol
- specified by ProtocolGuid is present on ControllerHandle and opened by
- ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
- If ProtocolGuid is NULL, then ASSERT().
-
- @param ControllerHandle A handle for a (parent) controller to test.
- @param ChildHandle A child handle to test.
- @param ConsumsedGuid Supplies the protocol that the child controller
- opens on its parent controller.
-
- @retval EFI_SUCCESS ChildHandle is a child of the ControllerHandle.
- @retval EFI_UNSUPPORTED ChildHandle is not a child of the
- ControllerHandle.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiTestChildHandle (
- IN CONST EFI_HANDLE ControllerHandle,
- IN CONST EFI_HANDLE ChildHandle,
- IN CONST EFI_GUID *ProtocolGuid
- )
-{
- EFI_STATUS Status;
- EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;
- UINTN EntryCount;
- UINTN Index;
-
- ASSERT (ProtocolGuid != NULL);
-
- //
- // Retrieve the list of agents that are consuming the specific protocol
- // on ControllerHandle.
- //
- Status = gBS->OpenProtocolInformation (
- ControllerHandle,
- (EFI_GUID *) ProtocolGuid,
- &OpenInfoBuffer,
- &EntryCount
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Inspect if ChildHandle is one of the agents.
- //
- Status = EFI_UNSUPPORTED;
- for (Index = 0; Index < EntryCount; Index++) {
- if ((OpenInfoBuffer[Index].ControllerHandle == ChildHandle) &&
- (OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
- Status = EFI_SUCCESS;
- break;
- }
- }
-
- FreePool (OpenInfoBuffer);
- return Status;
-}
-
-/**
- Tests whether a language code has format of ISO639-2.
-
- @param Languages The language code to be tested.
-
- @retval TRUE Language code format is ISO 639-2.
- @retval FALSE Language code format is not ISO639-2.
-
-**/
-STATIC
-BOOLEAN
-IsIso639LanguageCode (
- IN CONST CHAR8 *Languages
- )
-{
- UINTN Index;
-
- //
- // Find out format of Languages
- //
- for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';' && Languages[Index] != '-'; Index++);
- if (Languages[Index] != 0) {
- //
- // RFC4646 language code
- //
- return FALSE;
- }
-
- //
- // No ';' and '-', it's either ISO639-2 code (list) or single RFC4646 code
- //
- if (Index == 2) {
- //
- // Single RFC4646 language code without country code, e.g. "en"
- //
- return FALSE;
- }
-
- //
- // Languages in format of ISO639-2
- //
- return TRUE;
-}
-
-/**
- Compare the first language instance of two language codes, either could be a
- single language code or a language code list. This function assume Language1
- and Language2 has the same language code format, i.e. either ISO639-2 or RFC4646.
-
- @param Language1 The first language code to be tested.
- @param Language2 The second language code to be tested.
-
- @retval TRUE Language code match.
- @retval FALSE Language code mismatch.
-
-**/
-STATIC
-BOOLEAN
-CompareLanguageCode (
- IN CONST CHAR8 *Language1,
- IN CONST CHAR8 *Language2
- )
-{
- UINTN Index;
-
- //
- // Compare first two bytes of language tag
- //
- if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {
- return FALSE;
- }
-
- if (IsIso639LanguageCode (Language1)) {
- //
- // ISO639-2 language code, compare the third byte of language tag
- //
- return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);
- }
-
- //
- // RFC4646 language code
- //
- for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++);
- if ((AsciiStrnCmp (Language1, Language2, Index) == 0) && (Language2[Index] == 0 || Language2[Index] == ';')) {
- return TRUE;
- }
-
- return FALSE;
-}
-
-/**
- Step to next language code of a language code list.
-
- @param Languages The language code list to traverse.
-
- @return Pointer to next language code or NULL terminator if it's the last one.
-
-**/
-STATIC
-CONST
-CHAR8 *
-NextSupportedLanguage (
- IN CONST CHAR8 *Languages
- )
-{
- UINTN Index;
-
- if (IsIso639LanguageCode (Languages)) {
- //
- // ISO639-2 language code
- //
- return (Languages + 3);
- }
-
- //
- // Search in RFC4646 language code list
- //
- for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);
- if (Languages[Index] == ';') {
- Index++;
- }
- return (Languages + Index);
-}
-
-/**
- This function looks up a Unicode string in UnicodeStringTable. If Language is
- a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
- that matches the language code specified by Language, then it is returned in
- UnicodeString.
-
- @param Language A pointer to the ISO 639-2 language code for the
- Unicode string to look up and return.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports. Language
- must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string from UnicodeStringTable
- that matches the language specified by Language.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found
- in the table of Unicoide strings UnicodeStringTable,
- and it was returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_UNSUPPORTED UnicodeStringTable is NULL.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
- @retval EFI_UNSUPPORTED The language specified by Language is not
- supported by UnicodeStringTable.
-
-**/
-EFI_STATUS
-EFIAPI
-LookupUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
- OUT CHAR16 **UnicodeString
- )
-{
- //
- // Make sure the parameters are valid
- //
- if (Language == NULL || UnicodeString == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // If there are no supported languages, or the Unicode String Table is empty, then the
- // Unicode String specified by Language is not supported by this Unicode String Table
- //
- if (SupportedLanguages == NULL || UnicodeStringTable == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Make sure Language is in the set of Supported Languages
- //
- while (*SupportedLanguages != 0) {
- if (CompareLanguageCode (Language, SupportedLanguages)) {
-
- //
- // Search the Unicode String Table for the matching Language specifier
- //
- while (UnicodeStringTable->Language != NULL) {
- if (CompareLanguageCode (Language, UnicodeStringTable->Language)) {
-
- //
- // A matching string was found, so return it
- //
- *UnicodeString = UnicodeStringTable->UnicodeString;
- return EFI_SUCCESS;
- }
-
- UnicodeStringTable++;
- }
-
- return EFI_UNSUPPORTED;
- }
-
- SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
- }
-
- return EFI_UNSUPPORTED;
-}
-
-/**
- This function adds a Unicode string to UnicodeStringTable.
- If Language is a member of SupportedLanguages then UnicodeString is added to
- UnicodeStringTable. New buffers are allocated for both Language and
- UnicodeString. The contents of Language and UnicodeString are copied into
- these new buffers. These buffers are automatically freed when
- FreeUnicodeStringTable() is called.
-
- @param Language A pointer to the ISO 639-2 language code for the Unicode
- string to add.
- @param SupportedLanguages A pointer to the set of ISO 639-2 language codes
- that the Unicode string table supports.
- Language must be a member of this set.
- @param UnicodeStringTable A pointer to the table of Unicode strings.
- @param UnicodeString A pointer to the Unicode string to add.
-
- @retval EFI_SUCCESS The Unicode string that matches the language
- specified by Language was found in the table of
- Unicode strings UnicodeStringTable, and it was
- returned in UnicodeString.
- @retval EFI_INVALID_PARAMETER Language is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is NULL.
- @retval EFI_INVALID_PARAMETER UnicodeString is an empty string.
- @retval EFI_UNSUPPORTED SupportedLanguages is NULL.
- @retval EFI_ALREADY_STARTED A Unicode string with language Language is
- already present in UnicodeStringTable.
- @retval EFI_OUT_OF_RESOURCES There is not enough memory to add another
- Unicode string to UnicodeStringTable.
- @retval EFI_UNSUPPORTED The language specified by Language is not a
- member of SupportedLanguages.
-
-**/
-EFI_STATUS
-EFIAPI
-AddUnicodeString (
- IN CONST CHAR8 *Language,
- IN CONST CHAR8 *SupportedLanguages,
- IN EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
- IN CONST CHAR16 *UnicodeString
- )
-{
- UINTN NumberOfEntries;
- EFI_UNICODE_STRING_TABLE *OldUnicodeStringTable;
- EFI_UNICODE_STRING_TABLE *NewUnicodeStringTable;
- UINTN UnicodeStringLength;
-
- //
- // Make sure the parameter are valid
- //
- if (Language == NULL || UnicodeString == NULL || UnicodeStringTable == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // If there are no supported languages, then a Unicode String can not be added
- //
- if (SupportedLanguages == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // If the Unicode String is empty, then a Unicode String can not be added
- //
- if (UnicodeString[0] == 0) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Make sure Language is a member of SupportedLanguages
- //
- while (*SupportedLanguages != 0) {
- if (CompareLanguageCode (Language, SupportedLanguages)) {
-
- //
- // Determine the size of the Unicode String Table by looking for a NULL Language entry
- //
- NumberOfEntries = 0;
- if (*UnicodeStringTable != NULL) {
- OldUnicodeStringTable = *UnicodeStringTable;
- while (OldUnicodeStringTable->Language != NULL) {
- if (CompareLanguageCode (Language, OldUnicodeStringTable->Language)) {
- return EFI_ALREADY_STARTED;
- }
-
- OldUnicodeStringTable++;
- NumberOfEntries++;
- }
- }
-
- //
- // Allocate space for a new Unicode String Table. It must hold the current number of
- // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table
- // marker
- //
- NewUnicodeStringTable = AllocatePool ((NumberOfEntries + 2) * sizeof (EFI_UNICODE_STRING_TABLE));
- if (NewUnicodeStringTable == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // If the current Unicode String Table contains any entries, then copy them to the
- // newly allocated Unicode String Table.
- //
- if (*UnicodeStringTable != NULL) {
- CopyMem (
- NewUnicodeStringTable,
- *UnicodeStringTable,
- NumberOfEntries * sizeof (EFI_UNICODE_STRING_TABLE)
- );
- }
-
- //
- // Allocate space for a copy of the Language specifier
- //
- NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (AsciiStrSize (Language), Language);
- if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
- (gBS->FreePool) (NewUnicodeStringTable);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Compute the length of the Unicode String
- //
- for (UnicodeStringLength = 0; UnicodeString[UnicodeStringLength] != 0; UnicodeStringLength++)
- ;
-
- //
- // Allocate space for a copy of the Unicode String
- //
- NewUnicodeStringTable[NumberOfEntries].UnicodeString = AllocateCopyPool (
- (UnicodeStringLength + 1) * sizeof (CHAR16),
- UnicodeString
- );
- if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) {
- (gBS->FreePool) (NewUnicodeStringTable[NumberOfEntries].Language);
- (gBS->FreePool) (NewUnicodeStringTable);
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Mark the end of the Unicode String Table
- //
- NewUnicodeStringTable[NumberOfEntries + 1].Language = NULL;
- NewUnicodeStringTable[NumberOfEntries + 1].UnicodeString = NULL;
-
- //
- // Free the old Unicode String Table
- //
- if (*UnicodeStringTable != NULL) {
- (gBS->FreePool) (*UnicodeStringTable);
- }
-
- //
- // Point UnicodeStringTable at the newly allocated Unicode String Table
- //
- *UnicodeStringTable = NewUnicodeStringTable;
-
- return EFI_SUCCESS;
- }
-
- SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
- }
-
- return EFI_UNSUPPORTED;
-}
-
-/**
- This function frees the table of Unicode strings in UnicodeStringTable.
- If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.
- Otherwise, each language code, and each Unicode string in the Unicode string
- table are freed, and EFI_SUCCESS is returned.
-
- @param UnicodeStringTable A pointer to the table of Unicode strings.
-
- @retval EFI_SUCCESS The Unicode string table was freed.
-
-**/
-EFI_STATUS
-EFIAPI
-FreeUnicodeStringTable (
- IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
- )
-{
- UINTN Index;
-
- //
- // If the Unicode String Table is NULL, then it is already freed
- //
- if (UnicodeStringTable == NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // Loop through the Unicode String Table until we reach the end of table marker
- //
- for (Index = 0; UnicodeStringTable[Index].Language != NULL; Index++) {
-
- //
- // Free the Language string from the Unicode String Table
- //
- (gBS->FreePool) (UnicodeStringTable[Index].Language);
-
- //
- // Free the Unicode String from the Unicode String Table
- //
- if (UnicodeStringTable[Index].UnicodeString != NULL) {
- (gBS->FreePool) (UnicodeStringTable[Index].UnicodeString);
- }
- }
-
- //
- // Free the Unicode String Table itself
- //
- (gBS->FreePool) (UnicodeStringTable);
-
- return EFI_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.inf
deleted file mode 100644
index da6168d76e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.inf
+++ /dev/null
@@ -1,89 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# UefiLib.inf
-#
-# Abstract:
-#
-# Component description file for UefiLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueUefiLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiLib.c
- Console.c
- UefiNotTiano.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
- $(EDK_SOURCE)/Foundation/Efi/Protocol/DevicePath
-
-[libraries.common]
- EdkIIGlueBaseLib
- EdkIIGlueBaseMemoryLib
- EdkIIGlueUefiBootServicesTableLib
-#
-# MemoryAllocationLib instance
-#
- EdkIIGlueDxeMemoryAllocationLib
- EfiGuidLib
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
deleted file mode 100644
index 4a8809b90c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- UefiNotTiano.c
-
-Abstract:
-
- Library functions that abstract areas of conflict between Tiano an UEFI 2.0.
-
- Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the
- oldconflicts with library functions and supporting implementations of the old
- (EFI 1.10) and new (EdkII/UEFI 2.0) way.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-
-/**
- An empty function to pass error checking of CreateEventEx ().
-
- This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error
- checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.
-
-**/
-STATIC
-VOID
-EFIAPI
-InternalEmptyFuntion (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- return;
-}
-
-/**
- Create a Legacy Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
- work both ways.
-
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiCreateEventLegacyBoot (
- OUT EFI_EVENT *LegacyBootEvent
- )
-{
- return EfiCreateEventLegacyBootEx (
- EFI_TPL_CALLBACK,
- NULL,
- NULL,
- LegacyBootEvent
- );
-}
-
-/**
- Create an EFI event in the Legacy Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Legacy Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If LegacyBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventLegacyBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *LegacyBootEvent
- )
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
- ASSERT (LegacyBootEvent != NULL);
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- LegacyBootEvent
- );
-#else
-
- EventType = EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = InternalEmptyFuntion;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventLegacyBootGuid,
- LegacyBootEvent
- );
-#endif
-
- return Status;
-}
-
-/**
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to
- work both ways.
-
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-GlueEfiCreateEventReadyToBoot (
- OUT EFI_EVENT *ReadyToBootEvent
- )
-{
- return EfiCreateEventReadyToBootEx (
- EFI_TPL_CALLBACK,
- NULL,
- NULL,
- ReadyToBootEvent
- );
-}
-
-/**
- Create an EFI event in the Ready To Boot Event Group and allows
- the caller to specify a notification function.
-
- This function abstracts the creation of the Ready to Boot Event.
- The Framework moved from a proprietary to UEFI 2.0 based mechanism.
- This library abstracts the caller from how this event is created to prevent
- to code form having to change with the version of the specification supported.
- If ReadyToBootEvent is NULL, then ASSERT().
-
- @param NotifyTpl The task priority level of the event.
- @param NotifyFunction The notification function to call when the event is signaled.
- @param NotifyContext The content to pass to NotifyFunction when the event is signaled.
- @param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex).
-
- @retval EFI_SUCCESS Event was created.
- @retval Other Event was not created.
-
-**/
-EFI_STATUS
-EFIAPI
-EfiCreateEventReadyToBootEx (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL
- IN VOID *NotifyContext, OPTIONAL
- OUT EFI_EVENT *ReadyToBootEvent
- )
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
- ASSERT (ReadyToBootEvent != NULL);
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- ReadyToBootEvent
- );
-#else
-
- EventType = EVENT_NOTIFY_SIGNAL;
-
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = InternalEmptyFuntion;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventReadyToBootGuid,
- ReadyToBootEvent
- );
-#endif
-
- return Status;
-}
-
-
-/**
- Signal a Ready to Boot Event.
-
- Create a Ready to Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventReadyToBoot (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_EVENT ReadyToBootEvent;
-
- Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent);
- if (!EFI_ERROR (Status)) {
- gBS->SignalEvent (ReadyToBootEvent);
- gBS->CloseEvent (ReadyToBootEvent);
- }
-}
-
-/**
- Signal a Legacy Boot Event.
-
- Create a legacy Boot Event. Signal it and close it. This causes other
- events of the same event group to be signaled in other modules.
-
-**/
-VOID
-EFIAPI
-EfiSignalEventLegacyBoot (
- VOID
- )
-{
- EFI_STATUS Status;
- EFI_EVENT LegacyBootEvent;
-
- Status = EfiCreateEventLegacyBoot (&LegacyBootEvent);
- if (!EFI_ERROR (Status)) {
- gBS->SignalEvent (LegacyBootEvent);
- gBS->CloseEvent (LegacyBootEvent);
- }
-}
-
-
-/**
- Check to see if the Firmware Volume (FV) Media Device Path is valid
-
- @param FvDevicePathNode Pointer to FV device path to check.
-
- @retval NULL FvDevicePathNode is not valid.
- @retval Other FvDevicePathNode is valid and pointer to NameGuid was returned.
-
-**/
-EFI_GUID *
-EFIAPI
-GlueEfiGetNameGuidFromFwVolDevicePathNode (
- IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- )
-{
- ASSERT (FvDevicePathNode != NULL);
-
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
- return (EFI_GUID *) &FvDevicePathNode->NameGuid;
- }
-
- return NULL;
-}
-
-
-/**
- Initialize a Firmware Volume (FV) Media Device Path node.
-
- @param FvDevicePathNode Pointer to a FV device path node to initialize
- @param NameGuid FV file name to use in FvDevicePathNode
-
-**/
-VOID
-EFIAPI
-GlueEfiInitializeFwVolDevicepathNode (
- IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN CONST EFI_GUID *NameGuid
- )
-{
- ASSERT (FvDevicePathNode != NULL);
- ASSERT (NameGuid != NULL);
-
- FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
- FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
- SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
-
- CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c
deleted file mode 100644
index 416f4d3353..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-
-Module Name:
-
- UefiRuntimeServicesTableLib.c
-
-Abstract:
-
- UEFI Runtime Services Table Library.
-
---*/
-
-#include "EdkIIGlueUefi.h"
-
-EFI_RUNTIME_SERVICES *gRT = NULL;
-
-/**
- The constructor function caches the pointer of Runtime Services Table.
-
- The constructor function caches the pointer of Runtime Services Table.
- It will ASSERT() if the pointer of Runtime Services Table is NULL.
- It will always return EFI_SUCCESS.
-
- @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
-UefiRuntimeServicesTableLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- //
- // Cache pointer to the EFI Runtime Services Table
- //
- gRT = SystemTable->RuntimeServices;
- ASSERT (gRT != NULL);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
deleted file mode 100644
index 6f51e55a21..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+++ /dev/null
@@ -1,78 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# UefiRuntimeServicesTableLib.inf
-#
-# Abstract:
-#
-# Component description file for UefiRuntimeServicesTableLib.
-#
-#--*/
-
-[defines]
-BASE_NAME = EdkIIGlueUefiRuntimeServicesTableLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- UefiRuntimeServicesTableLib.c
-
-[sources.ia32]
-
-[sources.x64]
-
-[sources.ipf]
-
-[sources.ebc]
-
-
-[includes.common]
- .
- ../../Include
- ../../include/Library
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
- $(EDK_SOURCE)/Foundation/Efi/Protocol/DevicePath
-
-[libraries.common]
-
-[libraries.ia32]
-
-
-[libraries.x64]
-
-
-[nmake.common]
- C_FLAGS = $(C_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- LIB_STD_FLAGS = $(LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
-
-[nmake.ia32]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IA32
-
-[nmake.x64]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_X64
-
-[nmake.ipf]
- C_FLAGS = $(C_FLAGS) /D MDE_CPU_IPF
-
-[nmake.ebc]
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D EDKII_GLUE_LIBRARY_IMPLEMENTATION
- EBC_LIB_STD_FLAGS = $(EBC_LIB_STD_FLAGS) /IGNORE:4006 /IGNORE:4221
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /D MDE_CPU_EBC
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
deleted file mode 100644
index 07b02b7656..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
+++ /dev/null
@@ -1,108 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiCommonLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI common library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiCommonLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- EfiCompareGuid.c
- EfiCompareMem.c
- ReportStatusCode.c
- PostCode.c
- String.c
- ValueToString.c
- LinkedList.c
-
-[sources.ia32]
- Ia32/EfiCopyMemRep1.c
- Ia32/EfiSetMemRep4.c
- Ia32/EfiZeroMemRep4.c
-# Ia32/EfiCopyMem.c
-# Ia32/EfiSetMem.c
-# Ia32/EfiZeroMem.c
- Ia32/LShiftU64.c
- Ia32/RShiftU64.c
- Ia32/MultU64x32.c
- Ia32/DivU64x32.c
- Ia32/Power10U64.c
- Ia32/Log2.c
- Ia32/GetPowerOfTwo.c
-
-[sources.ipf]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[sources.ebc]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[sources.x64]
- X64/EfiCopyMemRep4.asm
- X64/EfiSetMemRep4.asm
- X64/EfiZeroMemRep4.asm
-# X64/EfiCopyMem.asm
-# X64/EfiSetMem.asm
-# X64/EfiZeroMem.asm
- Math.c
-
-[sources.ARM]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[sources.AArch64]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Framework/Ppi/CpuIo
- $(EDK_SOURCE)/Foundation/Framework
-
-[libraries.common]
- EdkFrameworkGuidLib
-
-[libraries.ARM]
- CompilerIntrinsicsLib
-
-[libraries.AArch64]
- CompilerIntrinsicsLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
deleted file mode 100644
index fd183c1d6a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
+++ /dev/null
@@ -1,128 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiCommonLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI common library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiCommonLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- EfiCompareGuid.c
- EfiCompareMem.c
- ReportStatusCode.c
- PostCode.c
- String.c
- ValueToString.c
- LinkedList.c
-
-[sources.ia32]
- Ia32/EfiCopyMemRep1.c | MSFT
- Ia32/EfiSetMemRep4.c | MSFT
- Ia32/EfiZeroMemRep4.c | MSFT
-# Ia32/EfiCopyMem.c
-# Ia32/EfiSetMem.c
-# Ia32/EfiZeroMem.c
- Ia32/LShiftU64.c | MSFT
- Ia32/RShiftU64.c | MSFT
- Ia32/MultU64x32.c | MSFT
- Ia32/DivU64x32.c | MSFT
- Ia32/Power10U64.c | MSFT
- Ia32/Log2.c | MSFT
- Ia32/GetPowerOfTwo.c | MSFT
-
- Ia32/EfiCopyMem.S | GCC
- Ia32/EfiSetMem.S | GCC
- Ia32/EfiZeroMem.S | GCC
- Ia32/LShiftU64.S | GCC
- Ia32/RShiftU64.S | GCC
- Ia32/MultU64x32.S | GCC
- Ia32/DivU64x32.S | GCC
- Ia32/Power10U64.S | GCC
- Ia32/Log2.S | GCC
- Ia32/GetPowerOfTwo.S | GCC
-
- Ia32/EfiCopyMemRep1.asm | INTEL
- Ia32/EfiSetMemRep4.asm | INTEL
- Ia32/EfiZeroMemRep4.asm | INTEL
-# Ia32/EfiCopyMem.asm | INTEL
-# Ia32/EfiSetMem.asm | INTEL
-# Ia32/EfiZeroMem.asm | INTEL
- Ia32/LShiftU64.asm | INTEL
- Ia32/RShiftU64.asm | INTEL
- Ia32/MultU64x32.asm | INTEL
- Ia32/DivU64x32.asm | INTEL
- Ia32/Power10U64.asm | INTEL
- Ia32/Log2.asm | INTEL
- Ia32/GetPowerOfTwo.asm | INTEL
-
-[sources.ipf]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[sources.ebc]
- EfiCopyMem.c
- EfiSetMem.c
- EfiZeroMem.c
- Math.c
-
-[sources.x64]
- X64/EfiCopyMemRep4.asm | MSFT
- X64/EfiSetMemRep4.asm | MSFT
- X64/EfiZeroMemRep4.asm | MSFT
-# X64/EfiCopyMem.asm | MSFT
-# X64/EfiSetMem.asm | MSFT
-# X64/EfiZeroMem.asm | MSFT
-
- X64/EfiCopyMemRep4.asm | INTEL
- X64/EfiSetMemRep4.asm | INTEL
- X64/EfiZeroMemRep4.asm | INTEL
-# X64/EfiCopyMem.asm | INTEL
-# X64/EfiSetMem.asm | INTEL
-# X64/EfiZeroMem.asm | INTEL
-
- X64/EfiCopyMemRep1.S | GCC
- X64/EfiSetMemRep4.S | GCC
- X64/EfiZeroMemRep4.S | GCC
-
- Math.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Framework/Ppi/CpuIo
- $(EDK_SOURCE)/Foundation/Framework
-
-[libraries.common]
- EdkFrameworkGuidLib
-
-[nmake.common]
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareGuid.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareGuid.c
deleted file mode 100644
index e84c462e7e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareGuid.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- EfiCompareGuid.c
-
-Abstract:
-
- Driver library routine to compare two GUIDs.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-BOOLEAN
-EfiCompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-/*++
-
-Routine Description:
-
- Compares two GUIDs
-
-Arguments:
-
- Guid1 - guid to compare
-
- Guid2 - guid to compare
-
-Returns:
- TRUE if Guid1 == Guid2
- FALSE if Guid1 != Guid2
-
---*/
-{
- UINTN Index;
-
- //
- // compare byte by byte
- //
- for (Index = 0; Index < 16; ++Index) {
- if (*(((UINT8*) Guid1) + Index) != *(((UINT8*) Guid2) + Index)) {
- return FALSE;
- }
- }
- return TRUE;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareMem.c
deleted file mode 100644
index 2fcc03d51b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCompareMem.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiCompareMem.c
-
-Abstract:
-
- Generic compare-memory routine.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-
-INTN
-EfiCompareMem (
- IN VOID *MemOne,
- IN VOID *MemTwo,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Compares two memory buffers of a given length.
-
-Arguments:
-
- MemOne - First memory buffer
-
- MemTwo - Second memory buffer
-
- Len - Length of Mem1 and Mem2 memory regions to compare
-
-Returns:
-
- = 0 if MemOne == MemTwo
-
---*/
-{
- INTN ReturnValue;
-
- if (!(EFI_UINTN_ALIGNED (MemOne) || EFI_UINTN_ALIGNED (MemTwo) || EFI_UINTN_ALIGNED (Length))) {
- //
- // If Destination/Source/Length are aligned do UINTN conpare
- //
- for (; Length > 0; Length -= sizeof (INTN), MemOne = (VOID *)((UINTN)MemOne + sizeof (INTN)), MemTwo = (VOID *)((UINTN)MemTwo + sizeof (INTN))) {
- if (*(INTN *)MemOne != *(INTN *)MemTwo) {
- break;
- }
- }
- }
-
- //
- // If Destination/Source/Length not aligned do byte compare
- //
- for (; Length > 0; Length--, MemOne = (VOID *)((UINTN)MemOne + 1), MemTwo = (VOID *)((UINTN)MemTwo + 1)) {
- ReturnValue = (INTN)(*(INT8 *)MemOne - *(INT8 *)MemTwo);
- if (ReturnValue != 0) {
- return ReturnValue;
- }
- }
-
- return 0;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCopyMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCopyMem.c
deleted file mode 100644
index eb75c993f2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCopyMem.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiCopyMem.c
-
-Abstract:
-
- Implementation of the EfiCopyMem routine. This function is broken
- out into its own source file so that it can be excluded from a
- build for a particular platform easily if an optimized version
- is desired.
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- CHAR8 *Destination8;
- CHAR8 *Source8;
-
- if (Source < Destination) {
- Destination8 = (CHAR8 *) Destination + Length - 1;
- Source8 = (CHAR8 *) Source + Length - 1;
- while (Length--) {
- *(Destination8--) = *(Source8--);
- }
- } else {
- Destination8 = (CHAR8 *) Destination;
- Source8 = (CHAR8 *) Source;
- while (Length--) {
- *(Destination8++) = *(Source8++);
- }
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiSetMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiSetMem.c
deleted file mode 100644
index b50aab3c7f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiSetMem.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiSetMem.c
-
-Abstract:
-
- Implementation of the EfiSetMem routine. This function is broken
- out into its own source file so that it can be excluded from a
- build for a particular platform easily if an optimized version
- is desired.
-
---*/
-
-#include "Tiano.h"
-#include "EfiCommonLib.h"
-
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN UINT8 Value
- )
-/*++
-
-Routine Description:
-
- Set Buffer to Value for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
- Value - Value of the set operation.
-
-Returns:
-
- None
-
---*/
-{
- INT8 *Ptr;
-
- if (Value == 0) {
- EfiCommonLibZeroMem (Buffer, Size);
- } else {
- Ptr = Buffer;
- while (Size--) {
- *(Ptr++) = Value;
- }
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiZeroMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiZeroMem.c
deleted file mode 100644
index 8ca346b794..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiZeroMem.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiZeroMem.c
-
-Abstract:
-
- Implementation of the EfiSetMem routine. This function is broken
- out into its own source file so that it can be excluded from a
- build for a particular platform easily if an optimized version
- is desired.
-
---*/
-
-#include "Tiano.h"
-
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Set Buffer to 0 for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
-Returns:
-
- None
-
---*/
-{
- INT8 *Ptr;
-
- Ptr = Buffer;
- while (Size--) {
- *(Ptr++) = 0;
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.S
deleted file mode 100644
index cbe7bc349b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.S
+++ /dev/null
@@ -1,91 +0,0 @@
-#---------------------------------------------------------------------------
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# DivU64x32.c
-#
-#Abstract:
-#
-# 64-bit division function for IA-32
-#
-#--*/
-
-#---------------------------------------------------------------------------
-#include "EfiBind.h" //For ASM_PFX
-#---------------------------------------------------------------------------
-
-#---------------------------------------------------------------------------
- .386:
- .code:
-
-#---------------------------------------------------------------------------
-
-.globl ASM_PFX(DivU64x32)
-
-#UINT64
-#DivU64x32 (
-# IN UINT64 Dividend,
-# IN UINTN Divisor,
-# OUT UINTN *Remainder OPTIONAL
-# )
-#/*++
-
-#Routine Description:
-
-# This routine allows a 64 bit value to be divided with a 32 bit value returns
-# 64bit result and the Remainder.
-#
-#Arguments:
-
-# Dividend - dividend
-# Divisor - divisor
-# Remainder - buffer for remainder
-#
-#Returns:
-
-# Dividend / Divisor
-# Remainder = Dividend mod Divisor
-#
-#N.B. only works for 31bit divisors!!
-#
-#--*/
-#---------------------------------------------------------------------------
-
-ASM_PFX(DivU64x32):
- pushl %ebp
- movl %esp, %ebp
- xorl %edx, %edx # Clear EDX
-
- movl 0xC(%ebp), %eax # Put high 32 bits of 64-bit dividend in EAX
- movl 0x10(%ebp), %ecx # Put 32 bits divisor in ECX
- divl %ecx # Dividend Divisor Quoitent...Remainder
- # 0:EAX / ECX = EAX EDX
-
- pushl %eax # Push quoitent in stack
-
- movl 8(%ebp), %eax # Put low 32 bits of 64-bit dividend in EAX
- divl %ecx # Leave the REMAINDER in EDX as High 32-bit of new dividend
- # Dividend Divisor Quoitent...Remainder
- # EDX:EAX / ECX = EAX EDX
-
- movl 0x14(%ebp), %ecx # Put &REMAINDER to ecx
-
- jecxz Label1 # If ecx == 0, no remainder exist, return with quoitent in EDX directly
- movl %edx, (%ecx) # Put EDX through REMAINDER pointer in ECX
-
-Label1:
- popl %edx # Pop High 32-bit QUOITENT to EDX
- popl %ebp
-
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
deleted file mode 100644
index 42ae896773..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.asm
+++ /dev/null
@@ -1,87 +0,0 @@
-;---------------------------------------------------------------------------
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; DivU64x32.c
-;
-;Abstract:
-;
-; 64-bit division function for IA-32
-;
-;--*/
-
-;---------------------------------------------------------------------------
- .386
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;UINT64
-;DivU64x32 (
-; IN UINT64 Dividend,
-; IN UINTN Divisor,
-; OUT UINTN *Remainder OPTIONAL
-; )
-;/*++
-
-;Routine Description:
-
-; This routine allows a 64 bit value to be divided with a 32 bit value returns
-; 64bit result and the Remainder.
-;
-;Arguments:
-
-; Dividend - dividend
-; Divisor - divisor
-; Remainder - buffer for remainder
-;
-;Returns:
-
-; Dividend / Divisor
-; Remainder = Dividend mod Divisor
-;
-;N.B. only works for 31bit divisors!!
-;
-;--*/
-;---------------------------------------------------------------------------
-
-DivU64x32 PROC
- push ebp
- mov ebp, esp
- xor edx, edx ; Clear EDX
-
- mov eax, [ebp + 0Ch] ; Put high 32 bits of 64-bit dividend in EAX
- mov ecx, [ebp + 10h] ; Put 32 bits divisor in ECX
- div ecx ; Dividend Divisor Quoitent...Remainder
- ; 0:EAX / ECX = EAX EDX
-
- push eax ; Push quoitent in stack
-
- mov eax, [ebp + 8] ; Put low 32 bits of 64-bit dividend in EAX
- div ecx ; Leave the REMAINDER in EDX as High 32-bit of new dividend
- ; Dividend Divisor Quoitent...Remainder
- ; EDX:EAX / ECX = EAX EDX
-
- mov ecx, [ebp + 14h] ; Put &REMAINDER to ecx
-
- jecxz Label1 ; If ecx == 0, no remainder exist, return with quoitent in EDX directly
- mov dword ptr [ecx], edx ; Put EDX through REMAINDER pointer in ECX
-
-Label1:
- pop edx ; Pop High 32-bit QUOITENT to EDX
- pop ebp
-
- ret
-
-DivU64x32 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.c
deleted file mode 100644
index 6bae05558c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/DivU64x32.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- DivU64x32.c
-
-Abstract:
-
- 64-bit division function for IA-32
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
-
-Arguments:
-
- Dividend - dividend
- Divisor - divisor
- Remainder - buffer for remainder
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
-N.B. only works for 31bit divisors!!
-
---*/
-{
- __asm {
- xor edx, edx ; Clear EDX
-
- mov eax, dword ptr Dividend[4] ; Put high 32 bits of 64-bit dividend in EAX
- mov ecx, Divisor ; Put 32 bits divisor in ECX
- div ecx ; Dividend Divisor Quoitent...Remainder
- ; 0:EAX / ECX = EAX EDX
-
- push eax ; Push quoitent in stack
-
- mov eax, dword ptr Dividend[0] ; Put low 32 bits of 64-bit dividend in EAX
- div ecx ; Leave the REMAINDER in EDX as High 32-bit of new dividend
- ; Dividend Divisor Quoitent...Remainder
- ; EDX:EAX / ECX = EAX EDX
-
- mov ecx, Remainder ; Put &REMAINDER to ecx
-
- jecxz Label1 ; If ecx == 0, no remainder exist, return with quoitent in EDX directly
- mov dword ptr [ecx], edx ; Put EDX through REMAINDER pointer in ECX
-
-Label1:
- pop edx ; Pop High 32-bit QUOITENT to EDX
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
deleted file mode 100644
index 580c3fe94b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
+++ /dev/null
@@ -1,202 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# EfiCopyMem.c
-#
-#Abstract:
-#
-# This is the code that supports IA32-optimized CopyMem service
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .mmx:
- .code:
-
-#---------------------------------------------------------------------------
-
-.globl ASM_PFX(EfiCommonLibCopyMem)
-
-#VOID
-#EfiCommonLibCopyMem (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# )
-#/*++
-#
-#Routine Description:
-#
-# Copy Length bytes from Source to Destination.
-#
-#Arguments:
-#
-# Destination - Target of copy
-#
-# Source - Place to copy from
-#
-# Length - Number of bytes to copy
-#
-#Returns:
-#
-# None
-#
-#--*/
-ASM_PFX(EfiCommonLibCopyMem):
-
- pushl %ebp
- movl %esp, %ebp
- pushl %ecx # reserve space for Scratch Local variable UINT64 MmxSave
- pushl %ecx
- pushl %esi
- pushl %edi
-
- movl 0x10(%ebp), %ecx # Count
- movl 0xC(%ebp), %esi # Source
- movl 8(%ebp), %edi # Destination
-
-##First off, make sure we have no overlap. That is to say,
-## if (Source == Destination) => do nothing
-## if (Source + Count <= Destination) => regular copy
-## if (Destination + Count <= Source) => regular copy
-## otherwise, do a reverse copy
- movl %esi, %eax
- addl %ecx, %eax # Source + Count
- cmpl %edi, %eax
- jbe _StartByteCopy
-
- movl %edi, %eax
- addl %ecx, %eax # Dest + Count
- cmpl %esi, %eax
- jbe _StartByteCopy
-
- cmpl %edi, %esi
- je _CopyMemDone
- jb _CopyOverlapped # too bad -- overlaps
-
- # Pick up misaligned start bytes to get destination pointer 4-byte aligned
-_StartByteCopy:
- cmpl $0, %ecx
- je _CopyMemDone # Count == 0, all done
- movl %edi, %edx
- andb $3, %dl # check lower 2 bits of address
- testb %dl, %dl
- je _CopyBlocks # already aligned?
-
- # Copy a byte
- movb (%esi), %al # get byte from Source
- movb %al, (%edi) # write byte to Destination
- decl %ecx
- incl %edi
- incl %esi
- jmp _StartByteCopy # back to top of loop
-
-_CopyBlocks:
- # Compute how many 64-byte blocks we can clear
- movl %ecx, %eax # get Count in eax
- shrl $6, %eax # convert to 64-byte count
- shll $6, %eax # convert back to bytes
- subl %eax, %ecx # subtract from the original count
- shrl $6, %eax # and this is how many 64-byte blocks
-
- # If no 64-byte blocks, then skip
- cmpl $0, %eax
- je _CopyRemainingDWords
-
- # Save mm0 to UINT64 MmxSave
- movq %mm0, -8(%ebp)
-
-copymmx:
-
- movq %ds:(%esi), %mm0
- movq %mm0, %ds:(%edi)
- movq %ds:8(%esi), %mm0
- movq %mm0, %ds:8(%edi)
- movq %ds:16(%esi), %mm0
- movq %mm0, %ds:16(%edi)
- movq %ds:24(%esi), %mm0
- movq %mm0, %ds:24(%edi)
- movq %ds:32(%esi), %mm0
- movq %mm0, %ds:32(%edi)
- movq %ds:40(%esi), %mm0
- movq %mm0, %ds:40(%edi)
- movq %ds:48(%esi), %mm0
- movq %mm0, %ds:48(%edi)
- movq %ds:56(%esi), %mm0
- movq %mm0, %ds:56(%edi)
-
- addl $64, %edi
- addl $64, %esi
- decl %eax
- jnz copymmx
-
-# Restore mm0 from MmxSave
- movq -8(%ebp), %mm0
- emms # Exit MMX Instruction
-
- # Copy as many DWORDS as possible
-_CopyRemainingDWords:
- cmpl $4, %ecx
- jb _CopyRemainingBytes
-
- movl (%esi), %eax # get data from Source
- movl %eax, (%edi) # write byte to Destination
- subl $4, %ecx # decrement Count
- addl $4, %esi # advance Source pointer
- addl $4, %edi # advance Destination pointer
- jmp _CopyRemainingDWords # back to top
-
-_CopyRemainingBytes:
- cmpl $0, %ecx
- je _CopyMemDone
- movb (%esi), %al # get byte from Source
- movb %al, (%edi) # write byte to Destination
- decl %ecx
- incl %esi
- incl %edi # advance Destination pointer
- jmp _CopyRemainingBytes # back to top of loop
-
- #
- # We do this block if the source and destination buffers overlap. To
- # handle it, copy starting at the end of the source buffer and work
- # your way back. Since this is the atypical case, this code has not
- # been optimized, and thus simply copies bytes.
- #
-_CopyOverlapped:
-
- # Move the source and destination pointers to the end of the range
- addl %ecx, %esi # Source + Count
- decl %esi
- addl %ecx, %edi # Dest + Count
- decl %edi
-
-_CopyOverlappedLoop:
- cmpl $0, %ecx
- je _CopyMemDone
- movb (%esi), %al # get byte from Source
- movb %al, (%edi) # write byte to Destination
- decl %ecx
- decl %esi
- decl %edi
- jmp _CopyOverlappedLoop # back to top of loop
-
-_CopyMemDone:
-
- popl %edi
- popl %esi
- leave
- ret
-#EfiCommonLibCopyMem ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
deleted file mode 100644
index 275e29b0c5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
+++ /dev/null
@@ -1,200 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; EfiCopyMem.c
-;
-;Abstract:
-;
-; This is the code that supports IA32-optimized CopyMem service
-;
-;--*/
-
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .mmx
- .code
-
-;---------------------------------------------------------------------------
-
-;VOID
-;EfiCommonLibCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; )
-;/*++
-;
-;Routine Description:
-;
-; Copy Length bytes from Source to Destination.
-;
-;Arguments:
-;
-; Destination - Target of copy
-;
-; Source - Place to copy from
-;
-; Length - Number of bytes to copy
-;
-;Returns:
-;
-; None
-;
-;--*/
-EfiCommonLibCopyMem PROC
-
- push ebp
- mov ebp, esp
- push ecx ; reserve space for Scratch Local variable UINT64 MmxSave
- push ecx
- push esi
- push edi
-
- mov ecx, [ebp + 10h] ; Count
- mov esi, [ebp + 0Ch] ; Source
- mov edi, [ebp + 8] ; Destination
-
- ; First off, make sure we have no overlap. That is to say,
- ; if (Source == Destination) => do nothing
- ; if (Source + Count <= Destination) => regular copy
- ; if (Destination + Count <= Source) => regular copy
- ; otherwise, do a reverse copy
- mov eax, esi
- add eax, ecx ; Source + Count
- cmp eax, edi
- jbe _StartByteCopy
-
- mov eax, edi
- add eax, ecx ; Dest + Count
- cmp eax, esi
- jbe _StartByteCopy
-
- cmp esi, edi
- je _CopyMemDone
- jb _CopyOverlapped ; too bad -- overlaps
-
- ; Pick up misaligned start bytes to get destination pointer 4-byte aligned
-_StartByteCopy:
- cmp ecx, 0
- je _CopyMemDone ; Count == 0, all done
- mov edx, edi
- and dl, 3 ; check lower 2 bits of address
- test dl, dl
- je SHORT _CopyBlocks ; already aligned?
-
- ; Copy a byte
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc edi
- inc esi
- jmp _StartByteCopy ; back to top of loop
-
-_CopyBlocks:
- ; Compute how many 64-byte blocks we can clear
- mov eax, ecx ; get Count in eax
- shr eax, 6 ; convert to 64-byte count
- shl eax, 6 ; convert back to bytes
- sub ecx, eax ; subtract from the original count
- shr eax, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp eax, 0
- je _CopyRemainingDWords
-
- ; Save mm0 to UINT64 MmxSave
- movq [ebp - 8], mm0
-
-copymmx:
-
- movq mm0, QWORD PTR ds:[esi]
- movq QWORD PTR ds:[edi], mm0
- movq mm0, QWORD PTR ds:[esi+8]
- movq QWORD PTR ds:[edi+8], mm0
- movq mm0, QWORD PTR ds:[esi+16]
- movq QWORD PTR ds:[edi+16], mm0
- movq mm0, QWORD PTR ds:[esi+24]
- movq QWORD PTR ds:[edi+24], mm0
- movq mm0, QWORD PTR ds:[esi+32]
- movq QWORD PTR ds:[edi+32], mm0
- movq mm0, QWORD PTR ds:[esi+40]
- movq QWORD PTR ds:[edi+40], mm0
- movq mm0, QWORD PTR ds:[esi+48]
- movq QWORD PTR ds:[edi+48], mm0
- movq mm0, QWORD PTR ds:[esi+56]
- movq QWORD PTR ds:[edi+56], mm0
-
- add edi, 64
- add esi, 64
- dec eax
- jnz copymmx
-
-; Restore mm0 from MmxSave
- movq mm0, [ebp - 8]
- emms ; Exit MMX Instruction
-
- ; Copy as many DWORDS as possible
-_CopyRemainingDWords:
- cmp ecx, 4
- jb _CopyRemainingBytes
-
- mov eax, DWORD PTR [esi] ; get data from Source
- mov DWORD PTR [edi], eax ; write byte to Destination
- sub ecx, 4 ; decrement Count
- add esi, 4 ; advance Source pointer
- add edi, 4 ; advance Destination pointer
- jmp _CopyRemainingDWords ; back to top
-
-_CopyRemainingBytes:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc esi
- inc edi ; advance Destination pointer
- jmp SHORT _CopyRemainingBytes ; back to top of loop
-
- ;
- ; We do this block if the source and destination buffers overlap. To
- ; handle it, copy starting at the end of the source buffer and work
- ; your way back. Since this is the atypical case, this code has not
- ; been optimized, and thus simply copies bytes.
- ;
-_CopyOverlapped:
-
- ; Move the source and destination pointers to the end of the range
- add esi, ecx ; Source + Count
- dec esi
- add edi, ecx ; Dest + Count
- dec edi
-
-_CopyOverlappedLoop:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- dec esi
- dec edi
- jmp _CopyOverlappedLoop ; back to top of loop
-
-_CopyMemDone:
-
- pop edi
- pop esi
- leave
- ret
-EfiCommonLibCopyMem ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
deleted file mode 100644
index cb6b8ffe89..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiCopyMem.c
-
-Abstract:
-
- This is the code that supports IA32-optimized CopyMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- UINT64 MmxSave;
- __asm {
-
- mov ecx, Count
- mov esi, Source
- mov edi, Destination
-
- ; First off, make sure we have no overlap. That is to say,
- ; if (Source == Destination) => do nothing
- ; if (Source + Count <= Destination) => regular copy
- ; if (Destination + Count <= Source) => regular copy
- ; if (Source >= Destination) => regular copy
- ; otherwise, do a reverse copy
- mov eax, esi
- add eax, ecx ; Source + Count
- cmp eax, edi
- jbe _StartByteCopy
-
- mov eax, edi
- add eax, ecx ; Dest + Count
- cmp eax, esi
- jbe _StartByteCopy
-
- cmp esi, edi
- je _CopyMemDone
- jb _CopyOverlapped ; too bad -- overlaps
-
- ; Pick up misaligned start bytes to get destination pointer 4-byte aligned
-_StartByteCopy:
- cmp ecx, 0
- je _CopyMemDone ; Count == 0, all done
- mov edx, edi
- and dl, 3 ; check lower 2 bits of address
- test dl, dl
- je SHORT _CopyBlocks ; already aligned?
-
- ; Copy a byte
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc edi
- inc esi
- jmp _StartByteCopy ; back to top of loop
-
-_CopyBlocks:
- ; Compute how many 64-byte blocks we can clear
- mov eax, ecx ; get Count in eax
- shr eax, 6 ; convert to 64-byte count
- shl eax, 6 ; convert back to bytes
- sub ecx, eax ; subtract from the original count
- shr eax, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp eax, 0
- je _CopyRemainingDWords
-
- ; Save mm0
- movq MmxSave, mm0
-
-copymmx:
-
- movq mm0, QWORD PTR ds:[esi]
- movq QWORD PTR ds:[edi], mm0
- movq mm0, QWORD PTR ds:[esi+8]
- movq QWORD PTR ds:[edi+8], mm0
- movq mm0, QWORD PTR ds:[esi+16]
- movq QWORD PTR ds:[edi+16], mm0
- movq mm0, QWORD PTR ds:[esi+24]
- movq QWORD PTR ds:[edi+24], mm0
- movq mm0, QWORD PTR ds:[esi+32]
- movq QWORD PTR ds:[edi+32], mm0
- movq mm0, QWORD PTR ds:[esi+40]
- movq QWORD PTR ds:[edi+40], mm0
- movq mm0, QWORD PTR ds:[esi+48]
- movq QWORD PTR ds:[edi+48], mm0
- movq mm0, QWORD PTR ds:[esi+56]
- movq QWORD PTR ds:[edi+56], mm0
-
- add edi, 64
- add esi, 64
- dec eax
- jnz copymmx
-
-; Restore mm0
- movq mm0, MmxSave
- emms ; Exit MMX Instruction
-
- ; Copy as many DWORDS as possible
-_CopyRemainingDWords:
- cmp ecx, 4
- jb _CopyRemainingBytes
-
- mov eax, DWORD PTR [esi] ; get data from Source
- mov DWORD PTR [edi], eax ; write byte to Destination
- sub ecx, 4 ; decrement Count
- add esi, 4 ; advance Source pointer
- add edi, 4 ; advance Destination pointer
- jmp _CopyRemainingDWords ; back to top
-
-_CopyRemainingBytes:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc esi
- inc edi ; advance Destination pointer
- jmp SHORT _CopyRemainingBytes ; back to top of loop
-
- ;
- ; We do this block if the source and destination buffers overlap. To
- ; handle it, copy starting at the end of the source buffer and work
- ; your way back. Since this is the atypical case, this code has not
- ; been optimized, and thus simply copies bytes.
- ;
-_CopyOverlapped:
-
- ; Move the source and destination pointers to the end of the range
- add esi, ecx ; Source + Count
- dec esi
- add edi, ecx ; Dest + Count
- dec edi
-
-_CopyOverlappedLoop:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- dec esi
- dec edi
- jmp _CopyOverlappedLoop ; back to top of loop
-
-_CopyMemDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm
deleted file mode 100644
index 469050e27c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm
+++ /dev/null
@@ -1,86 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; EfiCopyMemRep1.asm
-;
-;Abstract:
-;
-; This is the code that uses rep movsb CopyMem service
-;
-;--*/
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;#include "Tiano.h"
-;
-;VOID
-;EfiCommonLibCopyMem (
-; IN VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; )
-;/*++
-;
-;Routine Description:
-;
-; Copy Length bytes from Source to Destination.
-;
-;Arguments:
-;
-; Destination - Target of copy
-;
-; Source - Place to copy from
-;
-; Length - Number of bytes to copy
-;
-;Returns:
-;
-; None
-;
-;--*/
-EfiCommonLibCopyMem PROC
- push ebp
- mov ebp, esp
- push esi
- push edi
- mov esi, dword ptr[ebp + 0Ch] ; esi <- Source
- mov edi, dword ptr[ebp + 8] ; edi <- Destination
- mov edx, dword ptr[ebp + 10h] ; edx <- Count
- cmp esi, edi
- je _CopyDone
- cmp edx, 0
- je _CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae _CopyBytes
- cmp eax, edi
- jb _CopyBytes ; Copy backward if overlapped
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-_CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-_CopyDone:
- pop edi
- pop esi
- pop ebp
- ret
-EfiCommonLibCopyMem ENDP
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.c
deleted file mode 100644
index 8dfa04245d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiCopyMemRep1.c
-
-Abstract:
-
- This is the code that uses rep movsb CopyMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- __asm {
- mov esi, Source ; esi <- Source
- mov edi, Destination ; edi <- Destination
- mov edx, Count ; edx <- Count
- cmp esi, edi
- je _CopyDone
- cmp edx, 0
- je _CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae _CopyBytes
- cmp eax, edi
- jb _CopyBytes ; Copy backward if overlapped
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-_CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-_CopyDone:
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep4.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep4.c
deleted file mode 100644
index 844c0ca660..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep4.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiCopyMemRep4.c
-
-Abstract:
-
- This is the code that uses rep movsd CopyMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- __asm {
- mov esi, Source ; esi <- Source
- mov edi, Destination ; edi <- Destination
- mov edx, Count ; edx <- Count
- cmp esi, edi
- je _CopyDone
- cmp edx, 0
- je _CopyDone
- lea eax, [esi + edx - 1] ; eax <- End of Source
- cmp esi, edi
- jae _CopyDWord
- cmp eax, edi
- jae _CopyBackward ; Copy backward if overlapped
-_CopyDWord:
- mov ecx, edx
- and edx, 3
- shr ecx, 2
- rep movsd ; Copy as many Dwords as possible
- jmp _CopyBytes
-_CopyBackward:
- mov esi, eax ; esi <- End of Source
- lea edi, [edi + edx - 1] ; edi <- End of Destination
- std
-_CopyBytes:
- mov ecx, edx
- rep movsb ; Copy bytes backward
- cld
-_CopyDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
deleted file mode 100644
index 595c008a04..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiCopyMemSSE2.c
-
-Abstract:
-
- This is the code that supports IA32-optimized CopyMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- __asm {
- mov ecx, Count
- mov esi, Source
- mov edi, Destination
-
- ; First off, make sure we have no overlap. That is to say,
- ; if (Source == Destination) => do nothing
- ; if (Source + Count <= Destination) => regular copy
- ; if (Destination + Count <= Source) => regular copy
- ; otherwise, do a reverse copy
- mov eax, esi
- add eax, ecx ; Source + Count
- cmp eax, edi
- jle _StartByteCopy
-
- mov eax, edi
- add eax, ecx ; Dest + Count
- cmp eax, esi
- jle _StartByteCopy
-
- cmp esi, edi
- je _CopyMemDone
- jl _CopyOverlapped ; too bad -- overlaps
-
- ; Pick up misaligned start bytes to get destination pointer 4-byte aligned
-_StartByteCopy:
- cmp ecx, 0
- je _CopyMemDone ; Count == 0, all done
- mov edx, edi
- and dl, 3 ; check lower 2 bits of address
- test dl, dl
- je SHORT _CopyBlocks ; already aligned?
-
- ; Copy a byte
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc edi
- inc esi
- jmp _StartByteCopy ; back to top of loop
-
-_CopyBlocks:
- ; Compute how many 64-byte blocks we can clear
- mov eax, ecx ; get Count in eax
- shr eax, 6 ; convert to 64-byte count
- shl eax, 6 ; convert back to bytes
- sub ecx, eax ; subtract from the original count
- shr eax, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp eax, 0
- je _CopyRemainingDWords
-
-
-copyxmm:
-
- movdqu xmm0, OWORD PTR ds:[esi]
- movdqu OWORD PTR ds:[edi], xmm0
- movdqu xmm1, OWORD PTR ds:[esi+16]
- movdqu OWORD PTR ds:[edi+16], xmm1
- movdqu xmm2, OWORD PTR ds:[esi+32]
- movdqu OWORD PTR ds:[edi+32], xmm2
- movdqu xmm3, OWORD PTR ds:[esi+48]
- movdqu OWORD PTR ds:[edi+48], xmm3
-
- add edi, 64
- add esi, 64
- dec eax
- jnz copyxmm
-
-
- ; Copy as many DWORDS as possible
-_CopyRemainingDWords:
- cmp ecx, 4
- jb _CopyRemainingBytes
-
- mov eax, DWORD PTR [esi] ; get data from Source
- mov DWORD PTR [edi], eax ; write byte to Destination
- sub ecx, 4 ; decrement Count
- add esi, 4 ; advance Source pointer
- add edi, 4 ; advance Destination pointer
- jmp _CopyRemainingDWords ; back to top
-
-_CopyRemainingBytes:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- inc esi
- inc edi ; advance Destination pointer
- jmp SHORT _CopyRemainingBytes ; back to top of loop
-
- ;
- ; We do this block if the source and destination buffers overlap. To
- ; handle it, copy starting at the end of the source buffer and work
- ; your way back. Since this is the atypical case, this code has not
- ; been optimized, and thus simply copies bytes.
- ;
-_CopyOverlapped:
-
- ; Move the source and destination pointers to the end of the range
- add esi, ecx ; Source + Count
- dec esi
- add edi, ecx ; Dest + Count
- dec edi
-
-_CopyOverlappedLoop:
- cmp ecx, 0
- je _CopyMemDone
- mov al, BYTE PTR [esi] ; get byte from Source
- mov BYTE PTR [edi], al ; write byte to Destination
- dec ecx
- dec esi
- dec edi
- jmp _CopyOverlappedLoop ; back to top of loop
-
-_CopyMemDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.S
deleted file mode 100644
index b0759589ff..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.S
+++ /dev/null
@@ -1,158 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# EfiSetMem.asm
-#
-#Abstract:
-#
-# This is the code that supports IA32-optimized SetMem service
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .mmx:
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(EfiCommonLibSetMem)
-
-#VOID
-#EfiCommonLibSetMem (
-# IN VOID *Buffer,
-# IN UINTN Count,
-# IN UINT8 Value
-# )
-#/*++
-#
-#Input: VOID *Buffer - Pointer to buffer to write
-# UINTN Count - Number of bytes to write
-# UINT8 Value - Value to write
-#
-#Output: None.
-#
-#Saves:
-#
-#Modifies:
-#
-#Description: This function is an optimized set-memory function.
-#
-#Notes: This function tries to set memory 8 bytes at a time. As a result,
-# it first picks up any misaligned bytes, then words, before getting
-# in the main loop that does the 8-byte clears.
-#
-#--*/
-ASM_PFX(EfiCommonLibSetMem):
-
- pushl %ebp
- movl %esp, %ebp
- subl $0x10, %esp # Reserve space for local variable UINT64 QWordValue @[ebp - 10H] & UINT64 MmxSave @[ebp - 18H]
- pushl %ebx
- pushl %edi
-
- movl 0xC(%ebp), %edx # Count
- testl %edx, %edx
- je _SetMemDone
-
- pushl %ebx
-
- movl 8(%ebp), %eax # Buffer
- movb 0x10(%ebp), %bl # Value
- movl %eax, %edi
- movb %bl, %bh
-
- cmpl $256, %edx
- jb _SetRemindingByte
-
- andb $0x7, %al
- testb %al, %al
- je _SetBlock
-
- movl %edi, %eax
- shrl $3, %eax
- incl %eax
- shll $3, %eax
- subl %edi, %eax
- cmpl %edx, %eax
- jnb _SetRemindingByte
-
- subl %eax, %edx
- movl %eax, %ecx
-
- movb %bl, %al
- rep
- stosb
-
-_SetBlock:
- movl %edx, %eax
- shrl $6, %eax
- testl %eax, %eax
- je _SetRemindingByte
-
- shll $6, %eax
- subl %eax, %edx
- shrl $6, %eax
-
- movw %bx, -0x10(%ebp) # QWordValue[0]
- movw %bx, -0x10+2(%ebp) # QWordValue[2]
- movw %bx, -0x10+4(%ebp) # QWordValue[4]
- movw %bx, -0x10+6(%ebp) # QWordValue[6]
-
-
- movq %mm0, -8(%ebp) # Save mm0 to MmxSave
- movq -0x10(%ebp), %mm0 # Load QWordValue to mm0
-
-_B:
- movq %mm0, %ds:(%edi)
- movq %mm0, %ds:8(%edi)
- movq %mm0, %ds:16(%edi)
- movq %mm0, %ds:24(%edi)
- movq %mm0, %ds:32(%edi)
- movq %mm0, %ds:40(%edi)
- movq %mm0, %ds:48(%edi)
- movq %mm0, %ds:56(%edi)
- addl $64, %edi
- decl %eax
- jnz _B
-
-# Restore mm0
- movq -8(%ebp), %mm0 # Restore MmxSave to mm0
- emms # Exit MMX Instruction
-
-_SetRemindingByte:
- movl %edx, %ecx
-
- movl %ebx, %eax
- shll $16, %eax
- movw %bx, %ax
- shrl $2, %ecx
- rep
- stosl
-
- movl %edx, %ecx
- andl $3, %ecx
- rep
- stosb
-
- popl %ebx
-
-_SetMemDone:
-
- popl %edi
- popl %ebx
- leave
- ret
-
-#EfiCommonLibSetMem ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.asm
deleted file mode 100644
index cf1657bafe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.asm
+++ /dev/null
@@ -1,152 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; EfiSetMem.asm
-;
-;Abstract:
-;
-; This is the code that supports IA32-optimized SetMem service
-;
-;--*/
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .mmx
- .code
-
-;---------------------------------------------------------------------------
-;VOID
-;EfiCommonLibSetMem (
-; IN VOID *Buffer,
-; IN UINTN Count,
-; IN UINT8 Value
-; )
-;/*++
-;
-;Input: VOID *Buffer - Pointer to buffer to write
-; UINTN Count - Number of bytes to write
-; UINT8 Value - Value to write
-;
-;Output: None.
-;
-;Saves:
-;
-;Modifies:
-;
-;Description: This function is an optimized set-memory function.
-;
-;Notes: This function tries to set memory 8 bytes at a time. As a result,
-; it first picks up any misaligned bytes, then words, before getting
-; in the main loop that does the 8-byte clears.
-;
-;--*/
-EfiCommonLibSetMem PROC
-
- push ebp
- mov ebp, esp
- sub esp, 10h; Reserve space for local variable UINT64 QWordValue @[ebp - 10H] & UINT64 MmxSave @[ebp - 18H]
- push ebx
- push edi
-
- mov edx, [ebp + 0Ch] ; Count
- test edx, edx
- je _SetMemDone
-
- push ebx
-
- mov eax, [ebp + 8] ; Buffer
- mov bl, [ebp + 10h] ; Value
- mov edi, eax
- mov bh, bl
-
- cmp edx, 256
- jb _SetRemindingByte
-
- and al, 07h
- test al, al
- je _SetBlock
-
- mov eax, edi
- shr eax, 3
- inc eax
- shl eax, 3
- sub eax, edi
- cmp eax, edx
- jnb _SetRemindingByte
-
- sub edx, eax
- mov ecx, eax
-
- mov al, bl
- rep stosb
-
-_SetBlock:
- mov eax, edx
- shr eax, 6
- test eax, eax
- je _SetRemindingByte
-
- shl eax, 6
- sub edx, eax
- shr eax, 6
-
- mov WORD PTR [ebp - 10H], bx ; QWordValue[0]
- mov WORD PTR [ebp - 10H + 2], bx ; QWordValue[2]
- mov WORD PTR [ebp - 10H + 4], bx ; QWordValue[4]
- mov WORD PTR [ebp - 10H + 6], bx ; QWordValue[6]
-
-
- movq [ebp - 8], mm0 ; Save mm0 to MmxSave
- movq mm0, [ebp - 10H] ; Load QWordValue to mm0
-
-_B:
- movq QWORD PTR ds:[edi], mm0
- movq QWORD PTR ds:[edi+8], mm0
- movq QWORD PTR ds:[edi+16], mm0
- movq QWORD PTR ds:[edi+24], mm0
- movq QWORD PTR ds:[edi+32], mm0
- movq QWORD PTR ds:[edi+40], mm0
- movq QWORD PTR ds:[edi+48], mm0
- movq QWORD PTR ds:[edi+56], mm0
- add edi, 64
- dec eax
- jnz _B
-
-; Restore mm0
- movq mm0, [ebp - 8] ; Restore MmxSave to mm0
- emms ; Exit MMX Instruction
-
-_SetRemindingByte:
- mov ecx, edx
-
- mov eax, ebx
- shl eax, 16
- mov ax, bx
- shr ecx, 2
- rep stosd
-
- mov ecx, edx
- and ecx, 3
- rep stosb
-
- pop ebx
-
-_SetMemDone:
-
- pop edi
- pop ebx
- leave
- ret
-
-EfiCommonLibSetMem ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.c
deleted file mode 100644
index 077384a19c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMem.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiSetMem.c
-
-Abstract:
-
- This is the code that supports IA32-optimized SetMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Count,
- IN UINT8 Value
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to write
- UINTN Count - Number of bytes to write
- UINT8 Value - Value to write
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function is an optimized set-memory function.
-
-Notes: This function tries to set memory 8 bytes at a time. As a result,
- it first picks up any misaligned bytes, then words, before getting
- in the main loop that does the 8-byte clears.
-
---*/
-{
- UINT64 QWordValue;
- UINT64 MmxSave;
- __asm {
- mov edx, Count
- test edx, edx
- je _SetMemDone
-
- push ebx
-
- mov eax, Buffer
- mov bl, Value
- mov edi, eax
- mov bh, bl
-
- cmp edx, 256
- jb _SetRemindingByte
-
- and al, 07h
- test al, al
- je _SetBlock
-
- mov eax, edi
- shr eax, 3
- inc eax
- shl eax, 3
- sub eax, edi
- cmp eax, edx
- jnb _SetRemindingByte
-
- sub edx, eax
- mov ecx, eax
-
- mov al, bl
- rep stosb
-
-_SetBlock:
- mov eax, edx
- shr eax, 6
- test eax, eax
- je _SetRemindingByte
-
- shl eax, 6
- sub edx, eax
- shr eax, 6
-
- mov WORD PTR QWordValue[0], bx
- mov WORD PTR QWordValue[2], bx
- mov WORD PTR QWordValue[4], bx
- mov WORD PTR QWordValue[6], bx
-
-
- movq MmxSave, mm0
- movq mm0, QWordValue
-
-_B:
- movq QWORD PTR ds:[edi], mm0
- movq QWORD PTR ds:[edi+8], mm0
- movq QWORD PTR ds:[edi+16], mm0
- movq QWORD PTR ds:[edi+24], mm0
- movq QWORD PTR ds:[edi+32], mm0
- movq QWORD PTR ds:[edi+40], mm0
- movq QWORD PTR ds:[edi+48], mm0
- movq QWORD PTR ds:[edi+56], mm0
- add edi, 64
- dec eax
- jnz _B
-
-; Restore mm0
- movq mm0, MmxSave
- emms ; Exit MMX Instruction
-
-_SetRemindingByte:
- mov ecx, edx
-
- mov eax, ebx
- shl eax, 16
- mov ax, bx
- shr ecx, 2
- rep stosd
-
- mov ecx, edx
- and ecx, 3
- rep stosb
-
- pop ebx
-
-_SetMemDone:
-
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep1.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep1.c
deleted file mode 100644
index 152c9bcbf5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep1.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiSetMemRep1.c
-
-Abstract:
-
- This is the code that uses rep stosb SetMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Count,
- IN UINT8 Value
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to write
- UINTN Count - Number of bytes to write
- UINT8 Value - Value to write
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function uses rep stosb to set memory.
-
---*/
-{
- __asm {
- mov ecx, Count
- test ecx, ecx
- je Exit
- mov al, Value
- mov edi, Buffer
- rep stosb
-Exit:
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm
deleted file mode 100644
index 0ec1c93c19..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm
+++ /dev/null
@@ -1,75 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
- ;EfiSetMemRep4.c
-;
-;Abstract:
-;
- ;This is the code that uses rep stosd SetMem service
-;
-;--*/
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;#include "Tiano.h"
-;
-;VOID
-;EfiCommonLibSetMem (
- ;IN VOID *Buffer,
- ;IN UINTN Count,
- ;IN UINT8 Value
- ;)
-;/*++
-;
-;Input: VOID *Buffer - Pointer to buffer to write
- ;UINTN Count - Number of bytes to write
- ;UINT8 Value - Value to write
-;
-;Output: None.
-;
-;Saves:
-;
-;Modifies:
-;
-;Description: This function uses rep stosd to set memory.
-;
-;--*/
-EfiCommonLibSetMem PROC
- push ebp
- mov ebp,esp
- push edi
- mov ecx,dword ptr [ebp+0Ch]
- test ecx, ecx
- je Exit
- mov al,byte ptr [ebp+10h]
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, ecx
- mov edi,dword ptr [ebp+8]
- shr ecx, 2
- rep stosd
- mov ecx, edx
- and ecx, 3
- rep stosb
-Exit:
- pop edi
- pop ebp
- ret
-
-EfiCommonLibSetMem ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.c
deleted file mode 100644
index a538b9bee9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiSetMemRep4.c
-
-Abstract:
-
- This is the code that uses rep stosd SetMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Count,
- IN UINT8 Value
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to write
- UINTN Count - Number of bytes to write
- UINT8 Value - Value to write
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function uses rep stosd to set memory.
-
---*/
-{
- __asm {
- mov ecx, Count
- test ecx, ecx
- je Exit
- mov al, Value
- mov ah, al
- shrd edx, eax, 16
- shld eax, edx, 16
- mov edx, ecx
- mov edi, Buffer
- shr ecx, 2
- rep stosd
- mov ecx, edx
- and ecx, 3
- rep stosb
-Exit:
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemSSE2.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemSSE2.c
deleted file mode 100644
index 748274a61d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemSSE2.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiSetMemSSE2.c
-
-Abstract:
-
- This is the code that supports IA32-optimized SetMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibSetMem (
- IN VOID *Buffer,
- IN UINTN Count,
- IN UINT8 Value
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to write
- UINTN Count - Number of bytes to write
- UINT8 Value - Value to write
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function is an optimized set-memory function.
-
-Notes: This function tries to set memory 8 bytes at a time. As a result,
- it first picks up any misaligned bytes, then words, before getting
- in the main loop that does the 8-byte clears.
-
---*/
-{
- UINT64 QWordValue;
- UINT64 MmxSave;
- __asm {
- mov edx, Count
- test edx, edx
- je _SetMemDone
-
- push ebx
-
- mov eax, Buffer
- mov bl, Value
- mov edi, eax
- mov bh, bl
-
- cmp edx, 256
- jb _SetRemindingByte
-
- and al, 0fh
- test al, al
- je _SetBlock
-
- mov eax, edi
- shr eax, 4
- inc eax
- shl eax, 4
- sub eax, edi
- cmp eax, edx
- jnb _SetRemindingByte
-
- sub edx, eax
- mov ecx, eax
-
- mov al, bl
- rep stosb
-
-_SetBlock:
- mov eax, edx
- shr eax, 7
- test eax, eax
- je _SetRemindingByte
-
- shl eax, 7
- sub edx, eax
- shr eax, 7
-
- mov WORD PTR QWordValue[0], bx
- mov WORD PTR QWordValue[2], bx
- mov WORD PTR QWordValue[4], bx
- mov WORD PTR QWordValue[6], bx
-
-
- movq MmxSave, mm0
- movq mm0, QWordValue
-
- movq2dq xmm1, mm0
- pshufd xmm1, xmm1, 0
-
-_Loop:
- movdqa OWORD PTR ds:[edi], xmm1
- movdqa OWORD PTR ds:[edi+16], xmm1
- movdqa OWORD PTR ds:[edi+32], xmm1
- movdqa OWORD PTR ds:[edi+48], xmm1
- movdqa OWORD PTR ds:[edi+64], xmm1
- movdqa OWORD PTR ds:[edi+80], xmm1
- movdqa OWORD PTR ds:[edi+96], xmm1
- movdqa OWORD PTR ds:[edi+112], xmm1
- add edi, 128
- dec eax
- jnz _Loop
-
-; Restore mm0
- movq mm0, MmxSave
- emms ; Exit MMX Instruction
-
-_SetRemindingByte:
- mov ecx, edx
-
- mov eax, ebx
- shl eax, 16
- mov ax, bx
- shr ecx, 2
- rep stosd
-
- mov ecx, edx
- and ecx, 3
- rep stosb
-
- pop ebx
-
-_SetMemDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.S
deleted file mode 100644
index 591ea744e0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.S
+++ /dev/null
@@ -1,139 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# EfiZeroMem.c
-#
-#Abstract:
-#
-# This is the code that supports IA32-optimized ZeroMem service
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .mmx:
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(EfiCommonLibZeroMem)
-#VOID
-#EfiCommonLibZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Count
-# )
-#/*++
-#
-#Input: VOID *Buffer - Pointer to buffer to clear
-# UINTN Count - Number of bytes to clear
-#
-#Output: None.
-#
-#Saves:
-#
-#Modifies:
-#
-#Description: This function is an optimized zero-memory function.
-#
-#Notes: This function tries to zero memory 8 bytes at a time. As a result,
-# it first picks up any misaligned bytes, then words, before getting
-# in the main loop that does the 8-byte clears.
-#
-#--*/
-ASM_PFX(EfiCommonLibZeroMem):
-# UINT64 MmxSave;
- pushl %ebp
- movl %esp, %ebp
- pushl %ecx # Reserve space for local variable MmxSave
- pushl %ecx
- pushl %edi
-
- movl 0xC(%ebp), %ecx # Count
- movl 8(%ebp), %edi # Buffer
-
- # Pick up misaligned start bytes (get pointer 4-byte aligned)
-_StartByteZero:
- movl %edi, %eax
- andb $3, %al # check lower 2 bits of address
- testb %al, %al
- je _ZeroBlocks # already aligned?
- cmpl $0, %ecx
- je _ZeroMemDone
-
- # Clear the byte memory location
- movb $0, (%edi)
- incl %edi
-
- # Decrement our count
- decl %ecx
- jmp _StartByteZero # back to top of loop
-
-_ZeroBlocks:
-
- # Compute how many 64-byte blocks we can clear
- movl %ecx, %edx
- shrl $6, %ecx # convert to 64-byte count
- shll $6, %ecx # convert back to bytes
- subl %ecx, %edx # subtract from the original count
- shrl $6, %ecx # and this is how many 64-byte blocks
-
- # If no 64-byte blocks, then skip
- cmpl $0, %ecx
- je _ZeroRemaining
-
- # Save mm0
- movq %mm0, -8(%ebp) # Save mm0 to MmxSave
-
- pxor %mm0, %mm0 # Clear mm0
-
-_B:
- movq %mm0, %ds:(%edi)
- movq %mm0, %ds:8(%edi)
- movq %mm0, %ds:16(%edi)
- movq %mm0, %ds:24(%edi)
- movq %mm0, %ds:32(%edi)
- movq %mm0, %ds:40(%edi)
- movq %mm0, %ds:48(%edi)
- movq %mm0, %ds:56(%edi)
-
- addl $64, %edi
- decl %ecx
- jnz _B
-
-# Restore mm0
- movq -8(%ebp), %mm0 # Restore mm0 from MmxSave
- emms # Exit MMX Instruction
-
-_ZeroRemaining:
- # Zero out as many DWORDS as possible
- movl %edx, %ecx
- shrl $2, %ecx
- xorl %eax, %eax
-
- rep
- stosl
-
- # Zero out remaining as bytes
- movl %edx, %ecx
- andl $03, %ecx
-
- rep
- stosb
-
-_ZeroMemDone:
-
- popl %edi
- leave
- ret
-#EfiCommonLibZeroMem ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.asm
deleted file mode 100644
index 92d8a13363..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.asm
+++ /dev/null
@@ -1,135 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; EfiZeroMem.c
-;
-;Abstract:
-;
-; This is the code that supports IA32-optimized ZeroMem service
-;
-;--*/
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .mmx
- .code
-
-;---------------------------------------------------------------------------
-;VOID
-;EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Count
-; )
-;/*++
-;
-;Input: VOID *Buffer - Pointer to buffer to clear
-; UINTN Count - Number of bytes to clear
-;
-;Output: None.
-;
-;Saves:
-;
-;Modifies:
-;
-;Description: This function is an optimized zero-memory function.
-;
-;Notes: This function tries to zero memory 8 bytes at a time. As a result,
-; it first picks up any misaligned bytes, then words, before getting
-; in the main loop that does the 8-byte clears.
-;
-;--*/
-EfiCommonLibZeroMem PROC
-; UINT64 MmxSave;
- push ebp
- mov ebp, esp
- push ecx ; Reserve space for local variable MmxSave
- push ecx
- push edi
-
- mov ecx, [ebp + 0Ch] ; Count
- mov edi, [ebp + 8]; Buffer
-
- ; Pick up misaligned start bytes (get pointer 4-byte aligned)
-_StartByteZero:
- mov eax, edi
- and al, 3 ; check lower 2 bits of address
- test al, al
- je _ZeroBlocks ; already aligned?
- cmp ecx, 0
- je _ZeroMemDone
-
- ; Clear the byte memory location
- mov BYTE PTR [edi], 0
- inc edi
-
- ; Decrement our count
- dec ecx
- jmp _StartByteZero ; back to top of loop
-
-_ZeroBlocks:
-
- ; Compute how many 64-byte blocks we can clear
- mov edx, ecx
- shr ecx, 6 ; convert to 64-byte count
- shl ecx, 6 ; convert back to bytes
- sub edx, ecx ; subtract from the original count
- shr ecx, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp ecx, 0
- je _ZeroRemaining
-
- ; Save mm0
- movq [ebp - 8], mm0 ; Save mm0 to MmxSave
-
- pxor mm0, mm0 ; Clear mm0
-
-_B:
- movq QWORD PTR ds:[edi], mm0
- movq QWORD PTR ds:[edi+8], mm0
- movq QWORD PTR ds:[edi+16], mm0
- movq QWORD PTR ds:[edi+24], mm0
- movq QWORD PTR ds:[edi+32], mm0
- movq QWORD PTR ds:[edi+40], mm0
- movq QWORD PTR ds:[edi+48], mm0
- movq QWORD PTR ds:[edi+56], mm0
-
- add edi, 64
- dec ecx
- jnz _B
-
-; Restore mm0
- movq mm0, [ebp - 8] ; Restore mm0 from MmxSave
- emms ; Exit MMX Instruction
-
-_ZeroRemaining:
- ; Zero out as many DWORDS as possible
- mov ecx, edx
- shr ecx, 2
- xor eax, eax
-
- rep stosd
-
- ; Zero out remaining as bytes
- mov ecx, edx
- and ecx, 03
-
- rep stosb
-
-_ZeroMemDone:
-
- pop edi
- leave
- ret
-EfiCommonLibZeroMem ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.c
deleted file mode 100644
index 21dad8ff83..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMem.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiZeroMem.c
-
-Abstract:
-
- This is the code that supports IA32-optimized ZeroMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Count
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to clear
- UINTN Count - Number of bytes to clear
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function is an optimized zero-memory function.
-
-Notes: This function tries to zero memory 8 bytes at a time. As a result,
- it first picks up any misaligned bytes, then words, before getting
- in the main loop that does the 8-byte clears.
-
---*/
-{
- UINT64 MmxSave;
- __asm {
- mov ecx, Count
- mov edi, Buffer
-
- ; Pick up misaligned start bytes (get pointer 4-byte aligned)
-_StartByteZero:
- mov eax, edi
- and al, 3 ; check lower 2 bits of address
- test al, al
- je _ZeroBlocks ; already aligned?
- cmp ecx, 0
- je _ZeroMemDone
-
- ; Clear the byte memory location
- mov BYTE PTR [edi], 0
- inc edi
-
- ; Decrement our count
- dec ecx
- jmp _StartByteZero ; back to top of loop
-
-_ZeroBlocks:
-
- ; Compute how many 64-byte blocks we can clear
- mov edx, ecx
- shr ecx, 6 ; convert to 64-byte count
- shl ecx, 6 ; convert back to bytes
- sub edx, ecx ; subtract from the original count
- shr ecx, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp ecx, 0
- je _ZeroRemaining
-
- ; Save mm0
- movq MmxSave, mm0
-
- pxor mm0, mm0 ; Clear mm0
-
-_B:
- movq QWORD PTR ds:[edi], mm0
- movq QWORD PTR ds:[edi+8], mm0
- movq QWORD PTR ds:[edi+16], mm0
- movq QWORD PTR ds:[edi+24], mm0
- movq QWORD PTR ds:[edi+32], mm0
- movq QWORD PTR ds:[edi+40], mm0
- movq QWORD PTR ds:[edi+48], mm0
- movq QWORD PTR ds:[edi+56], mm0
-
- add edi, 64
- dec ecx
- jnz _B
-
-; Restore mm0
- movq mm0, MmxSave
- emms ; Exit MMX Instruction
-
-_ZeroRemaining:
- ; Zero out as many DWORDS as possible
- mov ecx, edx
- shr ecx, 2
- xor eax, eax
-
- rep stosd
-
- ; Zero out remaining as bytes
- mov ecx, edx
- and ecx, 03
-
- rep stosb
-
-_ZeroMemDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep1.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep1.c
deleted file mode 100644
index 25e07552e5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep1.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiZeroMemRep1.c
-
-Abstract:
-
- This is the code that uses rep stosb ZeroMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Count
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to clear
- UINTN Count - Number of bytes to clear
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function uses rep stosb to zero memory.
-
---*/
-{
- __asm {
- mov ecx, Count
- xor eax, eax
- mov edi, Buffer
- rep stosb
-Exit:
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm
deleted file mode 100644
index 9ec9eca46e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
- ;EfiZeroMemRep4.asm
-;
-;Abstract:
-;
- ;This is the code that uses rep stosd ZeroMem service
-;
-;--*/
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;#include "Tiano.h"
-;
-;VOID
-;EfiCommonLibZeroMem (
- ;IN VOID *Buffer,
- ;IN UINTN Count
- ;)
-;/*++
-;
-;Input: VOID *Buffer - Pointer to buffer to clear
- ;UINTN Count - Number of bytes to clear
-;
-;Output: None.
-;
-;Saves:
-;
-;Modifies:
-;
-;Description: This function uses rep stosd to zero memory.
-;
-;--*/
-EfiCommonLibZeroMem PROC
- push ebp
- mov ebp,esp
- push edi
- mov ecx,dword ptr [ebp+0Ch]
- test ecx, ecx
- je Exit
- xor eax, eax
- mov edi,dword ptr [ebp+8]
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- rep stosd
- mov ecx, edx
- rep stosb
-Exit:
- pop edi
- pop ebp
- ret
-
-EfiCommonLibZeroMem ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.c
deleted file mode 100644
index 28604cd082..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiZeroMemRep4.c
-
-Abstract:
-
- This is the code that uses rep stosd ZeroMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Count
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to clear
- UINTN Count - Number of bytes to clear
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function uses rep stosd to zero memory.
-
---*/
-{
- __asm {
- mov ecx, Count
- test ecx, ecx
- je Exit
- xor eax, eax
- mov edi, Buffer
- mov edx, ecx
- shr ecx, 2
- and edx, 3
- rep stosd
- mov ecx, edx
- rep stosb
-Exit:
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemSSE2.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemSSE2.c
deleted file mode 100644
index 09ac64fc14..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemSSE2.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- EfiZeroMemSSE2.c
-
-Abstract:
-
- This is the code that supports IA32-optimized ZeroMem service
-
---*/
-
-#include "Tiano.h"
-
-VOID
-EfiCommonLibZeroMem (
- IN VOID *Buffer,
- IN UINTN Count
- )
-/*++
-
-Input: VOID *Buffer - Pointer to buffer to clear
- UINTN Count - Number of bytes to clear
-
-Output: None.
-
-Saves:
-
-Modifies:
-
-Description: This function is an optimized zero-memory function.
-
-Notes: This function tries to zero memory 8 bytes at a time. As a result,
- it first picks up any misaligned bytes, then words, before getting
- in the main loop that does the 8-byte clears.
-
---*/
-{
- __asm {
- mov ecx, Count
- mov edi, Buffer
-
- ; Pick up misaligned start bytes (get pointer 4-byte aligned)
-_StartByteZero:
- mov eax, edi
- and al, 3 ; check lower 2 bits of address
- test al, al
- je _ZeroBlocks ; already aligned?
- cmp ecx, 0
- je _ZeroMemDone
-
- ; Clear the byte memory location
- mov BYTE PTR [edi], 0
- inc edi
-
- ; Decrement our count
- dec ecx
- jmp _StartByteZero ; back to top of loop
-
-_ZeroBlocks:
-
- ; Compute how many 64-byte blocks we can clear
- mov edx, ecx
- shr ecx, 6 ; convert to 64-byte count
- shl ecx, 6 ; convert back to bytes
- sub edx, ecx ; subtract from the original count
- shr ecx, 6 ; and this is how many 64-byte blocks
-
- ; If no 64-byte blocks, then skip
- cmp ecx, 0
- je _ZeroRemaining
-
- xorps xmm1, xmm1
-
-_B:
- movdqu OWORD PTR ds:[edi], xmm1
- movdqu OWORD PTR ds:[edi+16], xmm1
- movdqu OWORD PTR ds:[edi+32], xmm1
- movdqu OWORD PTR ds:[edi+48], xmm1
-
- add edi, 64
- dec ecx
- jnz _B
-
-
-_ZeroRemaining:
- ; Zero out as many DWORDS as possible
- mov ecx, edx
- shr ecx, 2
- xor eax, eax
-
- rep stosd
-
- ; Zero out remaining as bytes
- mov ecx, edx
- and ecx, 03
-
- rep stosb
-
-_ZeroMemDone:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.S
deleted file mode 100644
index 485fb8bc48..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.S
+++ /dev/null
@@ -1,68 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# GetPowerOfTwo.c
-#
-#Abstract:
-#
-# Calculates the largest integer that is both
-# a power of two and less than Input
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(GetPowerOfTwo)
-#UINT64
-#GetPowerOfTwo (
-# IN UINT64 Input
-# )
-#/*++
-#
-#Routine Description:
-#
-# Calculates the largest integer that is both
-# a power of two and less than Input
-#
-#Arguments:
-#
-# Input - value to calculate power of two
-#
-#Returns:
-#
-# the largest integer that is both a power of
-# two and less than Input
-#
-#--*/
-ASM_PFX(GetPowerOfTwo):
- xorl %eax, %eax
- movl %eax, %edx
- movl 8(%esp), %ecx # dword ptr Input[4]
- jecxz _F
- bsrl %ecx, %ecx
- btsl %ecx, %edx
- jmp _Exit
-_F:
- movl 4(%esp), %ecx # dword ptr Input[0]
- jecxz _Exit
- bsrl %ecx, %ecx
- btsl %ecx, %eax
-_Exit:
-
- ret
-#GetPowerOfTwo ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm
deleted file mode 100644
index 72658e90e8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.asm
+++ /dev/null
@@ -1,67 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; GetPowerOfTwo.c
-;
-;Abstract:
-;
-; Calculates the largest integer that is both
-; a power of two and less than Input
-;
-;--*/
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-
-;UINT64
-;GetPowerOfTwo (
-; IN UINT64 Input
-; )
-;/*++
-;
-;Routine Description:
-;
-; Calculates the largest integer that is both
-; a power of two and less than Input
-;
-;Arguments:
-;
-; Input - value to calculate power of two
-;
-;Returns:
-;
-; the largest integer that is both a power of
-; two and less than Input
-;
-;--*/
-GetPowerOfTwo PROC
- xor eax, eax
- mov edx, eax
- mov ecx, [esp + 8] ; dword ptr Input[4]
- jecxz _F
- bsr ecx, ecx
- bts edx, ecx
- jmp _Exit
-_F:
- mov ecx, [esp + 4] ; dword ptr Input[0]
- jecxz _Exit
- bsr ecx, ecx
- bts eax, ecx
-_Exit:
-
- ret
-GetPowerOfTwo ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.c
deleted file mode 100644
index 268bb14f51..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/GetPowerOfTwo.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- GetPowerOfTwo.c
-
-Abstract:
-
- Calculates the largest integer that is both
- a power of two and less than Input
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-GetPowerOfTwo (
- IN UINT64 Input
- )
-/*++
-
-Routine Description:
-
- Calculates the largest integer that is both
- a power of two and less than Input
-
-Arguments:
-
- Input - value to calculate power of two
-
-Returns:
-
- the largest integer that is both a power of
- two and less than Input
-
---*/
-{
- __asm {
- xor eax, eax
- mov edx, eax
- mov ecx, dword ptr Input[4]
- jecxz _F
- bsr ecx, ecx
- bts edx, ecx
- jmp _Exit
-_F:
- mov ecx, dword ptr Input[0]
- jecxz _Exit
- bsr ecx, ecx
- bts eax, ecx
-_Exit:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.S
deleted file mode 100644
index 0127d823cf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.S
+++ /dev/null
@@ -1,82 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# LShiftU64.c
-#
-#Abstract:
-#
-# 64-bit left shift function for IA-32
-#
-#--*/
-#
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(LShiftU64)
-#
-#UINT64
-#LShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# )
-#/*++
-#
-#Routine Description:
-#
-# This routine allows a 64 bit value to be left shifted by 32 bits and
-# returns the shifted value.
-# Count is valid up 63. (Only Bits 0-5 is valid for Count)
-#
-#Arguments:
-#
-# Operand - Value to be shifted
-# Count - Number of times to shift left.
-#
-#Returns:
-#
-# Value shifted left identified by the Count.
-#
-#--*/
-ASM_PFX(LShiftU64):
-
- movl 4(%esp), %eax # dword ptr Operand[0]
- movl 8(%esp), %edx # dword ptr Operand[4]
-
- #
- # CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EAX is not touched
- # For CL of 32 - 63, it will be shifted 0 - 31 so we will move eax to edx later.
- #
- movl 0xC(%esp), %ecx # Count
- andl $63, %ecx
- shld %cl, %eax, %edx
- shlb %cl, %eax
-
- #
- # Since Count is 32 - 63, eax will have been shifted by 0 - 31
- # If shifted by 32 or more, set lower 32 bits to zero.
- #
- cmpl $32, %ecx
- jc _LShiftU64_Done
-
- movl %eax, %edx
- xorl %eax, %eax
-
-_LShiftU64_Done:
-
- ret
-#LShiftU64 ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.asm
deleted file mode 100644
index 30c660203c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.asm
+++ /dev/null
@@ -1,80 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; LShiftU64.c
-;
-;Abstract:
-;
-; 64-bit left shift function for IA-32
-;
-;--*/
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;
-;UINT64
-;LShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; )
-;/*++
-;
-;Routine Description:
-;
-; This routine allows a 64 bit value to be left shifted by 32 bits and
-; returns the shifted value.
-; Count is valid up 63. (Only Bits 0-5 is valid for Count)
-;
-;Arguments:
-;
-; Operand - Value to be shifted
-; Count - Number of times to shift left.
-;
-;Returns:
-;
-; Value shifted left identified by the Count.
-;
-;--*/
-LShiftU64 PROC
-
- mov eax, [esp + 4]; dword ptr Operand[0]
- mov edx, [esp + 8]; dword ptr Operand[4]
-
- ;
- ; CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EAX is not touched
- ; For CL of 32 - 63, it will be shifted 0 - 31 so we will move eax to edx later.
- ;
- mov ecx, [esp + 0Ch]; Count
- and ecx, 63
- shld edx, eax, cl
- shl eax, cl
-
- ;
- ; Since Count is 32 - 63, eax will have been shifted by 0 - 31
- ; If shifted by 32 or more, set lower 32 bits to zero.
- ;
- cmp ecx, 32
- jc short _LShiftU64_Done
-
- mov edx, eax
- xor eax, eax
-
-_LShiftU64_Done:
-
- ret
-LShiftU64 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.c
deleted file mode 100644
index 57009af6f3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/LShiftU64.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- LShiftU64.c
-
-Abstract:
-
- 64-bit left shift function for IA-32
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and
- returns the shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-{
- __asm {
-
- mov eax, dword ptr Operand[0]
- mov edx, dword ptr Operand[4]
-
- ;
- ; CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EAX is not touched
- ; For CL of 32 - 63, it will be shifted 0 - 31 so we will move eax to edx later.
- ;
- mov ecx, Count
- and ecx, 63
- shld edx, eax, cl
- shl eax, cl
-
- ;
- ; Since Count is 32 - 63, eax will have been shifted by 0 - 31
- ; If shifted by 32 or more, set lower 32 bits to zero.
- ;
- cmp ecx, 32
- jc short _LShiftU64_Done
-
- mov edx, eax
- xor eax, eax
-
-_LShiftU64_Done:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.S
deleted file mode 100644
index 2441e38fa1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.S
+++ /dev/null
@@ -1,78 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# Log2.c
-#
-#Abstract:
-#
-# 64-bit integer logarithm function for IA-32
-#
-#--*/
-#
-#---------------------------------------------------------------------------
-#include "EfiBind.h" //For ASM_PFX
-#---------------------------------------------------------------------------
-
-.globl ASM_PFX(Log2)
-
-#UINT8
-#Log2 (
-# IN UINT64 Operand
-# )
-#/*++
-#
-#Routine Description:
-#
-# Calculates and floors logarithms based on 2
-#
-#Arguments:
-#
-# Operand - value to calculate logarithm
-#
-#Returns:
-#
-# The largest integer that is less than or equal
-# to the logarithm of Operand based on 2
-#
-#--*/
-ASM_PFX(Log2):
- movl $64, %ecx
-
- cmpl $0, 4(%esp) # (UINT32 *(&Operand))
- jne _Log2_Wend
- cmpl $0, 8(%esp) # (UINT32 *(&Operand)) + 1
- jne _Log2_Wend
- movb $0xFF, %cl
- jmp _Log2_Done
-
-_Log2_Wend:
- decl %ecx
- cmpl $32, %ecx
- jae _Log2_Higher
- btl %ecx, 4(%esp) # (UINT32 *(&Operand))
- jmp _Log2_Bit
-
-_Log2_Higher:
- movl %ecx, %eax
- subl $32, %eax
- btl %eax, 8(%esp) # (UINT32 *(&Operand)) + 1
-
-_Log2_Bit:
- jc _Log2_Done
- jmp _Log2_Wend
-
-_Log2_Done:
- movb %cl, %al
-
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.asm
deleted file mode 100644
index cf932f525f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.asm
+++ /dev/null
@@ -1,81 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; Log2.c
-;
-;Abstract:
-;
-; 64-bit integer logarithm function for IA-32
-;
-;--*/
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-
-;UINT8
-;Log2 (
-; IN UINT64 Operand
-; )
-;/*++
-;
-;Routine Description:
-;
-; Calculates and floors logarithms based on 2
-;
-;Arguments:
-;
-; Operand - value to calculate logarithm
-;
-;Returns:
-;
-; The largest integer that is less than or equal
-; to the logarithm of Operand based on 2
-;
-;--*/
-Log2 PROC
- mov ecx, 64
-
- cmp dword ptr [esp + 4], 0 ; (UINT32 *(&Operand))
- jne _Log2_Wend
- cmp dword ptr [esp + 8], 0 ; (UINT32 *(&Operand)) + 1
- jne _Log2_Wend
- mov cl, 0FFH
- jmp _Log2_Done
-
-_Log2_Wend:
- dec ecx
- cmp ecx, 32
- jae _Log2_Higher
- bt [esp + 4], ecx ; (UINT32 *(&Operand))
- jmp _Log2_Bit
-
-_Log2_Higher:
- mov eax, ecx
- sub eax, 32
- bt [esp + 8], eax ; (UINT32 *(&Operand)) + 1
-
-_Log2_Bit:
- jc _Log2_Done
- jmp _Log2_Wend
-
-_Log2_Done:
- mov al, cl
-
- ret
-
- Log2 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.c
deleted file mode 100644
index 93a9530086..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Log2.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- Log2.c
-
-Abstract:
-
- 64-bit integer logarithm function for IA-32
-
---*/
-
-#include "Tiano.h"
-
-UINT8
-Log2 (
- IN UINT64 Operand
- )
-/*++
-
-Routine Description:
-
- Calculates and floors logarithms based on 2
-
-Arguments:
-
- Operand - value to calculate logarithm
-
-Returns:
-
- The largest integer that is less than or equal
- to the logarithm of Operand based on 2
-
---*/
-{
- __asm {
- mov ecx, 64
-
- cmp dword ptr Operand[0], 0
- jne _Log2_Wend
- cmp dword ptr Operand[4], 0
- jne _Log2_Wend
- mov cl, 0FFH
- jmp _Log2_Done
-
-_Log2_Wend:
- dec ecx
- cmp ecx, 32
- jae _Log2_Higher
- bt dword ptr Operand[0], ecx
- jmp _Log2_Bit
-
-_Log2_Higher:
- mov eax, ecx
- sub eax, 32
- bt dword ptr Operand[4], eax
-
-_Log2_Bit:
- jc _Log2_Done
- jmp _Log2_Wend
-
-_Log2_Done:
- mov al, cl
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.S
deleted file mode 100644
index 5d065e15cb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.S
+++ /dev/null
@@ -1,71 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# MultU64x32.c
-#
-#Abstract:
-#
-# 64-bit Multiplication function for IA-32
-#
-#--*/
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(MultU64x32)
-#UINT64
-#MultU64x32 (
-# IN UINT64 Multiplicand,
-# IN UINTN Multiplier
-# )
-#/*++
-#
-#Routine Description:
-#
-# This routine allows a 64 bit value to be multiplied with a 32 bit
-# value returns 64bit result.
-# No checking if the result is greater than 64bits
-#
-#Arguments:
-#
-# Multiplicand - multiplicand
-# Multiplier - multiplier
-#
-#Returns:
-#
-# Multiplicand * Multiplier
-#
-#--*/
-ASM_PFX(MultU64x32):
-
- movl 4(%esp), %eax # dword ptr Multiplicand[0]
- mull 0xC(%esp) # Multiplier
- pushl %eax
- pushl %edx
- movl 0x10(%esp), %eax # dword ptr Multiplicand[4]
- mull 0x14(%esp) # Multiplier
- #
- # The value in edx stored by second multiplication overflows
- # the output and should be discarded. So here we overwrite it
- # with the edx value of first multiplication.
- #
- popl %edx
- addl %eax, %edx
- popl %eax
-
- ret
-#MultU64x32 ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.asm
deleted file mode 100644
index abb2b6c2e3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; MultU64x32.c
-;
-;Abstract:
-;
-; 64-bit Multiplication function for IA-32
-;
-;--*/
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-
-;UINT64
-;MultU64x32 (
-; IN UINT64 Multiplicand,
-; IN UINTN Multiplier
-; )
-;/*++
-;
-;Routine Description:
-;
-; This routine allows a 64 bit value to be multiplied with a 32 bit
-; value returns 64bit result.
-; No checking if the result is greater than 64bits
-;
-;Arguments:
-;
-; Multiplicand - multiplicand
-; Multiplier - multiplier
-;
-;Returns:
-;
-; Multiplicand * Multiplier
-;
-;--*/
-MultU64x32 PROC
-
- mov eax, [esp + 4]; dword ptr Multiplicand[0]
- mul dword ptr [esp + 0Ch] ; Multiplier
- push eax
- push edx
- mov eax, [esp + 10h]; dword ptr Multiplicand[4]
- mul dword ptr [esp + 14h]; Multiplier
- ;
- ; The value in edx stored by second multiplication overflows
- ; the output and should be discarded. So here we overwrite it
- ; with the edx value of first multiplication.
- ;
- pop edx
- add edx, eax
- pop eax
-
- ret
-MultU64x32 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.c
deleted file mode 100644
index 0af0707173..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/MultU64x32.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- MultU64x32.c
-
-Abstract:
-
- 64-bit Multiplication function for IA-32
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit
- value returns 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand - multiplicand
- Multiplier - multiplier
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-{
- __asm {
- mov eax, dword ptr Multiplicand[0]
- mul Multiplier
- push eax
- push edx
- mov eax, dword ptr Multiplicand[4]
- mul Multiplier
- ;
- ; The value in edx stored by second multiplication overflows
- ; the output and should be discarded. So here we overwrite it
- ; with the edx value of first multiplication.
- ;
- pop edx
- add edx, eax
- pop eax
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
deleted file mode 100644
index a40c56bcb1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
+++ /dev/null
@@ -1,84 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# Power10U64.c
-#
-#Abstract:
-#
-# Calculates Operand * 10 ^ Power
-#
-#--*/
-#
-##include "Tiano.h"
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .code:
-
-.globl ASM_PFX(DivU64x32)
-#---------------------------------------------------------------------------
-#
-#UINT64
-#MultU64x32 (
-# IN UINT64 Multiplicand,
-# IN UINTN Multiplier
-# );
-#
-#UINT64
-#Power10U64 (
-# IN UINT64 Operand,
-# IN UINTN Power
-# )
-#/*++
-#
-#Routine Description:
-#
-# Raise 10 to the power of Power, and multiply the result with Operand
-#
-#Arguments:
-#
-# Operand - multiplicand
-# Power - power
-#
-#Returns:
-#
-# Operand * 10 ^ Power
-#
-#--*/
-ASM_PFX(Power10U64):
- pushl %ebp
- movl %esp, %ebp
- movl 8(%ebp), %eax # dword ptr Operand[0]
- movl 0xC(%ebp), %edx # dword ptr Operand[4]
- movl 0x10(%ebp), %ecx #Power
- jcxz _Power10U64_Done
-
-_Power10U64_Wend:
- pushl %ecx
- pushl $10
- push 0xC(%ebp)
- push 0x8(%ebp)
- call ASM_PFX(MultU64x32)
- addl $0xc, %esp
- popl %ecx
- movl %eax, 8(%ebp) # dword ptr Operand[0]
- movl %edx, 0xC(%ebp) # dword ptr Operand[4]
- loopl _Power10U64_Wend
-
-_Power10U64_Done:
-
- popl %ebp
- ret
-#Power10U64 ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
deleted file mode 100644
index b6e25320d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
+++ /dev/null
@@ -1,83 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; Power10U64.c
-;
-;Abstract:
-;
-; Calculates Operand * 10 ^ Power
-;
-;--*/
-;
-;#include "Tiano.h"
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-MultU64x32 PROTO C
-;---------------------------------------------------------------------------
-;
-;UINT64
-;MultU64x32 (
-; IN UINT64 Multiplicand,
-; IN UINTN Multiplier
-; );
-;
-;UINT64
-;Power10U64 (
-; IN UINT64 Operand,
-; IN UINTN Power
-; )
-;/*++
-;
-;Routine Description:
-;
-; Raise 10 to the power of Power, and multiply the result with Operand
-;
-;Arguments:
-;
-; Operand - multiplicand
-; Power - power
-;
-;Returns:
-;
-; Operand * 10 ^ Power
-;
-;--*/
-Power10U64 PROC
- push ebp
- mov ebp, esp
- mov eax, dword ptr [ebp + 8]; dword ptr Operand[0]
- mov edx, dword ptr [ebp + 0Ch]; dword ptr Operand[4]
- mov ecx, dword ptr [ebp + 10h] ;Power
- jcxz _Power10U64_Done
-
-_Power10U64_Wend:
- push ecx
- push 10
- push [ebp + 0Ch]; dword ptr Operand[4]
- push [ebp + 8]; dword ptr Operand[0]
- call MultU64x32
- add esp, 0cH
- pop ecx
- mov [ebp + 8] , eax; dword ptr Operand[0]
- mov [ebp + 0Ch] , edx; dword ptr Operand[4]
- loop _Power10U64_Wend
-
-_Power10U64_Done:
-
- pop ebp
- ret
-Power10U64 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
deleted file mode 100644
index 2a31fe133e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- Power10U64.c
-
-Abstract:
-
- Calculates Operand * 10 ^ Power
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- );
-
-UINT64
-Power10U64 (
- IN UINT64 Operand,
- IN UINTN Power
- )
-/*++
-
-Routine Description:
-
- Raise 10 to the power of Power, and multiply the result with Operand
-
-Arguments:
-
- Operand - multiplicand
- Power - power
-
-Returns:
-
- Operand * 10 ^ Power
-
---*/
-{
- __asm {
- mov eax, dword ptr Operand[0]
- mov edx, dword ptr Operand[4]
- mov ecx, Power
- jcxz _Power10U64_Done
-
-_Power10U64_Wend:
- push ecx
- push 10
- push dword ptr Operand[4]
- push dword ptr Operand[0]
- call MultU64x32
- add esp, 0Ch
- pop ecx
- mov dword ptr Operand[0], eax
- mov dword ptr Operand[4], edx
- loop _Power10U64_Wend
-
-_Power10U64_Done:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.S
deleted file mode 100644
index 70fda781d5..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.S
+++ /dev/null
@@ -1,80 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
-# RShiftU64.c
-#
-#Abstract:
-#
-# 64-bit right shift function for IA-32
-#
-#--*/
-#
-##include "Tiano.h"
-#
-#include "EfiBind.h"
-#---------------------------------------------------------------------------
- .686:
- #.MODEL flat,C
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(RShiftU64)
-#UINT64
-#RShiftU64 (
-# IN UINT64 Operand,
-# IN UINTN Count
-# )
-#/*++
-#
-#Routine Description:
-# This routine allows a 64 bit value to be right shifted by 32 bits and returns the
-# shifted value.
-# Count is valid up 63. (Only Bits 0-5 is valid for Count)
-#Arguments:
-# Operand - Value to be shifted
-# Count - Number of times to shift right.
-#
-#Returns:
-#
-# Value shifted right identified by the Count.
-#
-#--*/
-ASM_PFX(RShiftU64):
-
- movl 4(%esp), %eax # dword ptr Operand[0]
- movl 8(%esp), %edx # dword ptr Operand[4]
-
- #
- # CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EDX is not touched
- # For CL of 32 - 63, it will be shifted 0 - 31 so we will move edx to eax later.
- #
- movl 0xC(%esp), %ecx # Count
- andl $63, %ecx
- shrd %cl, %edx, %eax
- shrb %cl, %edx
-
- cmpl $32, %ecx
- jc _RShiftU64_Done
-
- #
- # Since Count is 32 - 63, edx will have been shifted by 0 - 31
- # If shifted by 32 or more, set upper 32 bits to zero.
- #
- movl %edx, %eax
- xorl %edx, %edx
-
-_RShiftU64_Done:
-
- ret
-#RShiftU64 ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.asm
deleted file mode 100644
index fe82a86b10..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.asm
+++ /dev/null
@@ -1,78 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
-; RShiftU64.c
-;
-;Abstract:
-;
-; 64-bit right shift function for IA-32
-;
-;--*/
-;
-;#include "Tiano.h"
-;
-;---------------------------------------------------------------------------
- .686
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;UINT64
-;RShiftU64 (
-; IN UINT64 Operand,
-; IN UINTN Count
-; )
-;/*++
-;
-;Routine Description:
-; This routine allows a 64 bit value to be right shifted by 32 bits and returns the
-; shifted value.
-; Count is valid up 63. (Only Bits 0-5 is valid for Count)
-;Arguments:
-; Operand - Value to be shifted
-; Count - Number of times to shift right.
-;
-;Returns:
-;
-; Value shifted right identified by the Count.
-;
-;--*/
-RShiftU64 PROC
-
- mov eax, [esp + 4]; dword ptr Operand[0]
- mov edx, [esp + 8]; dword ptr Operand[4]
-
- ;
- ; CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EDX is not touched
- ; For CL of 32 - 63, it will be shifted 0 - 31 so we will move edx to eax later.
- ;
- mov ecx, [esp + 0Ch] ; Count
- and ecx, 63
- shrd eax, edx, cl
- shr edx, cl
-
- cmp ecx, 32
- jc short _RShiftU64_Done
-
- ;
- ; Since Count is 32 - 63, edx will have been shifted by 0 - 31
- ; If shifted by 32 or more, set upper 32 bits to zero.
- ;
- mov eax, edx
- xor edx, edx
-
-_RShiftU64_Done:
-
- ret
-RShiftU64 ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.c
deleted file mode 100644
index 8c9da33727..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/RShiftU64.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- RShiftU64.c
-
-Abstract:
-
- 64-bit right shift function for IA-32
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
- This routine allows a 64 bit value to be right shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-Arguments:
- Operand - Value to be shifted
- Count - Number of times to shift right.
-
-Returns:
-
- Value shifted right identified by the Count.
-
---*/
-{
- __asm {
-
- mov eax, dword ptr Operand[0]
- mov edx, dword ptr Operand[4]
-
- ;
- ; CL is valid from 0 - 31. shld will move EDX:EAX by CL times but EDX is not touched
- ; For CL of 32 - 63, it will be shifted 0 - 31 so we will move edx to eax later.
- ;
- mov ecx, Count
- and ecx, 63
- shrd eax, edx, cl
- shr edx, cl
-
- cmp ecx, 32
- jc short _RShiftU64_Done
-
- ;
- ; Since Count is 32 - 63, edx will have been shifted by 0 - 31
- ; If shifted by 32 or more, set upper 32 bits to zero.
- ;
- mov eax, edx
- xor edx, edx
-
-_RShiftU64_Done:
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/LinkedList.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/LinkedList.c
deleted file mode 100644
index 2ba4d1c267..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/LinkedList.c
+++ /dev/null
@@ -1,354 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LinkedList.c
-
-Abstract:
-
- Linked List Library Functions
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-
-VOID
-InitializeListHead (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Initialize the head of the List. The caller must allocate the memory
- for the EFI_LIST. This function must be called before the other linked
- list macros can be used.
-
-Arguments:
-
- List - Pointer to list head to initialize
-
-Returns:
-
- None.
-
---*/
-
-{
- List->ForwardLink = List;
- List->BackLink = List;
-}
-
-
-BOOLEAN
-IsListEmpty (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Return TRUE is the list contains zero nodes. Otherzise return FALSE.
- The list must have been initialized with InitializeListHead () before using
- this function.
-
-Arguments:
-
- List - Pointer to list head to test
-
-
-Returns:
-
- Return TRUE is the list contains zero nodes. Otherzise return FALSE.
-
---*/
-{
- return (BOOLEAN)(List->ForwardLink == List);
-}
-
-
-VOID
-RemoveEntryList (
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Remove Node from the doubly linked list. It is the caller's responsibility
- to free any memory used by the entry if needed. The list must have been
- initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- Entry - Element to remove from the list.
-
-Returns:
-
- None
-
---*/
-{
- EFI_LIST_ENTRY *_ForwardLink;
- EFI_LIST_ENTRY *_BackLink;
-
- _ForwardLink = Entry->ForwardLink;
- _BackLink = Entry->BackLink;
- _BackLink->ForwardLink = _ForwardLink;
- _ForwardLink->BackLink = _BackLink;
-
- DEBUG_CODE (
- Entry->ForwardLink = (EFI_LIST_ENTRY *) EFI_BAD_POINTER;
- Entry->BackLink = (EFI_LIST_ENTRY *) EFI_BAD_POINTER;
- )
-}
-
-
-VOID
-InsertTailList (
- EFI_LIST_ENTRY *ListHead,
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Insert a Node into the end of a doubly linked list. The list must have
- been initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- ListHead - Head of doubly linked list
-
- Entry - Element to insert at the end of the list.
-
-Returns:
-
- None
-
---*/
-{
- EFI_LIST_ENTRY *_ListHead;
- EFI_LIST_ENTRY *_BackLink;
-
- _ListHead = ListHead;
- _BackLink = _ListHead->BackLink;
- Entry->ForwardLink = _ListHead;
- Entry->BackLink = _BackLink;
- _BackLink->ForwardLink = Entry;
- _ListHead->BackLink = Entry;
-}
-
-
-
-VOID
-InsertHeadList (
- EFI_LIST_ENTRY *ListHead,
- EFI_LIST_ENTRY *Entry
- )
-/*++
-
-Routine Description:
-
- Insert a Node into the start of a doubly linked list. The list must have
- been initialized with InitializeListHead () before using this function.
-
-Arguments:
-
- ListHead - Head of doubly linked list
-
- Entry - Element to insert to beginning of list
-
-Returns:
-
- None
-
---*/
-{
- EFI_LIST_ENTRY *_ListHead;
- EFI_LIST_ENTRY *_ForwardLink;
-
- _ListHead = ListHead;
- _ForwardLink = _ListHead->ForwardLink;
- Entry->ForwardLink = _ForwardLink;
- Entry->BackLink = _ListHead;
- _ForwardLink->BackLink = Entry;
- _ListHead->ForwardLink = Entry;
-}
-
-VOID
-SwapListEntries (
- EFI_LIST_ENTRY *Entry1,
- EFI_LIST_ENTRY *Entry2
- )
-/*++
-
-Routine Description:
-
- Swap the location of the two elements of a doubly linked list. Node2
- is placed in front of Node1. The list must have been initialized with
- InitializeListHead () before using this function.
-
-Arguments:
-
- Entry1 - Element in the doubly linked list in front of Node2.
-
- Entry2 - Element in the doubly linked list behind Node1.
-
-Returns:
-
- None
-
---*/
-{
- EFI_LIST_ENTRY *Entry1BackLink;
- EFI_LIST_ENTRY *Entry2ForwardLink;
- EFI_LIST_ENTRY *Entry2BackLink;
-
- Entry2ForwardLink = Entry2->ForwardLink;
- Entry2BackLink = Entry2->BackLink;
- Entry1BackLink = Entry1->BackLink;
- Entry2BackLink->ForwardLink = Entry2ForwardLink;
- Entry2ForwardLink->BackLink = Entry2BackLink;
- Entry2->ForwardLink = Entry1;
- Entry2->BackLink = Entry1BackLink;
- Entry1BackLink->ForwardLink = Entry2;
- Entry1->BackLink = Entry2;
-}
-
-
-EFI_LIST_ENTRY *
-GetFirstNode (
- EFI_LIST_ENTRY *List
- )
-/*++
-
-Routine Description:
-
- Return the first node pointed to by the list head. The list must
- have been initialized with InitializeListHead () before using this
- function and must contain data.
-
-Arguments:
-
- List - The head of the doubly linked list.
-
-Returns:
-
- Pointer to the first node, if the list contains nodes. The list will
- return a null value--that is, the value of List--when the list is empty.
- See the description of IsNull for more information.
-
-
---*/
-{
- return List->ForwardLink;
-}
-
-
-EFI_LIST_ENTRY *
-GetNextNode (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Returns the node following Node in the list. The list must
- have been initialized with InitializeListHead () before using this
- function and must contain data.
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node in the list. This value MUST NOT be the literal value NULL.
- See the description of IsNull for more information.
-
-Returns:
-
- Pointer to the next node, if one exists. Otherwise, returns a null value,
- which is actually a pointer to List.
- See the description of IsNull for more information.
-
---*/
-{
- if (Node == List) {
- return List;
- }
- return Node->ForwardLink;
-}
-
-
-BOOLEAN
-IsNull (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Determines whether the given node is null. Note that Node is null
- when its value is equal to the value of List. It is an error for
- Node to be the literal value NULL [(VOID*)0x0].
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node to test. MUST NOT be the literal value NULL. See
- the description above.
-
-Returns:
-
- Returns true if the node is null.
-
---*/
-{
- return (BOOLEAN)(Node == List);
-}
-
-
-BOOLEAN
-IsNodeAtEnd (
- EFI_LIST_ENTRY *List,
- EFI_LIST_ENTRY *Node
- )
-/*++
-
-Routine Description:
-
- Determines whether the given node is at the end of the list. Used
- to walk the list. The list must have been initialized with
- InitializeListHead () before using this function and must contain
- data.
-
-Arguments:
-
- List - The head of the list. MUST NOT be the literal value NULL.
- Node - The node to test. MUST NOT be the literal value NULL.
- See the description of IsNull for more information.
-
-Returns:
-
- Returns true if the list is the tail.
-
---*/
-{
- if (IsNull (List, Node)) {
- return FALSE;
- }
- return (BOOLEAN)(List->BackLink == Node);
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
deleted file mode 100644
index c558869149..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Math.c
-
-Abstract:
-
- Math worker functions.
-
---*/
-
-#include "Tiano.h"
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and
- returns the shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-{
- return Operand << Count;
-}
-
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit
- value returns 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand - multiplicand
- Multiplier - multiplier
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-{
- return Multiplicand * Multiplier;
-}
-
-UINT64
-Power10U64 (
- IN UINT64 Operand,
- IN UINTN Power
- )
-{
- UINT64 Result;
-
- Result = Operand;
- while (Power-- > 0) {
- Result *= 10;
- }
- return Result;
-}
-
-UINT64
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be right shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift right.
-
-Returns:
-
- Value shifted right identified by the Count.
-
---*/
-{
- return Operand >> Count;
-}
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
-
-Arguments:
-
- Dividend - dividend
- Divisor - divisor
- Remainder - buffer for remainder
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
---*/
-{
- if (Remainder != NULL) {
- *Remainder = Dividend % Divisor;
- }
-
- return Dividend / Divisor;
-}
-
-UINT8
-Log2 (
- IN UINT64 Operand
- )
-/*++
-
-Routine Description:
-
- This function computes rounded down log2 of the Operand. This is an equivalent
- of the position of the highest bit set in the Operand treated as a mask.
- E.g., Log2 (0x0001) == 0, Log2 (0x0002) == 1, Log2 (0x0003) == 1, Log2 (0x0005) == 2
- Log2 (0x4000) == 14, Log2 (0x8000) == 15, Log2 (0xC000) == 15, Log2 (0xFFFF) == 15, etc.
-
-Arguments:
- Operand - value of which the Log2 is to be computed.
-
-Returns:
- Rounded down log2 of the Operand or 0xFF if zero passed in.
-
---*/
-{
- UINT8 Bitpos;
- Bitpos = 0;
-
- if (Operand == 0) {
- return (0xff);
- }
-
- while (Operand != 0) {
- Operand >>= 1;
- Bitpos++;
- }
- return (UINT8)(Bitpos - 1);
-
-}
-
-UINT64
-GetPowerOfTwo (
- IN UINT64 Operand
- )
-/*++
-
-Routine Description:
-
- Calculates the largest integer that is both
- a power of two and less than Input
-
-Arguments:
-
- Operand - value to calculate power of two
-
-Returns:
-
- the largest integer that is both a power of
- two and less than Input
-
---*/
-{
- UINT8 Bitpos;
- Bitpos = 0;
-
- if (Operand == 0) {
- return 0;
- }
-
- while (Operand != 0) {
- Operand >>= 1;
- Bitpos++;
- }
-
- Operand = 1;
- Bitpos--;
- while (Bitpos != 0) {
- Operand <<= 1;
- Bitpos--;
- }
-
- return Operand;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
deleted file mode 100644
index ef68647569..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- misc.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "pei.h"
-#include "cpuio.h"
-#include EFI_PPI_CONSUMER (PciCfg)
-#include EFI_PPI_CONSUMER (PciCfg2)
-#include EFI_PROTOCOL_CONSUMER (PciRootBridgeIo)
-
-//
-// Modular variable used by common libiary in PEI phase
-//
-EFI_GUID mPeiCpuIoPpiGuid = PEI_CPU_IO_PPI_GUID;
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
-EFI_GUID mPeiPciCfgPpiGuid = PEI_PCI_CFG_PPI_GUID;
-PEI_PCI_CFG_PPI *PciCfgPpi = NULL;
-#else
-EFI_GUID mPeiPciCfgPpiGuid = EFI_PEI_PCI_CFG2_PPI_GUID;
-EFI_PEI_PCI_CFG2_PPI *PciCfgPpi = NULL;
-#endif
-EFI_PEI_SERVICES **mPeiServices = NULL;
-PEI_CPU_IO_PPI *CpuIoPpi = NULL;
-
-//
-// Modular variable used by common libiary in DXE phase
-//
-EFI_SYSTEM_TABLE *mST = NULL;
-EFI_BOOT_SERVICES *mBS = NULL;
-EFI_RUNTIME_SERVICES *mRT = NULL;
-
-EFI_STATUS
-EfiInitializeCommonDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN VOID *SystemTable
- )
-/*++
-
-Routine Description:
-
- Initialize lib function calling phase: PEI or DXE
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS
-
---*/
-{
- mPeiServices = NULL;
- CpuIoPpi = NULL;
- PciCfgPpi = NULL;
-
- if (ImageHandle == NULL) {
- //
- // The function is called in PEI phase, use PEI interfaces
- //
- mPeiServices = (EFI_PEI_SERVICES **) SystemTable;
- ASSERT (mPeiServices == NULL);
-
- CpuIoPpi = (**mPeiServices).CpuIo;
- PciCfgPpi = (**mPeiServices).PciCfg;
-
- } else {
- //
- // ImageHandle is not NULL. The function is called in DXE phase
- //
- mST = SystemTable;
- ASSERT (mST != NULL);
-
- mBS = mST->BootServices;
- mRT = mST->RuntimeServices;
- ASSERT (mBS != NULL);
- ASSERT (mRT != NULL);
-
- //
- // Should be at EFI_D_INFO, but lets us know things are running
- //
- DEBUG ((EFI_D_INFO, "EfiInitializeCommonDriverLib: Started in DXE\n"));
- return EFI_SUCCESS;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EfiCommonIoWrite (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io write operation.
-
-Arguments:
-
- Width - Width of write operation
- Address - Start IO address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
-
- if (mPeiServices != NULL) {
- //
- // The function is called in PEI phase, use PEI interfaces
- //
- Status = CpuIoPpi->Io.Write (
- mPeiServices,
- CpuIoPpi,
- Width,
- Address,
- Count,
- Buffer
- );
- } else {
- //
- // The function is called in DXE phase
- //
- Status = mBS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- (VOID **) &RootBridgeIo
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = RootBridgeIo->Io.Write (RootBridgeIo, Width, Address, Count, Buffer);
- }
-
- return Status;
-}
-
-
-EFI_STATUS
-EfiCommonIoRead (
- IN UINT8 Width,
- IN UINTN Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Io read operation.
-
-Arguments:
-
- Width - Width of read operation
- Address - Start IO address to read
- Count - Read count
- Buffer - Buffer to store result
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
-
- if (mPeiServices != NULL) {
- //
- // The function is called in PEI phase, use PEI interfaces
- //
- Status = CpuIoPpi->Io.Read (
- mPeiServices,
- CpuIoPpi,
- Width,
- Address,
- Count,
- Buffer
- );
- } else {
- //
- // The function is called in DXE phase
- //
- Status = mBS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- (VOID **) &RootBridgeIo
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = RootBridgeIo->Io.Read (RootBridgeIo, Width, Address, Count, Buffer);
- }
-
- return Status;
-}
-
-
-EFI_STATUS
-EfiCommonPciWrite (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci write operation
-
-Arguments:
-
- Width - Width of PCI write
- Address - PCI address to write
- Count - Write count
- Buffer - Buffer to write to the address
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- UINT8 *Buffer8;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
-
- if (mPeiServices != NULL) {
- //
- // The function is called in PEI phase, use PEI interfaces
- //
- Buffer8 = Buffer;
- for (Index = 0; Index < Count; Index++) {
- Status = PciCfgPpi->Write (
- mPeiServices,
- PciCfgPpi,
- Width,
- Address,
- Buffer8
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Buffer8 += Width;
- }
-
- } else {
- //
- // The function is called in DXE phase
- //
- Status = mBS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- (VOID **) &RootBridgeIo
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = RootBridgeIo->Pci.Write (
- RootBridgeIo,
- Width,
- Address,
- Count,
- Buffer
- );
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiCommonPciRead (
- IN UINT8 Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Pci read operation
-
-Arguments:
-
- Width - Width of PCI read
- Address - PCI address to read
- Count - Read count
- Buffer - Output buffer for the read
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
- UINTN Index;
- UINT8 *Buffer8;
- EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
-
- if (mPeiServices != NULL) {
- //
- // The function is called in PEI phase, use PEI interfaces
- //
- Buffer8 = Buffer;
- for (Index = 0; Index < Count; Index++) {
- Status = PciCfgPpi->Read (
- mPeiServices,
- PciCfgPpi,
- Width,
- Address,
- Buffer8
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Buffer8 += Width;
- }
-
- } else {
- //
- // The function is called in DXE phase
- //
- Status = mBS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
- (VOID **) &RootBridgeIo
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = RootBridgeIo->Pci.Read (
- RootBridgeIo,
- Width,
- Address,
- Count,
- Buffer
- );
- }
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/PostCode.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/PostCode.c
deleted file mode 100644
index 6c40eec688..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/PostCode.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- PostCode.c
-
-Abstract:
-
- Worker functions for PostCode
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-
-BOOLEAN
-CodeTypeToPostCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- OUT UINT8 *PostCode
- )
-/*++
-
-Routine Description:
-
- Convert code value to an 8 bit post code
-
-Arguments:
-
- CodeType - Code type
- Value - Code value
- PostCode - Post code as output
-
-Returns:
-
- TRUE - Successfully converted
-
- FALSE - Convertion failed
-
---*/
-{
- //
- // Convert Value to an 8 bit post code
- //
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||
- ((CodeType & EFI_STATUS_CODE_TYPE_MASK)== EFI_ERROR_CODE)) {
- *PostCode = (UINT8) (((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5);
- *PostCode = (UINT8)(*PostCode | (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));
- return TRUE;
- }
-
- return FALSE;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ReportStatusCode.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ReportStatusCode.c
deleted file mode 100644
index 775b7c36b6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ReportStatusCode.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- ReportStatusCode.c
-
-Abstract:
-
- Worker functions for ReportStatusCode
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiCommonLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-
-VOID *
-EfiConstructStatusCodeData (
- IN UINT16 DataSize,
- IN EFI_GUID *TypeGuid,
- IN OUT EFI_STATUS_CODE_DATA *Data
- )
-/*++
-
-Routine Description:
-
- Construct stanader header for optional data passed into ReportStatusCode
-
-Arguments:
-
- DataSize - Size of optional data. Does not include EFI_STATUS_CODE_DATA header
- TypeGuid - GUID to place in EFI_STATUS_CODE_DATA
- Data - Buffer to use.
-
-Returns:
-
- Return pointer to Data buffer pointing past the end of EFI_STATUS_CODE_DATA
-
---*/
-{
- Data->HeaderSize = (UINT16) sizeof (EFI_STATUS_CODE_DATA);
- Data->Size = (UINT16)(DataSize - sizeof (EFI_STATUS_CODE_DATA));
- EfiCommonLibCopyMem (&Data->Type, TypeGuid, sizeof (EFI_GUID));
-
- return (VOID *)(Data + 1);
-}
-
-EFI_STATUS
-EfiDebugVPrintWorker (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- IN VA_LIST Marker,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
- The Format string might be truncated to fit into the status code struture
- which has the max size of EFI_STATUS_CODE_DATA_MAX_SIZE.
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- Marker - VarArgs
-
- BufferSize - Size of Buffer.
-
- Buffer - Caller allocated buffer, contains ReportStatusCode extended data
-
-Returns:
-
- Status code
-
- EFI_SUCCESS - Successfully printed
-
---*/
-{
- UINTN Index;
- UINTN FormatStrLen;
- UINTN RemainingStrLen;
- UINT64 *Ptr;
- EFI_DEBUG_INFO *EfiDebug;
-
-
- //
- // Build the type specific EFI_STATUS_CODE_DATA in order
- //
-
- //
- // Fill in EFI_STATUS_CODE_DATA to Buffer.
- //
- EfiDebug = (EFI_DEBUG_INFO *)EfiConstructStatusCodeData (
- (UINT16)BufferSize,
- &gEfiStatusCodeDataTypeDebugGuid,
- Buffer
- );
-
- //
- // Then EFI_DEBUG_INFO
- //
- EfiDebug->ErrorLevel = (UINT32)ErrorLevel;
-
- //
- // 12 * sizeof (UINT64) byte mini Var Arg stack.
- // That is followed by the format string.
- //
- for (Index = 0, Ptr = (UINT64 *)(EfiDebug + 1); Index < 12; Index++, Ptr++) {
- *Ptr = VA_ARG (Marker, UINT64);
- }
-
- //
- // Place Ascii Format string at the end
- // Truncate it to fit into the status code structure
- //
- FormatStrLen = EfiAsciiStrLen (Format);
- RemainingStrLen = EFI_STATUS_CODE_DATA_MAX_SIZE
- - sizeof (EFI_STATUS_CODE_DATA)
- - sizeof (EFI_DEBUG_INFO)
- - 12 * sizeof (UINT64) - 1;
- if (FormatStrLen > RemainingStrLen) {
- FormatStrLen = RemainingStrLen;
- }
- EfiCommonLibCopyMem (Ptr, Format, FormatStrLen);
- *((CHAR8 *) Ptr + FormatStrLen) = '\0';
-
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-EfiDebugAssertWorker (
- IN CHAR8 *Filename,
- IN INTN LineNumber,
- IN CHAR8 *Description,
- IN UINTN BufferSize,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded DEADLOOP ().
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- Filename - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT().
-
- Description - Description, usually the assertion,
-
- BufferSize - Size of Buffer.
-
- Buffer - Caller allocated buffer, contains ReportStatusCode extendecd data
-
-Returns:
-
- Status code
-
- EFI_BUFFER_TOO_SMALL - Buffer not large enough
-
- EFI_SUCCESS - Function successfully done.
-
---*/
-{
- EFI_DEBUG_ASSERT_DATA *AssertData;
- UINTN TotalSize;
- CHAR8 *EndOfStr;
-
- //
- // Make sure it will all fit in the passed in buffer
- //
- TotalSize = sizeof (EFI_STATUS_CODE_DATA) + sizeof (EFI_DEBUG_ASSERT_DATA);
- TotalSize += EfiAsciiStrLen (Filename);
- TotalSize += EfiAsciiStrLen (Description);
- if (TotalSize > BufferSize) {
- return EFI_BUFFER_TOO_SMALL;
- }
-
- //
- // Fill in EFI_STATUS_CODE_DATA
- //
- AssertData = (EFI_DEBUG_ASSERT_DATA *)
- EfiConstructStatusCodeData (
- (UINT16)(TotalSize - sizeof (EFI_STATUS_CODE_DATA)),
- &gEfiStatusCodeDataTypeAssertGuid,
- Buffer
- );
-
- //
- // Fill in EFI_DEBUG_ASSERT_DATA
- //
- AssertData->LineNumber = (UINT32)LineNumber;
-
- //
- // Copy Ascii FileName including NULL.
- //
- EndOfStr = EfiAsciiStrCpy ((CHAR8 *)(AssertData + 1), Filename);
-
- //
- // Copy Ascii Description
- //
- EfiAsciiStrCpy (EndOfStr, Description);
- return EFI_SUCCESS;
-}
-
-
-
-BOOLEAN
-ReportStatusCodeExtractAssertInfo (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN EFI_STATUS_CODE_DATA *Data,
- OUT CHAR8 **Filename,
- OUT CHAR8 **Description,
- OUT UINT32 *LineNumber
- )
-/*++
-
-Routine Description:
-
- Extract assert information from status code data.
-
-Arguments:
-
- CodeType - Code type
- Value - Code value
- Data - Optional data associated with this status code.
- Filename - Filename extracted from Data
- Description - Description extracted from Data
- LineNumber - Line number extracted from Data
-
-Returns:
-
- TRUE - Successfully extracted
-
- FALSE - Extraction failed
-
---*/
-{
- EFI_DEBUG_ASSERT_DATA *AssertData;
-
- if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) &&
- ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK) == EFI_ERROR_UNRECOVERED)) {
- //
- // Assume if we have an uncontained unrecoverable error that the data hub
- // may not work. So we will print out data here. If we had an IPMI controller,
- // or error log we could wack the hardware here.
- //
- if ((Value & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE && (Data != NULL)) {
- //
- // ASSERT (Expresion) -
- // ExtendedData == FileName
- // Instance == Line Nuber
- // NULL == String of Expresion
- //
- AssertData = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);
- *Filename = (CHAR8 *)(AssertData + 1);
- *Description = *Filename + EfiAsciiStrLen (*Filename) + 1;
- *LineNumber = AssertData->LineNumber;
- return TRUE;
- }
- }
- return FALSE;
-}
-
-
-BOOLEAN
-ReportStatusCodeExtractDebugInfo (
- IN EFI_STATUS_CODE_DATA *Data,
- OUT UINT32 *ErrorLevel,
- OUT VA_LIST *Marker,
- OUT CHAR8 **Format
- )
-/*++
-
-Routine Description:
-
- Extract debug information from status code data.
-
-Arguments:
-
- Data - Optional data associated with status code.
- ErrorLevel - Error level extracted from Data
- Marker - VA_LIST extracted from Data
- Format - Format string extracted from Data
-
-Returns:
-
- TRUE - Successfully extracted
-
- FALSE - Extraction failed
-
---*/
-{
- EFI_DEBUG_INFO *DebugInfo;
-
- if ((Data == NULL) || (!EfiCompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid))) {
- return FALSE;
- }
-
- DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);
-
- *ErrorLevel = DebugInfo->ErrorLevel;
-
- //
- // The first 12 * UINTN bytes of the string are really an
- // arguement stack to support varargs on the Format string.
- //
-#if (defined (EFIARM) || defined(__APPLE__))
- // It is not legal C code to case VA_LIST to a pointer. VA_LIST can
- // be a structure.
- return FALSE;
-#else
- *Marker = (VA_LIST) (DebugInfo + 1);
- *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);
- return TRUE;
-#endif
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/String.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/String.c
deleted file mode 100644
index e0fe93a970..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/String.c
+++ /dev/null
@@ -1,806 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- String.c
-
-Abstract:
-
- Unicode string primatives
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-#include "EfiCommonLib.h"
-
-VOID
-EfiStrCpy (
- IN CHAR16 *Destination,
- IN CHAR16 *Source
- )
-/*++
-
-Routine Description:
- Copy the Unicode string Source to Destination.
-
-Arguments:
- Destination - Location to copy string
- Source - String to copy
-
-Returns:
- NONE
-
---*/
-{
- while (*Source) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
-}
-
-VOID
-EfiStrnCpy (
- OUT CHAR16 *Dst,
- IN CHAR16 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Copy a string from source to destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-{
- UINTN Index;
- UINTN SrcLen;
-
- SrcLen = EfiStrLen (Src);
-
- Index = 0;
- while (Index < Length && Index < SrcLen) {
- Dst[Index] = Src[Index];
- Index++;
- }
- for (Index = SrcLen; Index < Length; Index++) {
- Dst[Index] = 0;
- }
-}
-
-UINTN
-EfiStrLen (
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Return the number of Unicode characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Unicode characters in String
-
---*/
-{
- UINTN Length;
-
- for (Length=0; *String; String++, Length++);
- return Length;
-}
-
-
-UINTN
-EfiStrSize (
- IN CHAR16 *String
- )
-/*++
-
-Routine Description:
- Return the number bytes in the Unicode String. This is not the same as
- the length of the string in characters. The string size includes the NULL
-
-Arguments:
- String - String to process
-
-Returns:
- Number of bytes in String
-
---*/
-{
- return ((EfiStrLen (String) + 1) * sizeof (CHAR16));
-}
-
-
-INTN
-EfiStrCmp (
- IN CHAR16 *String,
- IN CHAR16 *String2
- )
-/*++
-
-Routine Description:
- Compare the Unicode string pointed by String to the string pointed by String2.
-
-Arguments:
- String - String to process
-
- String2 - The other string to process
-
-Returns:
- Return a positive integer if String is lexicall greater than String2; Zero if
- the two strings are identical; and a negative integer if String is lexically
- less than String2.
-
---*/
-{
- while (*String) {
- if (*String != *String2) {
- break;
- }
-
- String += 1;
- String2 += 1;
- }
-
- return *String - *String2;
-}
-
-INTN
-EfiStrnCmp (
- IN CHAR16 *String,
- IN CHAR16 *String2,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- This function compares the Unicode string String to the Unicode
- string String2 for len characters. If the first len characters
- of String is identical to the first len characters of String2,
- then 0 is returned. If substring of String sorts lexicographically
- after String2, the function returns a number greater than 0. If
- substring of String sorts lexicographically before String2, the
- function returns a number less than 0.
-
-Arguments:
- String - Compare to String2
- String2 - Compare to String
- Length - Number of Unicode characters to compare
-
-Returns:
- 0 - The substring of String and String2 is identical.
- > 0 - The substring of String sorts lexicographically after String2
- < 0 - The substring of String sorts lexicographically before String2
-
---*/
-{
- while (*String && Length != 0) {
- if (*String != *String2) {
- break;
- }
- String += 1;
- String2 += 1;
- Length -= 1;
- }
- return Length > 0 ? *String - *String2 : 0;
-}
-
-VOID
-EfiStrCat (
- IN CHAR16 *Destination,
- IN CHAR16 *Source
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-{
- EfiStrCpy (Destination + EfiStrLen (Destination), Source);
-}
-
-VOID
-EfiStrnCat (
- IN CHAR16 *Dest,
- IN CHAR16 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-{
- EfiStrnCpy (Dest + EfiStrLen (Dest), Src, Length);
-}
-
-UINTN
-EfiAsciiStrLen (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
- Return the number of Ascii characters in String. This is not the same as
- the length of the string in bytes.
-
-Arguments:
- String - String to process
-
-Returns:
- Number of Ascii characters in String
-
---*/
-{
- UINTN Length;
-
- for (Length=0; *String; String++, Length++);
- return Length;
-}
-
-
-CHAR8 *
-EfiAsciiStrCpy (
- IN CHAR8 *Destination,
- IN CHAR8 *Source
- )
-/*++
-
-Routine Description:
- Copy the Ascii string Source to Destination.
-
-Arguments:
- Destination - Location to copy string
- Source - String to copy
-
-Returns:
- Pointer just pass the end of Destination
-
---*/
-{
- while (*Source) {
- *(Destination++) = *(Source++);
- }
- *Destination = 0;
- return Destination + 1;
-}
-
-VOID
-EfiAsciiStrnCpy (
- OUT CHAR8 *Dst,
- IN CHAR8 *Src,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Copy the Ascii string from source to destination
-
-Arguments:
- Dst Destination string
- Src Source string
- Length Length of destination string
-
-Returns:
-
---*/
-{
- UINTN Index;
- UINTN SrcLen;
-
- SrcLen = EfiAsciiStrLen (Src);
-
- Index = 0;
- while (Index < Length && Index < SrcLen) {
- Dst[Index] = Src[Index];
- Index++;
- }
- for (Index = SrcLen; Index < Length; Index++) {
- Dst[Index] = 0;
- }
-}
-
-UINTN
-EfiAsciiStrSize (
- IN CHAR8 *String
- )
-/*++
-
-Routine Description:
- Return the number bytes in the Ascii String. This is not the same as
- the length of the string in characters. The string size includes the NULL
-
-Arguments:
- String - String to process
-
-Returns:
- Number of bytes in String
-
---*/
-{
- return (EfiAsciiStrLen (String) + 1);
-}
-
-
-INTN
-EfiAsciiStrCmp (
- IN CHAR8 *String,
- IN CHAR8 *String2
- )
-/*++
-
-Routine Description:
- Compare the Ascii string pointed by String to the string pointed by String2.
-
-Arguments:
- String - String to process
-
- String2 - The other string to process
-
-Returns:
- Return a positive integer if String is lexicall greater than String2; Zero if
- the two strings are identical; and a negative integer if String is lexically
- less than String2.
---*/
-{
- while (*String) {
- if (*String != *String2) {
- break;
- }
-
- String += 1;
- String2 += 1;
- }
-
- return *String - *String2;
-}
-
-INTN
-EfiAsciiStrnCmp (
- IN CHAR8 *String,
- IN CHAR8 *String2,
- IN UINTN Length
- )
-{
- if (Length == 0) {
- return 0;
- }
-
- while ((*String != '\0') &&
- (*String == *String2) &&
- (Length > 1)) {
- String++;
- String2++;
- Length--;
- }
- return *String - *String2;
-}
-
-VOID
-EfiAsciiStrCat (
- IN CHAR8 *Destination,
- IN CHAR8 *Source
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-{
- EfiAsciiStrCpy (Destination + EfiAsciiStrLen (Destination), Source);
-}
-
-VOID
-EfiAsciiStrnCat (
- IN CHAR8 *Destination,
- IN CHAR8 *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
- Concatinate Source on the end of Destination
-
-Arguments:
- Destination - String to added to the end of.
- Source - String to concatinate.
-
-Returns:
- NONE
-
---*/
-{
- EfiAsciiStrnCpy (Destination + EfiAsciiStrLen (Destination), Source, Length);
-}
-
-BOOLEAN
-IsHexDigit (
- OUT UINT8 *Digit,
- IN CHAR16 Char
- )
-/*++
-
- Routine Description:
- Determines if a Unicode character is a hexadecimal digit.
- The test is case insensitive.
-
- Arguments:
- Digit - Pointer to byte that receives the value of the hex character.
- Char - Unicode character to test.
-
- Returns:
- TRUE - If the character is a hexadecimal digit.
- FALSE - Otherwise.
-
---*/
-{
- if ((Char >= L'0') && (Char <= L'9')) {
- *Digit = (UINT8) (Char - L'0');
- return TRUE;
- }
-
- if ((Char >= L'A') && (Char <= L'F')) {
- *Digit = (UINT8) (Char - L'A' + 0x0A);
- return TRUE;
- }
-
- if ((Char >= L'a') && (Char <= L'f')) {
- *Digit = (UINT8) (Char - L'a' + 0x0A);
- return TRUE;
- }
-
- return FALSE;
-}
-
-CHAR16
-NibbleToHexChar (
- IN UINT8 Nibble
- )
-/*++
-
- Routine Description:
- Converts the low nibble of a byte to hex unicode character.
-
- Arguments:
- Nibble - lower nibble of a byte.
-
- Returns:
- Hex unicode character.
-
---*/
-{
- Nibble &= 0x0F;
- if (Nibble <= 0x9) {
- return (CHAR16)(Nibble + L'0');
- }
-
- return (CHAR16)(Nibble - 0xA + L'A');
-}
-
-EFI_STATUS
-HexStringToBuf (
- IN OUT UINT8 *Buf,
- IN OUT UINTN *Len,
- IN CHAR16 *Str,
- OUT UINTN *ConvertedStrLen OPTIONAL
- )
-/*++
-
- Routine Description:
- Converts Unicode string to binary buffer.
- The conversion may be partial.
- The first character in the string that is not hex digit stops the conversion.
- At a minimum, any blob of data could be represented as a hex string.
-
- Arguments:
- Buf - Pointer to buffer that receives the data.
- Len - Length in bytes of the buffer to hold converted data.
- If routine return with EFI_SUCCESS, containing length of converted data.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired.
- Str - String to be converted from.
- ConvertedStrLen - Length of the Hex String consumed.
-
- Returns:
- EFI_SUCCESS: Routine Success.
- EFI_BUFFER_TOO_SMALL: The buffer is too small to hold converted data.
- EFI_
-
---*/
-{
- UINTN HexCnt;
- UINTN Idx;
- UINTN BufferLength;
- UINT8 Digit;
- UINT8 Byte;
-
- //
- // Find out how many hex characters the string has.
- //
- for (Idx = 0, HexCnt = 0; IsHexDigit (&Digit, Str[Idx]); Idx++, HexCnt++);
-
- if (HexCnt == 0) {
- *Len = 0;
- return EFI_SUCCESS;
- }
- //
- // Two Unicode characters make up 1 buffer byte. Round up.
- //
- BufferLength = (HexCnt + 1) / 2;
-
- //
- // Test if buffer is passed enough.
- //
- if (BufferLength > (*Len)) {
- *Len = BufferLength;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- *Len = BufferLength;
-
- for (Idx = 0; Idx < HexCnt; Idx++) {
-
- IsHexDigit (&Digit, Str[HexCnt - 1 - Idx]);
-
- //
- // For odd charaters, write the lower nibble for each buffer byte,
- // and for even characters, the upper nibble.
- //
- if ((Idx & 1) == 0) {
- Byte = Digit;
- } else {
- Byte = Buf[Idx / 2];
- Byte &= 0x0F;
- Byte = (UINT8)(Byte | (Digit << 4));
- }
-
- Buf[Idx / 2] = Byte;
- }
-
- if (ConvertedStrLen != NULL) {
- *ConvertedStrLen = HexCnt;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-BufToHexString (
- IN OUT CHAR16 *Str,
- IN OUT UINTN *HexStringBufferLength,
- IN UINT8 *Buf,
- IN UINTN Len
- )
-/*++
-
- Routine Description:
- Converts binary buffer to Unicode string.
- At a minimum, any blob of data could be represented as a hex string.
-
- Arguments:
- Str - Pointer to the string.
- HexStringBufferLength - Length in bytes of buffer to hold the hex string. Includes tailing '\0' character.
- If routine return with EFI_SUCCESS, containing length of hex string buffer.
- If routine return with EFI_BUFFER_TOO_SMALL, containg length of hex string buffer desired.
- Buf - Buffer to be converted from.
- Len - Length in bytes of the buffer to be converted.
-
- Returns:
- EFI_SUCCESS: Routine success.
- EFI_BUFFER_TOO_SMALL: The hex string buffer is too small.
-
---*/
-{
- UINTN Idx;
- UINT8 Byte;
- UINTN StrLen;
-
- //
- // Make sure string is either passed or allocate enough.
- // It takes 2 Unicode characters (4 bytes) to represent 1 byte of the binary buffer.
- // Plus the Unicode termination character.
- //
- StrLen = Len * 2;
- if (StrLen > ((*HexStringBufferLength) - 1)) {
- *HexStringBufferLength = StrLen + 1;
- return EFI_BUFFER_TOO_SMALL;
- }
-
- *HexStringBufferLength = StrLen + 1;
- //
- // Ends the string.
- //
- Str[StrLen] = L'\0';
-
- for (Idx = 0; Idx < Len; Idx++) {
-
- Byte = Buf[Idx];
- Str[StrLen - 1 - Idx * 2] = NibbleToHexChar (Byte);
- Str[StrLen - 2 - Idx * 2] = NibbleToHexChar ((UINT8)(Byte >> 4));
- }
-
- return EFI_SUCCESS;
-}
-
-VOID
-EfiStrTrim (
- IN OUT CHAR16 *str,
- IN CHAR16 CharC
- )
-/*++
-
-Routine Description:
-
- Removes (trims) specified leading and trailing characters from a string.
-
-Arguments:
-
- str - Pointer to the null-terminated string to be trimmed. On return,
- str will hold the trimmed string.
- CharC - Character will be trimmed from str.
-
-Returns:
-
---*/
-{
- CHAR16 *p1;
- CHAR16 *p2;
-
- if (*str == 0) {
- return;
- }
-
- //
- // Trim off the leading and trailing characters c
- //
- for (p1 = str; *p1 && *p1 == CharC; p1++) {
- ;
- }
-
- p2 = str;
- if (p2 == p1) {
- while (*p1) {
- p2++;
- p1++;
- }
- } else {
- while (*p1) {
- *p2 = *p1;
- p1++;
- p2++;
- }
- *p2 = 0;
- }
-
-
- for (p1 = str + EfiStrLen(str) - 1; p1 >= str && *p1 == CharC; p1--) {
- ;
- }
- if (p1 != str + EfiStrLen(str) - 1) {
- *(p1 + 1) = 0;
- }
-}
-CHAR16*
-EfiStrStr (
- IN CHAR16 *String,
- IN CHAR16 *StrCharSet
- )
-/*++
-
-Routine Description:
-
- Find a substring.
-
-Arguments:
-
- String - Null-terminated string to search.
- StrCharSet - Null-terminated string to search for.
-
-Returns:
- The address of the first occurrence of the matching substring if successful, or NULL otherwise.
---*/
-{
- CHAR16 *Src;
- CHAR16 *Sub;
-
- Src = String;
- Sub = StrCharSet;
-
- while ((*String != L'\0') && (*StrCharSet != L'\0')) {
- if (*String++ != *StrCharSet) {
- String = ++Src;
- StrCharSet = Sub;
- } else {
- StrCharSet++;
- }
- }
- if (*StrCharSet == L'\0') {
- return Src;
- } else {
- return NULL;
- }
-}
-
-CHAR8*
-EfiAsciiStrStr (
- IN CHAR8 *String,
- IN CHAR8 *StrCharSet
- )
-/*++
-
-Routine Description:
-
- Find a Ascii substring.
-
-Arguments:
-
- String - Null-terminated Ascii string to search.
- StrCharSet - Null-terminated Ascii string to search for.
-
-Returns:
- The address of the first occurrence of the matching Ascii substring if successful, or NULL otherwise.
---*/
-{
- CHAR8 *Src;
- CHAR8 *Sub;
-
- Src = String;
- Sub = StrCharSet;
-
- while ((*String != '\0') && (*StrCharSet != '\0')) {
- if (*String++ != *StrCharSet) {
- String = ++Src;
- StrCharSet = Sub;
- } else {
- StrCharSet++;
- }
- }
- if (*StrCharSet == '\0') {
- return Src;
- } else {
- return NULL;
- }
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ValueToString.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ValueToString.c
deleted file mode 100644
index 7d79fb2e81..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/ValueToString.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*++
-
-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
-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:
-
- ValueToString.c
-
-Abstract:
-
- Routines changing value to Hex or Dec string
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-static CHAR16 mHexStr[] = { L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7',
- L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F' };
-
-UINTN
-EfiValueToHexStr (
- IN OUT CHAR16 *Buffer,
- IN UINT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints a Value as a hex number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii hex string of Value.
-
- Value - Hex value to convert to a string in Buffer.
-
- Flags - Flags to use in printing Hex string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR16 *TempStr;
- CHAR16 Prefix;
- CHAR16 *BufferPtr;
- UINTN Count;
- UINTN Index;
-
- TempStr = TempBuffer;
- BufferPtr = Buffer;
-
- //
- // Count starts at one since we will null terminate. Each iteration of the
- // loop picks off one nibble. Oh yea TempStr ends up backwards
- //
- Count = 0;
-
- if (Width > CHARACTER_NUMBER_FOR_VALUE - 1) {
- Width = CHARACTER_NUMBER_FOR_VALUE - 1;
- }
-
- do {
- Index = ((UINTN)Value & 0xf);
- *(TempStr++) = mHexStr[Index];
- Value = RShiftU64 (Value, 4);
- Count++;
- } while (Value != 0);
-
- if (Flags & PREFIX_ZERO) {
- Prefix = '0';
- } else {
- Prefix = ' ';
- }
-
- Index = Count;
- if (!(Flags & LEFT_JUSTIFY)) {
- for (; Index < Width; Index++) {
- *(TempStr++) = Prefix;
- }
- }
-
- //
- // Reverse temp string into Buffer.
- //
- if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
- TempStr = TempBuffer + Width;
- }
- Index = 0;
- while (TempStr != TempBuffer) {
- *(BufferPtr++) = *(--TempStr);
- Index++;
- }
-
- *BufferPtr = 0;
- return Index;
-}
-
-
-UINTN
-EfiValueToString (
- IN OUT CHAR16 *Buffer,
- IN INT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- VSPrint worker function that prints a Value as a decimal number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii decimal number string of Value.
-
- Value - Decimal value to convert to a string in Buffer.
-
- Flags - Flags to use in printing decimal string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR16 *TempStr;
- CHAR16 *BufferPtr;
- UINTN Count;
- UINTN ValueCharNum;
- UINTN Remainder;
- CHAR16 Prefix;
- UINTN Index;
- BOOLEAN ValueIsNegative;
-
- TempStr = TempBuffer;
- BufferPtr = Buffer;
- Count = 0;
- ValueCharNum = 0;
- ValueIsNegative = FALSE;
- Remainder = 0;
-
- if (Width > CHARACTER_NUMBER_FOR_VALUE - 1) {
- Width = CHARACTER_NUMBER_FOR_VALUE - 1;
- }
-
- if (Value < 0) {
- Value = -Value;
- ValueIsNegative = TRUE;
- }
-
- do {
- Value = (INT64)DivU64x32 ((UINT64)Value, 10, &Remainder);
- *(TempStr++) = (CHAR16)(Remainder + '0');
- ValueCharNum++;
- Count++;
- if ((Flags & COMMA_TYPE) == COMMA_TYPE) {
- if (ValueCharNum % 3 == 0 && Value != 0) {
- *(TempStr++) = ',';
- Count++;
- }
- }
- } while (Value != 0);
-
- if (ValueIsNegative) {
- *(TempStr++) = '-';
- Count++;
- }
-
- if ((Flags & PREFIX_ZERO) && !ValueIsNegative) {
- Prefix = '0';
- } else {
- Prefix = ' ';
- }
-
- Index = Count;
- if (!(Flags & LEFT_JUSTIFY)) {
- for (; Index < Width; Index++) {
- *(TempStr++) = Prefix;
- }
- }
-
- //
- // Reverse temp string into Buffer.
- //
- if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
- TempStr = TempBuffer + Width;
- }
- Index = 0;
- while (TempStr != TempBuffer) {
- *(BufferPtr++) = *(--TempStr);
- Index++;
- }
-
- *BufferPtr = 0;
- return Index;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMem.asm
deleted file mode 100644
index 4869b2794f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMem.asm
+++ /dev/null
@@ -1,74 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; EfiCommonLibCopyMem (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibCopyMem PROC USES rsi rdi
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- mov rax, rdi ; rax <- Destination as return value
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 7
- shr rcx, 3 ; rcx <- # of Qwords to copy
- jz @CopyBytes
- DB 49h, 0fh, 7eh, 0c2h ; movd r10, mm0 (Save mm0 in r10)
-@@:
- DB 0fh, 6fh, 06h ; movd mm0, [rsi]
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0
- add rsi, 8
- add rdi, 8
- loop @B
- DB 49h, 0fh, 6eh, 0c2h ; movd mm0, r10 (Restore mm0)
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-EfiCommonLibCopyMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.S
deleted file mode 100644
index d177dc027c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.S
+++ /dev/null
@@ -1,66 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EfiCopyMemRep1.S
-#
-# Abstract:
-#
-# CopyMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.globl ASM_PFX(EfiCommonLibCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibCopyMem (
-# OUT VOID *Destination,
-# IN VOID *Source,
-# IN UINTN Count
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibCopyMem):
- push %rsi
- push %rdi
- cmp %rcx,%rdx
- je CopyMemDone
- cmp $0x0,%r8
- je CopyMemDone
- mov %rdx,%rsi
- mov %rcx,%rdi
- lea -1(%r8,%rsi,1),%r9
- cmp %rdi,%rsi
- jae CopyBytes
- cmp %rdi,%r9
- jb CopyBytes
- mov %r9,%rsi
- lea -1(%r8,%rdi,1),%rdi
- std
-
-CopyBytes:
- mov %r8,%rcx
- rep movsb %ds:(%rsi),%es:(%rdi)
- cld
-
-CopyMemDone:
- pop %rdi
- pop %rsi
- retq
-
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.asm
deleted file mode 100644
index 8b3d33b37b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep1.asm
+++ /dev/null
@@ -1,58 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiCopyMemRep1.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibCopyMem (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibCopyMem PROC USES rsi rdi
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @CopyBytes
- cmp r9, rdi
- jb @CopyBytes ; Copy backward if overlapped
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-EfiCommonLibCopyMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep4.asm
deleted file mode 100644
index 7c6ffd90c0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep4.asm
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiCopyMemRep4.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibCopyMem (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibCopyMem PROC USES rsi rdi
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 3
- shr rcx, 2
- rep movsd ; Copy as many Dwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-EfiCommonLibCopyMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep8.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep8.asm
deleted file mode 100644
index 859e2a15d7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemRep8.asm
+++ /dev/null
@@ -1,65 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiCopyMemRep8.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibCopyMem (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibCopyMem PROC USES rsi rdi
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- jae @F
- cmp r9, rdi
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- mov rcx, r8
- and r8, 7
- shr rcx, 3
- rep movsq ; Copy as many Qwords as possible
- jmp @CopyBytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- End of Source
- lea rdi, [rdi + r8 - 1] ; esi <- End of Destination
- std ; set direction flag
-@CopyBytes:
- mov rcx, r8
- rep movsb ; Copy bytes backward
- cld
-@CopyMemDone:
- ret
-EfiCommonLibCopyMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemSSE2.asm
deleted file mode 100644
index 151ba2326a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiCopyMemSSE2.asm
+++ /dev/null
@@ -1,80 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; CopyMem.asm
-;
-; Abstract:
-;
-; CopyMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibCopyMem (
-; OUT VOID *Destination,
-; IN VOID *Source,
-; IN UINTN Count
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibCopyMem PROC USES rsi rdi
- cmp rdx, rcx ; if Source == Destination, do nothing
- je @CopyMemDone
- cmp r8, 0 ; if Count == 0, do nothing
- je @CopyMemDone
- mov rsi, rdx ; rsi <- Source
- mov rdi, rcx ; rdi <- Destination
- lea r9, [rsi + r8 - 1] ; r9 <- End of Source
- cmp rsi, rdi
- mov rax, rdi ; rax <- Destination as return value
- jae @F ; Copy forward if Source > Destination
- cmp r9, rdi ; Overlapped?
- jae @CopyBackward ; Copy backward if overlapped
-@@:
- xor rcx, rcx
- sub rcx, rdi ; rcx <- -rdi
- and rcx, 15 ; rcx + rsi should be 16 bytes aligned
- jz @F ; skip if rcx == 0
- cmp rcx, r8
- cmova rcx, r8
- sub r8, rcx
- rep movsb
-@@:
- mov rcx, r8
- and r8, 15
- shr rcx, 4 ; rcx <- # of DQwords to copy
- jz @CopyBytes
-@@:
- movdqu xmm0, [rsi] ; rsi may not be 16-byte aligned
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned
- add rsi, 16
- add rdi, 16
- loop @B
- jmp @CopyBytes ; copy remaining bytes
-@CopyBackward:
- mov rsi, r9 ; rsi <- Last byte of Source
- lea rdi, [rdi + r8 - 1] ; rdi <- Last byte of Destination
- std
-@CopyBytes:
- mov rcx, r8
- rep movsb
- cld
-@CopyMemDone:
- ret
-EfiCommonLibCopyMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMem.asm
deleted file mode 100644
index d2e4f6d69a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMem.asm
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EFIAPI
-; EfiCommonLibSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibSetMem PROC USES rdi
- cmp rdx, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rax, r8
- mov ah, al
- DB 48h, 0fh, 6eh, 0c0h ; movd mm0, rax
- mov r8, rcx
- mov rdi, r8 ; rdi <- Buffer
- mov rcx, rdx
- and edx, 7
- shr rcx, 3
- jz @SetBytes
- DB 0fh, 70h, 0C0h, 00h ; pshufw mm0, mm0, 0h
-@@:
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0
- add rdi, 8
- loop @B
-@SetBytes:
- mov ecx, edx
- rep stosb
- mov rax, r8
-@SetDone:
- ret
-EfiCommonLibSetMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep1.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep1.asm
deleted file mode 100644
index 4f64eda2d0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep1.asm
+++ /dev/null
@@ -1,46 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiSetMemRep1.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibSetMem PROC USES rdi
- cmp rdx, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rax, r8
- mov rdi, rcx
- mov rcx, rdx
- rep stosb
-@SetDone:
- ret
-EfiCommonLibSetMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.S
deleted file mode 100644
index 730426202f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.S
+++ /dev/null
@@ -1,54 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EfiSetMemRep4.S
-#
-# Abstract:
-#
-# SetMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.globl ASM_PFX(EfiCommonLibCopyMem)
-
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibSetMem (
-# OUT VOID *Buffer,
-# IN UINTN Size,
-# IN UINT8 Value
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibSetMem):
- push %rdi
- cmp $0x0,%rdx
- je SetDone
- mov %rcx,%rdi
- mov %r8b,%al
- mov %al,%ah
- shrd $0x10,%eax,%ecx
- shld $0x10,%ecx,%eax
- mov %rdx,%rcx
- shr $0x2,%rcx
- rep stos %eax,%es:(%rdi)
- mov %rdx,%rcx
- and $0x3,%rcx
- rep stos %al,%es:(%rdi)
-SetDone:
- pop %rdi
- retq
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.asm
deleted file mode 100644
index 07a2868c7e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep4.asm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiSetMemRep4.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibSetMem PROC USES rdi
- cmp rdx, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rdi, rcx
- mov al, r8b
- mov ah, al
- shrd ecx, eax, 16
- shld eax, ecx, 16
- mov rcx, rdx
- shr rcx, 2
- rep stosd
- mov rcx, rdx
- and rcx, 3
- rep stosb
-@SetDone:
- ret
-EfiCommonLibSetMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep8.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep8.asm
deleted file mode 100644
index e91d0d9a1c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemRep8.asm
+++ /dev/null
@@ -1,58 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiSetMemRep8.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibSetMem PROC USES rdi rbx
- cmp rdx, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rax, r8
- mov bl, al
- mov bh, bl
- mov ax, bx
- shl rax, 10h
- mov ax, bx
- mov ebx, eax
- shl rax, 20h
- mov eax, ebx
- mov rdi, rcx
- mov rcx, rdx
- shr rcx, 3
- rep stosq
- mov rcx, rdx
- and rcx, 7
- rep stosb
-@SetDone:
- ret
-EfiCommonLibSetMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemSSE2.asm
deleted file mode 100644
index 0819dcf8a2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiSetMemSSE2.asm
+++ /dev/null
@@ -1,67 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SetMem.asm
-;
-; Abstract:
-;
-; SetMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibSetMem (
-; OUT VOID *Buffer,
-; IN UINTN Size,
-; IN UINT8 Value
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibSetMem PROC USES rdi
- cmp rdx, 0 ; if Size == 0, do nothing
- je @SetDone
- mov rdi, rcx ; rdi <- Buffer
- mov al, r8b ; al <- Value
- xor rcx, rcx
- sub rcx, rdi
- and rcx, 15 ; rcx + rdi aligns on 16-byte boundary
- jz @F
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosb
-@@:
- mov rcx, rdx
- and rdx, 15
- shr rcx, 4
- jz @SetBytes
- mov ah, al ; ax <- Value repeats twice
- movd xmm0, eax ; xmm0[0..16] <- Value repeats twice
- pshuflw xmm0, xmm0, 0 ; xmm0[0..63] <- Value repeats 8 times
- movlhps xmm0, xmm0 ; xmm0 <- Value repeats 16 times
-@@:
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned
- add rdi, 16
- loop @B
-@SetBytes:
- mov ecx, edx ; high 32 bits of rcx are always zero
- rep stosb
-@SetDone:
- ret
-EfiCommonLibSetMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMem.asm
deleted file mode 100644
index fbfc2d55b4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMem.asm
+++ /dev/null
@@ -1,53 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ZeroMem.asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID *
-; EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Size
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibZeroMem PROC USES rdi
- mov rdi, rcx
- mov rcx, rdx
- mov r8, rdi
- and edx, 7
- shr rcx, 3
- jz @ZeroBytes
- DB 0fh, 0efh, 0c0h ; pxor mm0, mm0
-@@:
- DB 48h, 0fh, 7eh, 07h ; movd [rdi], mm0
- add rdi, 8
- loop @B
-@ZeroBytes:
- xor eax, eax
- mov ecx, edx
- rep stosb
- mov rax, r8
- ret
-EfiCommonLibZeroMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep1.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep1.asm
deleted file mode 100644
index da6fb35729..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep1.asm
+++ /dev/null
@@ -1,42 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiZeroMemRep1.asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Size
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibZeroMem PROC USES rdi
- xor rax, rax
- mov rdi, rcx
- mov rcx, rdx
- rep stosb
- ret
-EfiCommonLibZeroMem ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.S
deleted file mode 100644
index b0bd55bc58..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.S
+++ /dev/null
@@ -1,46 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# EfiZeroMemRep4.S
-#
-# Abstract:
-#
-# ZeroMem function
-#
-# Notes:
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .code:
-
-.globl ASM_PFX(EfiCommonLibZeroMem)
-#------------------------------------------------------------------------------
-# VOID
-# EfiCommonLibZeroMem (
-# IN VOID *Buffer,
-# IN UINTN Size
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(EfiCommonLibZeroMem):
- push %rdi
- xor %rax,%rax
- mov %rcx,%rdi
- mov %rdx,%rcx
- shr $0x2,%rcx
- and $0x3,%rdx
- rep stos %eax,%es:(%rdi)
- mov %rdx,%rcx
- rep stos %al,%es:(%rdi)
- pop %rdi
- retq \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.asm
deleted file mode 100644
index a0da4b7bc6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep4.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiZeroMemRep4.asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Size
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibZeroMem PROC USES rdi
- xor rax, rax
- mov rdi, rcx
- mov rcx, rdx
- shr rcx, 2
- and rdx, 3
- rep stosd
- mov rcx, rdx
- rep stosb
- ret
-EfiCommonLibZeroMem ENDP
-
- END \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep8.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep8.asm
deleted file mode 100644
index 226aa8d5c3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemRep8.asm
+++ /dev/null
@@ -1,45 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; EfiZeroMemRep8.asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Size
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibZeroMem PROC USES rdi
- xor rax, rax
- mov rdi, rcx
- mov rcx, rdx
- shr rcx, 3
- and rdx, 7
- rep stosq
- mov rcx, rdx
- rep stosb
- ret
-EfiCommonLibZeroMem ENDP
-
- END \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemSSE2.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemSSE2.asm
deleted file mode 100644
index b2dc4e989c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/X64/EfiZeroMemSSE2.asm
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ZeroMem.asm
-;
-; Abstract:
-;
-; ZeroMem function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; EfiCommonLibZeroMem (
-; IN VOID *Buffer,
-; IN UINTN Size
-; );
-;------------------------------------------------------------------------------
-EfiCommonLibZeroMem PROC USES rdi
- mov rdi, rcx
- xor rcx, rcx
- xor eax, eax
- sub rcx, rdi
- and rcx, 15
- jz @F
- cmp rcx, rdx
- cmova rcx, rdx
- sub rdx, rcx
- rep stosb
-@@:
- mov rcx, rdx
- and edx, 15
- shr rcx, 4
- jz @ZeroBytes
- pxor xmm0, xmm0
-@@:
- movdqa [rdi], xmm0 ; rdi should be 16-byte aligned
- add rdi, 16
- loop @B
-@ZeroBytes:
- mov ecx, edx
- rep stosb
- ret
-EfiCommonLibZeroMem ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.c b/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.c
deleted file mode 100644
index 4672209739..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.c
+++ /dev/null
@@ -1,722 +0,0 @@
-
-/*++
-
-Copyright (c) 2004 - 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.
-
-MemoryAllocationModule Name:
-
- Peihoblib.c
-
-Abstract:
-
- PEI Library Functions
-
---*/
-
-#include "Tiano.h"
-#include "PeiHob.h"
-#include "PeiHobLib.h"
-#include "PeiLib.h"
-#include EFI_GUID_DEFINITION(MemoryAllocationHob)
-
-
-EFI_PEI_HOB_POINTERS
-BuildHobEndOfHobList (
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- Builds an end of HOB list HOB
-
-Arguments:
-
- HobStart - The HOB to build
-
-Returns:
-
- A pointer to the next HOB
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
-
- Hob.Header->HobType = EFI_HOB_TYPE_END_OF_HOB_LIST;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_GENERIC_HEADER);
-
- Hob.Header++;
- return Hob;
-}
-
-EFI_STATUS
-BuildHobHandoffInfoTable (
- IN VOID *HobStart,
- IN UINT16 Version,
- IN EFI_BOOT_MODE BootMode,
- IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,
- IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
- )
-/*++
-
-Routine Description:
-
- Builds a HandoffInformationTable Information Table HOB
-
-Arguments:
-
- HobStart - Start pointer of hob list
- Version - The version number pertaining to the PHIT HOB definition.
- BootMode - The system boot mode as determined during the HOB producer phase.
- EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB
- producer phase.
- EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB
- producer phase.
- EfiFreeMemoryTop - The highest address location of free memory that is currently available for use
- by the HOB producer phase.
- EfiFreeMemoryBottom - The lowest address location of free memory that is available for
- use by the HOB producer phase.
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_PEI_HOB_POINTERS HandOffHob;
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HobEnd;
-
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = HobStart;
- Hob.Header->HobType = EFI_HOB_TYPE_HANDOFF;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_HANDOFF_INFO_TABLE);
-
- Hob.HandoffInformationTable->Version = Version;
- Hob.HandoffInformationTable->BootMode = BootMode;
-
- Hob.HandoffInformationTable->EfiMemoryTop = EfiMemoryTop;
- Hob.HandoffInformationTable->EfiMemoryBottom = EfiMemoryBottom;
- Hob.HandoffInformationTable->EfiFreeMemoryTop = EfiFreeMemoryTop;
- Hob.HandoffInformationTable->EfiFreeMemoryBottom = EfiFreeMemoryBottom;
-
- HobEnd.Raw = (VOID*)(Hob.HandoffInformationTable + 1);
- Hob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd.Raw;
- Hob = BuildHobEndOfHobList (HobEnd.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-BuildHobModule (
- IN VOID *HobStart,
- IN EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for a loaded PE32 module
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- ModuleName - The GUID File Name of the HON from the Firmware Volume
-
- MemoryAllocationModule - The 64 bit physical address of the module
-
- ModuleLength - The length of the module in bytes
-
- EntryPoint - The 64 bit physical address of the entry point to the module
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID*)(UINTN)(HandOffHob.HandoffInformationTable->EfiEndOfHobList);
-
- Hob.Header->HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE);
-
- CopyMem(&(Hob.MemoryAllocationModule->ModuleName), ModuleName, sizeof(EFI_GUID));
- CopyMem(&(Hob.MemoryAllocationModule->MemoryAllocationHeader.Name), &gEfiHobMemeryAllocModuleGuid, sizeof(EFI_GUID));
- Hob.MemoryAllocationModule->MemoryAllocationHeader.MemoryBaseAddress = MemoryAllocationModule;
- Hob.MemoryAllocationModule->MemoryAllocationHeader.MemoryLength = ModuleLength;
- Hob.MemoryAllocationModule->MemoryAllocationHeader.MemoryType = EfiConventionalMemory;
-
- Hob.MemoryAllocationModule->EntryPoint = EntryPoint;
-
- Hob.MemoryAllocationModule++;
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-BuildHobResourceDescriptor (
- IN VOID * HobStart,
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-/*++
-
-Routine Description:
-
- Builds a HOB that describes a chunck of system memory
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- ResourceType - The type of memory described by this HOB
-
- ResourceAttribute - The memory attributes of the memory described by this HOB
-
- PhysicalStart - The 64 bit physical address of memory described by this HOB
-
- NumberOfBytes - The length of the memoty described by this HOB in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID *)(UINTN)(HandOffHob.HandoffInformationTable->EfiEndOfHobList);
-
- Hob.Header->HobType = EFI_HOB_TYPE_RESOURCE_DESCRIPTOR;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_RESOURCE_DESCRIPTOR);
-
- Hob.ResourceDescriptor->ResourceType = ResourceType;
- Hob.ResourceDescriptor->ResourceAttribute = ResourceAttribute;
- Hob.ResourceDescriptor->PhysicalStart = PhysicalStart;
- Hob.ResourceDescriptor->ResourceLength = NumberOfBytes;
-
- Hob.ResourceDescriptor++;
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-BuildHobGuidType (
- IN VOID *HobStart,
- IN EFI_GUID *Guid,
- IN VOID *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- Guid - The GUID of the custome HOB type
-
- Buffer - A pointer to the data for the custom HOB type
-
- BufferSize - The size in byte of BufferSize
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
- UINTN Length;
-
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID *)(UINTN)HandOffHob.HandoffInformationTable->EfiEndOfHobList;
-
-
- Hob.Header->HobType = EFI_HOB_TYPE_GUID_EXTENSION;
- Length = sizeof(EFI_HOB_GUID_TYPE) + BufferSize;
- Length = (Length + 0x7) & (~0x7);
- Hob.Header->HobLength = (UINT16)Length;
- CopyMem(&Hob.Guid->Name, Guid, sizeof(EFI_GUID));
- CopyMem(Hob.Raw + sizeof(EFI_HOB_GUID_TYPE), Buffer, BufferSize);
- Hob.Raw += Length;
-
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-BuildHobFvDescriptor (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a Firmware Volume HOB
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The base address of the Firmware Volume
-
- Length - The size of the Firmware Volume in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID*)(UINTN)(HandOffHob.HandoffInformationTable->EfiEndOfHobList);
-
- Hob.Header->HobType = EFI_HOB_TYPE_FV;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_FIRMWARE_VOLUME);
-
- Hob.FirmwareVolume->BaseAddress = BaseAddress;
- Hob.FirmwareVolume->Length = Length;
-
- Hob.FirmwareVolume++;
-
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-BuildHobCpu (
- IN VOID *HobStart,
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the CPU
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- SizeOfMemorySpace - Identifies the maximum
- physical memory addressibility of the processor.
-
- SizeOfIoSpace - Identifies the maximum physical I/O addressibility
- of the processor.
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID*)(UINTN)HandOffHob.HandoffInformationTable->EfiEndOfHobList;
-
- Hob.Header->HobType = EFI_HOB_TYPE_CPU;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_CPU);
-
- Hob.Cpu->SizeOfMemorySpace = SizeOfMemorySpace;
- Hob.Cpu->SizeOfIoSpace = SizeOfIoSpace;
-
- Hob.Cpu++;
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-BuildHobStack (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the Stack
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The 64 bit physical address of the Stack
-
- Length - The length of the stack in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID*)(UINTN)HandOffHob.HandoffInformationTable->EfiEndOfHobList;
-
- Hob.Header->HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK);
-
- CopyMem(&(Hob.MemoryAllocationStack->AllocDescriptor.Name), &gEfiHobMemeryAllocStackGuid, sizeof(EFI_GUID));
- (Hob.MemoryAllocationStack->AllocDescriptor).MemoryBaseAddress = BaseAddress;
- (Hob.MemoryAllocationStack->AllocDescriptor).MemoryLength = Length;
- (Hob.MemoryAllocationStack->AllocDescriptor).MemoryType = EfiBootServicesData;
-
- Hob.MemoryAllocationStack++;
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-BuildHobBspStore (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the bsp store
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The 64 bit physical address of bsp store
-
- Length - The length of the bsp store in bytes
-
- MemoryType - Memory type of the bsp store
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID *)(UINTN)HandOffHob.HandoffInformationTable->EfiEndOfHobList;
- Hob.Header->HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION_BSP_STORE);
-
- (Hob.MemoryAllocationBspStore->AllocDescriptor).MemoryBaseAddress = BaseAddress;
- (Hob.MemoryAllocationBspStore->AllocDescriptor).MemoryLength = Length;
- (Hob.MemoryAllocationBspStore->AllocDescriptor).MemoryType = MemoryType;
- CopyMem(&(Hob.MemoryAllocationBspStore->AllocDescriptor).Name, &gEfiHobMemeryAllocBspStoreGuid, sizeof(EFI_GUID));
- Hob.MemoryAllocationBspStore++;
-
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-BuildMemoryAllocationHob (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *Name,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for memory allocation
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The base address of memory allocated by this HOB.
-
- Length - The length in bytes of memory allocated by this HOB.
-
- Name - A GUID that defines the memory allocation region's type and purpose,
- as well as other fields within the memory allocation HOB.
-
- MemoryType - Defines the type of memory allocated by this HOB.
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
- EFI_PEI_HOB_POINTERS HandOffHob;
-
-
- HandOffHob.Raw = HobStart;
- Hob.Raw = (VOID*)(UINTN)HandOffHob.HandoffInformationTable->EfiEndOfHobList;
-
- Hob.Header->HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION;
- Hob.Header->HobLength = (UINT16) sizeof (EFI_HOB_MEMORY_ALLOCATION);
-
- if (Name != NULL) {
- CopyMem (&(Hob.MemoryAllocation->AllocDescriptor.Name), &Name, sizeof (EFI_GUID));
- } else {
- ZeroMem (&Hob.MemoryAllocation->AllocDescriptor.Name, sizeof (EFI_GUID));
- }
-
- (Hob.MemoryAllocation->AllocDescriptor).MemoryBaseAddress = BaseAddress;
- (Hob.MemoryAllocation->AllocDescriptor).MemoryLength = Length;
- (Hob.MemoryAllocation->AllocDescriptor).MemoryType = MemoryType;
-
- Hob.MemoryAllocation++;
- HandOffHob.HandoffInformationTable->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- Hob = BuildHobEndOfHobList(Hob.Raw);
- HandOffHob.HandoffInformationTable->EfiFreeMemoryBottom = (EFI_PHYSICAL_ADDRESS) (UINTN) Hob.Raw;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetFirstGuidHob (
- IN VOID **HobStart,
- IN EFI_GUID *Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This function searches the first instance of a HOB among the whole HOB list.
-
-Arguments:
-
- HobStart - A pointer to the start pointer of hob list.
-
- Guid - A pointer to the GUID to match with in the HOB list.
-
- Buffer - A pointer to the pointer to the data for the custom HOB type.
-
- BufferSize - A Pointer to the size in byte of BufferSize.
-
-Returns:
- EFI_SUCCESS
- The first instance of the matched GUID HOB among the whole HOB list
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- GuidHob.Raw = *HobStart;
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status); ) {
-
- if (END_OF_HOB_LIST (GuidHob)) {
- return EFI_NOT_FOUND;
- }
-
- if (GuidHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {
- if ( ((INT32 *)Guid)[0] == ((INT32 *)&GuidHob.Guid->Name)[0] &&
- ((INT32 *)Guid)[1] == ((INT32 *)&GuidHob.Guid->Name)[1] &&
- ((INT32 *)Guid)[2] == ((INT32 *)&GuidHob.Guid->Name)[2] &&
- ((INT32 *)Guid)[3] == ((INT32 *)&GuidHob.Guid->Name)[3] ) {
- Status = EFI_SUCCESS;
- *Buffer = (VOID *)((UINT8 *)(&GuidHob.Guid->Name) + sizeof (EFI_GUID));
- if (BufferSize) {
- *BufferSize = GuidHob.Header->HobLength - sizeof (EFI_HOB_GUID_TYPE);
- }
- }
- }
-
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
-
-VOID *
-GetHob (
- IN UINT16 Type,
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- This function returns the first instance of a HOB type in a HOB list.
-
-Arguments:
-
- Type The HOB type to return.
- HobStart The first HOB in the HOB list.
-
-Returns:
-
- HobStart There were no HOBs found with the requested type.
- else Returns the first HOB with the matching type.
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
- //
- // Return input if not found
- //
- if (HobStart == NULL) {
- return HobStart;
- }
-
- //
- // Parse the HOB list, stop if end of list or matching type found.
- //
- while (!END_OF_HOB_LIST (Hob)) {
-
- if (Hob.Header->HobType == Type) {
- break;
- }
-
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
-
- //
- // Return input if not found
- //
- if (END_OF_HOB_LIST (Hob)) {
- return HobStart;
- }
-
- return (VOID *) (Hob.Raw);
-}
-
-EFI_STATUS
-GetNextGuidHob (
- IN OUT VOID **HobStart,
- IN EFI_GUID * Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
- Get the next guid hob.
-
-Arguments:
- HobStart A pointer to the start hob.
- Guid A pointer to a guid.
- Buffer A pointer to the buffer.
- BufferSize Buffer size.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - Next Guid hob not found
-
- EFI_SUCCESS - Next Guid hob found and data for this Guid got
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- if (Buffer == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
-
- GuidHob.Raw = *HobStart;
- if (END_OF_HOB_LIST (GuidHob)) {
- return EFI_NOT_FOUND;
- }
-
- GuidHob.Raw = GetHob (EFI_HOB_TYPE_GUID_EXTENSION, *HobStart);
- if (GuidHob.Header->HobType == EFI_HOB_TYPE_GUID_EXTENSION) {
- if ( ((INT32 *)Guid)[0] == ((INT32 *)&GuidHob.Guid->Name)[0] &&
- ((INT32 *)Guid)[1] == ((INT32 *)&GuidHob.Guid->Name)[1] &&
- ((INT32 *)Guid)[2] == ((INT32 *)&GuidHob.Guid->Name)[2] &&
- ((INT32 *)Guid)[3] == ((INT32 *)&GuidHob.Guid->Name)[3] ) {
- Status = EFI_SUCCESS;
- *Buffer = (VOID *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
- if (BufferSize != NULL) {
- *BufferSize = GuidHob.Header->HobLength - sizeof (EFI_HOB_GUID_TYPE);
- }
- }
- }
-
- *HobStart = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.inf b/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.inf
deleted file mode 100644
index 4bdcaa1ce0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/Hob/PeiHobLib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# PeiHobLib.inf
-#
-# Abstract:
-#
-# Component description file for the PEI library.
-#
-#--*/
-
-[defines]
-BASE_NAME = PeiHobLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiHobLib.c
-
-[sources.ia32]
-
-[sources.ipf]
-
-[libraries.common]
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Framework
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiHobLib.h b/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiHobLib.h
deleted file mode 100644
index 3e19f8d84b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiHobLib.h
+++ /dev/null
@@ -1,400 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeiHobLib.h
-
-Abstract:
-
-
---*/
-
-#ifndef _EFI_PEI_HOB_LIB_H_
-#define _EFI_PEI_HOB_LIB_H_
-
-#include "PeiApi.h" // EFI_PEI_SERVICES definition
-#define EFI_STACK_SIZE 0x20000
-#define EFI_BSP_STORE_SIZE 0x4000
-
-EFI_STATUS
-BuildHobHandoffInfoTable (
- IN VOID *HobStart,
- IN UINT16 Version,
- IN EFI_BOOT_MODE BootMode,
- IN EFI_PHYSICAL_ADDRESS EfiMemoryTop,
- IN EFI_PHYSICAL_ADDRESS EfiMemoryBottom,
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop,
- IN EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom
- )
-/*++
-
-Routine Description:
-
- Builds a HandoffInformationTable Information Table HOB
-
-Arguments:
-
- HobStart - Start pointer of hob list
- Version - The version number pertaining to the PHIT HOB definition.
- BootMode - The system boot mode as determined during the HOB producer phase.
- EfiMemoryTop - The highest address location of memory that is allocated for use by the HOB
- producer phase.
- EfiMemoryBottom - The lowest address location of memory that is allocated for use by the HOB
- producer phase.
- EfiFreeMemoryTop - The highest address location of free memory that is currently available for use
- by the HOB producer phase.
- EfiFreeMemoryBottom - The lowest address location of free memory that is available for
- use by the HOB producer phase.
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-BuildHobModule (
- IN VOID *HobStart,
- IN EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS Module,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for a loaded PE32 module
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- ModuleName - The GUID File Name of the HON from the Firmware Volume
-
- Module - The 64 bit physical address of the module
-
- ModuleLength - The length of the module in bytes
-
- EntryPoint - The 64 bit physical address of the entry point to the module
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobResourceDescriptor (
- IN VOID *HobStart,
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-/*++
-
-Routine Description:
-
- Builds a HOB that describes a chunck of system memory
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- ResourceType - The type of memory described by this HOB
-
- ResourceAttribute - The memory attributes of the memory described by this HOB
-
- PhysicalStart - The 64 bit physical address of memory described by this HOB
-
- NumberOfBytes - The length of the memoty described by this HOB in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobGuidType (
- IN VOID *HobStart,
- IN EFI_GUID *Guid,
- IN VOID *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- Guid - The GUID of the custome HOB type
-
- Buffer - A pointer to the data for the custom HOB type
-
- BufferSize - The size in byte of BufferSize
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobFvDescriptor (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a Firmware Volume HOB
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The base address of the Firmware Volume
-
- Length - The size of the Firmware Volume in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobCpu (
- IN VOID *HobStart,
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the CPU
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- SizeOfMemorySpace - Identifies the maximum
- physical memory addressibility of the processor.
-
- SizeOfIoSpace - Identifies the maximum physical I/O addressibility
- of the processor.
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobStack (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the Stack
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The 64 bit physical address of the Stack
-
- Length - The length of the stack in bytes
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildHobBspStore (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the bsp store
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The 64 bit physical address of bsp store
-
- Length - The length of the bsp store in bytes
-
- MemoryType - Memory type of the bsp store
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-EFI_STATUS
-BuildMemoryAllocationHob (
- IN VOID *HobStart,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *Name,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for memory allocation
-
-Arguments:
-
- HobStart - Start pointer of hob list
-
- BaseAddress - The base address of memory allocated by this HOB.
-
- Length - The length in bytes of memory allocated by this HOB.
-
- Name - A GUID that defines the memory allocation region's type and purpose,
- as well as other fields within the memory allocation HOB.
-
- MemoryType - Defines the type of memory allocated by this HOB.
-
-Returns:
-
- EFI_SUCCESS
- EFI_NOT_AVAILABLE_YET
-
---*/
-;
-
-VOID *
-GetHob (
- IN UINT16 Type,
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- This function returns the first instance of a HOB type in a HOB list.
-
-Arguments:
-
- Type The HOB type to return.
- HobStart The first HOB in the HOB list.
-
-Returns:
-
- HobStart There were no HOBs found with the requested type.
- else Returns the first HOB with the matching type.
-
---*/
-;
-
-EFI_STATUS
-GetFirstGuidHob (
- IN VOID **HobStart,
- IN EFI_GUID *Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This function searches the first instance of a HOB among the whole HOB list.
-
-Arguments:
-
- HobStart - A pointer to the start pointer of hob list.
-
- Guid - A pointer to the GUID to match with in the HOB list.
-
- Buffer - A pointer to the pointer to the data for the custom HOB type.
-
- BufferSize - A Pointer to the size in byte of BufferSize.
-
-Returns:
- EFI_SUCCESS
- The first instance of the matched GUID HOB among the whole HOB list
-
---*/
-;
-
-EFI_STATUS
-GetNextGuidHob (
- IN OUT VOID **HobStart,
- IN EFI_GUID * Guid,
- OUT VOID **Buffer,
- OUT UINTN *BufferSize OPTIONAL
- )
-/*++
-
-Routine Description:
- Get the next guid hob.
-
-Arguments:
- HobStart A pointer to the start hob.
- Guid A pointer to a guid.
- Buffer A pointer to the buffer.
- BufferSize Buffer size.
-
-Returns:
- Status code.
-
- EFI_NOT_FOUND - Next Guid hob not found
-
- EFI_SUCCESS - Next Guid hob found and data for this Guid got
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h b/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
deleted file mode 100644
index 8fd3f93247..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
+++ /dev/null
@@ -1,1433 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeiLib.h
-
-Abstract:
-
- PEI Library Functions
-
---*/
-
-#ifndef _PEI_LIB_H_
-#define _PEI_LIB_H_
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiHobLib.h"
-#include "PeiPerf.h"
-#include EFI_PROTOCOL_DEFINITION (Decompress)
-#include EFI_PROTOCOL_DEFINITION (TianoDecompress)
-#include EFI_GUID_DEFINITION (PeiPeCoffLoader)
-#include EFI_PPI_DEFINITION (FindFv)
-
-#if defined(__GNUC__) && defined(ECP_CPU_IPF)
-
-VOID
-EFIAPI
-EcpEfiBreakPoint (
- VOID
- )
-/*++
-
-Routine Description:
-
- Generates a breakpoint on the CPU.
-
- Generates a breakpoint on the CPU. The breakpoint must be implemented such
- that code can resume normal execution after the breakpoint.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-VOID
-EFIAPI
-EcpMemoryFence (
- VOID
- )
-/*++
-
-Routine Description:
-
- Used to serialize load and store operations.
-
- All loads and stores that proceed calls to this function are guaranteed to be
- globally visible when this function returns.
-
-Arguments:
-
- VOID
-
-Returns:
-
- VOID
-
---*/
-;
-
-#endif
-
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-
-typedef struct {
- UINT32 PeiServiceTable;
-} PEI_IDT_TABLE;
-
-
-VOID *
-EFIAPI
-ScanGuid (
- IN VOID *Buffer,
- IN UINTN Length,
- IN EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
-
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (EFI_MAX_ADDRESS ?Buffer + 1), then ASSERT().
-
-Arguments:
-
- Buffer - Pointer to the target buffer to scan.
- Length - Number of bytes in Buffer to scan.
- Guid - Value to search for in the target buffer.
-
-Returns:
- A pointer to the matching Guid in the target buffer or NULL otherwise.
-
---*/
-;
-
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (EFI_MAX_ADDRESS - Address + 1), then ASSERT().
-
-Arguments:
-
- Address - The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- Length - The number of bytes to invalidate from the instruction cache.
-
- Returns:
- Address
-
-**/
-;
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindNextVolume.
-
-Arguments:
-
- Instance - The Fv Volume Instance.
- VolumeHandle - Pointer to the current Fv Volume to search.
-
-Returns:
- EFI_STATUS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE FvHandle,
- IN OUT EFI_PEI_FILE_HANDLE *FileHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindNextFile.
-
-Arguments:
-
- SearchType - Filter to find only file of this type.
- FvHandle - Pointer to the current FV to search.
- FileHandle - Pointer to the file matching SearchType in FwVolHeader.
- - NULL if file not found
-
-Returns:
- EFI_STATUS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindFileByName (
- IN EFI_GUID *FileName,
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindFileByName.
-
-Arguments:
-
- FileName - File name to search.
- VolumeHandle - The current FV to search.
- FileHandle - Pointer to the file matching name in VolumeHandle.
- - NULL if file not found
-
-Returns:
- EFI_STATUS
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindSectionData.
-
-Arguments:
-
- SearchType - Filter to find only sections of this type.
- FileHandle - Pointer to the current file to search.
- SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
- - NULL if section not found
-
-Returns:
- EFI_STATUS
---*/
-;
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_FV_INFO *VolumeInfo
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsGetVolumeInfo.
-
-Arguments:
-
- VolumeHandle - The handle to Fv Volume.
- VolumeInfo - The pointer to volume information.
-
-Returns:
- EFI_STATUS
---*/
-;
-
-EFI_STATUS
-EFIAPI
-PeiServicesLocatePpi (
- IN EFI_GUID *Guid,
- IN UINTN Instance,
- IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
- IN OUT VOID **Ppi
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function LocatePpi.
-
-Arguments:
-
- Guid - Pointer to GUID of the PPI.
- Instance - Instance Number to discover.
- PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
- returns a pointer to the descriptor (includes flags, etc)
- Ppi - Pointer to reference the found PPI
-
-Returns:
-
- Status - EFI_SUCCESS if the PPI is in the database
- EFI_NOT_FOUND if the PPI is not in the database
---*/
-;
-
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Build FvHob.
-
-Arguments:
-
- BaseAddress - Fv base address.
- Length - Fv Length.
-
-Returns:
- NONE.
-
---*/
-;
-
-VOID
-EFIAPI
-BuildFvHob2 (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *FvNameGuid,
- IN EFI_GUID *FileNameGuid
- )
-/*++
-
-Routine Description:
-
- Build FvHob2.
-
-Arguments:
-
- BaseAddress - Fv base address.
- Length - Fv length.
- FvNameGuid - Fv name.
- FileNameGuid - File name which contians encapsulated Fv.
-
-Returns:
- NONE.
---*/
-;
-
-
-VOID
-EFIAPI
-BuildGuidDataHob (
- IN EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-/*++
-
-Routine Description:
-
- Build Guid data Hob.
-
-Arguments:
-
- Guid - guid to build data hob.
- Data - data to build data hob.
- DataLength - the length of data.
-
-Returns:
- NONE
-
---*/
-;
-
-VOID *
-EFIAPI
-AllocatePages (
- IN UINTN Pages
- )
-/*++
-
-Routine Description:
-
- Allocate Memory.
-
-Arguments:
-
- Pages - Pages to allocate.
-
-Returns:
- Address if successful to allocate memory.
- NULL if fail to allocate memory.
-
---*/
-;
-
-VOID
-SetPeiServicesTablePointer (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Save PeiService pointer so that it can be retrieved anywhere.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
-
-Returns:
- NONE
-
---*/
-;
-
-EFI_PEI_SERVICES **
-GetPeiServicesTablePointer (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get PeiService pointer.
-
-Arguments:
-
- NONE.
-
-Returns:
- The direct pointer to PeiServiceTable.
-
---*/
-;
-
-VOID
-MigrateIdtTable (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Migrate IDT from CAR to real memory where preceded with 4 bytes for
- storing PeiService pointer.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
-
-Returns:
-
- NONE.
-
---*/
-;
-
-
-UINTN
-ReadIdtBase (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read IDT Register BaseAddress.
-
-Arguments:
-
- NONE
-
-Returns:
- IDT Register BaseAddress.
-
---*/
-;
-
-
-UINT16
-ReadIdtLimit (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read IDT Register Limit.
-
-Arguments:
-
- NONE
-
-Returns:
- IDT Register Limit.
-
---*/
-;
-
-
-VOID
-SetIdtBase (
- UINT32 IdtBase,
- UINT16 IdtLimit
- )
-/*++
-
-Routine Description:
-
- Set IDT Register BaseAddress.
-
-Arguments:
-
- IdtBase - IDT.BaseAddress
- IdtLimit - IDT.Limit
-
-Returns:
- NONE
---*/
-;
-
-VOID
-AsmWriteKr7 (
- UINT64 Address
- )
-/*++
-
-Routine Description:
-
- Write 64 bit into Kernel Register7 on IPF.
-
-Arguments:
-
- Address - Data to write into kr7.
-
-Returns:
- NONE
-
---*/
-;
-
-
-UINT64
-AsmReadKr7 (
- VOID
- )
-/*++
-
-Routine Description:
-
- Read 64 bit from Kernel Register7 on IPF.
-
-Arguments:
-
- NONE
-
-Returns:
- Data in kr7.
-
---*/
-;
-
-#endif
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Set Buffer to zero for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-;
-
-BOOLEAN
-CompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-/*++
-
-Routine Description:
-
- Compares two GUIDs
-
-Arguments:
-
- Guid1 - guid to compare
- Guid2 - guid to compare
-
-Returns:
- = TRUE if Guid1 == Guid2
- = FALSE if Guid1 != Guid2
-
---*/
-;
-
-EFI_STATUS
-InstallEfiPeiPeCoffLoader (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL **This,
- IN EFI_PEI_PPI_DESCRIPTOR *ThisPpi
- )
-/*++
-
-Routine Description:
-
- Install EFI Pei PE coff loader protocol.
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- This - Pointer to get Pei PE coff loader protocol as output
-
- ThisPpi - Passed in as EFI_NT_LOAD_AS_DLL_PPI on NT_EMULATOR platform
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-;
-
-EFI_STATUS
-InstallEfiPeiPeCoffLoader64 (
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT EFI_PEI_PE_COFF_LOADER_PROTOCOL **This,
- IN EFI_PEI_PPI_DESCRIPTOR *ThisPpi
- );
-
-
-
-EFI_STATUS
-InstallEfiDecompress (
- EFI_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install EFI decompress protocol.
-
-Arguments:
-
- This - Pointer to get decompress protocol as output
-
-Returns:
-
- EFI_SUCCESS - EFI decompress protocol successfully installed.
-
---*/
-;
-
-EFI_STATUS
-InstallTianoDecompress (
- EFI_TIANO_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install Tiano decompress protocol.
-
-Arguments:
-
- This - Pointer to get decompress protocol as output
-
-Returns:
-
- EFI_SUCCESS - Tiano decompress protocol successfully installed.
-
---*/
-;
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Get timer value.
-
-Arguments:
-
- TimerValue - Pointer to the returned timer value
-
-Returns:
-
- EFI_SUCCESS - Successfully got timer value
-
---*/
-;
-
-#ifdef EFI_NT_EMULATOR
-EFI_STATUS
-PeCoffLoaderWinNtLoadAsDll (
- IN CHAR8 *PdbFileName,
- IN VOID **ImageEntryPoint,
- OUT VOID **ModHandle
- )
-/*++
-
-Routine Description:
-
- Loads the .DLL file is present when a PE/COFF file is loaded. This provides source level
- debugging for drivers that have cooresponding .DLL files on the local system.
-
-Arguments:
-
- PdbFileName - The name of the .PDB file. This was found from the PE/COFF
- file's debug directory entry.
-
- ImageEntryPoint - A pointer to the DLL entry point of the .DLL file was loaded.
-
- ModHandle - Pointer to loaded library.
-
-Returns:
-
- EFI_SUCCESS - The .DLL file was loaded, and the DLL entry point is returned in ImageEntryPoint
-
- EFI_NOT_FOUND - The .DLL file could not be found
-
- EFI_UNSUPPORTED - The .DLL file was loaded, but the entry point to the .DLL file could not
- determined.
-
---*/
-;
-
-#endif
-//
-// hob.c
-//
-EFI_STATUS
-PeiBuildHobModule (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS Module,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for a loaded PE32 module
-
-Arguments:
-
- PeiServices - The PEI core services table.
- ModuleName - The GUID File Name of the module
- Memory - The 64 bit physical address of the module
- ModuleLength - The length of the module in bytes
- EntryPoint - The 64 bit physical address of the entry point
- to the module
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobResourceDescriptor (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-/*++
-
-Routine Description:
-
- Builds a HOB that describes a chunck of system memory
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- ResourceType - The type of resource described by this HOB
-
- ResourceAttribute - The resource attributes of the memory described by this HOB
-
- PhysicalStart - The 64 bit physical address of memory described by this HOB
-
- NumberOfBytes - The length of the memoty described by this HOB in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobGuid (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *Guid,
- IN UINTN DataLength,
- IN OUT VOID **Hob
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- Guid - The GUID of the custome HOB type
-
- DataLength - The size of the data payload for the GUIDed HOB
-
- Hob - Pointer to the Hob
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobGuidData (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- Guid - The GUID of the custome HOB type
-
- Data - The data to be copied into the GUIDed HOB data field.
-
- DataLength - The data field length.
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobFv (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a Firmware Volume HOB
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The base address of the Firmware Volume
-
- Length - The size of the Firmware Volume in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobCpu (
- IN EFI_PEI_SERVICES **PeiServices,
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the CPU
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- SizeOfMemorySpace - Identifies the maximum
- physical memory addressibility of the processor.
-
- SizeOfIoSpace - Identifies the maximum physical I/O addressibility
- of the processor.
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobStack (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the Stack
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the Stack
-
- Length - The length of the stack in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobBspStore (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the bsp store
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the bsp store
-
- Length - The length of the bsp store in bytes
-
- MemoryType - Memory type
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-EFI_STATUS
-PeiBuildHobMemoryAllocation (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *Name,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the memory allocation
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the memory
-
- Length - The length of the memory allocation in bytes
-
- Name - Name for Hob
-
- MemoryType - Memory type
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-;
-
-//
-// print.c
-//
-UINTN
-AvSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN StrSize,
- IN CONST CHAR8 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- AvSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Ascii buffer to print the results of the parsing of Format into.
-
- StrSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Ascii format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- ASPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Ascii buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-;
-
-//
-// math.c
-//
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit
- value returns 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand - multiplicand
- Multiplier - multiplier
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-;
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
- N.B. only works for 31bit divisors!!
-
-Arguments:
-
- Dividend - dividend
- Divisor - divisor
- Remainder - buffer for remainder
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
---*/
-;
-
-UINT64
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be right shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift right.
-
-Returns:
-
- Value shifted right identified by the Count.
-
---*/
-;
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and
- returns the shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-;
-
-VOID
-RegisterNativeCpuIo (
- IN EFI_PEI_SERVICES **PeiServices,
- IN VOID *CpuIo
- )
-/*++
-
-Routine Description:
-
- Register a native Cpu IO
-
-Arguments:
-
- PeiServices - Calling context
- CpuIo - CpuIo instance to register
-
-Returns:
-
- None
-
---*/
-;
-
-VOID
-GetNativeCpuIo (
- IN EFI_PEI_SERVICES **PeiServices,
- OUT VOID **CpuIo
- )
-/*++
-
-Routine Description:
-
- Get registered Cpu IO.
-
-Arguments:
-
- PeiServices - Calling context
- CpuIo - CpuIo instance registered before
-
-Returns:
-
- None
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-FindFv (
- IN EFI_FIND_FV_PPI *This,
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT UINT8 *FvNumber,
- IN OUT EFI_FIRMWARE_VOLUME_HEADER **FVAddress
- )
-/*++
-
-Routine Description:
-
- Search Fv in Hob.
-
-Arguments:
-
- This - Interface pointer that implement the Find Fv PPI
-
- PeiServices - Pointer to the PEI Service Table
-
- FvNumber - On input, the number of the fireware volume which supports FFS to locate
- On output, the next FV number which supports FFS.
-
- FVAddress - The address of the volume which supports FFS to discover
-
-Returns:
-
- EFI_SUCCESS - An addtional FV which supports FFS found
- EFI_OUT_OF_RESOURCES - There are no fireware volume which supports FFS for given fvnumber
- EFI_INVALID_PARAMETER - FvAddress is NULL
-
---*/
-;
-
-
-
-EFI_STATUS
-EFIAPI
-PeiLibPciCfgModify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_PCI_CFG_PPI *PciCfg,
- IN PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN UINTN SetBits,
- IN UINTN ClearBits
- )
-/*++
-
-Routine Description:
-
- PCI read-modify-write operations.
-
- PIWG's PI specification replaces Inte's EFI Specification 1.10.
- EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by
- EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function in these two PPI are not
- compatibile with each other.
-
-
- For Framework code that make the following call:
-
- PciCfg->Modify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
- it will be updated to the following code which call this library API:
- PeiLibPciCfgModify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
-
- The
-
-Arguments:
-
- PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- PciCfg A pointer to the this pointer of EFI_PEI_PCI_CFG_PPI.
- This parameter is unused as a place holder to make
- the parameter list identical to PEI_PCI_CFG_PPI_RW.
- Width The width of the access. Enumerated in bytes. Type
- EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
-
- Address The physical address of the access.
-
- SetBits Points to value to bitwise-OR with the read configuration value.
-
- The size of the value is determined by Width.
-
- ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
- The size of the value is determined by Width.
-
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
-
- EFI_DEVICE_ERROR There was a problem with the transaction.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Aarch64/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Aarch64/PerformancePrimitives.c
deleted file mode 100644
index 9f820650bb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Aarch64/PerformancePrimitives.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Get timer value.
-
-Arguments:
-
- TimerValue - Pointer to the returned timer value
-
-Returns:
-
- EFI_SUCCESS - Successfully got timer value
-
---*/
-{
- // CPU does not have a timer for AArch64 ...
- ASSERT (FALSE);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Arm/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Arm/PerformancePrimitives.c
deleted file mode 100755
index aeb08713a3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Arm/PerformancePrimitives.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Get timer value.
-
-Arguments:
-
- TimerValue - Pointer to the returned timer value
-
-Returns:
-
- EFI_SUCCESS - Successfully got timer value
-
---*/
-{
- // CPU does not have a timer for ARM....
- ASSERT (FALSE);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Debug.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Debug.c
deleted file mode 100644
index eaf785bd36..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Debug.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Debug.c
-
-Abstract:
-
- Support for Debug primatives.
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "EfiPrintLib.h"
-#include "EfiStatusCode.h"
-#include "EfiCommonLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-VOID
-PeiDebugAssert (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded DEADLOOP ().
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- FileName - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT().
-
- Description - Description, usually the assertion,
-
-Returns:
-
- None
-
---*/
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
-
- EfiDebugAssertWorker (FileName, LineNumber, Description, sizeof (Buffer), Buffer);
-
- //
- // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,
- // we want get enough information if assert.
- //
- (**PeiServices).PeiReportStatusCode (
- (EFI_PEI_SERVICES**)PeiServices,
- (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
- (EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),
- 0,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
- EFI_DEADLOOP ();
-}
-
-
-VOID
-PeiDebugPrint (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- ... - Print arguments
-
-Returns:
-
- None
-
---*/
-{
- VA_LIST Marker;
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
-
- VA_START (Marker, Format);
- EfiDebugVPrintWorker (ErrorLevel, Format, Marker, sizeof (Buffer), Buffer);
- VA_END (Marker);
-
- //
- // We choose NOT to use PEI_REPORT_STATUS_CODE here, because when debug is enable,
- // we want get enough information if assert.
- //
- (**PeiServices).PeiReportStatusCode (
- (EFI_PEI_SERVICES**)PeiServices,
- EFI_DEBUG_CODE,
- (EFI_SOFTWARE_PEI_MODULE | EFI_DC_UNSPECIFIED),
- 0,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Decompress.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Decompress.c
deleted file mode 100644
index 6d09c6152e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Decompress.c
+++ /dev/null
@@ -1,1142 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Decompress.c
-
-Abstract:
-
- Decompressor. Algorithm Ported from OPSD code (Decomp.asm)
-
---*/
-
-#include "TianoCommon.h"
-#include EFI_PROTOCOL_DEFINITION (Decompress)
-#include EFI_PROTOCOL_DEFINITION (TianoDecompress)
-
-EFI_STATUS
-EFIAPI
-EfiGetInfo (
- IN EFI_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- );
-
-EFI_STATUS
-EFIAPI
-EfiDecompress (
- IN EFI_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- );
-
-EFI_STATUS
-EFIAPI
-TianoGetInfo (
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- );
-
-EFI_STATUS
-EFIAPI
-TianoDecompress (
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- );
-
-//
-// The protocol instance
-//
-
-EFI_DECOMPRESS_PROTOCOL mEfiDecompress = {
- EfiGetInfo,
- EfiDecompress
-};
-
-EFI_TIANO_DECOMPRESS_PROTOCOL mTianoDecompress = {
- TianoGetInfo,
- TianoDecompress
-};
-
-EFI_STATUS
-InstallEfiDecompress (
- IN OUT EFI_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install EFI decompress protocol.
-
-Arguments:
-
- This - Pointer to get decompress protocol as output
-
-Returns:
-
- EFI_SUCCESS - EFI decompress protocol successfully installed.
-
---*/
-{
- *This = &mEfiDecompress;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-InstallTianoDecompress (
- EFI_TIANO_DECOMPRESS_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Install Tiano decompress protocol.
-
-Arguments:
-
- This - Pointer to get decompress protocol as output
-
-Returns:
-
- EFI_SUCCESS - Tiano decompress protocol successfully installed.
-
---*/
-{
- *This = &mTianoDecompress;
- return EFI_SUCCESS;
-}
-//
-// Decompression algorithm begins here
-//
-#define BITBUFSIZ 32
-#define MAXMATCH 256
-#define THRESHOLD 3
-#define CODE_BIT 16
-#ifndef UINT8_MAX
-#define UINT8_MAX 0xff
-#endif
-#define BAD_TABLE - 1
-
-//
-// C: Char&Len Set; P: Position Set; T: exTra Set
-//
-#define NC (0xff + MAXMATCH + 2 - THRESHOLD)
-#define CBIT 9
-#define MAXPBIT 5
-#define TBIT 5
-#define MAXNP ((1U << MAXPBIT) - 1)
-#define NT (CODE_BIT + 3)
-#if NT > MAXNP
-#define NPT NT
-#else
-#define NPT MAXNP
-#endif
-
-typedef struct {
- UINT8 *mSrcBase; // Starting address of compressed data
- UINT8 *mDstBase; // Starting address of decompressed data
- UINT32 mOutBuf;
- UINT32 mInBuf;
-
- UINT16 mBitCount;
- UINT32 mBitBuf;
- UINT32 mSubBitBuf;
- UINT16 mBlockSize;
- UINT32 mCompSize;
- UINT32 mOrigSize;
-
- UINT16 mBadTableFlag;
-
- UINT16 mLeft[2 * NC - 1];
- UINT16 mRight[2 * NC - 1];
- UINT8 mCLen[NC];
- UINT8 mPTLen[NPT];
- UINT16 mCTable[4096];
- UINT16 mPTTable[256];
-
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm, mPBit = 4
- // For Tiano de/compression algorithm, mPBit = 5
- //
- UINT8 mPBit;
-} SCRATCH_DATA;
-
-STATIC
-VOID
-FillBuf (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Shift mBitBuf NumOfBits left. Read in NumOfBits of bits from source.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfBits - The number of bits to shift and read.
-
-Returns: (VOID)
-
---*/
-{
- Sd->mBitBuf = (UINT32) (Sd->mBitBuf << NumOfBits);
-
- while (NumOfBits > Sd->mBitCount) {
-
- Sd->mBitBuf |= (UINT32) (Sd->mSubBitBuf << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
-
- if (Sd->mCompSize > 0) {
- //
- // Get 1 byte into SubBitBuf
- //
- Sd->mCompSize--;
- Sd->mSubBitBuf = 0;
- Sd->mSubBitBuf = Sd->mSrcBase[Sd->mInBuf++];
- Sd->mBitCount = 8;
-
- } else {
- //
- // No more bits from the source, just pad zero bit.
- //
- Sd->mSubBitBuf = 0;
- Sd->mBitCount = 8;
-
- }
- }
-
- Sd->mBitCount = (UINT16) (Sd->mBitCount - NumOfBits);
- Sd->mBitBuf |= Sd->mSubBitBuf >> Sd->mBitCount;
-}
-
-STATIC
-UINT32
-GetBits (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfBits
- )
-/*++
-
-Routine Description:
-
- Get NumOfBits of bits out from mBitBuf. Fill mBitBuf with subsequent
- NumOfBits of bits from source. Returns NumOfBits of bits that are
- popped out.
-
-Arguments:
-
- Sd - The global scratch data.
- NumOfBits - The number of bits to pop and read.
-
-Returns:
-
- The bits that are popped out.
-
---*/
-{
- UINT32 OutBits;
-
- OutBits = (UINT32) (Sd->mBitBuf >> (BITBUFSIZ - NumOfBits));
-
- FillBuf (Sd, NumOfBits);
-
- return OutBits;
-}
-
-STATIC
-UINT16
-MakeTable (
- IN SCRATCH_DATA *Sd,
- IN UINT16 NumOfChar,
- IN UINT8 *BitLen,
- IN UINT16 TableBits,
- OUT UINT16 *Table
- )
-/*++
-
-Routine Description:
-
- Creates Huffman Code mapping table according to code length array.
-
-Arguments:
-
- Sd - The global scratch data
- NumOfChar - Number of symbols in the symbol set
- BitLen - Code length array
- TableBits - The width of the mapping table
- Table - The table
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - The table is corrupted.
-
---*/
-{
- UINT16 Count[17];
- UINT16 Weight[17];
- UINT16 Start[18];
- UINT16 *Pointer;
- UINT16 Index3;
- UINT16 Index;
- UINT16 Len;
- UINT16 Char;
- UINT16 JuBits;
- UINT16 Avail;
- UINT16 NextCode;
- UINT16 Mask;
-
- //
- // TableBits should not be greater than 16.
- //
- if (TableBits >= (sizeof (Count)/sizeof (UINT16))) {
- return (UINT16) BAD_TABLE;
- }
-
- //
- // Initialize Count array starting from Index 0, as there is a possibility of Count array being uninitialized.
- //
- for (Index = 0; Index <= 16; Index++) {
- Count[Index] = 0;
- }
-
- for (Index = 0; Index < NumOfChar; Index++) {
- //
- // Count array index should not be greater than or equal to its size.
- //
- if (BitLen[Index] < (sizeof (Count)/sizeof (UINT16))) {
- Count[BitLen[Index]]++;
- } else {
- return (UINT16) BAD_TABLE;
- }
- }
-
- Start[0] = 0;
- Start[1] = 0;
-
- for (Index = 1; Index <= 16; Index++) {
- Start[Index + 1] = (UINT16) (Start[Index] + (Count[Index] << (16 - Index)));
- }
-
- if (Start[17] != 0) {
- /*(1U << 16)*/
- return (UINT16) BAD_TABLE;
- }
-
- JuBits = (UINT16) (16 - TableBits);
-
- for (Index = 1; Index <= TableBits; Index++) {
- Start[Index] >>= JuBits;
- Weight[Index] = (UINT16) (1U << (TableBits - Index));
- }
-
- while (Index <= 16) {
- Weight[Index] = (UINT16) (1U << (16 - Index));
- Index++;
- }
-
- Index = (UINT16) (Start[TableBits + 1] >> JuBits);
-
- if (Index != 0) {
- Index3 = (UINT16) (1U << TableBits);
- while (Index != Index3) {
- Table[Index++] = 0;
- }
- }
-
- Avail = NumOfChar;
- Mask = (UINT16) (1U << (15 - TableBits));
-
- for (Char = 0; Char < NumOfChar; Char++) {
-
- Len = BitLen[Char];
- if (Len == 0 || Len >= 17) {
- continue;
- }
-
- NextCode = (UINT16) (Start[Len] + Weight[Len]);
-
- if (Len <= TableBits) {
-
- for (Index = Start[Len]; Index < NextCode; Index++) {
- Table[Index] = Char;
- }
-
- } else {
-
- Index3 = Start[Len];
- Pointer = &Table[Index3 >> JuBits];
- Index = (UINT16) (Len - TableBits);
-
- while (Index != 0) {
- //
- // Avail should be lesser than size of mRight and mLeft to prevent buffer overflow.
- //
- if ((*Pointer == 0) && (Avail < sizeof (Sd->mRight)/sizeof (UINT16)) && (Avail < sizeof (Sd->mLeft)/sizeof (UINT16))) {
- Sd->mRight[Avail] = Sd->mLeft[Avail] = 0;
- *Pointer = Avail++;
- }
-
- //
- // *Pointer should be lesser than size of mRight and mLeft to prevent buffer overflow.
- //
- if ((Index3 & Mask) && (*Pointer < (sizeof (Sd->mRight)/sizeof (UINT16)))) {
- Pointer = &Sd->mRight[*Pointer];
- } else if (*Pointer < (sizeof (Sd->mLeft)/sizeof (UINT16))) {
- Pointer = &Sd->mLeft[*Pointer];
- }
-
- Index3 <<= 1;
- Index--;
- }
-
- *Pointer = Char;
-
- }
-
- Start[Len] = NextCode;
- }
- //
- // Succeeds
- //
- return 0;
-}
-
-STATIC
-UINT32
-DecodeP (
- IN SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decodes a position value.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns:
-
- The position value decoded.
-
---*/
-{
- UINT16 Val;
- UINT32 Mask;
- UINT32 Pos;
-
- Val = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
-
- if (Val >= MAXNP) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Sd->mBitBuf & Mask) {
- Val = Sd->mRight[Val];
- } else {
- Val = Sd->mLeft[Val];
- }
-
- Mask >>= 1;
- } while (Val >= MAXNP);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[Val]);
-
- Pos = Val;
- if (Val > 1) {
- Pos = (UINT32) ((1U << (Val - 1)) + GetBits (Sd, (UINT16) (Val - 1)));
- }
-
- return Pos;
-}
-
-STATIC
-UINT16
-ReadPTLen (
- IN SCRATCH_DATA *Sd,
- IN UINT16 nn,
- IN UINT16 nbit,
- IN UINT16 Special
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for the Extra Set or the Position Set
-
-Arguments:
-
- Sd - The global scratch data
- nn - Number of symbols
- nbit - Number of bits needed to represent nn
- Special - The special symbol that needs to be taken care of
-
-Returns:
-
- 0 - OK.
- BAD_TABLE - Table is corrupted.
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, nbit);
-
- if ((Number > sizeof (Sd->mPTLen)) || (nn > sizeof (Sd->mPTLen))) {
- //
- // Fail if Number or nn is greater than size of mPTLen
- //
- return (UINT16) BAD_TABLE;
- }
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, nbit);
-
- for (Index = 0; Index < 256; Index++) {
- Sd->mPTTable[Index] = CharC;
- }
-
- for (Index = 0; Index < nn; Index++) {
- Sd->mPTLen[Index] = 0;
- }
-
- return 0;
- }
-
- Index = 0;
-
- while (Index < Number) {
-
- CharC = (UINT16) (Sd->mBitBuf >> (BITBUFSIZ - 3));
-
- if (CharC == 7) {
- Mask = 1U << (BITBUFSIZ - 1 - 3);
- while (Mask & Sd->mBitBuf) {
- Mask >>= 1;
- CharC += 1;
- }
- }
-
- FillBuf (Sd, (UINT16) ((CharC < 7) ? 3 : CharC - 3));
-
- Sd->mPTLen[Index++] = (UINT8) CharC;
-
- if (Index == Special) {
- CharC = (UINT16) GetBits (Sd, 2);
- while ((INT16) (--CharC) >= 0) {
- if (Index >= sizeof (Sd->mPTLen)) {
- //
- // Fail if Index is greater than or equal to mPTLen
- //
- return (UINT16) BAD_TABLE;
- }
- Sd->mPTLen[Index++] = 0;
- }
- }
- }
-
- while (Index < nn) {
- Sd->mPTLen[Index++] = 0;
- }
-
- return MakeTable (Sd, nn, Sd->mPTLen, 8, Sd->mPTTable);
-}
-
-STATIC
-VOID
-ReadCLen (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Reads code lengths for Char&Len Set.
-
-Arguments:
-
- Sd - the global scratch data
-
-Returns: (VOID)
-
---*/
-{
- UINT16 Number;
- UINT16 CharC;
- UINT16 Index;
- UINT32 Mask;
-
- Number = (UINT16) GetBits (Sd, CBIT);
-
- if (Number == 0) {
- CharC = (UINT16) GetBits (Sd, CBIT);
-
- for (Index = 0; Index < NC; Index++) {
- Sd->mCLen[Index] = 0;
- }
-
- for (Index = 0; Index < 4096; Index++) {
- Sd->mCTable[Index] = CharC;
- }
-
- return ;
- }
-
- Index = 0;
- while (Index < Number) {
-
- CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
- if (CharC >= NT) {
- Mask = 1U << (BITBUFSIZ - 1 - 8);
-
- do {
-
- if (Mask & Sd->mBitBuf) {
- CharC = Sd->mRight[CharC];
- } else {
- CharC = Sd->mLeft[CharC];
- }
-
- Mask >>= 1;
-
- } while (CharC >= NT);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mPTLen[CharC]);
-
- if (CharC <= 2) {
-
- if (CharC == 0) {
- CharC = 1;
- } else if (CharC == 1) {
- CharC = (UINT16) (GetBits (Sd, 4) + 3);
- } else if (CharC == 2) {
- CharC = (UINT16) (GetBits (Sd, CBIT) + 20);
- }
-
- while ((INT16) (--CharC) >= 0) {
- Sd->mCLen[Index++] = 0;
- }
-
- } else {
-
- Sd->mCLen[Index++] = (UINT8) (CharC - 2);
-
- }
- }
-
- while (Index < NC) {
- Sd->mCLen[Index++] = 0;
- }
-
- MakeTable (Sd, NC, Sd->mCLen, 12, Sd->mCTable);
-
- return ;
-}
-
-STATIC
-UINT16
-DecodeC (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode a character/length value.
-
-Arguments:
-
- Sd - The global scratch data.
-
-Returns:
-
- The value decoded.
-
---*/
-{
- UINT16 Index2;
- UINT32 Mask;
-
- if (Sd->mBlockSize == 0) {
- //
- // Starting a new block
- //
- Sd->mBlockSize = (UINT16) GetBits (Sd, 16);
- Sd->mBadTableFlag = ReadPTLen (Sd, NT, TBIT, 3);
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
-
- ReadCLen (Sd);
-
- Sd->mBadTableFlag = ReadPTLen (Sd, MAXNP, Sd->mPBit, (UINT16) (-1));
- if (Sd->mBadTableFlag != 0) {
- return 0;
- }
- }
-
- Sd->mBlockSize--;
- Index2 = Sd->mCTable[Sd->mBitBuf >> (BITBUFSIZ - 12)];
-
- if (Index2 >= NC) {
- Mask = 1U << (BITBUFSIZ - 1 - 12);
-
- do {
- if (Sd->mBitBuf & Mask) {
- Index2 = Sd->mRight[Index2];
- } else {
- Index2 = Sd->mLeft[Index2];
- }
-
- Mask >>= 1;
- } while (Index2 >= NC);
- }
- //
- // Advance what we have read
- //
- FillBuf (Sd, Sd->mCLen[Index2]);
-
- return Index2;
-}
-
-STATIC
-VOID
-Decode (
- SCRATCH_DATA *Sd
- )
-/*++
-
-Routine Description:
-
- Decode the source data and put the resulting data into the destination buffer.
-
-Arguments:
-
- Sd - The global scratch data
-
-Returns: (VOID)
-
- --*/
-{
- UINT16 BytesRemain;
- UINT32 DataIdx;
- UINT16 CharC;
-
- BytesRemain = (UINT16) (-1);
-
- DataIdx = 0;
-
- for (;;) {
- CharC = DecodeC (Sd);
- if (Sd->mBadTableFlag != 0) {
- return ;
- }
-
- if (CharC < 256) {
- //
- // Process an Original character
- //
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
- } else {
- Sd->mDstBase[Sd->mOutBuf++] = (UINT8) CharC;
- }
-
- } else {
- //
- // Process a Pointer
- //
- CharC = (UINT16) (CharC - (UINT8_MAX + 1 - THRESHOLD));
-
- BytesRemain = CharC;
-
- DataIdx = Sd->mOutBuf - DecodeP (Sd) - 1;
-
- BytesRemain--;
- while ((INT16) (BytesRemain) >= 0) {
- Sd->mDstBase[Sd->mOutBuf++] = Sd->mDstBase[DataIdx++];
- if (Sd->mOutBuf >= Sd->mOrigSize) {
- return ;
- }
-
- BytesRemain--;
- }
- }
- }
-}
-
-EFI_STATUS
-GetInfo (
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The internal implementation of *_DECOMPRESS_PROTOCOL.GetInfo().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- UINT8 *Src;
-
- *ScratchSize = sizeof (SCRATCH_DATA);
-
- Src = Source;
- if (SrcSize < 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- *DstSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-Decompress (
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize,
- IN UINT8 Version
- )
-/*++
-
-Routine Description:
-
- The internal implementation of *_DECOMPRESS_PROTOCOL.Decompress().
-
-Arguments:
-
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
- Version - The version of de/compression algorithm.
- Version 1 for EFI 1.1 de/compression algorithm.
- Version 2 for Tiano de/compression algorithm.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- UINT32 Index;
- UINT32 CompSize;
- UINT32 OrigSize;
- EFI_STATUS Status;
- SCRATCH_DATA *Sd;
- UINT8 *Src;
- UINT8 *Dst;
-
- Status = EFI_SUCCESS;
- Src = Source;
- Dst = Destination;
-
- if (ScratchSize < sizeof (SCRATCH_DATA)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Sd = (SCRATCH_DATA *) Scratch;
-
- if (SrcSize < 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- CompSize = Src[0] + (Src[1] << 8) + (Src[2] << 16) + (Src[3] << 24);
- OrigSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
-
- //
- // If compressed file size is 0, return
- //
- if (OrigSize == 0) {
- return Status;
- }
-
- if (SrcSize < CompSize + 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (DstSize != OrigSize) {
- return EFI_INVALID_PARAMETER;
- }
-
- Src = Src + 8;
-
- for (Index = 0; Index < sizeof (SCRATCH_DATA); Index++) {
- ((UINT8 *) Sd)[Index] = 0;
- }
- //
- // The length of the field 'Position Set Code Length Array Size' in Block Header.
- // For EFI 1.1 de/compression algorithm(Version 1), mPBit = 4
- // For Tiano de/compression algorithm(Version 2), mPBit = 5
- //
- switch (Version) {
- case 1:
- Sd->mPBit = 4;
- break;
-
- case 2:
- Sd->mPBit = 5;
- break;
-
- default:
- //
- // Currently, only have 2 versions
- //
- return EFI_INVALID_PARAMETER;
- }
-
- Sd->mSrcBase = Src;
- Sd->mDstBase = Dst;
- Sd->mCompSize = CompSize;
- Sd->mOrigSize = OrigSize;
-
- //
- // Fill the first BITBUFSIZ bits
- //
- FillBuf (Sd, BITBUFSIZ);
-
- //
- // Decompress it
- //
- Decode (Sd);
-
- if (Sd->mBadTableFlag != 0) {
- //
- // Something wrong with the source
- //
- Status = EFI_INVALID_PARAMETER;
- }
-
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-EfiGetInfo (
- IN EFI_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of EFI_DECOMPRESS_PROTOCOL.GetInfo().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- return GetInfo (
- Source,
- SrcSize,
- DstSize,
- ScratchSize
- );
-}
-
-EFI_STATUS
-EFIAPI
-EfiDecompress (
- IN EFI_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of EFI_DECOMPRESS_PROTOCOL.Decompress().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- //
- // For EFI 1.1 de/compression algorithm, the version is 1.
- //
- return Decompress (
- Source,
- SrcSize,
- Destination,
- DstSize,
- Scratch,
- ScratchSize,
- 1
- );
-}
-
-EFI_STATUS
-EFIAPI
-TianoGetInfo (
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- OUT UINT32 *DstSize,
- OUT UINT32 *ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of EFI_TIANO_DECOMPRESS_PROTOCOL.GetInfo().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- DstSize - The size of destination buffer.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successull retrieved.
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- return GetInfo (
- Source,
- SrcSize,
- DstSize,
- ScratchSize
- );
-}
-
-EFI_STATUS
-EFIAPI
-TianoDecompress (
- IN EFI_TIANO_DECOMPRESS_PROTOCOL *This,
- IN VOID *Source,
- IN UINT32 SrcSize,
- IN OUT VOID *Destination,
- IN UINT32 DstSize,
- IN OUT VOID *Scratch,
- IN UINT32 ScratchSize
- )
-/*++
-
-Routine Description:
-
- The implementation of EFI_TIANO_DECOMPRESS_PROTOCOL.Decompress().
-
-Arguments:
-
- This - The protocol instance pointer
- Source - The source buffer containing the compressed data.
- SrcSize - The size of source buffer
- Destination - The destination buffer to store the decompressed data
- DstSize - The size of destination buffer.
- Scratch - The buffer used internally by the decompress routine. This buffer is needed to store intermediate data.
- ScratchSize - The size of scratch buffer.
-
-Returns:
-
- EFI_SUCCESS - Decompression is successfull
- EFI_INVALID_PARAMETER - The source data is corrupted
-
---*/
-{
- //
- // For Tiano de/compression algorithm, the version is 2.
- //
- return Decompress (
- Source,
- SrcSize,
- Destination,
- DstSize,
- Scratch,
- ScratchSize,
- 2
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/FindFv.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/FindFv.c
deleted file mode 100644
index 3a8da83eca..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/FindFv.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*++
-
-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.
-
-
-Module Name:
-
- FindFv.c
-
-Abstract:
-
- Library function to find fv by hob.
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include "PeiHobLib.h"
-#include "EfiCommonLib.h"
-#include EFI_GUID_DEFINITION (FirmwareFileSystem)
-
-static
-VOID *
-FindFvGetHob (
- IN UINT16 Type,
- IN VOID *HobStart
- )
-/*++
-
-Routine Description:
-
- This function returns the first instance of a HOB type in a HOB list.
-
-Arguments:
-
- Type The HOB type to return.
- HobStart The first HOB in the HOB list.
-
-Returns:
-
- HobStart There were no HOBs found with the requested type.
- else Returns the first HOB with the matching type.
-
---*/
-{
- EFI_PEI_HOB_POINTERS Hob;
-
- Hob.Raw = HobStart;
- //
- // Return input if not found
- //
- if (HobStart == NULL) {
- return HobStart;
- }
-
- //
- // Parse the HOB list, stop if end of list or matching type found.
- //
- while (!END_OF_HOB_LIST (Hob)) {
-
- if (Hob.Header->HobType == Type) {
- break;
- }
-
- Hob.Raw = GET_NEXT_HOB (Hob);
- }
-
- //
- // Return input if not found
- //
- if (END_OF_HOB_LIST (Hob)) {
- return HobStart;
- }
-
- return (VOID *) (Hob.Raw);
-}
-
-EFI_STATUS
-EFIAPI
-FindFv (
- IN EFI_FIND_FV_PPI *This,
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT UINT8 *FvNumber,
- IN OUT EFI_FIRMWARE_VOLUME_HEADER **FvAddress
- )
-/*++
-
-Routine Description:
-
- Search Fv which supports FFS.
-
-Arguments:
-
- This - Interface pointer that implement the Find Fv PPI
-
- PeiServices - Pointer to the PEI Service Table
-
- FvNumber - On input, the number of the fireware volume which supports FFS to locate
- On output, the next FV number which supports FFS.
-
- FVAddress - The address of the volume which supports FFS to discover
-
-Returns:
-
- EFI_SUCCESS - An addtional FV which supports FFS found
- EFI_OUT_OF_RESOURCES - There are no fireware volume which supports FFS for given fvnumber
- EFI_INVALID_PARAMETER - FvAddress is NULL
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS HobStart;
- EFI_PEI_HOB_POINTERS Hob;
- EFI_HOB_FIRMWARE_VOLUME *FvHob;
- UINT8 FvIndex;
-
- if (FvAddress == NULL){
- return EFI_INVALID_PARAMETER;
- }
-
- Hob.Raw = NULL;
- FvIndex = 0;
-
- //
- // Get the Hob table pointer
- //
- Status = (*PeiServices)->GetHobList (
- PeiServices,
- (VOID **) &HobStart.Raw
- );
-
- if (EFI_ERROR (Status)) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- //
- // Loop to search the wanted FirmwareVolume which supports FFS
- //
- //
- while (FvIndex <= *FvNumber) {
-
- Hob.Raw = FindFvGetHob (EFI_HOB_TYPE_FV, HobStart.Raw);
-
- //
- // If the Hob is not EFI_HOB_TYPE_FV, it indicates that
- // we have finished all FV volumes search, and there is no
- // the FFS FV specified by FvNumber.
- //
- if (Hob.Header->HobType != EFI_HOB_TYPE_FV) {
- *FvNumber = 0;
- return EFI_OUT_OF_RESOURCES;
- }
-
- HobStart.Raw = Hob.Raw + Hob.Header->HobLength;
- FvHob = Hob.FirmwareVolume;
- *FvAddress = (EFI_FIRMWARE_VOLUME_HEADER *) ((UINTN) FvHob->BaseAddress);
- //
- // Check if the FV supports FFS
- //
- if (EfiCompareGuid (&((*FvAddress)->FileSystemGuid), &gEfiFirmwareFileSystemGuid)) {
- FvIndex++;
- }
- }
-
- //
- // Return the next FV number which supports FFS.
- //
- (*FvNumber)++;
-
- return EFI_SUCCESS;
-
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Hob/Hob.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Hob/Hob.c
deleted file mode 100644
index 4dcd3d14d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Hob/Hob.c
+++ /dev/null
@@ -1,521 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- hob.c
-
-Abstract:
-
- PEI Library Functions
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include EFI_GUID_DEFINITION (MemoryAllocationHob)
-
-
-EFI_STATUS
-PeiBuildHobModule (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *ModuleName,
- IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
- IN UINT64 ModuleLength,
- IN EFI_PHYSICAL_ADDRESS EntryPoint
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for a loaded PE32 module
-
-Arguments:
-
- PeiServices - The PEI core services table.
- ModuleName - The GUID File Name of the module
- MemoryAllocationModule - The 64 bit physical address of the module
- ModuleLength - The length of the module in bytes
- EntryPoint - The 64 bit physical address of the entry point
- to the module
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_MEMORY_ALLOCATION_MODULE *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_MEMORY_ALLOCATION,
- sizeof (EFI_HOB_MEMORY_ALLOCATION_MODULE),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->MemoryAllocationHeader.Name = gEfiHobMemeryAllocModuleGuid;
- Hob->MemoryAllocationHeader.MemoryBaseAddress = MemoryAllocationModule;
- Hob->MemoryAllocationHeader.MemoryLength = ModuleLength;
- Hob->MemoryAllocationHeader.MemoryType = EfiBootServicesCode;
- (*PeiServices)->SetMem (
- Hob->MemoryAllocationHeader.Reserved,
- sizeof (Hob->MemoryAllocationHeader.Reserved),
- 0
- );
-
- Hob->ModuleName = *ModuleName;
- Hob->EntryPoint = EntryPoint;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobResourceDescriptor (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_RESOURCE_TYPE ResourceType,
- IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
- IN EFI_PHYSICAL_ADDRESS PhysicalStart,
- IN UINT64 NumberOfBytes
- )
-/*++
-
-Routine Description:
-
- Builds a HOB that describes a chunck of system memory
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- ResourceType - The type of resource described by this HOB
-
- ResourceAttribute - The resource attributes of the memory described by this HOB
-
- PhysicalStart - The 64 bit physical address of memory described by this HOB
-
- NumberOfBytes - The length of the memoty described by this HOB in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_RESOURCE_DESCRIPTOR *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_RESOURCE_DESCRIPTOR,
- sizeof (EFI_HOB_RESOURCE_DESCRIPTOR),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->ResourceType = ResourceType;
- Hob->ResourceAttribute = ResourceAttribute;
- Hob->PhysicalStart = PhysicalStart;
- Hob->ResourceLength = NumberOfBytes;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobGuid (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *Guid,
- IN UINTN DataLength,
- OUT VOID **Hob
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- PeiServices - The PEI core services table.
- Guid - The GUID of the custome HOB type
- DataLength - The size of the data payload for the GUIDed HOB
- Hob - Pointer to pointer to the created Hob
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_GUID_EXTENSION,
- (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + DataLength),
- Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- ((EFI_HOB_GUID_TYPE *)(*Hob))->Name = *Guid;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobGuidData (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-/*++
-
-Routine Description:
-
- Builds a custom HOB that is tagged with a GUID for identification
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- Guid - The GUID of the custome HOB type
-
- Data - The data to be copied into the GUIDed HOB data field.
-
- DataLength - The data field length.
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
-
- EFI_HOB_GUID_TYPE *Hob;
-
- Status = PeiBuildHobGuid (
- PeiServices,
- Guid,
- DataLength,
- (VOID **) &Hob
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob++;
- (*PeiServices)->CopyMem (Hob, Data, DataLength);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobFv (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a Firmware Volume HOB
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The base address of the Firmware Volume
-
- Length - The size of the Firmware Volume in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_FIRMWARE_VOLUME *Hob;
-
- //
- // Check FV Signature
- //
- PEI_ASSERT ((CONST EFI_PEI_SERVICES **) PeiServices, ((EFI_FIRMWARE_VOLUME_HEADER*)((UINTN)BaseAddress))->Signature == EFI_FVH_SIGNATURE);
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_FV,
- sizeof (EFI_HOB_FIRMWARE_VOLUME),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->BaseAddress = BaseAddress;
- Hob->Length = Length;
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobCpu (
- IN EFI_PEI_SERVICES **PeiServices,
- IN UINT8 SizeOfMemorySpace,
- IN UINT8 SizeOfIoSpace
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the CPU
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- SizeOfMemorySpace - Identifies the maximum
- physical memory addressibility of the processor.
-
- SizeOfIoSpace - Identifies the maximum physical I/O addressibility
- of the processor.
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_CPU *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_CPU,
- sizeof (EFI_HOB_CPU),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->SizeOfMemorySpace = SizeOfMemorySpace;
- Hob->SizeOfIoSpace = SizeOfIoSpace;
- (*PeiServices)->SetMem (
- Hob->Reserved,
- sizeof (Hob->Reserved),
- 0
- );
-
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-PeiBuildHobStack (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the Stack
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the Stack
-
- Length - The length of the stack in bytes
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_MEMORY_ALLOCATION_STACK *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_MEMORY_ALLOCATION,
- sizeof (EFI_HOB_MEMORY_ALLOCATION_STACK),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->AllocDescriptor.Name = gEfiHobMemeryAllocStackGuid;
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = EfiBootServicesData;
- (*PeiServices)->SetMem (
- Hob->AllocDescriptor.Reserved,
- sizeof (Hob->AllocDescriptor.Reserved),
- 0
- );
-
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-PeiBuildHobBspStore (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the bsp store
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the bsp
-
- Length - The length of the bsp store in bytes
-
- MemoryType - Memory type
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_MEMORY_ALLOCATION,
- sizeof (EFI_HOB_MEMORY_ALLOCATION_BSP_STORE),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Hob->AllocDescriptor.Name = gEfiHobMemeryAllocBspStoreGuid;
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = MemoryType;
- (*PeiServices)->SetMem (
- Hob->AllocDescriptor.Reserved,
- sizeof (Hob->AllocDescriptor.Reserved),
- 0
- );
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PeiBuildHobMemoryAllocation (
- IN EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *Name,
- IN EFI_MEMORY_TYPE MemoryType
- )
-/*++
-
-Routine Description:
-
- Builds a HOB for the memory allocation.
-
-Arguments:
-
- PeiServices - The PEI core services table.
-
- BaseAddress - The 64 bit physical address of the memory
-
- Length - The length of the memory allocation in bytes
-
- Name - Name for Hob
-
- MemoryType - Memory type
-
-Returns:
-
- EFI_SUCCESS - Hob is successfully built.
- Others - Errors occur while creating new Hob
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_MEMORY_ALLOCATION *Hob;
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_MEMORY_ALLOCATION,
- sizeof (EFI_HOB_MEMORY_ALLOCATION),
- (VOID **) &Hob
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- if (Name != NULL) {
- Hob->AllocDescriptor.Name = *Name;
- } else {
- (*PeiServices)->SetMem(&(Hob->AllocDescriptor.Name), sizeof (EFI_GUID), 0);
- }
-
- Hob->AllocDescriptor.MemoryBaseAddress = BaseAddress;
- Hob->AllocDescriptor.MemoryLength = Length;
- Hob->AllocDescriptor.MemoryType = MemoryType;
- (*PeiServices)->SetMem (
- Hob->AllocDescriptor.Reserved,
- sizeof (Hob->AllocDescriptor.Reserved),
- 0
- );
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/EfiJump.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/EfiJump.h
deleted file mode 100644
index 7aa558eb47..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/EfiJump.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiJump.h
-
-Abstract:
-
- This is the Setjump/Longjump pair for an IA32 processor.
-
---*/
-
-#ifndef _EFI_JUMP_H_
-#define _EFI_JUMP_H_
-
-typedef struct {
- UINT32 ebx;
- UINT32 esi;
- UINT32 edi;
- UINT32 ebp;
- UINT32 esp;
- UINT32 eip;
-} EFI_JUMP_BUFFER;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.c
deleted file mode 100644
index 6e21e3eff1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- IA-32 Specific relocation fixups
-
-Revision History
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiImage.h"
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an IA-32 specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- EFI_UNSUPPORTED - relocate unsupported
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
- (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.h
deleted file mode 100644
index 6e33aa583e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeCoffLoaderEx.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeCoffLoaderEx.h
-
-Abstract:
-
- IA-32 Specific relocation fixups
-
-Revision History
-
---*/
-
-#ifndef _PE_COFF_LOADER_EX_H_
-#define _PE_COFF_LOADER_EX_H_
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an IA-32 specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- EFI_UNSUPPORTED - relocate unsupported
-
---*/
-;
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeiServicePointer.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeiServicePointer.c
deleted file mode 100644
index bda1ff5c93..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PeiServicePointer.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeiServicePointer.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "PeiApi.h"
-#include "PeiLib.h"
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-
-#ifdef EFI_NT_EMULATOR
-EFI_PEI_SERVICES **gPeiServices;
-#endif
-
-
-VOID
-SetPeiServicesTablePointer (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Save PeiService pointer so that it can be retrieved anywhere.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
- PhyscialAddress - The physcial address of variable PeiServices.
-
-Returns:
- NONE
-
---*/
-{
-
-#ifdef EFI_NT_EMULATOR
-
- //
- // For NT32, set EFI_PEI_SERVICES** to global variable.
- //
- gPeiServices = PeiServices;
-#else
-
- //
- // For X86 processor,the EFI_PEI_SERVICES** is stored in the
- // 4 bytes immediately preceding the Interrupt Descriptor Table.
- //
- UINTN IdtBaseAddress;
- IdtBaseAddress = (UINTN)ReadIdtBase();
- *(UINTN*)(IdtBaseAddress - 4) = (UINTN)PeiServices;
-
-#endif
-}
-
-
-EFI_PEI_SERVICES **
-GetPeiServicesTablePointer (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get PeiService pointer.
-
-Arguments:
-
- NONE.
-
-Returns:
- The direct pointer to PeiServiceTable.
-
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
-#ifdef EFI_NT_EMULATOR
-
- //
- // For NT32, set EFI_PEI_SERVICES** to global variable.
- //
- PeiServices = gPeiServices;
-#else
-
- //
- // For X86 processor,the EFI_PEI_SERVICES** is stored in the
- // 4 bytes immediately preceding the Interrupt Descriptor Table.
- //
- UINTN IdtBaseAddress;
- IdtBaseAddress = (UINTN)ReadIdtBase();
- PeiServices = (EFI_PEI_SERVICES **)(UINTN)(*(UINTN*)(IdtBaseAddress - 4));
-#endif
- return PeiServices;
-}
-
-
-VOID
-MigrateIdtTable (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Migrate IDT from temporary memory to real memory where preceded with 4 bytes for
- storing PeiService pointer.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
-
-Returns:
-
- NONE.
-
---*/
-{
-#ifndef EFI_NT_EMULATOR
- UINT16 IdtEntrySize;
- UINTN OldIdtBase;
- UINTN Size;
- VOID *NewIdtBase;
- EFI_STATUS Status;
-
- IdtEntrySize = ReadIdtLimit();
- OldIdtBase = ReadIdtBase();
- Size = sizeof(PEI_IDT_TABLE) + (IdtEntrySize + 1);
- Status = (*PeiServices)->AllocatePool (PeiServices, Size, &NewIdtBase);
- ASSERT_PEI_ERROR (PeiServices, Status);
- (*PeiServices)->CopyMem ((VOID*)((UINTN)NewIdtBase + sizeof(PEI_IDT_TABLE)), (VOID*)OldIdtBase, (IdtEntrySize + 1));
- SetIdtBase(((UINTN)NewIdtBase + sizeof(PEI_IDT_TABLE)), IdtEntrySize);
- SetPeiServicesTablePointer(PeiServices);
-#endif
-}
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PerformancePrimitives.c
deleted file mode 100644
index 627faf07e7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/PerformancePrimitives.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-#include "CpuIA32.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-/*++
-
-Routine Description:
-
- Get timer value.
-
-Arguments:
-
- TimerValue - Pointer to the returned timer value
-
-Returns:
-
- EFI_SUCCESS - Successfully got timer value
-
---*/
-{
- *TimerValue = EfiReadTsc ();
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/Processor.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/Processor.c
deleted file mode 100644
index bba2fd3f2b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/Processor.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Processor.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiJump.h"
-#include EFI_GUID_DEFINITION (PeiFlushInstructionCache)
-#include EFI_GUID_DEFINITION (PeiTransferControl)
-
-//
-// Prototypes
-//
-EFI_STATUS
-EFIAPI
-TransferControlSetJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN VOID *Jump
- );
-
-EFI_STATUS
-EFIAPI
-TransferControlLongJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN VOID *Jump
- );
-
-EFI_STATUS
-EFIAPI
-FlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- );
-
-//
-// Table declarations
-//
-EFI_PEI_TRANSFER_CONTROL_PROTOCOL mTransferControl = {
- TransferControlSetJump,
- TransferControlLongJump,
- sizeof (EFI_JUMP_BUFFER)
-};
-
-EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL mFlushInstructionCache = {
- FlushInstructionCacheFlush
-};
-
-
-EFI_STATUS
-InstallEfiPeiTransferControl (
- IN OUT EFI_PEI_TRANSFER_CONTROL_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the transfer control mechanism
-
-Arguments:
-
- This - Pointer to transfer control mechanism.
-
-Returns:
-
- EFI_SUCCESS - Successfully installed.
-
---*/
-{
- *This = &mTransferControl;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-InstallEfiPeiFlushInstructionCache (
- IN OUT EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the flush instruction cache mechanism
-
-Arguments:
-
- This - Pointer to flush instruction cache mechanism.
-
-Returns:
-
- EFI_SUCCESS - Successfully installed
-
---*/
-{
- *This = &mFlushInstructionCache;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-FlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- This routine would provide support for flushing the CPU instruction cache.
- In the case of IA32, this flushing is not necessary and is thus not implemented.
-
-Arguments:
-
- This - Pointer to CPU Architectural Protocol interface
- Start - Start adddress in memory to flush
- Length - Length of memory to flush
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.Asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.Asm
deleted file mode 100644
index 4a7de021dd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.Asm
+++ /dev/null
@@ -1,223 +0,0 @@
-;
-; Copyright (c) 2004, 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.
-;
-; Module Name:
-;
-; ProcessorAsms.Asm
-;
-; Abstract:
-; This is separated from processor.c to allow this functions to be built with /O1
-;
-; Notes:
-; - Masm uses "This", "ebx", etc as a directive.
-; - H2INC is still not embedded in our build process so I translated the struc manually.
-; - Unreferenced variables/arguments (This, NewBsp, NewStack) were causing compile errors and
-; did not know of "pragma" mechanism in MASM and I did not want to reduce the warning level.
-; Instead, I did a dummy referenced.
-;
-
- .686P
- .MMX
- .MODEL SMALL
- .CODE
-
-EFI_SUCCESS equ 0
-EFI_WARN_RETURN_FROM_LONG_JUMP equ 5
-
-;
-; Generated by h2inc run manually
-;
-_EFI_JUMP_BUFFER STRUCT 2t
-_ebx DWORD ?
-_esi DWORD ?
-_edi DWORD ?
-_ebp DWORD ?
-_esp DWORD ?
-_eip DWORD ?
-_EFI_JUMP_BUFFER ENDS
-
-EFI_JUMP_BUFFER TYPEDEF _EFI_JUMP_BUFFER
-
-TransferControlSetJump PROTO C \
- _This:PTR EFI_PEI_TRANSFER_CONTROL_PROTOCOL, \
- Jump:PTR EFI_JUMP_BUFFER
-
-TransferControlLongJump PROTO C \
- _This:PTR EFI_PEI_TRANSFER_CONTROL_PROTOCOL, \
- Jump:PTR EFI_JUMP_BUFFER
-
-SwitchStacks PROTO C \
- EntryPoint:PTR DWORD, \
- Parameter:DWORD, \
- NewStack:PTR DWORD, \
- NewBsp:PTR DWORD
-
-SwitchIplStacks PROTO C \
- EntryPoint:PTR DWORD, \
- Parameter1:DWORD, \
- Parameter2:DWORD, \
- NewStack:PTR DWORD, \
- NewBsp:PTR DWORD
-
-;
-;Routine Description:
-;
-; This routine implements the IA32 variant of the SetJump call. Its
-; responsibility is to store system state information for a possible
-; subsequent LongJump.
-;
-;Arguments:
-;
-; Pointer to CPU context save buffer.
-;
-;Returns:
-;
-; EFI_SUCCESS
-;
-TransferControlSetJump PROC C \
- _This:PTR EFI_PEI_TRANSFER_CONTROL_PROTOCOL, \
- Jump:PTR EFI_JUMP_BUFFER
-
- mov eax, _This
- mov ecx, Jump
- mov (EFI_JUMP_BUFFER PTR [ecx])._ebx, ebx
- mov (EFI_JUMP_BUFFER PTR [ecx])._esi, esi
- mov (EFI_JUMP_BUFFER PTR [ecx])._edi, edi
- mov eax, [ebp]
- mov (EFI_JUMP_BUFFER PTR [ecx])._ebp, eax
- lea eax, [ebp+4]
- mov (EFI_JUMP_BUFFER PTR [ecx])._esp, eax
- mov eax, [ebp+4]
- mov (EFI_JUMP_BUFFER PTR [ecx])._eip, eax
- mov eax, EFI_SUCCESS
-
- ret
-
-TransferControlSetJump ENDP
-
-;
-; Routine Description:
-;
-; This routine implements the IA32 variant of the LongJump call. Its
-; responsibility is restore the system state to the Context Buffer and
-; pass control back.
-;
-; Arguments:
-;
-; Pointer to CPU context save buffer.
-;
-; Returns:
-;
-; EFI_WARN_RETURN_FROM_LONG_JUMP
-;
-
-TransferControlLongJump PROC C \
- _This:PTR EFI_PEI_TRANSFER_CONTROL_PROTOCOL, \
- Jump:PTR EFI_JUMP_BUFFER
-
- push ebx
- push esi
- push edi
-
- mov eax, _This
- ; set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
- mov eax, EFI_WARN_RETURN_FROM_LONG_JUMP
- mov ecx, Jump
- mov ebx, (EFI_JUMP_BUFFER PTR [ecx])._ebx
- mov esi, (EFI_JUMP_BUFFER PTR [ecx])._esi
- mov edi, (EFI_JUMP_BUFFER PTR [ecx])._edi
- mov ebp, (EFI_JUMP_BUFFER PTR [ecx])._ebp
- mov esp, (EFI_JUMP_BUFFER PTR [ecx])._esp
- add esp, 4 ;pop the eip
- jmp DWORD PTR (EFI_JUMP_BUFFER PTR [ecx])._eip
- mov eax, EFI_WARN_RETURN_FROM_LONG_JUMP
-
- pop edi
- pop esi
- pop ebx
- ret
-
-TransferControlLongJump ENDP
-
-;
-; Routine Description:
-; This allows the caller to switch the stack and goes to the new entry point
-;
-; Arguments:
-; EntryPoint - Pointer to the location to enter
-; Parameter - Parameter to pass in
-; NewStack - New Location of the stack
-; NewBsp - New BSP
-;
-; Returns:
-;
-; Nothing. Goes to the Entry Point passing in the new parameters
-;
-SwitchStacks PROC C \
- EntryPoint:PTR DWORD, \
- Parameter:DWORD, \
- NewStack:PTR DWORD, \
- NewBsp:PTR DWORD
-
- push ebx
- mov eax, NewBsp
- mov ebx, Parameter
- mov ecx, EntryPoint
- mov eax, NewStack
- mov esp, eax
- push ebx
- push 0
- jmp ecx
-
- pop ebx
- ret
-
-SwitchStacks ENDP
-
-;
-; Routine Description:
-; This allows the caller to switch the stack and goes to the new entry point
-;
-; Arguments:
-; EntryPoint - Pointer to the location to enter
-; Parameter1/Parameter2 - Parameter to pass in
-; NewStack - New Location of the stack
-; NewBsp - New BSP
-;
-; Returns:
-;
-; Nothing. Goes to the Entry Point passing in the new parameters
-;
-SwitchIplStacks PROC C \
- EntryPoint:PTR DWORD, \
- Parameter1:DWORD, \
- Parameter2:DWORD, \
- NewStack:PTR DWORD, \
- NewBsp:PTR DWORD
-
- push ebx
- mov eax, NewBsp
- mov ebx, Parameter1
- mov edx, Parameter2
- mov ecx, EntryPoint
- mov eax, NewStack
- mov esp, eax
-
- push edx
- push ebx
- call ecx
-
- pop ebx
- ret
-
-SwitchIplStacks ENDP
-
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S
deleted file mode 100644
index 9d0aef34db..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ProcessorAsms.S
+++ /dev/null
@@ -1,207 +0,0 @@
-#
-# Copyright (c) 2004, 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.
-#
-# Module Name:
-#
-# ProcessorAsms.Asm
-#
-#
-#
-#include "EfiBind.h"
-#------------------------------------------------------------------------------
-
- .686P:
- .MMX:
- #.MODEL SMALL
- .CODE:
-#------------------------------------------------------------------------------
-
-.globl ASM_PFX(TransferControlSetJump)
-.globl ASM_PFX(TransferControlLongJump)
-.globl ASM_PFX(SwitchStacks)
-.globl ASM_PFX(SwitchIplStacks)
-
-#define EFI_SUCCESS 0
-#define EFI_WARN_RETURN_FROM_LONG_JUMP 5
-
-#
-# typedef struct {
-# UINT32 ebx;
-# UINT32 esi;
-# UINT32 edi;
-# UINT32 ebp;
-# UINT32 esp;
-# UINT32 eip;
-#} EFI_JUMP_BUFFER;
-#
-
-#typedef
-#EFI_STATUS
-#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_SET_JUMP) (
-# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
-# OUT EFI_JUMP_BUFFER *Context
-# );
-#
-#Routine Description:
-#
-# This routine implements the IA32 variant of the SetJump call. Its
-# responsibility is to store system state information for a possible
-# subsequent LongJump.
-#
-#Arguments:
-#
-# Pointer to CPU context save buffer.
-#
-#Returns:
-#
-# EFI_SUCCESS
-#
-ASM_PFX(TransferControlSetJump):
- push %ebp
- mov %esp,%ebp
- mov 0x8(%ebp),%eax
- mov 0xc(%ebp),%ecx
- mov %ebx,(%ecx)
- mov %esi,0x4(%ecx)
- mov %edi,0x8(%ecx)
- mov 0x0(%ebp),%eax
- mov %eax,0xc(%ecx)
- lea 0x4(%ebp),%eax
- mov %eax,0x10(%ecx)
- mov 0x4(%ebp),%eax
- mov %eax,0x14(%ecx)
- mov $0x0,%eax
- leave
- ret
-
-#typedef
-#EFI_STATUS
-#(EFIAPI *EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) (
-# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
-# IN EFI_JUMP_BUFFER *Context
-# );
-#
-# Routine Description:
-#
-# This routine implements the IA32 variant of the LongJump call. Its
-# responsibility is restore the system state to the Context Buffer and
-# pass control back.
-#
-# Arguments:
-#
-# Pointer to CPU context save buffer.
-#
-# Returns:
-#
-# EFI_WARN_RETURN_FROM_LONG_JUMP
-#
-
-ASM_PFX(TransferControlLongJump):
- push %ebp
- mov %esp,%ebp
- push %ebx
- push %esi
- push %edi
- mov 0x8(%ebp),%eax
- mov $0x5,%eax
- mov 0xc(%ebp),%ecx
- mov (%ecx),%ebx
- mov 0x4(%ecx),%esi
- mov 0x8(%ecx),%edi
- mov 0xc(%ecx),%ebp
- mov 0x10(%ecx),%esp
- add $0x4,%esp
- jmp *0x14(%ecx)
- mov $0x5,%eax
- pop %edi
- pop %esi
- pop %ebx
- leave
- ret
-
-#
-# Routine Description:
-# This allows the caller to switch the stack and goes to the new entry point
-#
-# Arguments:
-# EntryPoint - Pointer to the location to enter
-# Parameter - Parameter to pass in
-# NewStack - New Location of the stack
-# NewBsp - New BSP
-#
-# Returns:
-#
-# Nothing. Goes to the Entry Point passing in the new parameters
-#
-#SwitchStacks PROC C \
-# EntryPoint:PTR DWORD, \
-# Parameter:DWORD, \
-# NewStack:PTR DWORD, \
-# NewBsp:PTR DWORD
-ASM_PFX(SwitchStacks):
- push %ebp
- mov %esp,%ebp
- push %ebx
- mov 0x14(%ebp),%eax
- mov 0xc(%ebp),%ebx
- mov 0x8(%ebp),%ecx
- mov 0x10(%ebp),%eax
- mov %eax,%esp
- push %ebx
- push $0x0
- jmp *%ecx
- pop %ebx
- leave
- ret
-
-
-
-
-#
-# Routine Description:
-# This allows the caller to switch the stack and goes to the new entry point
-#
-# Arguments:
-# EntryPoint - Pointer to the location to enter
-# Parameter1/Parameter2 - Parameter to pass in
-# NewStack - New Location of the stack
-# NewBsp - New BSP
-#
-# Returns:
-#
-# Nothing. Goes to the Entry Point passing in the new parameters
-#
-#SwitchIplStacks PROC C \
-# EntryPoint:PTR DWORD, \
-# Parameter1:DWORD, \
-# Parameter2:DWORD, \
-# NewStack:PTR DWORD, \
-# NewBsp:PTR DWORD
-ASM_PFX(SwitchIplStacks):
- push %ebp
- mov %esp,%ebp
- push %ebx
- mov 0x18(%ebp),%eax
- mov 0xc(%ebp),%ebx
- mov 0x10(%ebp),%edx
- mov 0x8(%ebp),%ecx
- mov 0x14(%ebp),%eax
- mov %eax,%esp
- push %edx
- push %ebx
- call *%ecx
- pop %ebx
- leave
- ret
-
-#SwitchIplStacks ENDP
-
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S
deleted file mode 100644
index 70db236e9b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.S
+++ /dev/null
@@ -1,69 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# ReadIdtBase.Asm
-#
-# Abstract:
-#
-# ReadIdtBase function
-#
-# Notes:
-#
-#include "EfiBind.h"
-#------------------------------------------------------------------------------
-
- .586:
- #.MODEL flat,C
- .code:
-
-.globl ASM_PFX(ReadIdtBasea)
-.globl ASM_PFX(ReadIdtLimita)
-
-#------------------------------------------------------------------------------
-# UINTN
-# ReadIdtBase (
-# void
-# )
-#
-# Abstract: Returns physical address of IDTR
-#
-ASM_PFX(ReadIdtBasea):
- push %ebp
- mov %esp,%ebp
- add $0xfffffff8,%esp
- sidtl 0xfffffffa(%ebp)
- mov 0xfffffffc(%ebp),%eax
- leave
- ret
-
-
-
-#------------------------------------------------------------------------------
-# UINT16
-# ReadIdtLimit (
-# void
-# )
-#
-# Abstract: Returns Limit of IDTR
-#
-ASM_PFX(ReadIdtLimita):
- push %ebp
- mov %esp,%ebp
- add $0xfffffff8,%esp
- sidtl 0xfffffffa(%ebp)
- mov 0xfffffffa(%ebp),%ax
- leave
- ret
-
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.asm
deleted file mode 100644
index e63a78228e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/ReadIdt.asm
+++ /dev/null
@@ -1,60 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; ReadIdtBase.Asm
-;
-; Abstract:
-;
-; ReadIdtBase function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; UINTN
-; ReadIdtBase (
-; void
-; )
-;
-; Abstract: Returns physical address of IDTR
-;
-ReadIdtBase PROC C PUBLIC
- LOCAL IdtrBuf:FWORD
- sidt IdtrBuf
- mov eax, DWORD PTR IdtrBuf + 2
- ret
-ReadIdtBase ENDP
-
-;------------------------------------------------------------------------------
-; UINT16
-; ReadIdtLimit (
-; void
-; )
-;
-; Abstract: Returns Limit of IDTR
-;
-ReadIdtLimit PROC C PUBLIC
- LOCAL IdtrBuf:FWORD
- sidt IdtrBuf
- mov ax, WORD PTR IdtrBuf
- ret
-ReadIdtLimit ENDP
-
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S
deleted file mode 100644
index 879e7cd29b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.S
+++ /dev/null
@@ -1,71 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SupportItpDebug.asm
-#
-# Abstract:
-#
-# This is the code for debuging IA32, to add a break hook at loading every module
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
-# PROC:PRIVATE
- .686P:
- .MMX:
- #.MODEL SMALL
- .CODE:
-
-#------------------------------------------------------------------------------
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmEfiSetBreakSupport)
-
-# VOID
-# AsmEfiSetBreakSupport (
-# IN UINTN LoadAddr
-# )
-#------------------------------------------------------------------------------
-ASM_PFX(AsmEfiSetBreakSupport):
- push %ebp
- mov %esp, %ebp
- mov 0x8(%ebp),%eax
- movw $60000, %dx
- outl %eax, %dx
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ret
-
-#AsmEfiSetBreakSupport ENDP
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm
deleted file mode 100644
index 0879d327ab..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/SupportItpDebug.asm
+++ /dev/null
@@ -1,69 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SupportItpDebug.asm
-;
-; Abstract:
-;
-; This is the code for debuging IA32, to add a break hook at loading every module
-;
-;------------------------------------------------------------------------------
-
-; PROC:PRIVATE
- .686P
- .MMX
- .MODEL SMALL
- .CODE
-
-AsmEfiSetBreakSupport PROTO C LoadAddr:DWORD
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmEfiSetBreakSupport (
-; IN UINTN LoadAddr
-; )
-;------------------------------------------------------------------------------
-
-AsmEfiSetBreakSupport PROC C LoadAddr:DWORD
-
- mov eax, LoadAddr
- mov dx, 60000
- out dx, eax
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ret
-
-AsmEfiSetBreakSupport ENDP
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S
deleted file mode 100644
index 29f0f14e70..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.S
+++ /dev/null
@@ -1,50 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# WriteIdt.Asm
-#
-# Abstract:
-#
-# SetIdtBase function
-#
-# Notes:
-#
-#include "EfiBind.h"
-#------------------------------------------------------------------------------
-
- .586:
- #.MODEL flat,C
- .code:
-#------------------------------------------------------------------------------
-
-.globl ASM_PFX(SetIdtBase)
-
-# void
-# SetIdtBase (
-# UINT32 IdtBase,
-# UINT16 IdtLimit
-# )
-#
-# Abstract: Set IDTR with the given physical address
-#
-ASM_PFX(SetIdtBase):
- push %ebp
- mov %esp,%ebp
- add $0xfffffff8,%esp
- mov 0x8(%ebp),%eax
- mov 0xc(%ebp),%cx
- mov %eax,0xfffffffc(%ebp)
- mov %cx,0xfffffffa(%ebp)
- lidtl 0xfffffffa(%ebp)
- leave
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.asm
deleted file mode 100644
index c51d1912f4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ia32/WriteIdt.asm
+++ /dev/null
@@ -1,49 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; WriteIdt.Asm
-;
-; Abstract:
-;
-; SetIdtBase function
-;
-; Notes:
-;
-;------------------------------------------------------------------------------
-
- .586p
- .model flat,C
- .mmx
- .code
-
-;------------------------------------------------------------------------------
-; void
-; SetIdtBase (
-; UINT32 IdtBase,
-; UINT16 IdtLimit
-; )
-;
-; Abstract: Set IDTR with the given physical address
-;
-SetIdtBase PROC C PUBLIC IdtBase:DWORD, IdtLimit:WORD
- LOCAL IdtrBuf:FWORD
-
- mov eax, IdtBase
- mov cx, IdtLimit
- mov DWORD PTR IdtrBuf + 2, eax ; write IDT base address
- mov WORD PTR IdtrBuf, cx ; write ITD limit
- lidt FWORD PTR IdtrBuf
- ret
-SetIdtBase ENDP
-
- END \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Asm.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Asm.h
deleted file mode 100644
index f6171ad204..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Asm.h
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-//
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// asm.h
-//
-// Abstract:
-//
-// This module contains generic macros for an assembly writer.
-//
-//
-// Revision History
-//
-#ifndef _ASM_H
-#define _ASM_H
-
-#define TRUE 1
-#define FALSE 0
-#define PROCEDURE_ENTRY(name) .##text; \
- .##type name, @function; \
- .##proc name; \
- name::
-
-#define PROCEDURE_EXIT(name) .##endp name
-
-#endif // _ASM_H
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/AsmCpuMisc.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/AsmCpuMisc.s
deleted file mode 100644
index 81837472bf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/AsmCpuMisc.s
+++ /dev/null
@@ -1,44 +0,0 @@
-/// @file
-/// Contains an implementation of EcpEfiBreakPoint and EcpMemoryFence on Itanium-based
-/// architecture.
-///
-/// 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.
-///
-/// Module Name: AsmCpuMisc.s
-///
-///
-
-
-.text
-.proc EcpEfiBreakPoint
-.type EcpEfiBreakPoint, @function
-
-EcpEfiBreakPoint::
- break.i 0;;
- br.ret.dpnt b0;;
-
-.endp EcpEfiBreakPoint
-
-.proc EcpMemoryFence
-.type EcpMemoryFence, @function
-
-EcpMemoryFence::
- mf;; // memory access ordering
-
- // do we need the mf.a also here?
- mf.a // wait for any IO to complete?
-
- // not sure if we need serialization here, just put it, in case...
-
- srlz.d;;
- srlz.i;;
-
- br.ret.dpnt b0;;
-.endp EcpMemoryFence \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/EfiJump.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/EfiJump.h
deleted file mode 100644
index ab70a332dd..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/EfiJump.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- EfiJump.h
-
-Abstract:
-
- This is the Setjump/Longjump pair for an IA32 processor.
-
---*/
-
-#ifndef _EFI_JUMP_H_
-#define _EFI_JUMP_H_
-
-#include EFI_GUID_DEFINITION (PeiTransferControl)
-
-//
-// NOTE:Set/LongJump needs to have this buffer start
-// at 16 byte boundary. Either fix the structure
-// which call this buffer or fix inside SetJump/LongJump
-// Choosing 1K buffer storage for now
-//
-typedef struct {
- CHAR8 Buffer[1024];
-} EFI_JUMP_BUFFER;
-
-EFI_STATUS
-SetJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN EFI_JUMP_BUFFER *Jump
- )
-/*++
-
-Routine Description:
-
- SetJump stores the current register set in the area pointed to
-by "save". It returns zero. Subsequent calls to "LongJump" will
-restore the registers and return non-zero to the same location.
- On entry, r32 contains the pointer to the jmp_buffer
-
-Arguments:
-
- This - Calling context
- Jump - Jump buffer
-
-Returns:
-
- Status code
-
---*/
-;
-
-EFI_STATUS
-LongJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN EFI_JUMP_BUFFER *Jump
- )
-/*++
-
-Routine Description:
-
- LongJump initializes the register set to the values saved by a
-previous 'SetJump' and jumps to the return location saved by that
-'SetJump'. This has the effect of unwinding the stack and returning
-for a second time to the 'SetJump'.
-
-Arguments:
-
- This - Calling context
- Jump - Jump buffer
-
-Returns:
-
- Status code
-
---*/
-;
-
-VOID
-RtPioICacheFlush (
- IN VOID *StartAddress,
- IN UINTN SizeInBytes
- )
-/*++
-
-Routine Description:
-
- Flushing the CPU instruction cache.
-
-Arguments:
-
- StartAddress - Start address to flush
- SizeInBytes - Length in bytes to flush
-
-Returns:
-
- None
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/HwAccess.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/HwAccess.s
deleted file mode 100644
index bdaad969f8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/HwAccess.s
+++ /dev/null
@@ -1,77 +0,0 @@
-//++
-// 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.
-//
-// Module Name:
-//
-// HWAccess.s
-//
-// Abstract:
-//
-// Contains an implementation of Read/Write Kr7 for the Itanium-based architecture.
-//
-//
-//
-// Revision History:
-//
-//--
-
- .file "HWAccess.s"
-#include "IpfMacro.i"
-
-
-//----------------------------------------------------------------------------------
-//++
-//VOID
-//AsmWriteKr7 (
-// UINT64
-// );
-//
-// This routine saves the given input value into the kernel register 7
-//
-// Arguments :
-//
-// On Entry : 64 bit value to be saved.
-//
-// Return Value: None
-//
-//--
-//----------------------------------------------------------------------------------
-PROCEDURE_ENTRY (AsmWriteKr7)
- NESTED_SETUP (1,2,0,0)
- mov ar.k7 = in0;;
- NESTED_RETURN
-
-PROCEDURE_EXIT (AsmWriteKr7)
-
-//---------------------------------------------------------------------------------
-//++
-//UINT64
-//AsmReadKr7 (
-// VOID
-// );
-//
-// This routine returns the value of the kernel register 7
-//
-// Arguments :
-//
-// On Entry : None
-//
-// Return Value: 64bit Value of the register.
-//
-//--
-//----------------------------------------------------------------------------------
-PROCEDURE_ENTRY (AsmReadKr7)
- NESTED_SETUP (0,2,0,0)
- mov r8 = ar.k7;;
- NESTED_RETURN
-PROCEDURE_EXIT (AsmReadKr7)
-//----------------------------------------------------------------------------------
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Ia_64Gen.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Ia_64Gen.h
deleted file mode 100644
index 04f18cbaa2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Ia_64Gen.h
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-//
-//
-// Copyright (c) 2004, 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.
-//
-//Module Name: ia_64gen.h
-//
-//
-//Abstract:
-//
-//
-//
-//
-//Revision History
-//
-//
-#ifndef _IA64GEN_H
-#define _IA64GEN_H
-
-#define TT_UNAT 0
-#define C_PSR 0
-#define J_UNAT 0
-#define T_TYPE 0
-#define T_IPSR 0x8
-#define T_ISR 0x10
-#define T_IIP 0x18
-#define T_IFA 0x20
-#define T_IIPA 0x28
-#define T_IFS 0x30
-#define T_IIM 0x38
-#define T_RSC 0x40
-#define T_BSP 0x48
-#define T_BSPSTORE 0x50
-#define T_RNAT 0x58
-#define T_PFS 0x60
-#define T_KBSPSTORE 0x68
-#define T_UNAT 0x70
-#define T_CCV 0x78
-#define T_DCR 0x80
-#define T_PREDS 0x88
-#define T_NATS 0x90
-#define T_R1 0x98
-#define T_GP 0x98
-#define T_R2 0xa0
-#define T_R3 0xa8
-#define T_R4 0xb0
-#define T_R5 0xb8
-#define T_R6 0xc0
-#define T_R7 0xc8
-#define T_R8 0xd0
-#define T_R9 0xd8
-#define T_R10 0xe0
-#define T_R11 0xe8
-#define T_R12 0xf0
-#define T_SP 0xf0
-#define T_R13 0xf8
-#define T_R14 0x100
-#define T_R15 0x108
-#define T_R16 0x110
-#define T_R17 0x118
-#define T_R18 0x120
-#define T_R19 0x128
-#define T_R20 0x130
-#define T_R21 0x138
-#define T_R22 0x140
-#define T_R23 0x148
-#define T_R24 0x150
-#define T_R25 0x158
-#define T_R26 0x160
-#define T_R27 0x168
-#define T_R28 0x170
-#define T_R29 0x178
-#define T_R30 0x180
-#define T_R31 0x188
-#define T_F2 0x1f0
-#define T_F3 0x200
-#define T_F4 0x210
-#define T_F5 0x220
-#define T_F6 0x230
-#define T_F7 0x240
-#define T_F8 0x250
-#define T_F9 0x260
-#define T_F10 0x270
-#define T_F11 0x280
-#define T_F12 0x290
-#define T_F13 0x2a0
-#define T_F14 0x2b0
-#define T_F15 0x2c0
-#define T_F16 0x2d0
-#define T_F17 0x2e0
-#define T_F18 0x2f0
-#define T_F19 0x300
-#define T_F20 0x310
-#define T_F21 0x320
-#define T_F22 0x330
-#define T_F23 0x340
-#define T_F24 0x350
-#define T_F25 0x360
-#define T_F26 0x370
-#define T_F27 0x380
-#define T_F28 0x390
-#define T_F29 0x3a0
-#define T_F30 0x3b0
-#define T_F31 0x3c0
-#define T_FPSR 0x1e0
-#define T_B0 0x190
-#define T_B1 0x198
-#define T_B2 0x1a0
-#define T_B3 0x1a8
-#define T_B4 0x1b0
-#define T_B5 0x1b8
-#define T_B6 0x1c0
-#define T_B7 0x1c8
-#define T_EC 0x1d0
-#define T_LC 0x1d8
-#define J_NATS 0x8
-#define J_PFS 0x10
-#define J_BSP 0x18
-#define J_RNAT 0x20
-#define J_PREDS 0x28
-#define J_LC 0x30
-#define J_R4 0x38
-#define J_R5 0x40
-#define J_R6 0x48
-#define J_R7 0x50
-#define J_SP 0x58
-#define J_F2 0x60
-#define J_F3 0x70
-#define J_F4 0x80
-#define J_F5 0x90
-#define J_F16 0xa0
-#define J_F17 0xb0
-#define J_F18 0xc0
-#define J_F19 0xd0
-#define J_F20 0xe0
-#define J_F21 0xf0
-#define J_F22 0x100
-#define J_F23 0x110
-#define J_F24 0x120
-#define J_F25 0x130
-#define J_F26 0x140
-#define J_F27 0x150
-#define J_F28 0x160
-#define J_F29 0x170
-#define J_F30 0x180
-#define J_F31 0x190
-#define J_FPSR 0x1a0
-#define J_B0 0x1a8
-#define J_B1 0x1b0
-#define J_B2 0x1b8
-#define J_B3 0x1c0
-#define J_B4 0x1c8
-#define J_B5 0x1d0
-#define TRAP_FRAME_LENGTH 0x3d0
-#define C_UNAT 0x28
-#define C_NATS 0x30
-#define C_PFS 0x8
-#define C_BSPSTORE 0x10
-#define C_RNAT 0x18
-#define C_RSC 0x20
-#define C_PREDS 0x38
-#define C_LC 0x40
-#define C_DCR 0x48
-#define C_R1 0x50
-#define C_GP 0x50
-#define C_R4 0x58
-#define C_R5 0x60
-#define C_R6 0x68
-#define C_R7 0x70
-#define C_SP 0x78
-#define C_R13 0x80
-#define C_F2 0x90
-#define C_F3 0xa0
-#define C_F4 0xb0
-#define C_F5 0xc0
-#define C_F16 0xd0
-#define C_F17 0xe0
-#define C_F18 0xf0
-#define C_F19 0x100
-#define C_F20 0x110
-#define C_F21 0x120
-#define C_F22 0x130
-#define C_F23 0x140
-#define C_F24 0x150
-#define C_F25 0x160
-#define C_F26 0x170
-#define C_F27 0x180
-#define C_F28 0x190
-#define C_F29 0x1a0
-#define C_F30 0x1b0
-#define C_F31 0x1c0
-#define C_FPSR 0x1d0
-#define C_B0 0x1d8
-#define C_B1 0x1e0
-#define C_B2 0x1e8
-#define C_B3 0x1f0
-#define C_B4 0x1f8
-#define C_B5 0x200
-#define TT_R2 0x8
-#define TT_R3 0x10
-#define TT_R8 0x18
-#define TT_R9 0x20
-#define TT_R10 0x28
-#define TT_R11 0x30
-#define TT_R14 0x38
-
-#endif _IA64GEN_H
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Math.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Math.c
deleted file mode 100644
index 7c2af543d7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Math.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- math.c
-
-Abstract:
-
- 64-bit Math worker functions for Intel Itanium(TM) processors.
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and
- returns the shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-{
- return Operand << Count;
-}
-
-UINT64
-RShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be right shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
- Count - Number of times to shift right.
-
-Returns:
-
- Value shifted right identified by the Count.
-
---*/
-{
- return Operand >> Count;
-}
-
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit
- value returns 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand - multiplicand
- Multiplier - multiplier
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-{
- return Multiplicand * Multiplier;
-}
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
- N.B. only works for 31bit divisors!!
-
-Arguments:
-
- Dividend - dividend
- Divisor - divisor
- Remainder - buffer for remainder
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
---*/
-{
- if (Remainder) {
- *Remainder = Dividend % Divisor;
- }
-
- return Dividend / Divisor;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.c
deleted file mode 100644
index d89379d727..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- Fixes Intel Itanium(TM) specific relocation types
-
-
-Revision History
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiImage.h"
-
-#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) \
- Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos)
-
-#define INS_IMM64(Value, Address, Size, InstPos, ValPos) \
- *(UINT32*)Address = (*(UINT32*)Address & ~(((1 << Size) - 1) << InstPos)) | \
- ((UINT32)((((UINT64)Value >> ValPos) & (((UINT64)1 << Size) - 1))) << InstPos)
-
-#define IMM64_IMM7B_INST_WORD_X 3
-#define IMM64_IMM7B_SIZE_X 7
-#define IMM64_IMM7B_INST_WORD_POS_X 4
-#define IMM64_IMM7B_VAL_POS_X 0
-
-#define IMM64_IMM9D_INST_WORD_X 3
-#define IMM64_IMM9D_SIZE_X 9
-#define IMM64_IMM9D_INST_WORD_POS_X 18
-#define IMM64_IMM9D_VAL_POS_X 7
-
-#define IMM64_IMM5C_INST_WORD_X 3
-#define IMM64_IMM5C_SIZE_X 5
-#define IMM64_IMM5C_INST_WORD_POS_X 13
-#define IMM64_IMM5C_VAL_POS_X 16
-
-#define IMM64_IC_INST_WORD_X 3
-#define IMM64_IC_SIZE_X 1
-#define IMM64_IC_INST_WORD_POS_X 12
-#define IMM64_IC_VAL_POS_X 21
-
-#define IMM64_IMM41a_INST_WORD_X 1
-#define IMM64_IMM41a_SIZE_X 10
-#define IMM64_IMM41a_INST_WORD_POS_X 14
-#define IMM64_IMM41a_VAL_POS_X 22
-
-#define IMM64_IMM41b_INST_WORD_X 1
-#define IMM64_IMM41b_SIZE_X 8
-#define IMM64_IMM41b_INST_WORD_POS_X 24
-#define IMM64_IMM41b_VAL_POS_X 32
-
-#define IMM64_IMM41c_INST_WORD_X 2
-#define IMM64_IMM41c_SIZE_X 23
-#define IMM64_IMM41c_INST_WORD_POS_X 0
-#define IMM64_IMM41c_VAL_POS_X 40
-
-#define IMM64_SIGN_INST_WORD_X 3
-#define IMM64_SIGN_SIZE_X 1
-#define IMM64_SIGN_INST_WORD_POS_X 27
-#define IMM64_SIGN_VAL_POS_X 63
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an Itanium-based specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- Status code
-
---*/
-{
- UINT64 *F64;
- UINT64 FixupVal;
-
- switch ((*Reloc) >> 12) {
-
- case EFI_IMAGE_REL_BASED_IA64_IMM64:
-
- //
- // Align it to bundle address before fixing up the
- // 64-bit immediate value of the movl instruction.
- //
-
- Fixup = (CHAR8 *)((UINTN) Fixup & (UINTN) ~(15));
- FixupVal = (UINT64)0;
-
- //
- // Extract the lower 32 bits of IMM64 from bundle
- //
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X,
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X,
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X,
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IC_INST_WORD_X,
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- EXT_IMM64(FixupVal,
- (UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X,
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- //
- // Update 64-bit address
- //
- FixupVal += Adjust;
-
- //
- // Insert IMM64 into bundle
- //
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM7B_INST_WORD_X),
- IMM64_IMM7B_SIZE_X,
- IMM64_IMM7B_INST_WORD_POS_X,
- IMM64_IMM7B_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM9D_INST_WORD_X),
- IMM64_IMM9D_SIZE_X,
- IMM64_IMM9D_INST_WORD_POS_X,
- IMM64_IMM9D_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM5C_INST_WORD_X),
- IMM64_IMM5C_SIZE_X,
- IMM64_IMM5C_INST_WORD_POS_X,
- IMM64_IMM5C_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IC_INST_WORD_X),
- IMM64_IC_SIZE_X,
- IMM64_IC_INST_WORD_POS_X,
- IMM64_IC_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41a_INST_WORD_X),
- IMM64_IMM41a_SIZE_X,
- IMM64_IMM41a_INST_WORD_POS_X,
- IMM64_IMM41a_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41b_INST_WORD_X),
- IMM64_IMM41b_SIZE_X,
- IMM64_IMM41b_INST_WORD_POS_X,
- IMM64_IMM41b_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_IMM41c_INST_WORD_X),
- IMM64_IMM41c_SIZE_X,
- IMM64_IMM41c_INST_WORD_POS_X,
- IMM64_IMM41c_VAL_POS_X
- );
-
- INS_IMM64(FixupVal,
- ((UINT32 *)Fixup + IMM64_SIGN_INST_WORD_X),
- IMM64_SIGN_SIZE_X,
- IMM64_SIGN_INST_WORD_POS_X,
- IMM64_SIGN_VAL_POS_X
- );
-
- F64 = (UINT64 *) Fixup;
- if (*FixupData != NULL) {
- *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
- *(UINT64 *)(*FixupData) = *F64;
- *FixupData = *FixupData + sizeof(UINT64);
- }
- break;
-
- default:
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IPF, EBC,
- images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA64) || (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.h
deleted file mode 100644
index 017864fc34..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeCoffLoaderEx.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeCoffLoaderEx.h
-
-Abstract:
-
- Fixes Intel Itanium(TM) specific relocation types
-
-
-Revision History
-
---*/
-
-#ifndef _PE_COFF_LOADER_EX_H_
-#define _PE_COFF_LOADER_EX_H_
-
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an Itanium-based specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- Status code
-
---*/
-;
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IPF, EBC,
- images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeiServicePointer.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeiServicePointer.c
deleted file mode 100644
index 203022af3d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PeiServicePointer.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/*++
-
-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.
-
-
-Module Name:
-
- PeiServicePointer.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "PeiApi.h"
-#include "PeiLib.h"
-
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-
-VOID
-SetPeiServicesTablePointer (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Save PeiService pointer so that it can be retrieved anywhere.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
- PhyscialAddress - The physcial address of variable PeiServices.
-
-Returns:
- NONE
-
---*/
-
-{
- //
- // For Itanium Processor Family processors, the EFI_PEI_SERVICES**
- // is stored in kernel register7.
- //
- AsmWriteKr7((UINT64)(UINTN)PeiServices);
-}
-
-
-EFI_PEI_SERVICES **
-GetPeiServicesTablePointer (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get PeiService pointer.
-
-Arguments:
-
- NONE.
-
-Returns:
- The direct pointer to PeiServiceTable.
-
---*/
-
-{
- //
- // For Itanium Processor Family processors, the EFI_PEI_SERVICES**
- // is stored in kernel register7.
- //
- return (EFI_PEI_SERVICES **)(UINTN)AsmReadKr7();
-}
-
-VOID
-MigrateIdtTable (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Migrate IDT from temporary memory to real memory where preceded with 4 bytes for
- storing PeiService pointer.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
-
-Returns:
-
- NONE.
-
---*/
-{
- return;
-}
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PerformancePrimitives.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PerformancePrimitives.s
deleted file mode 100644
index d5b0a1af02..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PerformancePrimitives.s
+++ /dev/null
@@ -1,61 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// PerformancePrimitives.s
-//
-// Abstract:
-//
-//
-// Revision History:
-//
-//--
-
-.file "PerformancePrimitives.s"
-
-#include "IpfMacro.i"
-
-//-----------------------------------------------------------------------------
-//++
-// GetTimerValue
-//
-// Implementation of CPU-based time service
-//
-// On Entry :
-// EFI_STATUS
-// GetTimerValue (
-// OUT UINT64 *TimerValue
-// )
-//
-// Return Value:
-// r8 = Status
-// r9 = 0
-// r10 = 0
-// r11 = 0
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (GetTimerValue)
-
- NESTED_SETUP (1,8,0,0)
- mov r8 = ar.itc;;
- st8 [r32]= r8
- mov r8 = r0
- mov r9 = r0
- mov r10 = r0
- mov r11 = r0
- NESTED_RETURN
-
-PROCEDURE_EXIT (GetTimerValue)
-//---------------------------------------------------------------------------
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PioFlush.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PioFlush.s
deleted file mode 100644
index 2bd5b8ee8d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/PioFlush.s
+++ /dev/null
@@ -1,106 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// pioflush.s
-//
-// Abstract:
-//
-//
-// Revision History:
-//
-//--
-
- .file "pioflush.c"
- .radix C
- .section .text, "ax", "progbits"
- .align 32
- .section .pdata, "a", "progbits"
- .align 4
- .section .xdata, "a", "progbits"
- .align 8
- .section .data, "wa", "progbits"
- .align 16
- .section .rdata, "a", "progbits"
- .align 16
- .section .bss, "wa", "nobits"
- .align 16
- .section .tls$, "was", "progbits"
- .align 16
- .section .sdata, "was", "progbits"
- .align 16
- .section .sbss, "was", "nobits"
- .align 16
- .section .srdata, "as", "progbits"
- .align 16
- .section .rdata, "a", "progbits"
- .align 16
- .section .rtcode, "ax", "progbits"
- .align 32
- .type RtPioICacheFlush# ,@function
- .globl RtPioICacheFlush#
-// Function compile flags: /Ogsy
- .section .rtcode
-
-// Begin code for function: RtPioICacheFlush:
- .proc RtPioICacheFlush#
- .align 32
-RtPioICacheFlush:
-// File e:\tmp\pioflush.c
- { .mii //R-Addr: 0X00
- alloc r3=2, 0, 0, 0 //11, 00000002H
- cmp4.leu p0,p6=32, r33;; //15, 00000020H
- (p6) mov r33=32;; //16, 00000020H
- }
- { .mii //R-Addr: 0X010
- nop.m 0
- zxt4 r29=r33;; //21
- dep.z r30=r29, 0, 5;; //21, 00000005H
- }
- { .mii //R-Addr: 0X020
- cmp4.eq p0,p7=r0, r30 //21
- shr.u r28=r29, 5;; //19, 00000005H
- (p7) adds r28=1, r28;; //22, 00000001H
- }
- { .mii //R-Addr: 0X030
- nop.m 0
- shl r27=r28, 5;; //25, 00000005H
- zxt4 r26=r27;; //25
- }
- { .mfb //R-Addr: 0X040
- add r31=r26, r32 //25
- nop.f 0
- nop.b 0
- }
-$L143:
- { .mii //R-Addr: 0X050
- fc r32 //27
- adds r32=32, r32;; //28, 00000020H
- cmp.ltu p14,p15=r32, r31 //29
- }
- { .mfb //R-Addr: 0X060
- nop.m 0
- nop.f 0
- (p14) br.cond.dptk.few $L143#;; //29, 880000/120000
- }
- { .mmi
- sync.i;;
- srlz.i
- nop.i 0;;
- }
- { .mfb //R-Addr: 0X070
- nop.m 0
- nop.f 0
- br.ret.sptk.few b0;; //31
- }
-// End code for function:
- .endp RtPioICacheFlush#
-// END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Processor.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Processor.c
deleted file mode 100644
index 5546b28676..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/Processor.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Processor.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiJump.h"
-#include "PeiHob.h"
-#include EFI_GUID_DEFINITION (PeiFlushInstructionCache)
-#include EFI_GUID_DEFINITION (PeiTransferControl)
-
-EFI_STATUS
-WinNtFlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- );
-
-EFI_PEI_TRANSFER_CONTROL_PROTOCOL mTransferControl = {
- (EFI_PEI_TRANSFER_CONTROL_SET_JUMP) SetJump,
- (EFI_PEI_TRANSFER_CONTROL_LONG_JUMP) LongJump,
- sizeof (EFI_JUMP_BUFFER)
-};
-
-EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL mFlushInstructionCache = {
- WinNtFlushInstructionCacheFlush
-};
-
-EFI_STATUS
-InstallEfiPeiTransferControl (
- IN OUT EFI_PEI_TRANSFER_CONTROL_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the transfer control mechanism
-
-Arguments:
-
- This - Pointer to transfer control mechanism.
-
-Returns:
-
- EFI_SUCCESS - Successfully installed.
-
---*/
-{
- *This = &mTransferControl;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-InstallEfiPeiFlushInstructionCache (
- IN OUT EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the flush instruction cache mechanism
-
-Arguments:
-
- This - Pointer to flush instruction cache mechanism.
-
-Returns:
-
- EFI_SUCCESS - Successfully installed
-
---*/
-{
- *This = &mFlushInstructionCache;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-WinNtFlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- This routine would provide support for flushing the CPU instruction cache.
-
-Arguments:
-
- This - Pointer to CPU Architectural Protocol interface
- Start - Start adddress in memory to flush
- Length - Length of memory to flush
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-{
- RtPioICacheFlush ((UINT8 *) Start, (UINTN) Length);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SetJmp.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SetJmp.s
deleted file mode 100644
index b63c61f05f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SetJmp.s
+++ /dev/null
@@ -1,325 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// setjmp.s
-//
-// Abstract:
-//
-// Contains an implementation of setjmp and longjmp for the
-// Itanium-based architecture.
-//
-//
-//
-// Revision History:
-//
-//--
-
- .file "setjmp.s"
-
-#include <Asm.h>
-#include <Ia_64Gen.h>
-
-// int SetJump(struct jmp_buffer save)
-//
-// Setup a non-local goto.
-//
-// Description:
-//
-// SetJump stores the current register set in the area pointed to
-// by "save". It returns zero. Subsequent calls to "LongJump" will
-// restore the registers and return non-zero to the same location.
-//
-// On entry, r32 contains the pointer to the jmp_buffer
-//
-
-PROCEDURE_ENTRY(SetJump)
- //
- // Make sure buffer is aligned at 16byte boundary
- //
- mov r32 = r33
-
- add r10 = -0x10,r0 ;; // mask the lower 4 bits
- and r32 = r32, r10;;
- add r32 = 0x10, r32;; // move to next 16 byte boundary
-
- add r10 = J_PREDS, r32 // skip Unats & pfs save area
- add r11 = J_BSP, r32
- //
- // save immediate context
- //
- mov r2 = ar.bsp // save backing store pointer
- mov r3 = pr // save predicates
- ;;
- //
- // save user Unat register
- //
- mov r16 = ar.lc // save loop count register
- mov r14 = ar.unat // save user Unat register
-
- st8 [r10] = r3, J_LC-J_PREDS
- st8 [r11] = r2, J_R4-J_BSP
- ;;
- st8 [r10] = r16, J_R5-J_LC
- st8 [r32] = r14, J_NATS // Note: Unat at the
- // beginning of the save area
- mov r15 = ar.pfs
- ;;
- //
- // save preserved general registers & NaT's
- //
- st8.spill [r11] = r4, J_R6-J_R4
- ;;
- st8.spill [r10] = r5, J_R7-J_R5
- ;;
- st8.spill [r11] = r6, J_SP-J_R6
- ;;
- st8.spill [r10] = r7, J_F3-J_R7
- ;;
- st8.spill [r11] = sp, J_F2-J_SP
- ;;
- //
- // save spilled Unat and pfs registers
- //
- mov r2 = ar.unat // save Unat register after spill
- ;;
- st8 [r32] = r2, J_PFS-J_NATS // save unat for spilled regs
- ;;
- st8 [r32] = r15 // save pfs
- //
- // save floating registers
- //
- stf.spill [r11] = f2, J_F4-J_F2
- stf.spill [r10] = f3, J_F5-J_F3
- ;;
- stf.spill [r11] = f4, J_F16-J_F4
- stf.spill [r10] = f5, J_F17-J_F5
- ;;
- stf.spill [r11] = f16, J_F18-J_F16
- stf.spill [r10] = f17, J_F19-J_F17
- ;;
- stf.spill [r11] = f18, J_F20-J_F18
- stf.spill [r10] = f19, J_F21-J_F19
- ;;
- stf.spill [r11] = f20, J_F22-J_F20
- stf.spill [r10] = f21, J_F23-J_F21
- ;;
- stf.spill [r11] = f22, J_F24-J_F22
- stf.spill [r10] = f23, J_F25-J_F23
- ;;
- stf.spill [r11] = f24, J_F26-J_F24
- stf.spill [r10] = f25, J_F27-J_F25
- ;;
- stf.spill [r11] = f26, J_F28-J_F26
- stf.spill [r10] = f27, J_F29-J_F27
- ;;
- stf.spill [r11] = f28, J_F30-J_F28
- stf.spill [r10] = f29, J_F31-J_F29
- ;;
- stf.spill [r11] = f30, J_FPSR-J_F30
- stf.spill [r10] = f31, J_B0-J_F31 // size of f31 + fpsr
- //
- // save FPSR register & branch registers
- //
- mov r2 = ar.fpsr // save fpsr register
- mov r3 = b0
- ;;
- st8 [r11] = r2, J_B1-J_FPSR
- st8 [r10] = r3, J_B2-J_B0
- mov r2 = b1
- mov r3 = b2
- ;;
- st8 [r11] = r2, J_B3-J_B1
- st8 [r10] = r3, J_B4-J_B2
- mov r2 = b3
- mov r3 = b4
- ;;
- st8 [r11] = r2, J_B5-J_B3
- st8 [r10] = r3
- mov r2 = b5
- ;;
- st8 [r11] = r2
- ;;
- //
- // return
- //
- mov r8 = r0 // return 0 from setjmp
- mov ar.unat = r14 // restore unat
- br.ret.sptk b0
-
-PROCEDURE_EXIT(SetJump)
-
-
-//
-// void LongJump(struct jmp_buffer *)
-//
-// Perform a non-local goto.
-//
-// Description:
-//
-// LongJump initializes the register set to the values saved by a
-// previous 'SetJump' and jumps to the return location saved by that
-// 'SetJump'. This has the effect of unwinding the stack and returning
-// for a second time to the 'SetJump'.
-//
-
-PROCEDURE_ENTRY(LongJump)
- //
- // Make sure buffer is aligned at 16byte boundary
- //
- mov r32 = r33
-
- add r10 = -0x10,r0 ;; // mask the lower 4 bits
- and r32 = r32, r10;;
- add r32 = 0x10, r32;; // move to next 16 byte boundary
-
- //
- // caching the return value as we do invala in the end
- //
-/// mov r8 = r33 // return value
- mov r8 = 1 // For now return hard coded 1
-
- //
- // get immediate context
- //
- mov r14 = ar.rsc // get user RSC conf
- add r10 = J_PFS, r32 // get address of pfs
- add r11 = J_NATS, r32
- ;;
- ld8 r15 = [r10], J_BSP-J_PFS // get pfs
- ld8 r2 = [r11], J_LC-J_NATS // get unat for spilled regs
- ;;
- mov ar.unat = r2
- ;;
- ld8 r16 = [r10], J_PREDS-J_BSP // get backing store pointer
- mov ar.rsc = r0 // put RSE in enforced lazy
- mov ar.pfs = r15
- ;;
-
- //
- // while returning from longjmp the BSPSTORE and BSP needs to be
- // same and discard all the registers allocated after we did
- // setjmp. Also, we need to generate the RNAT register since we
- // did not flushed the RSE on setjmp.
- //
- mov r17 = ar.bspstore // get current BSPSTORE
- ;;
- cmp.ltu p6,p7 = r17, r16 // is it less than BSP of
-(p6) br.spnt.few .flush_rse
- mov r19 = ar.rnat // get current RNAT
- ;;
- loadrs // invalidate dirty regs
- br.sptk.many .restore_rnat // restore RNAT
-
-.flush_rse:
- flushrs
- ;;
- mov r19 = ar.rnat // get current RNAT
- mov r17 = r16 // current BSPSTORE
- ;;
-.restore_rnat:
- //
- // check if RNAT is saved between saved BSP and curr BSPSTORE
- //
- dep r18 = -1,r16,3,6 // get RNAT address
- ;;
- cmp.ltu p8,p9 = r18, r17 // RNAT saved on RSE
- ;;
-(p8) ld8 r19 = [r18] // get RNAT from RSE
- ;;
- mov ar.bspstore = r16 // set new BSPSTORE
- ;;
- mov ar.rnat = r19 // restore RNAT
- mov ar.rsc = r14 // restore RSC conf
-
-
- ld8 r3 = [r11], J_R4-J_LC // get lc register
- ld8 r2 = [r10], J_R5-J_PREDS // get predicates
- ;;
- mov pr = r2, -1
- mov ar.lc = r3
- //
- // restore preserved general registers & NaT's
- //
- ld8.fill r4 = [r11], J_R6-J_R4
- ;;
- ld8.fill r5 = [r10], J_R7-J_R5
- ld8.fill r6 = [r11], J_SP-J_R6
- ;;
- ld8.fill r7 = [r10], J_F2-J_R7
- ld8.fill sp = [r11], J_F3-J_SP
- ;;
- //
- // restore floating registers
- //
- ldf.fill f2 = [r10], J_F4-J_F2
- ldf.fill f3 = [r11], J_F5-J_F3
- ;;
- ldf.fill f4 = [r10], J_F16-J_F4
- ldf.fill f5 = [r11], J_F17-J_F5
- ;;
- ldf.fill f16 = [r10], J_F18-J_F16
- ldf.fill f17 = [r11], J_F19-J_F17
- ;;
- ldf.fill f18 = [r10], J_F20-J_F18
- ldf.fill f19 = [r11], J_F21-J_F19
- ;;
- ldf.fill f20 = [r10], J_F22-J_F20
- ldf.fill f21 = [r11], J_F23-J_F21
- ;;
- ldf.fill f22 = [r10], J_F24-J_F22
- ldf.fill f23 = [r11], J_F25-J_F23
- ;;
- ldf.fill f24 = [r10], J_F26-J_F24
- ldf.fill f25 = [r11], J_F27-J_F25
- ;;
- ldf.fill f26 = [r10], J_F28-J_F26
- ldf.fill f27 = [r11], J_F29-J_F27
- ;;
- ldf.fill f28 = [r10], J_F30-J_F28
- ldf.fill f29 = [r11], J_F31-J_F29
- ;;
- ldf.fill f30 = [r10], J_FPSR-J_F30
- ldf.fill f31 = [r11], J_B0-J_F31 ;;
-
- //
- // restore branch registers and fpsr
- //
- ld8 r16 = [r10], J_B1-J_FPSR // get fpsr
- ld8 r17 = [r11], J_B2-J_B0 // get return pointer
- ;;
- mov ar.fpsr = r16
- mov b0 = r17
- ld8 r2 = [r10], J_B3-J_B1
- ld8 r3 = [r11], J_B4-J_B2
- ;;
- mov b1 = r2
- mov b2 = r3
- ld8 r2 = [r10], J_B5-J_B3
- ld8 r3 = [r11]
- ;;
- mov b3 = r2
- mov b4 = r3
- ld8 r2 = [r10]
- ld8 r21 = [r32] // get user unat
- ;;
- mov b5 = r2
- mov ar.unat = r21
-
- //
- // invalidate ALAT
- //
- invala ;;
-
- br.ret.sptk b0
-PROCEDURE_EXIT(LongJump)
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SwitchStack.s b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SwitchStack.s
deleted file mode 100644
index 439ebdba7d..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Ipf/SwitchStack.s
+++ /dev/null
@@ -1,122 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// SwitchStack.s
-//
-// Abstract:
-//
-// Contains an implementation of a stack switch for the Itanium-based architecture.
-//
-//
-//
-// Revision History:
-//
-//--
-
- .file "SwitchStack.s"
-
-#include <Asm.h>
-#include <Ia_64Gen.h>
-
-// Define hardware RSE Configuration Register
-//
-// RS Configuration (RSC) bit field positions
-
-#define RSC_MODE 0
-#define RSC_PL 2
-#define RSC_BE 4
-// RSC bits 5-15 reserved
-#define RSC_MBZ0 5
-#define RSC_MBZ0_V 0x3ff
-#define RSC_LOADRS 16
-#define RSC_LOADRS_LEN 14
-// RSC bits 30-63 reserved
-#define RSC_MBZ1 30
-#define RSC_MBZ1_V 0x3ffffffffULL
-
-// RSC modes
-// Lazy
-#define RSC_MODE_LY (0x0)
-// Store intensive
-#define RSC_MODE_SI (0x1)
-// Load intensive
-#define RSC_MODE_LI (0x2)
-// Eager
-#define RSC_MODE_EA (0x3)
-
-// RSC Endian bit values
-#define RSC_BE_LITTLE 0
-#define RSC_BE_BIG 1
-
-// RSC while in kernel: enabled, little endian, pl = 0, eager mode
-#define RSC_KERNEL ((RSC_MODE_EA<<RSC_MODE) | (RSC_BE_LITTLE<<RSC_BE))
-// Lazy RSC in kernel: enabled, little endian, pl = 0, lazy mode
-#define RSC_KERNEL_LAZ ((RSC_MODE_LY<<RSC_MODE) | (RSC_BE_LITTLE<<RSC_BE))
-// RSE disabled: disabled, pl = 0, little endian, eager mode
-#define RSC_KERNEL_DISABLED ((RSC_MODE_LY<<RSC_MODE) | (RSC_BE_LITTLE<<RSC_BE))
-
-
-//VOID
-//SwitchStacks (
-// VOID *ContinuationFunction,
-// UINTN Parameter,
-// UINTN NewTopOfStack,
-// UINTN NewBSPStore OPTIONAL
-//)
-///*++
-//
-//Input Arguments
-//
-// ContinuationFunction - This is a pointer to the PLABEL of the function that should be called once the
-// new stack has been created.
-// Parameter - The parameter to pass to the continuation function
-// NewTopOfStack - This is the new top of the memory stack for ensuing code. This is mandatory and
-// should be non-zero
-// NewBSPStore - This is the new BSP store for the ensuing code. It is optional on IA-32 and mandatory on Itanium-based platform.
-//
-//--*/
-
-PROCEDURE_ENTRY(SwitchStacks)
-
- mov r16 = -0x10;;
- and r16 = r34, r16;; // get new stack value in R16, 0 the last nibble.
- mov r15 = r35;; // Get new BspStore into R15
- mov r13 = r32;; // this is a pointer to the PLABEL of the continuation function.
- mov r17 = r33;; // this is the parameter to pass to the continuation function
-
- alloc r11=0,0,0,0 // Set 0-size frame
- ;;
- flushrs;;
-
- mov r21 = RSC_KERNEL_DISABLED // for rse disable
- ;;
- mov ar.rsc = r21 // turn off RSE
-
- add sp = r0, r16;; // transfer to the EFI stack
- mov ar.bspstore = r15 // switch to EFI BSP
- invala // change of ar.bspstore needs invala.
-
- mov r18 = RSC_KERNEL_LAZ // RSC enabled, Lazy mode
- ;;
- mov ar.rsc = r18 // turn rse on, in kernel mode
- ;;
- alloc r11=0,0,1,0;; // alloc 0 outs going to ensuing DXE IPL service
- mov out0 = r17
- ld8 r16 = [r13],8;; // r16 = address of continuation function from the PLABEL
- ld8 gp = [r13] // gp = gp of continuation function from the PLABEL
- mov b6 = r16
- ;;
- br.call.sptk.few b0=b6;; // Call the continuation function
- ;;
-PROCEDURE_EXIT(SwitchStacks)
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
deleted file mode 100644
index 1904902c78..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
+++ /dev/null
@@ -1,1484 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-Module Name:
-
- PeCoffLoader.c
-
-Abstract:
-
- Tiano PE/COFF loader
-
-Revision History
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include "PeCoffLoaderEx.h"
-
-#ifdef EFI_NT_EMULATOR
-#include "peilib.h"
-#include "EfiHobLib.h"
-#include EFI_PPI_DEFINITION (NtLoadAsDll)
-#endif
-
-STATIC
-EFI_STATUS
-PeCoffLoaderGetPeHeader (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- );
-
-STATIC
-VOID*
-PeCoffLoaderImageAddress (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- );
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderGetImageInfo (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderRelocateImage (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderLoadImage (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderUnloadImage (
- IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- );
-
-#if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)
-VOID
-AsmEfiSetBreakSupport (
- IN UINTN LoadAddr
- );
-#endif
-
-EFI_PEI_PE_COFF_LOADER_PROTOCOL mPeCoffLoader = {
- PeCoffLoaderGetImageInfo,
- PeCoffLoaderLoadImage,
- PeCoffLoaderRelocateImage,
- PeCoffLoaderUnloadImage
-};
-
-#ifdef EFI_NT_EMULATOR
-EFI_NT_LOAD_AS_DLL_PPI *mPeCoffLoaderWinNtLoadAsDll = NULL;
-#endif
-
-EFI_STATUS
-InstallEfiPeiPeCoffLoader (
- IN EFI_PEI_SERVICES **PeiServices,
- IN OUT EFI_PEI_PE_COFF_LOADER_PROTOCOL **This,
- IN EFI_PEI_PPI_DESCRIPTOR *ThisPpi
- )
-/*++
-
-Routine Description:
-
- Install PE/COFF loader PPI
-
-Arguments:
-
- PeiServices - General purpose services available to every PEIM
-
- This - Pointer to get Pei PE coff loader protocol as output
-
- ThisPpi - Passed in as EFI_NT_LOAD_AS_DLL_PPI on NT_EMULATOR platform
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
-#ifdef EFI_NT_EMULATOR
- //
- // For use by PEI Core and Modules
- //
- if (NULL != PeiServices) {
- Status = (**PeiServices).LocatePpi (
- PeiServices,
- &gEfiNtLoadAsDllPpiGuid,
- 0,
- NULL,
- &mPeCoffLoaderWinNtLoadAsDll
- );
- } else {
- //
- // Now in SecMain or ERM usage, bind appropriately
- //
- PEI_ASSERT (PeiServices, (NULL != ThisPpi));
-
- mPeCoffLoaderWinNtLoadAsDll = (EFI_NT_LOAD_AS_DLL_PPI *) ThisPpi;
- PEI_ASSERT (PeiServices, (NULL != mPeCoffLoaderWinNtLoadAsDll));
- }
-#endif
-
- if (NULL != This) {
- *This = &mPeCoffLoader;
- }
-
- return Status;
-}
-
-STATIC
-EFI_STATUS
-PeCoffLoaderGetPeHeader (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
- )
-/*++
-
-Routine Description:
-
- Retrieves the PE or TE Header from a PE/COFF or TE image
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
- PeHdr - The buffer in which to return the PE32, PE32+, or TE header
-
-Returns:
-
- EFI_SUCCESS if the PE or TE Header is read,
- Otherwise, the error status from reading the PE/COFF or TE image using the ImageRead function.
-
---*/
-{
- EFI_STATUS Status;
- EFI_IMAGE_DOS_HEADER DosHdr;
- UINTN Size;
- UINT16 Magic;
-
- //
- // Read the DOS image header to check for it's existance
- //
- Size = sizeof (EFI_IMAGE_DOS_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &Size,
- &DosHdr
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- ImageContext->PeCoffHeaderOffset = 0;
- if (DosHdr.e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image
- // header
- //
- ImageContext->PeCoffHeaderOffset = DosHdr.e_lfanew;
- }
-
- //
- // Read the PE/COFF Header. For PE32 (32-bit) this will read in too much
- // data, but that should not hurt anythine. Hdr.Pe32->OptionalHeader.Magic
- // determins if this is a PE32 or PE32+ image. The magic is in the same
- // location in both images.
- //
- Size = sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- ImageContext->PeCoffHeaderOffset,
- &Size,
- Hdr.Pe32
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- //
- // Use Signature to figure out if we understand the image format
- //
- if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
- ImageContext->IsTeImage = TRUE;
- ImageContext->Machine = Hdr.Te->Machine;
- ImageContext->ImageType = (UINT16)(Hdr.Te->Subsystem);
- ImageContext->ImageSize = 0;
- ImageContext->SectionAlignment = 4096;
- ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;
-
- } else if (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE) {
- ImageContext->IsTeImage = FALSE;
- ImageContext->Machine = Hdr.Pe32->FileHeader.Machine;
-
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC ||
- Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- //
- // PE32 and PE32+ have the same offset for these fields.
- // We use PE32 for both PE32 and PE32+ headers here.
- //
- ImageContext->ImageType = Hdr.Pe32->OptionalHeader.Subsystem;
- ImageContext->ImageSize = (UINT64)Hdr.Pe32->OptionalHeader.SizeOfImage;
- ImageContext->SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment;
- ImageContext->SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
-
- } else {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_MACHINE_TYPE;
- return EFI_UNSUPPORTED;
- }
- } else {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_MACHINE_TYPE;
- return EFI_UNSUPPORTED;
- }
-
- if (!PeCoffLoaderImageFormatSupported (ImageContext->Machine)) {
- //
- // If the PE/COFF loader does not support the image type return
- // unsupported. This library can suport lots of types of images
- // this does not mean the user of this library can call the entry
- // point of the image.
- //
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-STATIC
-EFI_STATUS
-PeCoffLoaderCheckImageType (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Checks the PE or TE header of a PE/COFF or TE image to determine if it supported
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
-Returns:
-
- EFI_SUCCESS if the PE/COFF or TE image is supported
- EFI_UNSUPPORTED of the PE/COFF or TE image is not supported.
-
---*/
-{
- switch (ImageContext->ImageType) {
-
- case EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION:
- ImageContext->ImageCodeMemoryType = EfiLoaderCode;
- ImageContext->ImageDataMemoryType = EfiLoaderData;
- break;
-
- case EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:
- ImageContext->ImageCodeMemoryType = EfiBootServicesCode;
- ImageContext->ImageDataMemoryType = EfiBootServicesData;
- break;
-
- case EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:
- case EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER:
- ImageContext->ImageCodeMemoryType = EfiRuntimeServicesCode;
- ImageContext->ImageDataMemoryType = EfiRuntimeServicesData;
- break;
-
- default:
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_SUBSYSTEM;
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderGetImageInfo (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Retrieves information on a PE/COFF image
-
-Arguments:
-
- This - Calling context
-
- ImageContext - The context of the image being loaded
-
-Returns:
-
- EFI_SUCCESS if the information on the PE/COFF image was collected.
- EFI_UNSUPPORTED of the PE/COFF image is not supported.
- Otherwise, the error status from reading the PE/COFF image using the
- ImageContext->ImageRead() function
-
- EFI_INVALID_PARAMETER - ImageContext is NULL.
-
---*/
-{
- EFI_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_UNION HdrData;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *DebugDirectoryEntry;
- UINTN Size;
- UINTN Index;
- UINTN DebugDirectoryEntryRva;
- UINTN DebugDirectoryEntryFileOffset;
- UINTN SectionHeaderOffset;
- EFI_IMAGE_SECTION_HEADER SectionHeader;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY DebugEntry;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-
- if (NULL == ImageContext) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Assume success
- //
- ImageContext->ImageError = EFI_IMAGE_ERROR_SUCCESS;
-
- Hdr.Union = &HdrData;
- Status = PeCoffLoaderGetPeHeader (ImageContext, Hdr);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Verify machine type
- //
- Status = PeCoffLoaderCheckImageType (ImageContext);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
-
- //
- // Retrieve the base address of the image
- //
- if (!(ImageContext->IsTeImage)) {
-
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- ImageContext->ImageAddress = Hdr.Pe32->OptionalHeader.ImageBase;
- } else {
- //
- // Use PE32+ offset
- //
- ImageContext->ImageAddress = Hdr.Pe32Plus->OptionalHeader.ImageBase;
- }
- } else {
- ImageContext->ImageAddress = (EFI_PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));
- }
-
- //
- // Initialize the alternate destination address to 0 indicating that it
- // should not be used.
- //
- ImageContext->DestinationAddress = 0;
-
- //
- // Initialize the codeview pointer.
- //
- ImageContext->CodeView = NULL;
- ImageContext->PdbPointer = NULL;
-
- //
- // Three cases with regards to relocations:
- // - Image has base relocs, RELOCS_STRIPPED==0 => image is relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==1 => Image is not relocatable
- // - Image has no base relocs, RELOCS_STRIPPED==0 => Image is relocatable but
- // has no base relocs to apply
- // Obviously having base relocations with RELOCS_STRIPPED==1 is invalid.
- //
- // Look at the file header to determine if relocations have been stripped, and
- // save this info in the image context for later use.
- //
- if ((!(ImageContext->IsTeImage)) && ((Hdr.Pe32->FileHeader.Characteristics & EFI_IMAGE_FILE_RELOCS_STRIPPED) != 0)) {
- ImageContext->RelocationsStripped = TRUE;
- } else {
- ImageContext->RelocationsStripped = FALSE;
- }
-
- if (!(ImageContext->IsTeImage)) {
- //
- // Use PE32 to access fields that have same offset in PE32 and PE32+
- //
- ImageContext->ImageSize = (UINT64) Hdr.Pe32->OptionalHeader.SizeOfImage;
- ImageContext->SectionAlignment = Hdr.Pe32->OptionalHeader.SectionAlignment;
- ImageContext->SizeOfHeaders = Hdr.Pe32->OptionalHeader.SizeOfHeaders;
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- } else {
- //
- // Use PE32+ offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DebugDirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&(Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
- }
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
-
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
-
- //
- // Determine the file offset of the debug directory... This means we walk
- // the sections to find which section contains the RVA of the debug
- // directory
- //
- DebugDirectoryEntryFileOffset = 0;
-
- SectionHeaderOffset = (UINTN)(
- ImageContext->PeCoffHeaderOffset +
- sizeof (UINT32) +
- sizeof (EFI_IMAGE_FILE_HEADER) +
- Hdr.Pe32->FileHeader.SizeOfOptionalHeader
- );
-
- for (Index = 0; Index < Hdr.Pe32->FileHeader.NumberOfSections; Index++) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
-
- DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva - SectionHeader.VirtualAddress + SectionHeader.PointerToRawData;
- break;
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index++) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset,
- &Size,
- &DebugEntry
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
- if (DebugEntry.RVA == 0 && DebugEntry.FileOffset != 0) {
- ImageContext->ImageSize += DebugEntry.SizeOfData;
- }
-
- return EFI_SUCCESS;
- }
- }
- }
- }
- } else {
- //
- // Because Te image only extracts base relocations and debug directory entries from
- // Pe image and in Te image header there is not a field to describe the imagesize,
- // we use the largest VirtualAddress plus Size in each directory entry to describe the imagesize
- //
- ImageContext->ImageSize = (UINT64) (Hdr.Te->DataDirectory[0].VirtualAddress + Hdr.Te->DataDirectory[0].Size);
- if(Hdr.Te->DataDirectory[1].VirtualAddress > Hdr.Te->DataDirectory[0].VirtualAddress) {
- ImageContext->ImageSize = (UINT64) (Hdr.Te->DataDirectory[1].VirtualAddress + Hdr.Te->DataDirectory[1].Size);
- }
- ImageContext->SectionAlignment = 4096;
- ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN) Hdr.Te->BaseOfCode - (UINTN) Hdr.Te->StrippedSize;
-
- DebugDirectoryEntry = &Hdr.Te->DataDirectory[1];
- DebugDirectoryEntryRva = DebugDirectoryEntry->VirtualAddress;
- SectionHeaderOffset = (UINTN)(sizeof (EFI_TE_IMAGE_HEADER));
-
- DebugDirectoryEntryFileOffset = 0;
-
- for (Index = 0; Index < Hdr.Te->NumberOfSections; Index++) {
- //
- // Read section header from file
- //
- Size = sizeof (EFI_IMAGE_SECTION_HEADER);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- SectionHeaderOffset,
- &Size,
- &SectionHeader
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugDirectoryEntryRva >= SectionHeader.VirtualAddress &&
- DebugDirectoryEntryRva < SectionHeader.VirtualAddress + SectionHeader.Misc.VirtualSize) {
- DebugDirectoryEntryFileOffset = DebugDirectoryEntryRva -
- SectionHeader.VirtualAddress +
- SectionHeader.PointerToRawData +
- sizeof (EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize;
- break;
- }
-
- SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
- }
-
- if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index++) {
- //
- // Read next debug directory entry
- //
- Size = sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY);
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugDirectoryEntryFileOffset,
- &Size,
- &DebugEntry
- );
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
-
- if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
- return EFI_SUCCESS;
- }
- }
- }
- }
-
- return EFI_SUCCESS;
-}
-
-STATIC
-VOID *
-PeCoffLoaderImageAddress (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN UINTN Address
- )
-/*++
-
-Routine Description:
-
- Converts an image address to the loaded address
-
-Arguments:
-
- ImageContext - The context of the image being loaded
-
- Address - The address to be converted to the loaded address
-
-Returns:
-
- NULL if the address can not be converted, otherwise, the converted address
-
---*/
-{
- if (Address >= ImageContext->ImageSize) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return NULL;
- }
-
- return (CHAR8 *) ((UINTN) ImageContext->ImageAddress + Address);
-}
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderRelocateImage (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Relocates a PE/COFF image in memory
-
-Arguments:
-
- This - Calling context
-
- ImageContext - Contains information on the loaded image to relocate
-
-Returns:
-
- EFI_SUCCESS if the PE/COFF image was relocated
- EFI_LOAD_ERROR if the image is not a valid PE/COFF image
- EFI_UNSUPPORTED not support
-
---*/
-{
- EFI_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_IMAGE_DATA_DIRECTORY *RelocDir;
- UINT64 Adjust;
- EFI_IMAGE_BASE_RELOCATION *RelocBase;
- EFI_IMAGE_BASE_RELOCATION *RelocBaseEnd;
- UINT16 *Reloc;
- UINT16 *RelocEnd;
- CHAR8 *Fixup;
- CHAR8 *FixupBase;
- UINT16 *F16;
- UINT32 *F32;
- UINT64 *F64;
- CHAR8 *FixupData;
- EFI_PHYSICAL_ADDRESS BaseAddress;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-#ifdef EFI_NT_EMULATOR
- VOID *DllEntryPoint;
- VOID *ModHandle;
-
- ModHandle = NULL;
-#endif
-
- if (NULL == ImageContext) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Assume success
- //
- ImageContext->ImageError = EFI_IMAGE_ERROR_SUCCESS;
-
- //
- // If there are no relocation entries, then we are done
- //
- if (ImageContext->RelocationsStripped) {
- return EFI_SUCCESS;
- }
-
- //
- // If the destination address is not 0, use that rather than the
- // image address as the relocation target.
- //
- if (ImageContext->DestinationAddress != 0) {
- BaseAddress = ImageContext->DestinationAddress;
- } else {
- BaseAddress = ImageContext->ImageAddress;
- }
-
- if (!(ImageContext->IsTeImage)) {
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset);
-
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- Adjust = (UINT64)BaseAddress - Hdr.Pe32->OptionalHeader.ImageBase;
- Hdr.Pe32->OptionalHeader.ImageBase = (UINT32)BaseAddress;
-
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- RelocDir = &Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- } else {
- //
- // Use PE32+ offset
- //
- Adjust = (UINT64) BaseAddress - Hdr.Pe32Plus->OptionalHeader.ImageBase;
- Hdr.Pe32Plus->OptionalHeader.ImageBase = (UINT64)BaseAddress;
-
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- RelocDir = &Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- }
-
- //
- // Find the relocation block
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC && RelocDir->Size > 0) {
- RelocBase = PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress);
- RelocBaseEnd = PeCoffLoaderImageAddress (
- ImageContext,
- RelocDir->VirtualAddress + RelocDir->Size - 1
- );
- if ((RelocBase == NULL) || (RelocBaseEnd == NULL)) {
- //
- // If the base start or end address resolved to 0, then fail.
- //
- return EFI_LOAD_ERROR;
- }
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = RelocBaseEnd = 0;
- }
- } else {
- Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
- Adjust = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->ImageBase);
- Hdr.Te->ImageBase = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER));
-
- //
- // Find the relocation block
- //
- RelocDir = &Hdr.Te->DataDirectory[0];
- if (RelocDir->Size > 0) {
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *)(UINTN)(
- ImageContext->ImageAddress +
- RelocDir->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *) ((UINTN) RelocBase + (UINTN) RelocDir->Size - 1);
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = NULL;
- RelocBaseEnd = NULL;
- }
- }
-
- //
- // Run the relocation information and apply the fixups
- //
- FixupData = ImageContext->FixupData;
- while (RelocBase < RelocBaseEnd) {
-
- Reloc = (UINT16 *) ((CHAR8 *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
- RelocEnd = (UINT16 *) ((CHAR8 *) RelocBase + RelocBase->SizeOfBlock);
- if (!(ImageContext->IsTeImage)) {
- FixupBase = PeCoffLoaderImageAddress (ImageContext, RelocBase->VirtualAddress);
-
- if (FixupBase == NULL) {
- //
- // If the FixupBase address resolved to 0, then fail.
- //
- return EFI_LOAD_ERROR;
- }
- } else {
- FixupBase = (CHAR8 *)(UINTN)(ImageContext->ImageAddress +
- RelocBase->VirtualAddress +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- }
-
- if ((CHAR8 *) RelocEnd < (CHAR8 *) ((UINTN) ImageContext->ImageAddress) ||
- (CHAR8 *) RelocEnd > (CHAR8 *)((UINTN)ImageContext->ImageAddress +
- (UINTN)ImageContext->ImageSize)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_FAILED_RELOCATION;
- return EFI_LOAD_ERROR;
- }
-
- //
- // Run this relocation record
- //
- while (Reloc < RelocEnd) {
-
- Fixup = FixupBase + (*Reloc & 0xFFF);
- switch ((*Reloc) >> 12) {
- case EFI_IMAGE_REL_BASED_ABSOLUTE:
- break;
-
- case EFI_IMAGE_REL_BASED_HIGH:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + (UINT16)(((UINT32)Adjust) >> 16));
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_LOW:
- F16 = (UINT16 *) Fixup;
- *F16 = (UINT16) (*F16 + (UINT16) Adjust);
- if (FixupData != NULL) {
- *(UINT16 *) FixupData = *F16;
- FixupData = FixupData + sizeof (UINT16);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHLOW:
- F32 = (UINT32 *) Fixup;
- *F32 = *F32 + (UINT32) Adjust;
- if (FixupData != NULL) {
- FixupData = ALIGN_POINTER (FixupData, sizeof (UINT32));
- *(UINT32 *) FixupData = *F32;
- FixupData = FixupData + sizeof (UINT32);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_DIR64:
- //
- // For X64 and IPF
- //
- F64 = (UINT64 *) Fixup;
- *F64 = *F64 + (UINT64) Adjust;
- if (FixupData != NULL) {
- FixupData = ALIGN_POINTER (FixupData, sizeof(UINT64));
- *(UINT64 *)(FixupData) = *F64;
- FixupData = FixupData + sizeof(UINT64);
- }
- break;
-
- case EFI_IMAGE_REL_BASED_HIGHADJ:
- //
- // Return the same EFI_UNSUPPORTED return code as
- // PeCoffLoaderRelocateImageEx() returns if it does not recognize
- // the relocation type.
- //
- ImageContext->ImageError = EFI_IMAGE_ERROR_FAILED_RELOCATION;
- return EFI_UNSUPPORTED;
-
- default:
- //
- // The common code does not handle some of the stranger IPF relocations
- // PeCoffLoaderRelocateImageEx () addes support for these complex fixups
- // on IPF and is a No-Op on other archtiectures.
- //
- Status = PeCoffLoaderRelocateImageEx (Reloc, Fixup, &FixupData, Adjust);
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_FAILED_RELOCATION;
- return Status;
- }
- }
-
- //
- // Next relocation record
- //
- Reloc += 1;
- }
-
- //
- // Next reloc block
- //
- RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;
- }
-
-#ifdef EFI_NT_EMULATOR
- DllEntryPoint = NULL;
- ImageContext->ModHandle = NULL;
- //
- // Load the DLL if it's not an EBC image.
- //
- if ((ImageContext->PdbPointer != NULL) &&
- (ImageContext->Machine != EFI_IMAGE_MACHINE_EBC)) {
- Status = mPeCoffLoaderWinNtLoadAsDll->Entry (
- ImageContext->PdbPointer,
- &DllEntryPoint,
- &ModHandle
- );
-
- if (!EFI_ERROR (Status) && DllEntryPoint != NULL) {
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (UINTN) DllEntryPoint;
- ImageContext->ModHandle = ModHandle;
- }
- }
-#endif
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderLoadImage (
- IN EFI_PEI_PE_COFF_LOADER_PROTOCOL *This,
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Loads a PE/COFF image into memory
-
-Arguments:
-
- This - Calling context
-
- ImageContext - Contains information on image to load into memory
-
-Returns:
-
- EFI_SUCCESS if the PE/COFF image was loaded
- EFI_BUFFER_TOO_SMALL if the caller did not provide a large enough buffer
- EFI_LOAD_ERROR if the image is a runtime driver with no relocations
- EFI_INVALID_PARAMETER if the image address is invalid
-
---*/
-{
- EFI_STATUS Status;
- EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
- EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT CheckContext;
- EFI_IMAGE_SECTION_HEADER *FirstSection;
- EFI_IMAGE_SECTION_HEADER *Section;
- UINTN NumberOfSections;
- UINTN Index;
- CHAR8 *Base;
- CHAR8 *End;
- CHAR8 *MaxEnd;
- EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry;
- EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *DebugEntry;
- UINTN Size;
- UINT32 TempDebugEntryRva;
- UINT32 NumberOfRvaAndSizes;
- UINT16 Magic;
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- EFI_IMAGE_RESOURCE_DIRECTORY *ResourceDirectory;
- EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *ResourceDirectoryEntry;
- EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString;
- EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry;
-#endif
-
- if (NULL == ImageContext) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Assume success
- //
- ImageContext->ImageError = EFI_IMAGE_ERROR_SUCCESS;
-
- //
- // Copy the provided context info into our local version, get what we
- // can from the original image, and then use that to make sure everything
- // is legit.
- //
- CopyMem (&CheckContext, ImageContext, sizeof (EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT));
-
- Status = PeCoffLoaderGetImageInfo (This, &CheckContext);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Make sure there is enough allocated space for the image being loaded
- //
- if (ImageContext->ImageSize < CheckContext.ImageSize) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_IMAGE_SIZE;
- return EFI_BUFFER_TOO_SMALL;
- }
- if (ImageContext->ImageAddress == 0) {
- //
- // Image cannot be loaded into 0 address.
- //
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return EFI_INVALID_PARAMETER;
- }
- //
- // If there's no relocations, then make sure it's not a runtime driver,
- // and that it's being loaded at the linked address.
- //
- if (CheckContext.RelocationsStripped) {
- //
- // If the image does not contain relocations and it is a runtime driver
- // then return an error.
- //
- if (CheckContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_SUBSYSTEM;
- return EFI_LOAD_ERROR;
- }
- //
- // If the image does not contain relocations, and the requested load address
- // is not the linked address, then return an error.
- //
- if (CheckContext.ImageAddress != ImageContext->ImageAddress) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_IMAGE_ADDRESS;
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Make sure the allocated space has the proper section alignment
- //
- if (!(ImageContext->IsTeImage)) {
- if ((ImageContext->ImageAddress & (CheckContext.SectionAlignment - 1)) != 0) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_INVALID_SECTION_ALIGNMENT;
- return EFI_INVALID_PARAMETER;
- }
- }
- //
- // Read the entire PE/COFF or TE header into memory
- //
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (VOID *) (UINTN) ImageContext->ImageAddress
- );
-
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)ImageContext->ImageAddress + ImageContext->PeCoffHeaderOffset);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- ImageContext->PeCoffHeaderOffset +
- sizeof(UINT32) +
- sizeof(EFI_IMAGE_FILE_HEADER) +
- Hdr.Pe32->FileHeader.SizeOfOptionalHeader
- );
- NumberOfSections = (UINTN) (Hdr.Pe32->FileHeader.NumberOfSections);
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- 0,
- &ImageContext->SizeOfHeaders,
- (VOID *)(UINTN)ImageContext->ImageAddress
- );
-
- Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
-
- FirstSection = (EFI_IMAGE_SECTION_HEADER *) (
- (UINTN)ImageContext->ImageAddress +
- sizeof(EFI_TE_IMAGE_HEADER)
- );
- NumberOfSections = (UINTN) (Hdr.Te->NumberOfSections);
-
- }
-
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return EFI_LOAD_ERROR;
- }
-
- //
- // Load each section of the image
- //
- Section = FirstSection;
- for (Index = 0, MaxEnd = NULL; Index < NumberOfSections; Index++) {
-
- //
- // Compute sections address
- //
- Base = PeCoffLoaderImageAddress (ImageContext, Section->VirtualAddress);
- End = PeCoffLoaderImageAddress (
- ImageContext,
- Section->VirtualAddress + Section->Misc.VirtualSize - 1
- );
- if (ImageContext->IsTeImage) {
- Base = (CHAR8 *)((UINTN) Base + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize);
- End = (CHAR8 *)((UINTN) End + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize);
- }
-
- if (End > MaxEnd) {
- MaxEnd = End;
- }
- //
- // If the base start or end address resolved to 0, then fail.
- //
- if ((Base == NULL) || (End == NULL)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_SECTION_NOT_LOADED;
- return EFI_LOAD_ERROR;
- }
-
- //
- // Read the section
- //
- Size = (UINTN) Section->Misc.VirtualSize;
- if ((Size == 0) || (Size > Section->SizeOfRawData)) {
- Size = (UINTN) Section->SizeOfRawData;
- }
-
- if (Section->SizeOfRawData) {
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData,
- &Size,
- Base
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- Section->PointerToRawData + sizeof (EFI_TE_IMAGE_HEADER) - (UINTN)Hdr.Te->StrippedSize,
- &Size,
- Base
- );
- }
-
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return Status;
- }
- }
-
- //
- // If raw size is less then virt size, zero fill the remaining
- //
-
- if (Size < Section->Misc.VirtualSize) {
- ZeroMem (Base + Size, Section->Misc.VirtualSize - Size);
- }
-
- //
- // Next Section
- //
- Section += 1;
- }
-
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
-
- //
- // Get image's entry point
- //
- if (!(ImageContext->IsTeImage)) {
-
- //
- // NOTE: We use Machine to identify PE32/PE32+, instead of Magic.
- // It is for backward-compatibility consideration, because
- // some system will generate PE32+ image with PE32 Magic.
- //
- if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA32) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_IA64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (Hdr.Pe32->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = Hdr.Pe32->OptionalHeader.Magic;
- }
-
- //
- // Sizes of AddressOfEntryPoint are different so we need to do this safely
- //
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)PeCoffLoaderImageAddress (
- ImageContext,
- (UINTN)Hdr.Pe32->OptionalHeader.AddressOfEntryPoint
- );
-
- } else {
- ImageContext->EntryPoint = (EFI_PHYSICAL_ADDRESS) (
- (UINTN)ImageContext->ImageAddress +
- (UINTN)Hdr.Te->AddressOfEntryPoint +
- (UINTN)sizeof(EFI_TE_IMAGE_HEADER) -
- (UINTN)Hdr.Te->StrippedSize
- );
- }
-
- //
- // Determine the size of the fixup data
- //
- // Per the PE/COFF spec, you can't assume that a given data directory
- // is present in the image. You have to check the NumberOfRvaAndSizes in
- // the optional header to verify a desired directory entry is there.
- //
- if (!(ImageContext->IsTeImage)) {
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- } else {
- //
- // Use PE32+ offset
- //
- NumberOfRvaAndSizes = Hdr.Pe32Plus->OptionalHeader.NumberOfRvaAndSizes;
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC];
- }
-
- if (NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC) {
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- } else {
- ImageContext->FixupDataSize = 0;
- }
- } else {
- DirectoryEntry = &Hdr.Te->DataDirectory[0];
- ImageContext->FixupDataSize = DirectoryEntry->Size / sizeof (UINT16) * sizeof (UINTN);
- }
- //
- // Consumer must allocate a buffer for the relocation fixup log.
- // Only used for runtime drivers.
- //
- ImageContext->FixupData = NULL;
-
- //
- // Load the Codeview info if present
- //
- if (ImageContext->DebugDirectoryEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- DebugEntry = PeCoffLoaderImageAddress (
- ImageContext,
- ImageContext->DebugDirectoryEntryRva
- );
- } else {
- DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)(UINTN)(
- ImageContext->ImageAddress +
- ImageContext->DebugDirectoryEntryRva +
- sizeof(EFI_TE_IMAGE_HEADER) -
- Hdr.Te->StrippedSize
- );
- }
-
- if (DebugEntry != NULL) {
- TempDebugEntryRva = DebugEntry->RVA;
- if (DebugEntry->RVA == 0 && DebugEntry->FileOffset != 0) {
- Section--;
- if ((UINTN)Section->SizeOfRawData < Section->Misc.VirtualSize) {
- TempDebugEntryRva = Section->VirtualAddress + Section->Misc.VirtualSize;
- } else {
- TempDebugEntryRva = Section->VirtualAddress + Section->SizeOfRawData;
- }
- }
-
- if (TempDebugEntryRva != 0) {
- if (!(ImageContext->IsTeImage)) {
- ImageContext->CodeView = PeCoffLoaderImageAddress (ImageContext, TempDebugEntryRva);
- } else {
- ImageContext->CodeView = (VOID *)(
- (UINTN)ImageContext->ImageAddress +
- (UINTN)TempDebugEntryRva +
- (UINTN)sizeof (EFI_TE_IMAGE_HEADER) -
- (UINTN) Hdr.Te->StrippedSize
- );
- }
-
- if (ImageContext->CodeView == NULL) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return EFI_LOAD_ERROR;
- }
-
- if (DebugEntry->RVA == 0) {
- Size = DebugEntry->SizeOfData;
- if (!(ImageContext->IsTeImage)) {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset,
- &Size,
- ImageContext->CodeView
- );
- } else {
- Status = ImageContext->ImageRead (
- ImageContext->Handle,
- DebugEntry->FileOffset + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize,
- &Size,
- ImageContext->CodeView
- );
- //
- // Should we apply fix up to this field according to the size difference between PE and TE?
- // Because now we maintain TE header fields unfixed, this field will also remain as they are
- // in original PE image.
- //
- }
-
- if (EFI_ERROR (Status)) {
- ImageContext->ImageError = EFI_IMAGE_ERROR_IMAGE_READ;
- return EFI_LOAD_ERROR;
- }
-
- DebugEntry->RVA = TempDebugEntryRva;
- }
-
- switch (*(UINT32 *) ImageContext->CodeView) {
- case CODEVIEW_SIGNATURE_NB10:
- ImageContext->PdbPointer = (CHAR8 *)ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
- break;
-
- case CODEVIEW_SIGNATURE_RSDS:
- ImageContext->PdbPointer = (CHAR8 *)ImageContext->CodeView + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
- break;
-
- default:
- break;
- }
- }
- }
- }
-
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
- //
- // Get Image's HII resource section
- //
- if (!(ImageContext->IsTeImage)) {
- if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
- //
- // Use PE32 offset
- //
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE];
- } else {
- //
- // Use PE32+ offset
- //
- DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE];
- }
-
- if (DirectoryEntry->Size != 0) {
- Base = PeCoffLoaderImageAddress (ImageContext, DirectoryEntry->VirtualAddress);
-
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) Base;
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
-
- for (Index = 0; Index < ResourceDirectory->NumberOfNamedEntries; Index++) {
- if (ResourceDirectoryEntry->u1.s.NameIsString) {
- ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (Base + ResourceDirectoryEntry->u1.s.NameOffset);
-
- if (ResourceDirectoryString->Length == 3 &&
- ResourceDirectoryString->String[0] == L'H' &&
- ResourceDirectoryString->String[1] == L'I' &&
- ResourceDirectoryString->String[2] == L'I') {
- //
- // Resource Type "HII" found
- //
- if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- //
- // Move to next level - resource Name
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
-
- if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- //
- // Move to next level - resource Language
- //
- ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
- ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
- }
- }
-
- //
- // Now it ought to be resource Data
- //
- if (!ResourceDirectoryEntry->u2.s.DataIsDirectory) {
- ResourceDataEntry = (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (Base + ResourceDirectoryEntry->u2.OffsetToData);
- ImageContext->HiiResourceData = (EFI_PHYSICAL_ADDRESS) (UINTN) PeCoffLoaderImageAddress (ImageContext, ResourceDataEntry->OffsetToData);
- break;
- }
- }
- }
-
- ResourceDirectoryEntry++;
- }
- }
- }
-#endif
-
-#if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)
- AsmEfiSetBreakSupport ((UINTN)(ImageContext->ImageAddress));
-#endif
-
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-PeCoffLoaderUnloadImage (
- IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
- )
-/*++
-
-Routine Description:
-
- Unload a PE/COFF image from memory
-
-Arguments:
-
- ImageContext - Contains information on image to load into memory
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
-#ifdef EFI_NT_EMULATOR
- //
- // Calling Win32 API free library
- //
- mPeCoffLoaderWinNtLoadAsDll->FreeLibrary (ImageContext->ModHandle);
-
-#endif
-
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
deleted file mode 100644
index 11ae5a17f0..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeiLib.c
-
-Abstract:
-
- PEI Library Functions
-
---*/
-
-#include "TianoCommon.h"
-#include "PeiHob.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include "EfiCommonLib.h"
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- );
-
-VOID
-ZeroMem (
- IN VOID *Buffer,
- IN UINTN Size
- )
-/*++
-
-Routine Description:
-
- Set Buffer to zero for Size bytes.
-
-Arguments:
-
- Buffer - Memory to set.
-
- Size - Number of bytes to set
-
-Returns:
-
- None
-
---*/
-{
- EfiCommonLibZeroMem (Buffer, Size);
-}
-
-VOID
-PeiCopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- EfiCommonLibCopyMem (Destination, Source, Length);
-}
-
-VOID
-CopyMem (
- IN VOID *Destination,
- IN VOID *Source,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Copy Length bytes from Source to Destination.
-
-Arguments:
-
- Destination - Target of copy
-
- Source - Place to copy from
-
- Length - Number of bytes to copy
-
-Returns:
-
- None
-
---*/
-{
- EfiCommonLibCopyMem (Destination, Source, Length);
-}
-
-
-BOOLEAN
-CompareGuid (
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- )
-/*++
-
-Routine Description:
-
- Compares two GUIDs
-
-Arguments:
-
- Guid1 - guid to compare
- Guid2 - guid to compare
-
-Returns:
- = TRUE if Guid1 == Guid2
- = FALSE if Guid1 != Guid2
-
---*/
-{
- if ((((INT32 *) Guid1)[0] - ((INT32 *) Guid2)[0]) == 0) {
- if ((((INT32 *) Guid1)[1] - ((INT32 *) Guid2)[1]) == 0) {
- if ((((INT32 *) Guid1)[2] - ((INT32 *) Guid2)[2]) == 0) {
- if ((((INT32 *) Guid1)[3] - ((INT32 *) Guid2)[3]) == 0) {
- return TRUE;
- }
- }
- }
- }
-
- return FALSE;
-}
-
-
-EFI_STATUS
-EFIAPI
-PeiLibPciCfgModify (
- IN EFI_PEI_SERVICES **PeiServices,
- IN PEI_PCI_CFG_PPI *PciCfg,
- IN PEI_PCI_CFG_PPI_WIDTH Width,
- IN UINT64 Address,
- IN UINTN SetBits,
- IN UINTN ClearBits
- )
-/*++
-
-Routine Description:
-
- PCI read-modify-write operations.
-
- PIWG's PI specification replaces Inte's EFI Specification 1.10.
- EFI_PEI_PCI_CFG_PPI defined in Inte's EFI Specification 1.10 is replaced by
- EFI_PEI_PCI_CFG2_PPI in PI 1.0. "Modify" function in these two PPI are not
- compatibile with each other.
-
-
- For Framework code that make the following call:
-
- PciCfg->Modify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
- it will be updated to the following code which call this library API:
- PeiLibPciCfgModify (
- PeiServices,
- PciCfg,
- Width,
- Address,
- SetBits,
- ClearBits
- );
-
- The
-
-Arguments:
-
- PeiServices An indirect pointer to the PEI Services Table
- published by the PEI Foundation.
- PciCfg A pointer to the this pointer of EFI_PEI_PCI_CFG_PPI.
- This parameter is unused as a place holder to make
- the parameter list identical to PEI_PCI_CFG_PPI_RW.
- Width The width of the access. Enumerated in bytes. Type
- EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
-
- Address The physical address of the access.
-
- SetBits Points to value to bitwise-OR with the read configuration value.
-
- The size of the value is determined by Width.
-
- ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
- The size of the value is determined by Width.
-
-
-Returns:
-
- EFI_SUCCESS The function completed successfully.
-
- EFI_DEVICE_ERROR There was a problem with the transaction.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_PCI_CFG2_PPI *PciCfg2;
-
- Status = (*PeiServices)->LocatePpi (
- PeiServices,
- &gPeiPciCfg2PpiGuid,
- 0,
- NULL,
- (VOID **) &PciCfg2
- );
- ASSERT_PEI_ERROR ((CONST EFI_PEI_SERVICES **) PeiServices, Status);
-
- Status = PciCfg2->Modify (
- (CONST EFI_PEI_SERVICES **) PeiServices,
- PciCfg2,
- (EFI_PEI_PCI_CFG_PPI_WIDTH) Width,
- Address,
- &SetBits,
- &ClearBits
- );
-
- return Status;
-}
-
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-
-VOID *
-EFIAPI
-ScanGuid (
- IN VOID *Buffer,
- IN UINTN Length,
- IN EFI_GUID *Guid
- )
-/*++
-
-Routine Description:
-
- Scans a target buffer for a GUID, and returns a pointer to the matching GUID
- in the target buffer.
-
- This function searches target the buffer specified by Buffer and Length from
- the lowest address to the highest address at 128-bit increments for the 128-bit
- GUID value that matches Guid. If a match is found, then a pointer to the matching
- GUID in the target buffer is returned. If no match is found, then NULL is returned.
- If Length is 0, then NULL is returned.
- If Length > 0 and Buffer is NULL, then ASSERT().
- If Buffer is not aligned on a 32-bit boundary, then ASSERT().
- If Length is not aligned on a 128-bit boundary, then ASSERT().
- If Length is greater than (EFI_MAX_ADDRESS ?Buffer + 1), then ASSERT().
-
-Arguments:
-
- Buffer - Pointer to the target buffer to scan.
- Length - Number of bytes in Buffer to scan.
- Guid - Value to search for in the target buffer.
-
-Returns:
- A pointer to the matching Guid in the target buffer or NULL otherwise.
-
---*/
-{
- EFI_GUID *GuidPtr;
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- PEI_ASSERT(PeiServices, (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0));
- PEI_ASSERT(PeiServices, (Length <= (EFI_MAX_ADDRESS - (UINTN)Buffer + 1)));
- PEI_ASSERT(PeiServices, ((Length & (sizeof (*GuidPtr) - 1)) == 0));
-
- GuidPtr = (EFI_GUID*)Buffer;
- Buffer = GuidPtr + Length / sizeof (*GuidPtr);
- while (GuidPtr < (EFI_GUID*)Buffer) {
- if (CompareGuid (GuidPtr, Guid)) {
- return (VOID*)GuidPtr;
- }
- GuidPtr++;
- }
- return NULL;
-}
-
-
-VOID *
-EFIAPI
-InvalidateInstructionCacheRange (
- IN VOID *Address,
- IN UINTN Length
- )
-/*++
-
-Routine Description:
-
- Invalidates a range of instruction cache lines in the cache coherency domain
- of the calling CPU.
-
- Invalidates the instruction cache lines specified by Address and Length. If
- Address is not aligned on a cache line boundary, then entire instruction
- cache line containing Address is invalidated. If Address + Length is not
- aligned on a cache line boundary, then the entire instruction cache line
- containing Address + Length -1 is invalidated. This function may choose to
- invalidate the entire instruction cache if that is more efficient than
- invalidating the specified range. If Length is 0, the no instruction cache
- lines are invalidated. Address is returned.
-
- If Length is greater than (EFI_MAX_ADDRESS - Address + 1), then ASSERT().
-
-Arguments:
-
- Address - The base address of the instruction cache lines to
- invalidate. If the CPU is in a physical addressing mode, then
- Address is a physical address. If the CPU is in a virtual
- addressing mode, then Address is a virtual address.
-
- Length - The number of bytes to invalidate from the instruction cache.
-
- Returns:
- Address
-
-**/
-{
- PEI_ASSERT(GetPeiServicesTablePointer() , (Length <= EFI_MAX_ADDRESS - (UINTN)Address + 1));
- return Address;
-}
-
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindNextVolume (
- IN UINTN Instance,
- IN OUT EFI_PEI_FV_HANDLE *VolumeHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindNextVolume.
-
-Arguments:
-
- Instance - The Fv Volume Instance.
- VolumeHandle - Pointer to the current Fv Volume to search.
-
-Returns:
- EFI_STATUS
-
---*/
-
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindNextVolume (PeiServices, Instance, VolumeHandle);
-}
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindNextFile (
- IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE FvHandle,
- IN OUT EFI_PEI_FILE_HANDLE *FileHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindNextFile.
-
-Arguments:
-
- SearchType - Filter to find only file of this type.
- FvHandle - Pointer to the current FV to search.
- FileHandle - Pointer to the file matching SearchType in FwVolHeader.
- - NULL if file not found
-
-Returns:
- EFI_STATUS
-
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, FvHandle, FileHandle);
-}
-
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindFileByName (
- IN EFI_GUID *FileName,
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_PEI_FILE_HANDLE *FileHandle
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindFileByName.
-
-Arguments:
-
- FileName - File name to search.
- VolumeHandle - The current FV to search.
- FileHandle - Pointer to the file matching name in VolumeHandle.
- - NULL if file not found
-
-Returns:
- EFI_STATUS
-
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindFileByName (FileName, VolumeHandle, FileHandle);
-}
-
-
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsFindSectionData.
-
-Arguments:
-
- SearchType - Filter to find only sections of this type.
- FileHandle - Pointer to the current file to search.
- SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
- - NULL if section not found
-
-Returns:
- EFI_STATUS
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, (EFI_PEI_FILE_HANDLE)FfsFileHeader, SectionData);
-}
-
-EFI_STATUS
-EFIAPI
-PeiLibFfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE VolumeHandle,
- OUT EFI_FV_INFO *VolumeInfo
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function FfsGetVolumeInfo.
-
-Arguments:
-
- VolumeHandle - The handle to Fv Volume.
- VolumeInfo - The pointer to volume information.
-
-Returns:
- EFI_STATUS
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsGetVolumeInfo (VolumeHandle, VolumeInfo);
-}
-
-
-
-VOID
-EFIAPI
-BuildFvHob (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Build FvHob.
-
-Arguments:
-
- BaseAddress - Fv base address.
- Length - Fv Length.
-
-Returns:
- NONE.
---*/
-{
-
- EFI_STATUS Status;
- EFI_HOB_FIRMWARE_VOLUME *Hob;
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
-
- //
- // Check FV Signature
- //
- PEI_ASSERT (PeiServices, ((EFI_FIRMWARE_VOLUME_HEADER*)((UINTN)BaseAddress))->Signature == EFI_FVH_SIGNATURE);
-
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_FV,
- sizeof (EFI_HOB_FIRMWARE_VOLUME),
- &Hob
- );
- Hob->BaseAddress = BaseAddress;
- Hob->Length = Length;
-}
-
-VOID
-EFIAPI
-BuildFvHob2 (
- IN EFI_PHYSICAL_ADDRESS BaseAddress,
- IN UINT64 Length,
- IN EFI_GUID *FvNameGuid,
- IN EFI_GUID *FileNameGuid
- )
-/*++
-
-Routine Description:
-
- Build FvHob2.
-
-Arguments:
-
- BaseAddress - Fv base address.
- Length - Fv length.
- FvNameGuid - Fv name.
- FileNameGuid - File name which contians encapsulated Fv.
-
-Returns:
- NONE.
---*/
-{
-
- EFI_STATUS Status;
- EFI_HOB_FIRMWARE_VOLUME2 *Hob;
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
-
- //
- // Check FV Signature
- //
- PEI_ASSERT (PeiServices, ((EFI_FIRMWARE_VOLUME_HEADER*)((UINTN)BaseAddress))->Signature == EFI_FVH_SIGNATURE);
-
- Status = (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_FV2,
- sizeof (EFI_HOB_FIRMWARE_VOLUME2),
- &Hob
- );
- Hob->BaseAddress = BaseAddress;
- Hob->Length = Length;
- CopyMem ((VOID*)&Hob->FvName, FvNameGuid, sizeof(EFI_GUID));
- CopyMem ((VOID*)&Hob->FileName, FileNameGuid, sizeof(EFI_GUID));
-}
-
-EFI_STATUS
-EFIAPI
-PeiServicesLocatePpi (
- IN EFI_GUID *Guid,
- IN UINTN Instance,
- IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
- IN OUT VOID **Ppi
- )
-/*++
-
-Routine Description:
-
- The wrapper of Pei Core Service function LocatePpi.
-
-Arguments:
-
- Guid - Pointer to GUID of the PPI.
- Instance - Instance Number to discover.
- PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
- returns a pointer to the descriptor (includes flags, etc)
- Ppi - Pointer to reference the found PPI
-
-Returns:
-
- Status - EFI_SUCCESS if the PPI is in the database
- EFI_NOT_FOUND if the PPI is not in the database
---*/
-{
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->LocatePpi (PeiServices, Guid, Instance, PpiDescriptor, Ppi);
-}
-
-
-VOID
-EFIAPI
-BuildGuidDataHob (
- IN EFI_GUID *Guid,
- IN VOID *Data,
- IN UINTN DataLength
- )
-/*++
-
-Routine Description:
-
- Build Guid data Hob.
-
-Arguments:
-
- Guid - guid to build data hob.
- Data - data to build data hob.
- DataLength - the length of data.
-
-Returns:
- NONE
---*/
-{
- VOID *HobData;
- EFI_HOB_GUID_TYPE *Hob;
- EFI_PEI_SERVICES **PeiServices;
-
- PeiServices = GetPeiServicesTablePointer();
- (*PeiServices)->CreateHob (
- PeiServices,
- EFI_HOB_TYPE_GUID_EXTENSION,
- (UINT16) (sizeof (EFI_HOB_GUID_TYPE) + DataLength),
- &Hob
- );
- CopyMem ((VOID*)&Hob->Name, (VOID*)Guid, sizeof(EFI_GUID));
-
- HobData = Hob + 1;
-
- CopyMem (HobData, Data, DataLength);
-}
-
-
-VOID *
-EFIAPI
-AllocatePages (
- IN UINTN Pages
- )
-/*++
-
-Routine Description:
-
- Allocate Memory.
-
-Arguments:
-
- Pages - Pages to allocate.
-
-Returns:
- = Address if successful to allocate memory.
- = NULL if fail to allocate memory.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PHYSICAL_ADDRESS Memory;
- EFI_PEI_SERVICES **PeiServices;
-
- if (Pages == 0) {
- return NULL;
- }
-
- PeiServices = GetPeiServicesTablePointer();
- Status = (*PeiServices)->AllocatePages (PeiServices, EfiBootServicesData, Pages, &Memory);
- if (EFI_ERROR (Status)) {
- Memory = 0;
- }
- return (VOID *) (UINTN) Memory;
-
-}
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.inf b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.inf
deleted file mode 100644
index 6ac8794fc2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.inf
+++ /dev/null
@@ -1,110 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiLib.inf
-#
-# Abstract:
-#
-# Component description file for the PEI library.
-#
-#--*/
-
-[defines]
-BASE_NAME = PeiLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiLib.c
- PeCoffLoader.c
- Decompress.c
- Debug.c
- Hob/Hob.c
- Perf.c
- Print/Print.c
- Print/Print.h
- FindFv.c
-
-[sources.ia32]
-# Ia32/Math.c
- Ia32/PeCoffLoaderEx.c
- Ia32/PeCoffLoaderEx.h
- Ia32/PerformancePrimitives.c
- Ia32/Processor.c
- Ia32/ProcessorAsms.Asm
- Ia32/SupportItpDebug.asm
- Ia32/EfiJump.h
- Ia32/ReadIdt.asm
- Ia32/WriteIdt.asm
- Ia32/PeiServicePointer.c
-
-[sources.x64]
- X64/PeCoffLoaderEx.c
- X64/PeCoffLoaderEx.h
- X64/PerformancePrimitives.c
- X64/Processor.c
- X64/ProcessorAsms.Asm
- X64/SupportItpDebug.asm
- X64/EfiJump.h
- X64/PeiServicePointer.c
-
-[sources.ipf]
-# Ipf/Math.c
- Ipf/PeCoffLoaderEx.c
- Ipf/PeCoffLoaderEx.h
- Ipf/PerformancePrimitives.s
- Ipf/Processor.c
- Ipf/EfiJump.h
- Ipf/SetJmp.s
- Ipf/Asm.h
- Ipf/PioFlush.s
- Ipf/SwitchStack.s
- Ipf/Ia_64Gen.h
- Ipf/HwAccess.s
- Ipf/PeiServicePointer.c
-
-[sources.ARM]
- Arm/PerformancePrimitives.c
-
-[sources.AArch64]
- AArch64/PerformancePrimitives.c
-
-[libraries.common]
- EdkGuidLib
- EfiCommonLib
- EdkFrameworkPpiLib
-
-[libraries.ia32]
- CpuIA32Lib
-
-[libraries.x64]
- CpuIA32Lib
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[includes.ia32.Nt32]
- $(EDK_SOURCE)/Sample/Platform/Nt32
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib_Edk2.inf
deleted file mode 100644
index f84f5d119f..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib_Edk2.inf
+++ /dev/null
@@ -1,121 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# PeiLib.inf
-#
-# Abstract:
-#
-# Component description file for the PEI library.
-#
-#--*/
-
-[defines]
-BASE_NAME = PeiLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- PeiLib.c
- PeCoffLoader.c
- Decompress.c
- Debug.c
- Hob/Hob.c
- Perf.c
- Print/Print.c
- Print/Print.h
- FindFv.c
-
-[sources.ia32]
-# Ia32/Math.c
- Ia32/PeCoffLoaderEx.c
- Ia32/PeCoffLoaderEx.h
- Ia32/PerformancePrimitives.c
- Ia32/Processor.c
- Ia32/ProcessorAsms.Asm |MSFT
- Ia32/ProcessorAsms.Asm |INTEL
- Ia32/ProcessorAsms.S |GCC
- Ia32/SupportItpDebug.asm |MSFT
- Ia32/SupportItpDebug.asm |INTEL
- Ia32/SupportItpDebug.S |GCC
- Ia32/EfiJump.h
- Ia32/ReadIdt.asm |MSFT
- Ia32/ReadIdt.asm |INTEL
- Ia32/ReadIdt.S |GCC
- Ia32/WriteIdt.asm |MSFT
- Ia32/WriteIdt.asm |INTEL
- Ia32/WriteIdt.S |GCC
- Ia32/PeiServicePointer.c
-
-[sources.x64]
- X64/PeCoffLoaderEx.c
- X64/PeCoffLoaderEx.h
- X64/PerformancePrimitives.c
- X64/Processor.c
- X64/ProcessorAsms.Asm |MSFT
- X64/ProcessorAsms.Asm |INTEL
- X64/ProcessorAsms.S |GCC
- X64/SupportItpDebug.asm |MSFT
- X64/SupportItpDebug.asm |INTEL
- X64/SupportItpDebug.S |GCC
- X64/EfiJump.h
- X64/PeiServicePointer.c
-
-[sources.ipf]
-# Ipf/Math.c
- Ipf/PeCoffLoaderEx.c
- Ipf/PeCoffLoaderEx.h
- Ipf/PerformancePrimitives.s
- Ipf/Processor.c
- Ipf/EfiJump.h
- Ipf/SetJmp.s
- Ipf/Asm.h
- Ipf/PioFlush.s
- Ipf/SwitchStack.s
- Ipf/Ia_64Gen.h
- Ipf/HwAccess.s
- Ipf/PeiServicePointer.c
- #
- # Only for CYGWINGCC IPF tool chain, EFI_BREAKPOINT and MEMORY_FENCE
- # is defined as two functions EcpEfiBreakPoint and EcpMemoryFence.
- #
- Ipf/AsmCpuMisc.s | GCC
-
-
-[libraries.common]
- EdkGuidLib
- EfiCommonLib
-
-[libraries.ia32]
- CpuIA32Lib
-
-[libraries.x64]
- CpuIA32Lib
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Include/Pei
- $(EDK_SOURCE)/Foundation/Library/Pei/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Cpu/Pentium/Include
-
-[includes.ia32.Nt32]
- $(EDK_SOURCE)/Sample/Platform/Nt32
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Perf.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Perf.c
deleted file mode 100644
index 27f72b78e7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Perf.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Perf.c
-
-Abstract:
-
- Support for performance primitives.
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include "PeiHob.h"
-
-#include EFI_GUID_DEFINITION (PeiPerformanceHob)
-
-//
-// Perfomance HOB data definitions
-//
-
-#define MAX_PEI_PERF_LOG_ENTRIES 28
-
-//
-// Prototype functions
-//
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- );
-
-
-VOID
-EFIAPI
-PeiPerfMeasure (
- EFI_PEI_SERVICES **PeiServices,
- IN UINT16 *Token,
- IN EFI_FFS_FILE_HEADER *FileHeader,
- IN BOOLEAN EntryExit,
- IN UINT64 Value
- )
-/*++
-
-Routine Description:
-
- Log a timestamp count.
-
-Arguments:
-
- PeiServices - Pointer to the PEI Core Services table
-
- Token - Pointer to Token Name
-
- FileHeader - Pointer to the file header
-
- EntryExit - Indicates start or stop measurement
-
- Value - The start time or the stop time
-
-Returns:
-
---*/
-{
- EFI_STATUS Status;
- EFI_HOB_GUID_TYPE *Hob;
- EFI_HOB_GUID_DATA_PERFORMANCE_LOG *PerfHobData;
- PEI_PERFORMANCE_MEASURE_LOG_ENTRY *Log;
- EFI_PEI_PPI_DESCRIPTOR *PerfHobDescriptor;
- UINT64 TimeCount;
- INTN Index;
- UINTN Index2;
- EFI_GUID *Guid;
- EFI_GUID *CheckGuid;
-
- TimeCount = 0;
- //
- // Get the END time as early as possible to make it more accurate.
- //
- if (EntryExit) {
- GetTimerValue (&TimeCount);
- }
-
- //
- // Locate the Pei Performance Log Hob.
- //
- Status = (*PeiServices)->LocatePpi (
- PeiServices,
- &gEfiPeiPerformanceHobGuid,
- 0,
- &PerfHobDescriptor,
- NULL
- );
-
- //
- // If the Performance Hob was not found, build and install one.
- //
- if (EFI_ERROR(Status)) {
- Status = PeiBuildHobGuid (
- PeiServices,
- &gEfiPeiPerformanceHobGuid,
- (sizeof(EFI_HOB_GUID_DATA_PERFORMANCE_LOG) +
- ((MAX_PEI_PERF_LOG_ENTRIES-1) *
- sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY)) +
- sizeof(EFI_PEI_PPI_DESCRIPTOR)
- ),
- (VOID **) &Hob
- );
- ASSERT_PEI_ERROR((CONST EFI_PEI_SERVICES **) PeiServices, Status);
-
- PerfHobData = (EFI_HOB_GUID_DATA_PERFORMANCE_LOG *)(Hob+1);
- PerfHobData->NumberOfEntries = 0;
-
- PerfHobDescriptor = (EFI_PEI_PPI_DESCRIPTOR *)((UINT8 *)(PerfHobData+1) +
- (sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY) *
- (MAX_PEI_PERF_LOG_ENTRIES-1)
- )
- );
- PerfHobDescriptor->Flags = (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST);
- PerfHobDescriptor->Guid = &gEfiPeiPerformanceHobGuid;
- PerfHobDescriptor->Ppi = NULL;
-
- (*PeiServices)->InstallPpi (
- PeiServices,
- PerfHobDescriptor
- );
- }
-
- PerfHobData = (EFI_HOB_GUID_DATA_PERFORMANCE_LOG *)(((UINT8 *)(PerfHobDescriptor)) -
- ((sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY) *
- (MAX_PEI_PERF_LOG_ENTRIES-1)
- )
- + sizeof(EFI_HOB_GUID_DATA_PERFORMANCE_LOG)
- )
- );
-
- if (PerfHobData->NumberOfEntries >= MAX_PEI_PERF_LOG_ENTRIES) {
- return;
- }
-
- if (!EntryExit) {
- Log = &(PerfHobData->Log[PerfHobData->NumberOfEntries]);
- (*PeiServices)->SetMem (Log, sizeof(PEI_PERFORMANCE_MEASURE_LOG_ENTRY), 0);
-
- //
- // If not NULL pointer, copy the file name
- //
- if (FileHeader != NULL) {
- Log->Name = FileHeader->Name;
- }
-
- //
- // Copy the description string
- //
- (*PeiServices)->CopyMem (
- &(Log->DescriptionString),
- Token,
- (PEI_PERF_MAX_DESC_STRING-1) * sizeof(UINT16)
- );
-
- //
- // Get the start time as late as possible to make it more accurate.
- //
- GetTimerValue (&TimeCount);
-
- //
- // Record the time stamp.
- //
- if (Value != 0) {
- Log->StartTimeCount = Value;
- } else {
- Log->StartTimeCount = TimeCount;
- }
- Log->StopTimeCount = 0;
-
- //
- // Increment the number of valid log entries.
- //
- PerfHobData->NumberOfEntries++;
-
- } else {
-
- for (Index = PerfHobData->NumberOfEntries-1; Index >= 0; Index--) {
- Log = NULL;
- for (Index2 = 0; Index2 < PEI_PERF_MAX_DESC_STRING; Index2++) {
- if (PerfHobData->Log[Index].DescriptionString[Index2] == 0) {
- Log = &(PerfHobData->Log[Index]);
- break;
- }
- if (PerfHobData->Log[Index].DescriptionString[Index2] !=
- Token[Index2]) {
- break;
- }
- }
- if (Log != NULL) {
- if (FileHeader != NULL) {
- Guid = &(Log->Name);
- CheckGuid = &(FileHeader->Name);
- if ((((INT32 *)Guid)[0] == ((INT32 *)CheckGuid)[0]) &&
- (((INT32 *)Guid)[1] == ((INT32 *)CheckGuid)[1]) &&
- (((INT32 *)Guid)[2] == ((INT32 *)CheckGuid)[2]) &&
- (((INT32 *)Guid)[3] == ((INT32 *)CheckGuid)[3])) {
- if (Value != 0) {
- Log->StopTimeCount = Value;
- } else {
- Log->StopTimeCount = TimeCount;
- }
- break;
- }
- } else {
- if (Value != 0) {
- Log->StopTimeCount = Value;
- } else {
- Log->StopTimeCount = TimeCount;
- }
- break;
- }
- }
- }
-
- }
-
- return;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c
deleted file mode 100644
index 55c0a043d4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*++
-
-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
-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:
-
- Print.c
-
-Abstract:
-
- Basic Ascii AvSPrintf() function named AvSPrint(). AvSPrint() enables very
- simple implemenation of debug prints.
-
- You can not Print more than PEI_LIB_MAX_PRINT_BUFFER characters at a
- time. This makes the implementation very simple.
-
- AvSPrint format specification has the follwoing form
-
- %[flags][width]type
-
- flags:
- '-' - Left justify
- '+' - Prefix a sign
- ' ' - Prefix a blank
- ',' - Place commas in numberss
- '0' - Prefix for width with zeros
- 'l' - UINT64
- 'L' - UINT64
-
- width:
- '*' - Get width from a UINTN argumnet from the argument list
- Decimal number that represents width of print
-
- type:
- 'p' - arugment is VOID *; printed as hex number
- 'X' - argument is a UINTN hex number, prefix '0'
- 'x' - argument is a hex number
- 'd' - argument is a decimal number
- 'a' - argument is an ascii string
- 'S', 's' - argument is an Unicode string
- 'g' - argument is a pointer to an EFI_GUID
- 't' - argument is a pointer to an EFI_TIME structure
- 'c' - argument is an ascii character
- 'r' - argument is EFI_STATUS
- '%' - Print a %
-
---*/
-
-#include "Tiano.h"
-#include "Pei.h"
-#include "PeiLib.h"
-#include "Print.h"
-
-
-STATIC
-UINTN
-ValueToString (
- IN OUT CHAR8 *Buffer,
- IN INT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- );
-
-STATIC
-UINTN
-ValueTomHexStr (
- IN OUT CHAR8 *Buffer,
- IN UINT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- );
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN OUT CHAR8 *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- IN OUT CHAR8 *Buffer,
- IN UINTN BufferSize
- );
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize
- );
-
-
-UINTN
-ASPrint (
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- ASPrint function to process format and place the results in Buffer.
-
-Arguments:
-
- Buffer - Ascii buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means no
- limit.
-
- Format - Ascii format string see file header for more details.
-
- ... - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Return;
- VA_LIST Marker;
-
- VA_START(Marker, Format);
- Return = AvSPrint(Buffer, BufferSize, Format, Marker);
- VA_END (Marker);
-
- return Return;
-}
-
-
-UINTN
-AvSPrint (
- OUT CHAR8 *StartOfBuffer,
- IN UINTN BufferSize,
- IN CONST CHAR8 *FormatString,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- AvSPrint function to process format and place the results in Buffer. Since a
- VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
- this is the main print working routine
-
-Arguments:
-
- StartOfBuffer - Ascii buffer to print the results of the parsing of Format into.
-
- BufferSize - Maximum number of characters to put into buffer. Zero means
- no limit.
-
- FormatString - Ascii format string see file header for more details.
-
- Marker - Vararg list consumed by processing Format.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR8 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR8 *Buffer;
- CHAR8 *AsciiStr;
- CHAR16 *UnicodeStr;
- CHAR8 *Format;
- UINTN Index;
- UINTN Flags;
- UINTN Width;
- UINTN Count;
- UINTN BufferLeft;
- UINT64 Value;
- EFI_GUID *TmpGUID;
- BOOLEAN Done;
-
- //
- // Process the format string. Stop if Buffer is over run.
- //
- Buffer = StartOfBuffer;
- Format = (CHAR8 *) FormatString;
- BufferLeft = BufferSize;
- for (Index = 0; (*Format != '\0') && (Index < BufferSize - 1); Format++) {
- if (*Format != '%') {
- if ((*Format == '\n') && (Index < BufferSize - 2)) {
- //
- // If carage return add line feed
- //
- Buffer[Index++] = '\r';
- BufferLeft -= sizeof (CHAR8);
- }
-
- Buffer[Index++] = *Format;
- BufferLeft -= sizeof (CHAR8);
- } else {
-
- //
- // Now it's time to parse what follows after %
- //
- Flags = 0;
- Width = 0;
- for (Done = FALSE; !Done; ) {
- Format++;
-
- switch (*Format) {
-
- case '-': Flags |= LEFT_JUSTIFY; break;
- case '+': Flags |= PREFIX_SIGN; break;
- case ' ': Flags |= PREFIX_BLANK; break;
- case ',': Flags |= COMMA_TYPE; break;
- case 'L':
- case 'l': Flags |= LONG_TYPE; break;
-
- case '*':
- Width = VA_ARG (Marker, UINTN);
- break;
-
- case '0':
- Flags |= PREFIX_ZERO;
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- Count = 0;
- do {
- Count = (Count * 10) + *Format - '0';
- Format++;
- } while ((*Format >= '0') && (*Format <= '9'));
- Format--;
- Width = Count;
- break;
-
- default:
- Done = TRUE;
- }
- }
-
- switch (*Format) {
- case 'p':
- //
- // Flag space, +, 0, L & l are invalid for type p.
- //
- Flags &= ~(PREFIX_BLANK| PREFIX_SIGN | LONG_TYPE);
- if (sizeof (VOID *) > 4) {
- Flags |= LONG_TYPE;
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
- Flags |= PREFIX_ZERO;
-
- ValueTomHexStr (TempBuffer, Value, Flags, Width);
- AsciiStr = TempBuffer;
-
- for (; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++) {
- Buffer[Index++] = *AsciiStr;
- }
- break;
- case 'X':
- Flags |= PREFIX_ZERO;
- Width = sizeof (UINT64) * 2;
-
- //
- // break skiped on purpose
- //
- case 'x':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = VA_ARG (Marker, UINTN);
- }
-
- ValueTomHexStr (TempBuffer, Value, Flags, Width);
- AsciiStr = TempBuffer;
-
- for (; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++) {
- Buffer[Index++] = *AsciiStr;
- }
- break;
-
- case 'd':
- if ((Flags & LONG_TYPE) == LONG_TYPE) {
- Value = VA_ARG (Marker, UINT64);
- } else {
- Value = (UINTN) VA_ARG (Marker, UINTN);
- }
-
- ValueToString (TempBuffer, Value, Flags, Width);
- AsciiStr = TempBuffer;
-
- for (; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++) {
- Buffer[Index++] = *AsciiStr;
- }
- break;
-
- case 's':
- case 'S':
- UnicodeStr = (CHAR16 *) VA_ARG (Marker, CHAR8 *);
- if (UnicodeStr == NULL) {
- UnicodeStr = L"<null string>";
- }
-
- for (Count = 0; (*UnicodeStr != '\0') && (Index < BufferSize - 1); UnicodeStr++, Count++) {
- Buffer[Index++] = (CHAR8) *UnicodeStr;
- }
- //
- // Add padding if needed
- //
- for (; (Count < Width) && (Index < BufferSize - 1); Count++) {
- Buffer[Index++] = ' ';
- }
-
- break;
-
- case 'a':
- AsciiStr = (CHAR8 *) VA_ARG (Marker, CHAR8 *);
- if (AsciiStr == NULL) {
- AsciiStr = "<null string>";
- }
-
- for (Count = 0; (*AsciiStr != '\0') && (Index < BufferSize - 1); AsciiStr++, Count++) {
- Buffer[Index++] = *AsciiStr;
- }
- //
- // Add padding if needed
- //
- for (; (Count < Width) && (Index < BufferSize - 1); Count++) {
- Buffer[Index++] = ' ';
- }
- break;
-
- case 'c':
- Buffer[Index++] = (CHAR8) VA_ARG (Marker, UINTN);
- break;
-
- case 'g':
- TmpGUID = VA_ARG (Marker, EFI_GUID *);
- if (TmpGUID != NULL) {
- Index += GuidToString (
- TmpGUID,
- &Buffer[Index],
- BufferLeft
- );
- }
- break;
-
- case 't':
- Index += TimeToString (
- VA_ARG (Marker, EFI_TIME *),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case 'r':
- Index += EfiStatusToString (
- VA_ARG (Marker, EFI_STATUS),
- &Buffer[Index],
- BufferLeft
- );
- break;
-
- case '%':
- Buffer[Index++] = *Format;
- break;
-
- default:
- //
- // if the type is unknown print it to the screen
- //
- Buffer[Index++] = *Format;
- }
-
- BufferLeft = BufferSize - Index;
- }
- }
-
- Buffer[Index++] = '\0';
-
- return &Buffer[Index] - StartOfBuffer;
-}
-
-
-
-static CHAR8 mHexStr[] = { '0','1','2','3','4','5','6','7',
- '8','9','A','B','C','D','E','F' };
-
-STATIC
-UINTN
-ValueTomHexStr (
- IN OUT CHAR8 *Buffer,
- IN UINT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- AvSPrint worker function that prints a Value as a hex number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii hex string of Value.
-
- Value - Hex value to convert to a string in Buffer.
-
- Flags - Flags to use in printing Hex string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR8 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR8 *TempStr;
- CHAR8 Prefix;
- CHAR8 *BufferPtr;
- UINTN Count;
- UINTN Index;
-
- TempStr = TempBuffer;
- BufferPtr = Buffer;
-
- //
- // Count starts at one since we will null terminate. Each iteration of the
- // loop picks off one nibble. Oh yea TempStr ends up backwards
- //
- Count = 0;
- do {
- *(TempStr++) = mHexStr[Value & 0x0f];
- Value = RShiftU64 (Value, 4);
- Count++;
- } while (Value != 0);
-
- if (Flags & PREFIX_ZERO) {
- Prefix = '0';
- } else if (!(Flags & LEFT_JUSTIFY)) {
- Prefix = ' ';
- } else {
- Prefix = 0x00;
- }
- for (Index = Count; Index < Width; Index++) {
- *(TempStr++) = Prefix;
- }
-
- //
- // Reverse temp string into Buffer.
- //
- if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
- TempStr = TempBuffer + Width;
- }
- Index = 0;
- while (TempStr != TempBuffer) {
- *(BufferPtr++) = *(--TempStr);
- Index++;
- }
-
- *BufferPtr = 0;
- return Index;
-}
-
-STATIC
-UINTN
-ValueToString (
- IN OUT CHAR8 *Buffer,
- IN INT64 Value,
- IN UINTN Flags,
- IN UINTN Width
- )
-/*++
-
-Routine Description:
-
- AvSPrint worker function that prints a Value as a decimal number in Buffer
-
-Arguments:
-
- Buffer - Location to place ascii decimal number string of Value.
-
- Value - Decimal value to convert to a string in Buffer.
-
- Flags - Flags to use in printing decimal string, see file header for details.
-
- Width - Width of hex value.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- CHAR8 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
- CHAR8 *TempStr;
- CHAR8 *BufferPtr;
- UINTN Count;
- UINTN NumberCount;
- UINTN Remainder;
- BOOLEAN Negative;
- UINTN Index;
-
- Negative = FALSE;
- TempStr = TempBuffer;
- BufferPtr = Buffer;
- Count = 0;
- NumberCount = 0;
- Remainder = 0;
-
- if (Value < 0) {
- Negative = TRUE;
- Value = -Value;
- }
-
- do {
- Value = (INT64)DivU64x32 ((UINT64)Value, 10, &Remainder);
- *(TempStr++) = (CHAR8)(Remainder + '0');
- Count++;
- NumberCount++;
- if ((Flags & COMMA_TYPE) == COMMA_TYPE) {
- if (NumberCount % 3 == 0 && Value != 0) {
- *(TempStr++) = ',';
- Count++;
- }
- }
- } while (Value != 0);
-
- if (Negative) {
- *(BufferPtr++) = '-';
- Count++;
- }
-
- //
- // Reverse temp string into Buffer.
- //
- if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
- TempStr = TempBuffer + Width;
- }
- Index = 0;
- while (TempStr != TempBuffer) {
- *(BufferPtr++) = *(--TempStr);
- }
-
- *BufferPtr = 0;
- return Index;
-}
-
-STATIC
-UINTN
-GuidToString (
- IN EFI_GUID *Guid,
- IN CHAR8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- AvSPrint worker function that prints an EFI_GUID.
-
-Arguments:
-
- Guid - Pointer to GUID to print.
-
- Buffer - Buffe to print Guid into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = ASPrint (
- Buffer,
- BufferSize,
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- (UINTN)Guid->Data1,
- (UINTN)Guid->Data2,
- (UINTN)Guid->Data3,
- (UINTN)Guid->Data4[0],
- (UINTN)Guid->Data4[1],
- (UINTN)Guid->Data4[2],
- (UINTN)Guid->Data4[3],
- (UINTN)Guid->Data4[4],
- (UINTN)Guid->Data4[5],
- (UINTN)Guid->Data4[6],
- (UINTN)Guid->Data4[7]
- );
-
- //
- // ASPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-
-STATIC
-UINTN
-TimeToString (
- IN EFI_TIME *Time,
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- AvSPrint worker function that prints EFI_TIME.
-
-Arguments:
-
- Time - Pointer to EFI_TIME sturcture to print.
-
- Buffer - Buffer to print Time into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
-
- Size = ASPrint (
- Buffer,
- BufferSize,
- "%02d/%02d/%04d %02d:%02d",
- (UINTN)Time->Month,
- (UINTN)Time->Day,
- (UINTN)Time->Year,
- (UINTN)Time->Hour,
- (UINTN)Time->Minute
- );
-
- //
- // ASPrint will null terminate the string. The -1 skips the null
- //
- return Size - 1;
-}
-
-STATIC
-UINTN
-EfiStatusToString (
- IN EFI_STATUS Status,
- OUT CHAR8 *Buffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- AvSPrint worker function that prints EFI_STATUS as a string. If string is
- not known a hex value will be printed.
-
-Arguments:
-
- Status - EFI_STATUS sturcture to print.
-
- Buffer - Buffer to print EFI_STATUS message string into.
-
- BufferSize - Size of Buffer.
-
-Returns:
-
- Number of characters printed.
-
---*/
-{
- UINTN Size;
- CHAR8 *Desc;
-
- if (Status == EFI_SUCCESS) {
- Desc = "Success";
- } else if (Status == EFI_LOAD_ERROR) {
- Desc = "Load Error";
- } else if (Status == EFI_INVALID_PARAMETER) {
- Desc = "Invalid Parameter";
- } else if (Status == EFI_UNSUPPORTED) {
- Desc = "Unsupported";
- } else if (Status == EFI_BAD_BUFFER_SIZE) {
- Desc = "Bad Buffer Size";
- } else if (Status == EFI_BUFFER_TOO_SMALL) {
- Desc = "Buffer Too Small";
- } else if (Status == EFI_NOT_READY) {
- Desc = "Not Ready";
- } else if (Status == EFI_DEVICE_ERROR) {
- Desc = "Device Error";
- } else if (Status == EFI_WRITE_PROTECTED) {
- Desc = "Write Protected";
- } else if (Status == EFI_OUT_OF_RESOURCES) {
- Desc = "Out of Resources";
- } else if (Status == EFI_VOLUME_CORRUPTED) {
- Desc = "Volume Corrupt";
- } else if (Status == EFI_VOLUME_FULL) {
- Desc = "Volume Full";
- } else if (Status == EFI_NO_MEDIA) {
- Desc = "No Media";
- } else if (Status == EFI_MEDIA_CHANGED) {
- Desc = "Media changed";
- } else if (Status == EFI_NOT_FOUND) {
- Desc = "Not Found";
- } else if (Status == EFI_ACCESS_DENIED) {
- Desc = "Access Denied";
- } else if (Status == EFI_NO_RESPONSE) {
- Desc = "No Response";
- } else if (Status == EFI_NO_MAPPING) {
- Desc = "No mapping";
- } else if (Status == EFI_TIMEOUT) {
- Desc = "Time out";
- } else if (Status == EFI_NOT_STARTED) {
- Desc = "Not started";
- } else if (Status == EFI_ALREADY_STARTED) {
- Desc = "Already started";
- } else if (Status == EFI_ABORTED) {
- Desc = "Aborted";
- } else if (Status == EFI_ICMP_ERROR) {
- Desc = "ICMP Error";
- } else if (Status == EFI_TFTP_ERROR) {
- Desc = "TFTP Error";
- } else if (Status == EFI_PROTOCOL_ERROR) {
- Desc = "Protocol Error";
- } else if (Status == EFI_WARN_UNKNOWN_GLYPH) {
- Desc = "Warning Unknown Glyph";
- } else if (Status == EFI_WARN_DELETE_FAILURE) {
- Desc = "Warning Delete Failure";
- } else if (Status == EFI_WARN_WRITE_FAILURE) {
- Desc = "Warning Write Failure";
- } else if (Status == EFI_WARN_BUFFER_TOO_SMALL) {
- Desc = "Warning Buffer Too Small";
- } else {
- Desc = NULL;
- }
- //
- // If we found a match, copy the message to the user's buffer. Otherwise
- // sprint the hex status code to their buffer.
- //
- if (Desc != NULL) {
- Size = ASPrint (Buffer, BufferSize, "%a", Desc);
- } else {
- Size = ASPrint (Buffer, BufferSize, "%X", Status);
- }
- return Size - 1;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.h
deleted file mode 100644
index a6bb2360aa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/Print/Print.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Print.h
-
-Abstract:
-
- Private data for Print.c
-
---*/
-
-#ifndef _PRINT_H_
-#define _PRINT_H_
-
-#define LEFT_JUSTIFY 0x01
-#define PREFIX_SIGN 0x02
-#define PREFIX_BLANK 0x04
-#define COMMA_TYPE 0x08
-#define LONG_TYPE 0x10
-#define PREFIX_ZERO 0x20
-
-//
-// Largest number of characters that can be printed out.
-//
-#define PEI_LIB_MAX_PRINT_BUFFER (80 * 4)
-
-#include "EfiCommonLib.h"
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
deleted file mode 100644
index 884ec1cc27..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-Module Name:
-
- EfiJump.h
-
-Abstract:
-
- This is the Setjump/Longjump pair for an x64 processor.
-
---*/
-
-#ifndef _EFI_JUMP_H_
-#define _EFI_JUMP_H_
-
-typedef struct {
- UINT64 Rbx;
- UINT64 Rsp;
- UINT64 Rbp;
- UINT64 Rdi;
- UINT64 Rsi;
- UINT64 R10;
- UINT64 R11;
- UINT64 R12;
- UINT64 R13;
- UINT64 R14;
- UINT64 R15;
- UINT64 Rip;
- UINT32 MxCsr;
- UINT8 XmmBuffer[160]; // XMM6-XMM15
-} EFI_JUMP_BUFFER;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/IdtDumb.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/IdtDumb.c
deleted file mode 100644
index 903ca4dc56..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/IdtDumb.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-
-Module Name:
-
- IdtDumb.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-
-UINTN
-ReadIdtBase (
- VOID
- )
-{
-
- return 0;
-}
-
-
-VOID
-UpdateIdt (
- UINT32 IdtBase,
- UINT16 IdtLimit
- )
-{
- return;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Math.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Math.c
deleted file mode 100644
index ad0e8d2b7c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Math.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
-
- Math.c
-
-Abstract:
-
- 64-bit Math worker functions for x64
-
---*/
-
-#include "Efi.h"
-#include "Pei.h"
-#include "PeiLib.h"
-
-
-UINT64
-LShiftU64 (
- IN UINT64 Operand,
- IN UINTN Count
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be left shifted by 32 bits and returns the
- shifted value.
- Count is valid up 63. (Only Bits 0-5 is valid for Count)
-
-Arguments:
-
- Operand - Value to be shifted
-
- Count - Number of times to shift left.
-
-Returns:
-
- Value shifted left identified by the Count.
-
---*/
-{
- return Operand << Count;
-}
-
-
-UINT64
-MultU64x32 (
- IN UINT64 Multiplicand,
- IN UINTN Multiplier
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be multiplied with a 32 bit value returns
- 64bit result.
- No checking if the result is greater than 64bits
-
-Arguments:
-
- Multiplicand -
-
- Multiplier -
-
-Returns:
-
- Multiplicand * Multiplier
-
---*/
-{
- return Multiplicand * Multiplier;
-}
-
-UINT64
-DivU64x32 (
- IN UINT64 Dividend,
- IN UINTN Divisor,
- OUT UINTN *Remainder OPTIONAL
- )
-/*++
-
-Routine Description:
-
- This routine allows a 64 bit value to be divided with a 32 bit value returns
- 64bit result and the Remainder.
-
-Arguments:
-
- Dividend -
-
- Divisor -
-
- Remainder -
-
-Returns:
-
- Dividend / Divisor
- Remainder = Dividend mod Divisor
-
-N.B. only works for 31bit divisors!!
-
---*/
-{
- return Dividend/Divisor;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.c
deleted file mode 100644
index f025a390c2..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-
-Module Name:
-
- PeCoffLoaderEx.c
-
-Abstract:
-
- x64 Specific relocation fixups
-
-Revision History
-
---*/
-
-#include "TianoCommon.h"
-#include "EfiImage.h"
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
- Performs an x64 specific relocation fixup
-
-Arguments:
- Reloc - Pointer to the relocation record
- Fixup - Pointer to the address to fix up
- FixupData - Pointer to a buffer to log the fixups
- Adjust - The offset to adjust the fixup
-
-Returns:
- EFI_UNSUPPORTED - relocate unsupported
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-{
- if ((Machine == EFI_IMAGE_MACHINE_IA32) || (Machine == EFI_IMAGE_MACHINE_X64) ||
- (Machine == EFI_IMAGE_MACHINE_EBC)) {
- return TRUE;
- }
-
- return FALSE;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.h
deleted file mode 100644
index 16799c94ba..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeCoffLoaderEx.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PeCoffLoaderEx.h
-
-Abstract:
-
- x64 Specific relocation fixups
-
-Revision History
-
---*/
-
-#ifndef _PE_COFF_LOADER_EX_H_
-#define _PE_COFF_LOADER_EX_H_
-
-EFI_STATUS
-PeCoffLoaderRelocateImageEx (
- IN UINT16 *Reloc,
- IN OUT CHAR8 *Fixup,
- IN OUT CHAR8 **FixupData,
- IN UINT64 Adjust
- )
-/*++
-
-Routine Description:
-
- Performs an x64 specific relocation fixup
-
-Arguments:
-
- Reloc - Pointer to the relocation record
-
- Fixup - Pointer to the address to fix up
-
- FixupData - Pointer to a buffer to log the fixups
-
- Adjust - The offset to adjust the fixup
-
-Returns:
-
- EFI_UNSUPPORTED - relocate unsupported
-
---*/
-;
-
-BOOLEAN
-PeCoffLoaderImageFormatSupported (
- IN UINT16 Machine
- )
-/*++
-Routine Description:
-
- Returns TRUE if the machine type of PE/COFF image is supported. Supported
- does not mean the image can be executed it means the PE/COFF loader supports
- loading and relocating of the image type. It's up to the caller to support
- the entry point.
-
- This function implies the basic PE/COFF loader/relocator supports IA32, EBC,
- & X64 images. Calling the entry point in a correct mannor is up to the
- consumer of this library.
-
-Arguments:
-
- Machine - Machine type from the PE Header.
-
-Returns:
-
- TRUE - if this PE/COFF loader can load the image
- FALSE - if this PE/COFF loader cannot load the image
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeiServicePointer.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeiServicePointer.c
deleted file mode 100644
index b92e6e780c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PeiServicePointer.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*++
-
-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.
-
-
-Module Name:
-
- PeiServicePointer.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "PeiApi.h"
-
-
-#if (PI_SPECIFICATION_VERSION >= 0x00010000)
-
-VOID
-SetPeiServicesTablePointer (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Save PeiService pointer so that it can be retrieved anywhere.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
- PhyscialAddress - The physcial address of variable PeiServices.
-
-Returns:
- NONE
-
---*/
-{
- return;
-}
-
-EFI_PEI_SERVICES **
-GetPeiServicesTablePointer (
- VOID
- )
-/*++
-
-Routine Description:
-
- Get PeiService pointer.
-
-Arguments:
-
- NONE.
-
-Returns:
- The direct pointer to PeiServiceTable.
-
---*/
-{
- return NULL;
-}
-
-
-VOID
-MigrateIdtTable (
- IN EFI_PEI_SERVICES **PeiServices
- )
-/*++
-
-Routine Description:
-
- Migrate IDT from temporary memory to real memory where preceded with 4 bytes for
- storing PeiService pointer.
-
-Arguments:
-
- PeiServices - The direct pointer to PeiServiceTable.
-
-Returns:
-
- NONE.
-
---*/
-{
- return;
-}
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PerformancePrimitives.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PerformancePrimitives.c
deleted file mode 100644
index 5b5ed3eaeb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/PerformancePrimitives.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-
-Module Name:
-
- PerformancePrimitives.c
-
-Abstract:
-
- Support for Performance library
-
---*/
-
-#include "TianoCommon.h"
-#include "CpuIA32.h"
-
-EFI_STATUS
-GetTimerValue (
- OUT UINT64 *TimerValue
- )
-{
- *TimerValue = EfiReadTsc ();
- return EFI_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
deleted file mode 100644
index c930486183..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-
-Module Name:
-
- Processor.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiJump.h"
-#include EFI_GUID_DEFINITION (PeiFlushInstructionCache)
-#include EFI_GUID_DEFINITION (PeiTransferControl)
-
-//
-// Prototypes
-//
-EFI_STATUS
-EFIAPI
-TransferControlSetJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN VOID *Jump
- );
-
-EFI_STATUS
-EFIAPI
-TransferControlLongJump (
- IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
- IN VOID *Jump
- );
-
-EFI_STATUS
-EFIAPI
-FlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- );
-
-//
-// Table declarations
-//
-EFI_PEI_TRANSFER_CONTROL_PROTOCOL mTransferControl = {
- TransferControlSetJump,
- TransferControlLongJump,
- sizeof (EFI_JUMP_BUFFER)
-};
-
-EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL mFlushInstructionCache = {
- FlushInstructionCacheFlush
-};
-
-
-EFI_STATUS
-EFIAPI
-InstallEfiPeiTransferControl(
- IN OUT EFI_PEI_TRANSFER_CONTROL_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the transfer control mechanism
-
-Arguments:
-
- This - Pointer to transfer control mechanism.
-
-Returns:
-
- This - Pointer to transfer control mechanism.
-
---*/
-{
- *This = &mTransferControl;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-InstallEfiPeiFlushInstructionCache (
- IN OUT EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL **This
- )
-/*++
-
-Routine Description:
-
- Installs the pointer to the flush instruction cache mechanism
-
-Arguments:
-
- This - Pointer to flush instruction cache mechanism.
-
-Returns:
-
- This - Pointer to flush instruction cache mechanism.
-
---*/
-{
- *This = &mFlushInstructionCache;
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-EFIAPI
-FlushInstructionCacheFlush (
- IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- This routine would provide support for flushing the CPU instruction cache.
- In the case of IA32, this flushing is not necessary and is thus not implemented.
-
-Arguments:
-
- Pointer to CPU Architectural Protocol interface
- Start adddress in memory to flush
- Length of memory to flush
-
-Returns:
-
- Status
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
deleted file mode 100644
index 418400c15a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
+++ /dev/null
@@ -1,186 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; Copyright (c) 2005 - 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.
-;
-; Module Name:
-; ProcessorAsms.Asm
-;
-; Abstract:
-; This is separated from processor.c to allow this functions to be built with /O1
-;
-;
-;------------------------------------------------------------------------------
-
-text SEGMENT
-
-
-;
-; Routine Description:
-; This allows the caller to switch the stack and goes to the new entry point
-;
-; Arguments:
-; EntryPoint - Pointer to the location to enter // rcx
-; Parameter - Parameter to pass in // rdx
-; NewStack - New Location of the stack // r8
-; NewBsp - New BSP // r9 - not used
-;
-; Returns:
-; Nothing. Goes to the Entry Point passing in the new parameters
-;
-SwitchStacks PROC PUBLIC
-
- ; Adjust stack for
- ; 1) leave 4 registers space
- ; 2) let it 16 bytes aligned after call
- sub r8, 20h
- and r8w, 0fff0h ; do not assume 16 bytes aligned
-
- mov rsp, r8 ; rsp = NewStack
- mov r10, rcx ; save EntryPoint
- mov rcx, rdx ; Arg1 = Parameter
- call r10 ; r10 = copy of EntryPoint
- ;
- ; no ret as we have a new stack and we jumped to the new location
- ;
- ret
-
-SwitchStacks ENDP
-
-
-EFI_SUCCESS equ 0
-EFI_WARN_RETURN_FROM_LONG_JUMP equ 5
-
-;
-; Generated by h2inc run manually
-;
-_EFI_JUMP_BUFFER STRUCT 2t
-_rbx QWORD ?
-_rsp QWORD ?
-_rbp QWORD ?
-_rdi QWORD ?
-_rsi QWORD ?
-_r10 QWORD ?
-_r11 QWORD ?
-_r12 QWORD ?
-_r13 QWORD ?
-_r14 QWORD ?
-_r15 QWORD ?
-_rip QWORD ?
-_MxCsr DWORD ?
-_XmmBuffer DB 160 DUP (?)
-_EFI_JUMP_BUFFER ENDS
-
-EFI_JUMP_BUFFER TYPEDEF _EFI_JUMP_BUFFER
-
-
-;
-;Routine Description:
-;
-; This routine implements the x64 variant of the SetJump call. Its
-; responsibility is to store system state information for a possible
-; subsequent LongJump.
-;
-;Arguments:
-;
-; Pointer to CPU context save buffer.
-;
-;Returns:
-;
-; EFI_SUCCESS
-;
-; EFI_STATUS
-; EFIAPI
-; TransferControlLongJump (
-; IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
-; IN EFI_JUMP_BUFFER *Jump
-; );
-;
-; rcx - *This
-; rdx - JumpBuffer
-;
-PUBLIC TransferControlSetJump
-TransferControlSetJump PROC
- mov (EFI_JUMP_BUFFER PTR [rdx])._rbx, rbx
- mov (EFI_JUMP_BUFFER PTR [rdx])._rsp, rsp
- mov (EFI_JUMP_BUFFER PTR [rdx])._rbp, rbp
- mov (EFI_JUMP_BUFFER PTR [rdx])._rdi, rdi
- mov (EFI_JUMP_BUFFER PTR [rdx])._rsi, rsi
- mov (EFI_JUMP_BUFFER PTR [rdx])._r10, r10
- mov (EFI_JUMP_BUFFER PTR [rdx])._r11, r11
- mov (EFI_JUMP_BUFFER PTR [rdx])._r12, r12
- mov (EFI_JUMP_BUFFER PTR [rdx])._r13, r13
- mov (EFI_JUMP_BUFFER PTR [rdx])._r14, r14
- mov (EFI_JUMP_BUFFER PTR [rdx])._r15, r15
- ; save non-volatile fp registers
- stmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
- lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
- movdqu [rax], xmm6
- movdqu [rax + 10h], xmm7
- movdqu [rax + 20h], xmm8
- movdqu [rax + 30h], xmm9
- movdqu [rax + 40h], xmm10
- movdqu [rax + 50h], xmm11
- movdqu [rax + 60h], xmm12
- movdqu [rax + 70h], xmm13
- movdqu [rax + 80h], xmm14
- movdqu [rax + 90h], xmm15
- mov rax, QWORD PTR [rsp+0]
- mov (EFI_JUMP_BUFFER PTR [rdx])._rip, rax
- mov rax, EFI_SUCCESS
- ret
-
-TransferControlSetJump ENDP
-
-;
-; EFI_STATUS
-; EFIAPI
-; TransferControlLongJump (
-; IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx
-; IN EFI_JUMP_BUFFER *Jump // rdx
-; );
-;
-;
-PUBLIC TransferControlLongJump
-TransferControlLongJump PROC
- ; load non-volatile fp registers
- ldmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
- lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
- movdqu xmm6, [rax]
- movdqu xmm7, [rax + 10h]
- movdqu xmm8, [rax + 20h]
- movdqu xmm9, [rax + 30h]
- movdqu xmm10, [rax + 40h]
- movdqu xmm11, [rax + 50h]
- movdqu xmm12, [rax + 60h]
- movdqu xmm13, [rax + 70h]
- movdqu xmm14, [rax + 80h]
- movdqu xmm15, [rax + 90h]
- ; set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
- mov rax, EFI_WARN_RETURN_FROM_LONG_JUMP
- mov rbx, (EFI_JUMP_BUFFER PTR [rdx])._rbx
- mov rsp, (EFI_JUMP_BUFFER PTR [rdx])._rsp
- mov rbp, (EFI_JUMP_BUFFER PTR [rdx])._rbp
- mov rdi, (EFI_JUMP_BUFFER PTR [rdx])._rdi
- mov rsi, (EFI_JUMP_BUFFER PTR [rdx])._rsi
- mov r10, (EFI_JUMP_BUFFER PTR [rdx])._r10
- mov r11, (EFI_JUMP_BUFFER PTR [rdx])._r11
- mov r12, (EFI_JUMP_BUFFER PTR [rdx])._r12
- mov r13, (EFI_JUMP_BUFFER PTR [rdx])._r13
- mov r14, (EFI_JUMP_BUFFER PTR [rdx])._r14
- mov r15, (EFI_JUMP_BUFFER PTR [rdx])._r15
- add rsp, 8 ;pop the eip
- jmp QWORD PTR (EFI_JUMP_BUFFER PTR [rdx])._rip
- ; set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
- mov rax, EFI_WARN_RETURN_FROM_LONG_JUMP
- ret
-TransferControlLongJump ENDP
-
-text ENDS
-END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
deleted file mode 100644
index 6323c1fc44..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
+++ /dev/null
@@ -1,161 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-# ProcessorAsms.S
-#
-# Abstract:
-# This is separated from processor.c to allow this functions to be built with /O1
-#
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .text
-
-.globl ASM_PFX(SwitchStacks)
-.globl ASM_PFX(TransferControlSetJump)
-.globl ASM_PFX(TransferControlLongJump)
-
-#
-# Routine Description:
-# This allows the caller to switch the stack and goes to the new entry point
-#
-# Arguments:
-# EntryPoint - Pointer to the location to enter // rcx
-# Parameter - Parameter to pass in // rdx
-# NewStack - New Location of the stack // r8
-# NewBsp - New BSP // r9 - not used
-#
-# Returns:
-# Nothing. Goes to the Entry Point passing in the new parameters
-#
-ASM_PFX(SwitchStacks):
-
- # Adjust stack for
- # 1) leave 4 registers space
- # 2) let it 16 bytes aligned after call
- sub $0x20,%r8
- and -0x10,%r8w # do not assume 16 bytes aligned
-
- mov %r8,%rsp
- mov %rcx,%r10
- mov %rdx,%rcx
- callq *%r10
-
- #
- # no ret as we have a new stack and we jumped to the new location
- #
- ret
-
-#SwitchStacks ENDP
-
-
-.set EFI_SUCCESS, 0
-.set EFI_WARN_RETURN_FROM_LONG_JUMP, 5
-
-#
-#Routine Description:
-#
-# This routine implements the x64 variant of the SetJump call. Its
-# responsibility is to store system state information for a possible
-# subsequent LongJump.
-#
-#Arguments:
-#
-# Pointer to CPU context save buffer.
-#
-#Returns:
-#
-# EFI_SUCCESS
-#
-# EFI_STATUS
-# EFIAPI
-# TransferControlLongJump (
-# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
-# IN EFI_JUMP_BUFFER *Jump
-# );
-#
-# rcx - *This
-# rdx - JumpBuffer
-#
-ASM_PFX(TransferControlSetJump):
- mov %rbx,(%rdx)
- mov %rsp,0x8(%rdx)
- mov %rbp,0x10(%rdx)
- mov %rdi,0x18(%rdx)
- mov %rsi,0x20(%rdx)
- mov %r10,0x28(%rdx)
- mov %r11,0x30(%rdx)
- mov %r12,0x38(%rdx)
- mov %r13,0x40(%rdx)
- mov %r14,0x48(%rdx)
- mov %r15,0x50(%rdx)
- #; save non-volatile fp registers
- stmxcsr 0x60(%rdx)
- lea 0x68(%rdx), %rax
- movdqu %xmm6, (%rax)
- movdqu %xmm7, 0x10(%rax)
- movdqu %xmm8, 0x20(%rax)
- movdqu %xmm9, 0x30(%rax)
- movdqu %xmm10, 0x40(%rax)
- movdqu %xmm11, 0x50(%rax)
- movdqu %xmm12, 0x60(%rax)
- movdqu %xmm13, 0x70(%rax)
- movdqu %xmm14, 0x80(%rax)
- movdqu %xmm15, 0x90(%rax)
- mov (%rsp),%rax
- mov %rax,0x58(%rdx)
- mov $0x0,%rax
- retq
-
-
-#
-# EFI_STATUS
-# EFIAPI
-# TransferControlLongJump (
-# IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This, // rcx
-# IN EFI_JUMP_BUFFER *Jump // rdx
-# );
-#
-#
-ASM_PFX(TransferControlLongJump):
- # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
- #; load non-volatile fp registers
- ldmxcsr 0x60(%rdx)
- lea 0x68(%rdx), %rax
- movdqu (%rax), %xmm6
- movdqu 0x10(%rax), %xmm7
- movdqu 0x20(%rax), %xmm8
- movdqu 0x30(%rax), %xmm9
- movdqu 0x40(%rax), %xmm10
- movdqu 0x50(%rax), %xmm11
- movdqu 0x60(%rax), %xmm12
- movdqu 0x70(%rax), %xmm13
- movdqu 0x80(%rax), %xmm14
- movdqu 0x90(%rax), %xmm15
- mov $0x5,%rax
- mov (%rdx),%rbx
- mov 0x8(%rdx),%rsp
- mov 0x10(%rdx),%rbp
- mov 0x18(%rdx),%rdi
- mov 0x20(%rdx),%rsi
- mov 0x28(%rdx),%r10
- mov 0x30(%rdx),%r11
- mov 0x38(%rdx),%r12
- mov 0x40(%rdx),%r13
- mov 0x48(%rdx),%r14
- mov 0x50(%rdx),%r15
- add $0x8,%rsp
- jmpq *0x58(%rdx)
- mov $0x5,%rax
- retq
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S
deleted file mode 100644
index 13efef48ad..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.S
+++ /dev/null
@@ -1,78 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# SupportItpDebug.S
-#
-# Abstract:
-#
-# This is the code for debuging X64, to add a break hook at loading every module
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .text
-
-.globl ASM_PFX(AsmEfiSetBreakSupport)
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmEfiSetBreakSupport (
-# IN UINTN LoadAddr // rcx
-# )
-#------------------------------------------------------------------------------
-
-ASM_PFX(AsmEfiSetBreakSupport):
-
- movw $60000, %dx
- outl %eax, %dx
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ret
-
-
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.asm
deleted file mode 100644
index cf90136f67..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/SupportItpDebug.asm
+++ /dev/null
@@ -1,76 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; SupportItpDebug.asm
-;
-; Abstract:
-;
-; This is the code for debuging X64, to add a break hook at loading every module
-;
-;------------------------------------------------------------------------------
-
-; PROC:PRIVATE
- .CODE
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmEfiSetBreakSupport (
-; IN UINTN LoadAddr // rcx
-; )
-;------------------------------------------------------------------------------
-
-AsmEfiSetBreakSupport PROC PUBLIC
-
- mov dx, 60000
- out dx, eax
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- nop
- ret
-
-AsmEfiSetBreakSupport ENDP
- END
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Debug.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Debug.c
deleted file mode 100644
index ce5f049039..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Debug.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Debug.c
-
-Abstract:
-
- Support for Debug primatives.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-#define EFI_STATUS_CODE_DATA_MAX_SIZE64 (EFI_STATUS_CODE_DATA_MAX_SIZE / 8)
-
-VOID
-EfiDebugAssert (
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description
- )
-/*++
-
-Routine Description:
-
- Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded BREAKPOINT ().
-
-Arguments:
-
- FileName - File name of failing routine.
-
- LineNumber - Line number of failing ASSERT ().
-
- Description - Description, usually the assertion,
-
-Returns:
-
- None
-
---*/
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE64];
-
- EfiDebugAssertWorker (FileName, LineNumber, Description, sizeof (Buffer), Buffer);
-
- EfiReportStatusCode (
- (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),
- (EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),
- 0,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
- //
- // Put dead loop in module that contained the error.
- //
- EFI_DEADLOOP ();
-}
-
-VOID
-EfiDebugVPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- IN VA_LIST Marker
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- Marker - VarArgs
-
-Returns:
-
- None
-
---*/
-{
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE64];
-
- if (!(gRtErrorLevel & ErrorLevel)) {
- return ;
- }
-
- EfiDebugVPrintWorker (ErrorLevel, Format, Marker, sizeof (Buffer), Buffer);
-
- EfiReportStatusCode (
- EFI_DEBUG_CODE,
- (EFI_SOFTWARE_DXE_RT_DRIVER | EFI_DC_UNSPECIFIED),
- (UINT32) ErrorLevel,
- &gEfiCallerIdGuid,
- (EFI_STATUS_CODE_DATA *) Buffer
- );
-
- return ;
-}
-
-VOID
-EfiDebugPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
- ...
- )
-/*++
-
-Routine Description:
-
- Worker function for DEBUG (). If Error Logging hub is loaded log ASSERT
- information. If Error Logging hub is not loaded do nothing.
-
- We use UINT64 buffers due to IPF alignment concerns.
-
-Arguments:
-
- ErrorLevel - If error level is set do the debug print.
-
- Format - String to use for the print, followed by Print arguments.
-
- ... - VAR args for Format
-
-Returns:
-
- None
-
---*/
-{
- VA_LIST Marker;
-
- VA_START (Marker, Format);
- EfiDebugVPrint (ErrorLevel, Format, Marker);
- VA_END (Marker);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ebc/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ebc/RuntimeLib.c
deleted file mode 100644
index 8df559c683..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ebc/RuntimeLib.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- RuntimeLib.c
-
-Abstract:
-
- Light weight lib to support Tiano drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-
-//
-// Driver Lib Module Globals
-//
-static EFI_RUNTIME_SERVICES *mRT;
-static EFI_EVENT mRuntimeNotifyEvent = NULL;
-static BOOLEAN mRuntimeLibInitialized = FALSE;
-static BOOLEAN mEfiGoneVirtual = FALSE;
-
-//
-// Runtime Global, but you should use the Lib functions
-//
-BOOLEAN mEfiAtRuntime = FALSE;
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
-#endif
-
-EFI_STATUS
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->ConvertPointer (DebugDisposition, Address);
-}
-
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Set AtRuntime flag as TRUE after ExitBootServices
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- mEfiAtRuntime = TRUE;
-}
-
-EFI_STATUS
-EfiInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY GoVirtualChildEvent
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
-
- Status = EfiLibGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- ASSERT_EFI_ERROR (Status);
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status)) {
- gStatusCode = NULL;
- }
-#endif
-
- //
- // Register our ExitBootServices () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- RuntimeDriverExitBootServices,
- NULL,
- &mRuntimeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // To NOT register SetVirtualAddressMap () notify function,
- // because we do not know how to trigger it without our EBC driver.
- //
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiShutdownRuntimeDriverLib (
- VOID
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-{
- EFI_STATUS Status;
-
- if (!mRuntimeLibInitialized) {
- //
- // You must call EfiInitializeRuntimeDriverLib() first
- //
- return EFI_UNSUPPORTED;
- }
-
- mRuntimeLibInitialized = FALSE;
-
- //
- // Close our ExitBootServices () notify function
- //
- if (mRuntimeNotifyEvent != NULL) {
- Status = gBS->CloseEvent (mRuntimeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if ExitBootServices () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If ExitBootServices () has been called
-
---*/
-{
- return mEfiAtRuntime;
-}
-
-BOOLEAN
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
-
---*/
-{
- return mEfiGoneVirtual;
-}
-
-EFI_STATUS
-EfiReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId,
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-{
- return EFI_UNSUPPORTED;
-}
-//
-// Cache Flush Routine.
-//
-EFI_STATUS
-EfiCpuFlushCache (
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Flush cache with specified range.
-
-Arguments:
-
- Start - Start address
- Length - Length in bytes
-
-Returns:
-
- Status code
-
- EFI_SUCCESS - success
-
---*/
-{
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib.inf b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib.inf
deleted file mode 100644
index 948bffa205..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib.inf
+++ /dev/null
@@ -1,81 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiRuntimeLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI runtime library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiRuntimeLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Debug.c
- Event.c
- Io.c
- LibGlobals.c
- GetImage.c
- RtDevicePath.c
-
-[sources.ia32]
- Ia32/RuntimeLib.c
- Ia32/IoLib.c
- Ia32/Lock.c
- Ia32/PlatformIoLib.c
- Ia32/Fvb.c
- Ia32/CpuFlushCache.c
-
-[sources.x64]
- X64/RuntimeLib.c
- X64/IoLib.c
- X64/Lock.c
- X64/PlatformIoLib.c
- X64/Fvb.c
- X64/RuntimeLibAsm.asm
-
-[sources.ipf]
- Ipf/RuntimeLib.c
- Ipf/Lock.c
- Ipf/Fvb.c
- Ipf/EsalLib.s
- Ipf/IpfCpuCache.s
-
-[sources.ebc]
- Ebc/RuntimeLib.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
- EdkGuidLib
- EdkProtocolLib
- EdkFrameworkProtocolLib
- EfiGuidLib
- EfiProtocolLib
- ArchProtocolLib
- EfiCommonLib
-
-[nmake.common]
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib_Edk2.inf
deleted file mode 100644
index b9b48872b9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/EfiRuntimeLib_Edk2.inf
+++ /dev/null
@@ -1,90 +0,0 @@
-#/*++
-#
-# Copyright (c) 2004 - 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.
-#
-# Module Name:
-#
-# EfiRuntimeLib.inf
-#
-# Abstract:
-#
-# Component description file for the EFI runtime library.
-#
-#--*/
-
-[defines]
-BASE_NAME = EfiRuntimeLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- Debug.c
- Event.c
- Io.c
- LibGlobals.c
- GetImage.c
- RtDevicePath.c
-
-[sources.ia32]
- Ia32/RuntimeLib.c
- Ia32/IoLib.c
- Ia32/Lock.c
- Ia32/PlatformIoLib.c
- Ia32/Fvb.c
- Ia32/CpuFlushCache.c | MSFT
- Ia32/CpuFlushCache.asm | INTEL
- Ia32/CpuFlushCache.S | GCC
-
-[sources.x64]
- X64/RuntimeLib.c
- X64/IoLib.c
- X64/Lock.c
- X64/PlatformIoLib.c
- X64/Fvb.c
- X64/RuntimeLibAsm.asm | MSFT
- X64/RuntimeLibAsm.asm | INTEL
- X64/RuntimeLibAsm.S | GCC
-
-[sources.ipf]
- Ipf/RuntimeLib.c
- Ipf/Lock.c
- Ipf/Fvb.c
- Ipf/EsalLib.s
- Ipf/IpfCpuCache.s
- #
- # Only for CYGWINGCC IPF tool chain, EFI_BREAKPOINT and MEMORY_FENCE
- # is defined as two functions EcpEfiBreakPoint and EcpMemoryFence.
- #
- Ipf/AsmCpuMisc.s | GCC
-
-[sources.ebc]
- Ebc/RuntimeLib.c
-
-[includes.common]
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
- EdkGuidLib
- EdkProtocolLib
- EdkFrameworkProtocolLib
- EfiGuidLib
- EfiProtocolLib
- ArchProtocolLib
- EfiCommonLib
-
-[nmake.common]
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Event.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Event.c
deleted file mode 100644
index e8200af365..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Event.c
+++ /dev/null
@@ -1,351 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 2011, 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.
-
-Module Name:
-
- Event.c
-
-Abstract:
-
- Support for Event lib fucntions.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-
-EFI_EVENT
-RtEfiLibCreateProtocolNotifyEvent (
- IN EFI_GUID *ProtocolGuid,
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT VOID **Registration
- )
-/*++
-
-Routine Description:
-
- Create a protocol notification event and return it.
-
-Arguments:
-
- ProtocolGuid - Protocol to register notification event on.
-
- NotifyTpl - Maximum TPL to single the NotifyFunction.
-
- NotifyFunction - EFI notification routine.
-
- NotifyContext - Context passed into Event when it is created.
-
- Registration - Registration key returned from RegisterProtocolNotify().
-
-Returns:
-
- The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
- is added to the system.
-
---*/
-{
- EFI_STATUS Status;
- EFI_EVENT Event;
-
- //
- // Create the event
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- NotifyTpl,
- NotifyFunction,
- NotifyContext,
- &Event
- );
- ASSERT (!EFI_ERROR (Status));
-
- //
- // Register for protocol notifactions on this event
- //
- Status = gBS->RegisterProtocolNotify (
- ProtocolGuid,
- Event,
- Registration
- );
-
- ASSERT (!EFI_ERROR (Status));
-
- //
- // Kick the event so we will perform an initial pass of
- // current installed drivers
- //
- gBS->SignalEvent (Event);
- return Event;
-}
-
-EFI_STATUS
-EfiLibGetSystemConfigurationTable (
- IN EFI_GUID *TableGuid,
- IN OUT VOID **Table
- )
-/*++
-
-Routine Description:
-
- Return the EFI 1.0 System Tabl entry with TableGuid
-
-Arguments:
-
- TableGuid - Name of entry to return in the system table
- Table - Pointer in EFI system table associated with TableGuid
-
-Returns:
-
- EFI_SUCCESS - Table returned;
- EFI_NOT_FOUND - TableGuid not in EFI system table
-
---*/
-{
- UINTN Index;
-
- for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
- if (EfiCompareGuid (TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
- *Table = gST->ConfigurationTable[Index].VendorTable;
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
-
-EFI_STATUS
-EfiConvertList (
- IN UINTN DebugDisposition,
- IN OUT EFI_LIST_ENTRY *ListHead
- )
-/*++
-
-Routine Description:
-
- Conver the standard Lib double linked list to a virtual mapping.
-
-Arguments:
-
- DebugDisposition - Argument to EfiConvertPointer (EFI 1.0 API)
-
- ListHead - Head of linked list to convert
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- EFI_LIST_ENTRY *Link;
- EFI_LIST_ENTRY *NextLink;
-
- //
- // Convert all the ForwardLink & BackLink pointers in the list
- //
- Link = ListHead;
- do {
- NextLink = Link->ForwardLink;
-
- EfiConvertPointer (
- Link->ForwardLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->ForwardLink
- );
-
- EfiConvertPointer (
- Link->BackLink == ListHead ? DebugDisposition : 0,
- (VOID **) &Link->BackLink
- );
-
- Link = NextLink;
- } while (Link != ListHead);
- return EFI_SUCCESS;
-}
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-STATIC
-VOID
-EFIAPI
-EventNotifySignalAllNullEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- //
- // This null event is a size efficent way to enusre that
- // EFI_EVENT_NOTIFY_SIGNAL_ALL is error checked correctly.
- // EFI_EVENT_NOTIFY_SIGNAL_ALL is now mapped into
- // CreateEventEx() and this function is used to make the
- // old error checking in CreateEvent() for Tiano extensions
- // function.
- //
- return;
-}
-
-#endif
-
-EFI_STATUS
-EFIAPI
-RtEfiCreateEventLegacyBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *LegacyBootEvent
- )
-/*++
-
-Routine Description:
- Create a Legacy Boot Event.
- Tiano extended the CreateEvent Type enum to add a legacy boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification by
- declaring a GUID for the legacy boot event class. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Returns:
- EFI_SUCCESS Event was created.
- Other Event was not created.
-
---*/
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- LegacyBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventLegacyBootGuid,
- LegacyBootEvent
- );
-#endif
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-RtEfiCreateEventReadyToBoot (
- IN EFI_TPL NotifyTpl,
- IN EFI_EVENT_NOTIFY NotifyFunction,
- IN VOID *NotifyContext,
- OUT EFI_EVENT *ReadyToBootEvent
- )
-/*++
-
-Routine Description:
- Create a Read to Boot Event.
-
- Tiano extended the CreateEvent Type enum to add a ready to boot event type.
- This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
- added and now it's possible to not voilate the UEFI specification and use
- the ready to boot event class defined in UEFI 2.0. This library supports
- the EFI 1.10 form and UEFI 2.0 form and allows common code to work both ways.
-
-Arguments:
- ReadyToBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
-
-Return:
- EFI_SUCCESS - Event was created.
- Other - Event was not created.
-
---*/
-{
- EFI_STATUS Status;
- UINT32 EventType;
- EFI_EVENT_NOTIFY WorkerNotifyFunction;
-
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
-
- if (NotifyFunction == NULL) {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
- } else {
- EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
- }
- WorkerNotifyFunction = NotifyFunction;
-
- //
- // prior to UEFI 2.0 use Tiano extension to EFI
- //
- Status = gBS->CreateEvent (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- ReadyToBootEvent
- );
-#else
-
- EventType = EFI_EVENT_NOTIFY_SIGNAL;
- if (NotifyFunction == NULL) {
- //
- // CreatEventEx will check NotifyFunction is NULL or not
- //
- WorkerNotifyFunction = EventNotifySignalAllNullEvent;
- } else {
- WorkerNotifyFunction = NotifyFunction;
- }
-
- //
- // For UEFI 2.0 and the future use an Event Group
- //
- Status = gBS->CreateEventEx (
- EventType,
- NotifyTpl,
- WorkerNotifyFunction,
- NotifyContext,
- &gEfiEventReadyToBootGuid,
- ReadyToBootEvent
- );
-#endif
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/GetImage.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/GetImage.c
deleted file mode 100644
index 6dd2839914..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/GetImage.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- GetImage.c
-
-Abstract:
-
- Image data extraction support for common use.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include "EfiImageFormat.h"
-
-#include EFI_PROTOCOL_CONSUMER (LoadedImage)
-
-EFI_STATUS
-GetImageFromFv (
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- IN EFI_FIRMWARE_VOLUME_PROTOCOL *Fv,
-#else
- IN EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv,
-#endif
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size
- )
-{
- EFI_STATUS Status;
- EFI_FV_FILETYPE FileType;
- EFI_FV_FILE_ATTRIBUTES Attributes;
- UINT32 AuthenticationStatus;
-
- //
- // Read desired section content in NameGuid file
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadSection (
- Fv,
- NameGuid,
- SectionType,
- 0,
- Buffer,
- Size,
- &AuthenticationStatus
- );
-
- if (EFI_ERROR (Status) && (SectionType == EFI_SECTION_TE)) {
- //
- // Try reading PE32 section, since the TE section does not exist
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadSection (
- Fv,
- NameGuid,
- EFI_SECTION_PE32,
- 0,
- Buffer,
- Size,
- &AuthenticationStatus
- );
- }
-
- if (EFI_ERROR (Status) &&
- ((SectionType == EFI_SECTION_TE) || (SectionType == EFI_SECTION_PE32))) {
- //
- // Try reading raw file, since the desired section does not exist
- //
- *Buffer = NULL;
- *Size = 0;
- Status = Fv->ReadFile (
- Fv,
- NameGuid,
- Buffer,
- Size,
- &FileType,
- &Attributes,
- &AuthenticationStatus
- );
- }
-
- return Status;
-}
-
-EFI_STATUS
-GetImage (
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size
- )
-{
- return GetImageEx (NULL, NameGuid, SectionType, Buffer, Size, FALSE);
-}
-
-EFI_STATUS
-GetImageEx (
- IN EFI_HANDLE ImageHandle,
- IN EFI_GUID *NameGuid,
- IN EFI_SECTION_TYPE SectionType,
- OUT VOID **Buffer,
- OUT UINTN *Size,
- BOOLEAN WithinImageFv
- )
-{
- EFI_STATUS Status;
- EFI_HANDLE *HandleBuffer;
- UINTN HandleCount;
- UINTN Index;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
-#if (PI_SPECIFICATION_VERSION < 0x00010000)
- EFI_FIRMWARE_VOLUME_PROTOCOL *ImageFv;
- EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
-#else
- EFI_FIRMWARE_VOLUME2_PROTOCOL *ImageFv;
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
-#endif
-
- if (ImageHandle == NULL && WithinImageFv) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = EFI_NOT_FOUND;
- ImageFv = NULL;
- if (ImageHandle != NULL) {
- Status = gBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- Status = gBS->HandleProtocol (
- LoadedImage->DeviceHandle,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- (VOID **) &ImageFv
- );
- if (!EFI_ERROR (Status)) {
- Status = GetImageFromFv (ImageFv, NameGuid, SectionType, Buffer, Size);
- }
- }
-
- if (Status == EFI_SUCCESS || WithinImageFv) {
- return Status;
- }
-
- Status = gBS->LocateHandleBuffer (
- ByProtocol,
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- NULL,
- &HandleCount,
- &HandleBuffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Find desired image in all Fvs
- //
- for (Index = 0; Index < HandleCount; ++Index) {
- Status = gBS->HandleProtocol (
- HandleBuffer[Index],
- #if (PI_SPECIFICATION_VERSION < 0x00010000)
- &gEfiFirmwareVolumeProtocolGuid,
- #else
- &gEfiFirmwareVolume2ProtocolGuid,
- #endif
- (VOID**)&Fv
- );
-
- if (EFI_ERROR (Status)) {
- gBS->FreePool(HandleBuffer);
- return Status;
- }
-
- if (ImageFv != NULL && Fv == ImageFv) {
- continue;
- }
-
- Status = GetImageFromFv (Fv, NameGuid, SectionType, Buffer, Size);
-
- if (!EFI_ERROR (Status)) {
- break;
- }
- }
- gBS->FreePool(HandleBuffer);
-
- //
- // Not found image
- //
- if (Index == HandleCount) {
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.S b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.S
deleted file mode 100644
index cb66e737d8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.S
+++ /dev/null
@@ -1,61 +0,0 @@
-#/*++
-#
-#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.
-#
-#Module Name:
-#
- #CpuFlushCache.c
-#
-#Abstract:
-#
- #Cpu Flush Cache Function.
-#
-#--*/
-#---------------------------------------------------------------------------
-#include <EfiBind.h>
-
- .586p:
- #.MODEL flat,C
- .code:
-
-#---------------------------------------------------------------------------
-.globl ASM_PFX(EfiCpuFlushCache)
-
-#
-#//
-#// Cache Flush Routine.
-#//
-#EFI_STATUS
-#EfiCpuFlushCache (
- #IN EFI_PHYSICAL_ADDRESS Start,
-# IN UINT64 Length
- #)
-#/*++
-#
-#Routine Description:
-#
- #Flush cache with specified range.
-#
-#Arguments:
-#
- #Start - Start address
-# Length - Length in bytes
-#
-#Returns:
-#
- #Status code
-#
- #EFI_SUCCESS - success
-#
-#--*/
-ASM_PFX(EfiCpuFlushCache):
- wbinvd
- xorl %eax, %eax
- ret
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.asm b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.asm
deleted file mode 100644
index 0b0bb7654e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.asm
+++ /dev/null
@@ -1,62 +0,0 @@
-;/*++
-;
-;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.
-;
-;Module Name:
-;
- ;CpuFlushCache.c
-;
-;Abstract:
-;
- ;Cpu Flush Cache Function.
-;
-;--*/
-;---------------------------------------------------------------------------
- .586p
- .model flat,C
- .code
-
-;---------------------------------------------------------------------------
-;
-;//
-;// Cache Flush Routine.
-;//
-;EFI_STATUS
-;EfiCpuFlushCache (
- ;IN EFI_PHYSICAL_ADDRESS Start,
-; IN UINT64 Length
- ;)
-;/*++
-;
-;Routine Description:
-;
- ;Flush cache with specified range.
-;
-;Arguments:
-;
- ;Start - Start address
-; Length - Length in bytes
-;
-;Returns:
-;
- ;Status code
-;
- ;EFI_SUCCESS - success
-;
-;--*/
-EfiCpuFlushCache PROC
- wbinvd
- xor eax, eax
- ret
-EfiCpuFlushCache ENDP
-
- END
-
- \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.c
deleted file mode 100644
index 00e6030612..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/CpuFlushCache.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- CpuFlushCache.c
-
-Abstract:
-
- Cpu Flush Cache Function.
-
---*/
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-
-//
-// Cache Flush Routine.
-//
-EFI_STATUS
-EfiCpuFlushCache (
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Flush cache with specified range.
-
-Arguments:
-
- Start - Start address
- Length - Length in bytes
-
-Returns:
-
- Status code
-
- EFI_SUCCESS - success
-
---*/
-{
- __asm {
- wbinvd
- }
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Fvb.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Fvb.c
deleted file mode 100644
index a1ed0eb869..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Fvb.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Fvb.c
-
-Abstract:
-
- Firmware Volume Block Protocol Runtime Abstraction
-
- mFvbEntry is an array of Handle Fvb pairs. The Fvb Lib Instance matches the
- index in the mFvbEntry array. This should be the same sequence as the FVB's
- were described in the HOB. We have to remember the handle so we can tell if
- the protocol has been reinstalled and it needs updateing.
-
- If you are using any of these lib functions.you must first call FvbInitialize ().
-
-Key:
- FVB - Firmware Volume Block
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_PROTOCOL_DEFINITION (FvbExtension)
-
-//
-// Lib will ASSERT if more FVB devices than this are added to the system.
-//
-UINTN mFvbCount;
-VOID *mFvbRegistration;
-VOID *mFvbExtRegistration;
-//static EFI_EVENT mEfiFvbVirtualNotifyEvent;
-BOOLEAN gEfiFvbInitialized = FALSE;
-EFI_EVENT mFvbEvent;
-
-BOOLEAN
-IsMemoryRuntime (
- IN VOID *Address
- )
-/*++
-
-Routine Description:
- Check whether an address is runtime memory or not.
-
-Arguments:
-
- Address - The Address being checked.
-
-Returns:
- TRUE - The address is runtime memory.
- FALSE - The address is not runtime memory.
-
---*/
-{
- EFI_STATUS Status;
- UINT8 TmpMemoryMap[1];
- UINTN MapKey;
- UINTN DescriptorSize;
- UINT32 DescriptorVersion;
- UINTN MemoryMapSize;
- EFI_MEMORY_DESCRIPTOR *MemoryMap;
- EFI_MEMORY_DESCRIPTOR *MemoryMapPtr;
- BOOLEAN IsRuntime;
- UINTN Index;
-
- IsRuntime = FALSE;
-
- //
- // Get System MemoryMapSize
- //
- MemoryMapSize = 1;
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- (EFI_MEMORY_DESCRIPTOR *)TmpMemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- ASSERT (Status == EFI_BUFFER_TOO_SMALL);
- //
- // Enlarge space here, because we will allocate pool now.
- //
- MemoryMapSize += EFI_PAGE_SIZE;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- MemoryMapSize,
- (VOID**)&MemoryMap
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Get System MemoryMap
- //
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- ASSERT_EFI_ERROR (Status);
-
- MemoryMapPtr = MemoryMap;
- //
- // Search the request Address
- //
- for (Index = 0; Index < (MemoryMapSize / DescriptorSize); Index++) {
- if (((EFI_PHYSICAL_ADDRESS)(UINTN)Address >= MemoryMap->PhysicalStart) &&
- ((EFI_PHYSICAL_ADDRESS)(UINTN)Address < MemoryMap->PhysicalStart
- + LShiftU64 (MemoryMap->NumberOfPages, EFI_PAGE_SHIFT))) {
- //
- // Found it
- //
- if (MemoryMap->Attribute & EFI_MEMORY_RUNTIME) {
- IsRuntime = TRUE;
- }
- break;
- }
- //
- // Get next item
- //
- MemoryMap = (EFI_MEMORY_DESCRIPTOR *)((UINTN)MemoryMap + DescriptorSize);
- }
-
- //
- // Done
- //
- gBS->FreePool (MemoryMapPtr);
-
- return IsRuntime;
-}
-
-VOID
-EFIAPI
-FvbNotificationFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
- Update mFvbEntry. Add new entry, or update existing entry if Fvb protocol is
- reinstalled.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
- None
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HANDLE Handle;
- UINTN Index;
- UINTN UpdateIndex;
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
- EFI_FVB_EXTENSION_PROTOCOL *FvbExtension;
-
- while (TRUE) {
- BufferSize = sizeof (Handle);
- Status = gBS->LocateHandle (
- ByRegisterNotify,
- &gEfiFirmwareVolumeBlockProtocolGuid,
- mFvbRegistration,
- &BufferSize,
- &Handle
- );
- if (EFI_ERROR (Status)) {
- //
- // Exit Path of While Loop....
- //
- break;
- }
-
- UpdateIndex = MAX_FVB_COUNT;
- for (Index = 0; Index < mFvbCount; Index++) {
- if (mFvbEntry[Index].Handle == Handle) {
- //
- // If the handle is already in the table just update the protocol
- //
- UpdateIndex = Index;
- break;
- }
- }
-
- if (UpdateIndex == MAX_FVB_COUNT) {
- //
- // Use the next free slot for a new entry
- //
- UpdateIndex = mFvbCount;
- }
- //
- // The array does not have enough entries
- //
- ASSERT (UpdateIndex < MAX_FVB_COUNT);
-
- //
- // Get the interface pointer and if it's ours, skip it.
- // We check Runtime here, because it has no reason to register
- // a boot time FVB protocol.
- //
- Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **) &Fvb);
- ASSERT_EFI_ERROR (Status);
- if (IsMemoryRuntime (Fvb)) {
- //
- // Increase mFvbCount if we need to add a new entry
- //
- if (UpdateIndex == mFvbCount) {
- mFvbCount++;
- }
- mFvbEntry[UpdateIndex].Handle = Handle;
- mFvbEntry[UpdateIndex].Fvb = Fvb;
- mFvbEntry[UpdateIndex].FvbExtension = NULL;
-
- Status = gBS->HandleProtocol (Handle, &gEfiFvbExtensionProtocolGuid, (VOID **) &FvbExtension);
- if ((Status == EFI_SUCCESS) && IsMemoryRuntime (FvbExtension)) {
- mFvbEntry[UpdateIndex].FvbExtension = FvbExtension;
- }
- }
- }
-}
-
-EFI_STATUS
-EfiFvbInitialize (
- VOID
- )
-/*++
-
-Routine Description:
- Initialize globals and register Fvb Protocol notification function.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS - Fvb is successfully initialized
- others - Fail to initialize
-
---*/
-{
- UINTN Status;
- mFvbCount = 0;
-
- Status = gBS->AllocatePool (
- EfiRuntimeServicesData,
- (UINTN) sizeof (FVB_ENTRY) * MAX_FVB_COUNT,
- (VOID *) &mFvbEntry
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- EfiZeroMem (mFvbEntry, sizeof (FVB_ENTRY) * MAX_FVB_COUNT);
-
- mFvbEvent = RtEfiLibCreateProtocolNotifyEvent (
- &gEfiFirmwareVolumeBlockProtocolGuid,
- EFI_TPL_CALLBACK,
- FvbNotificationFunction,
- NULL,
- &mFvbRegistration
- );
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- // Status = gBS->CreateEvent (
- // EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- // EFI_TPL_NOTIFY,
- // EfiRuntimeLibFvbVirtualNotifyEvent,
- // NULL,
- // &mEfiFvbVirtualNotifyEvent
- // );
- // ASSERT_EFI_ERROR (Status);
- //
- gEfiFvbInitialized = TRUE;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiFvbShutdown (
- VOID
- )
-/*++
-
-Routine Description:
- Release resources allocated in EfiFvbInitialize.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-{
- gBS->FreePool ((VOID *) mFvbEntry);
- gBS->CloseEvent (mFvbEvent);
- gEfiFvbInitialized = FALSE;
- return EFI_SUCCESS;
-}
-
-//
-// The following functions wrap Fvb protocol in the Runtime Lib functions.
-// The Instance translates into Fvb instance. The Fvb order defined by HOBs and
-// thus the sequence of FVB protocol addition define Instance.
-//
-// EfiFvbInitialize () must be called before any of the following functions
-// must be called.
-//
-
-EFI_STATUS
-EfiFvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Reads specified number of bytes into a buffer from the specified block
-
-Arguments:
- Instance - The FV instance to be read from
- Lba - The logical block address to be read from
- Offset - Offset into the block at which to begin reading
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes read
- Buffer - Pointer to a caller allocated buffer that will be
- used to hold the data read
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->Read (mFvbEntry[Instance].Fvb, Lba, Offset, NumBytes, Buffer);
-}
-
-EFI_STATUS
-EfiFvbWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Writes specified number of bytes from the input buffer to the block
-
-Arguments:
- Instance - The FV instance to be written to
- Lba - The starting logical block index to write to
- Offset - Offset into the block at which to begin writing
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes actually written
- Buffer - Pointer to a caller allocated buffer that contains
- the source for the write
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->Write (mFvbEntry[Instance].Fvb, Lba, Offset, NumBytes, Buffer);
-}
-
-EFI_STATUS
-EfiFvbEraseBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba
- )
-/*++
-
-Routine Description:
- Erases and initializes a firmware volume block
-
-Arguments:
- Instance - The FV instance to be erased
- Lba - The logical block index to be erased
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->EraseBlocks (mFvbEntry[Instance].Fvb, Lba, -1);
-}
-
-EFI_STATUS
-EfiFvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES *Attributes
- )
-/*++
-
-Routine Description:
- Retrieves attributes, insures positive polarity of attribute bits, returns
- resulting attributes in output parameter
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- returned
- Attributes - Output buffer which contains attributes
-
-Returns:
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetVolumeAttributes (mFvbEntry[Instance].Fvb, Attributes);
-}
-
-EFI_STATUS
-EfiFvbSetVolumeAttributes (
- IN UINTN Instance,
- IN EFI_FVB_ATTRIBUTES Attributes
- )
-/*++
-
-Routine Description:
- Modifies the current settings of the firmware volume according to the
- input parameter.
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- modified
- Attributes - It is a pointer to EFI_FVB_ATTRIBUTES
- containing the desired firmware volume settings.
-
-Returns:
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->SetVolumeAttributes (mFvbEntry[Instance].Fvb, &Attributes);
-}
-
-EFI_STATUS
-EfiFvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- BaseAddress - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
- that on successful return, contains the base address
- of the firmware volume.
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetPhysicalAddress (mFvbEntry[Instance].Fvb, BaseAddress);
-}
-
-EFI_STATUS
-EfiFvbGetBlockSize (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
- Retrieve the size of a logical block
-
-Arguments:
- Instance - The FV instance whose block size is going to be
- returned
- Lba - Indicates which block to return the size for.
- BlockSize - A pointer to a caller allocated UINTN in which
- the size of the block is returned
- NumOfBlocks - a 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
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetBlockSize (mFvbEntry[Instance].Fvb, Lba, BlockSize, NumOfBlocks);
-}
-
-EFI_STATUS
-EfiFvbEraseCustomBlockRange (
- IN UINTN Instance,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- Instance - The FV instance to be erased
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetLastLba - Offset into the last block at which to end erasing
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
- EFI_UNSUPPORTED - not support
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (!(mFvbEntry[Instance].FvbExtension)) {
- return EFI_UNSUPPORTED;
- }
-
- if (!(mFvbEntry[Instance].FvbExtension->EraseFvbCustomBlock)) {
- return EFI_UNSUPPORTED;
- }
-
- return mFvbEntry[Instance].FvbExtension->EraseFvbCustomBlock (
- mFvbEntry[Instance].FvbExtension,
- StartLba,
- OffsetStartLba,
- LastLba,
- OffsetLastLba
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/IoLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/IoLib.c
deleted file mode 100644
index a67a8602b9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/IoLib.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- IoLib.c
-
-Abstract:
-
- Light weight lib to support Tiano drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-
-extern EFI_CPU_IO_PROTOCOL *gCpuIo;
-
-EFI_STATUS
-EfiIoRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO read into Buffer.
-
-Arguments:
- Width - Width of read transaction, and repeat operation to use
- Address - IO address to read
- Count - Number of times to read the IO address.
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Io.Read (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiIoWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Io.Write (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiMemRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a Memory mapped IO read into Buffer.
-
-Arguments:
- Width - Width of each read transaction.
- Address - Memory mapped IO address to read
- Count - Number of Width quanta to read
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Mem.Read (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiMemWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a memory mapped IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Mem.Write (gCpuIo, Width, Address, Count, Buffer);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Lock.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Lock.c
deleted file mode 100644
index f25c11ba26..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/Lock.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Lock.c
-
-Abstract:
-
- Support for locking lib services.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-extern
-BOOLEAN
-EfiAtRuntime (
- VOID
- );
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
- Note on a check build ASSERT()s are used to ensure proper
- lock usage.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - The task priority level of the lock
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-{
- Lock->Tpl = Priority;
- Lock->OwnerTpl = 0;
- Lock->Lock = 0;
-}
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-{
- if (Lock->Lock != 0) {
- //
- // Lock is already owned, so bail out
- //
- return EFI_ACCESS_DENIED;
- }
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
- }
-
- Lock->Lock += 1;
- return EFI_SUCCESS;
-}
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Raising to the task priority level of the mutual exclusion
- lock, and then acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- Lock owned
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiAcquireLockOrFail (Lock);
-
- //
- // Lock was already locked.
- //
- ASSERT_EFI_ERROR (Status);
-}
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock, and
- restores the previous task priority level.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- Lock unowned
-
---*/
-{
- EFI_TPL Tpl;
-
- Tpl = Lock->OwnerTpl;
-
- ASSERT (Lock->Lock == 1);
- Lock->Lock -= 1;
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- gBS->RestoreTPL (Tpl);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/PlatformIoLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/PlatformIoLib.c
deleted file mode 100644
index 62e691ffbc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/PlatformIoLib.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- PlatformIoLib.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-
-#define PCI_CONFIG_INDEX_PORT 0xcf8
-#define PCI_CONFIG_DATA_PORT 0xcfc
-#define REFRESH_CYCLE_TOGGLE_BIT 0x10
-
-UINT32
-GetPciAddress (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Constructs PCI Address 32 bits
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- PciAddress to be written to Config Port
-
---*/
-{
- UINT32 Data;
-
- Data = (((UINT32) Segment) << 24);
- Data |= (((UINT32) Bus) << 16);
- Data |= (((UINT32) DevFunc) << 8);
- Data |= (UINT32) Register;
-
- return Data;
-
-}
-
-UINT8
-PciRead8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT8 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint8, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-UINT16
-PciRead16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT16 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint16, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-UINT32
-PciRead32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT32 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint32, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-VOID
-PciWrite8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT8 Data
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint8, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-
-VOID
-PciWrite16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT16 Data
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint16, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-
-VOID
-PciWrite32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT32 Data
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint32, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-//
-// Delay Primative
-//
-VOID
-EfiStall (
- IN UINTN Microseconds
- )
-/*++
-
-Routine Description:
- Delay for at least the request number of microseconds
-
-Arguments:
- Microseconds - Number of microseconds to delay.
-
-Returns:
- NONE
-
---*/
-{
- UINT8 Data;
- UINT8 InitialState;
- UINTN CycleIterations;
-
- CycleIterations = 0;
- Data = 0;
- InitialState = 0;
-
- if (EfiAtRuntime ()) {
- //
- // The time-source is 30 us granular, so calibrate the timing loop
- // based on this baseline
- // Error is possible 30us.
- //
- CycleIterations = (Microseconds - 1) / 30 + 1;
-
- //
- // Use the DMA Refresh timer in port 0x61. Cheap but effective.
- // The only issue is that the granularity is 30us, and we want to
- // guarantee "at least" one full transition to avoid races.
- //
- //
- // _____________/----------\__________/--------
- //
- // |<--15us-->|<--15us-->|
- //
- // --------------------------------------------------> Time (us)
- //
- while (CycleIterations--) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- InitialState = Data;
-
- //
- // Capture first transition (strictly less than one period)
- //
- while (InitialState == Data) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- }
-
- InitialState = Data;
- //
- // Capture next transition (guarantee at least one full pulse)
- //
- while (InitialState == Data) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- }
- }
- } else {
- gBS->Stall (Microseconds);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
deleted file mode 100644
index 727e6636b9..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/*++
-
-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
-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:
-
- RuntimeLib.c
-
-Abstract:
-
- Light weight lib to support Tiano drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include "PeiHob.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
-#include EFI_PROTOCOL_DEFINITION (SmmBase)
-
-//
-// Driver Lib Module Globals
-//
-static EFI_RUNTIME_SERVICES *mRT;
-static EFI_EVENT mRuntimeNotifyEvent = NULL;
-static EFI_EVENT mEfiVirtualNotifyEvent = NULL;
-static BOOLEAN mRuntimeLibInitialized = FALSE;
-static BOOLEAN mEfiGoneVirtual = FALSE;
-static BOOLEAN mInSmm = FALSE;
-
-//
-// Runtime Global, but you should use the Lib functions
-//
-EFI_CPU_IO_PROTOCOL *gCpuIo;
-BOOLEAN mEfiAtRuntime = FALSE;
-FVB_ENTRY *mFvbEntry;
-EFI_SMM_STATUS_CODE_PROTOCOL *gSmmStatusCodeProtocol = NULL;
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_REPORT_STATUS_CODE gReportStatusCode = NULL;
-EFI_EVENT gEfiStatusCodeNotifyEvent = NULL;
-
-VOID
-EFIAPI
-OnStatusCodeInstall (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- EFI_STATUS_CODE_PROTOCOL *StatusCode;
-
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **) &StatusCode);
- if (!EFI_ERROR (Status)) {
- gReportStatusCode = StatusCode->ReportStatusCode;
- }
-}
-
-EFI_STATUS
-GetPeiProtocol (
- IN EFI_GUID *ProtocolGuid,
- IN VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Searches for a Protocol Interface passed from PEI through a HOB
-
-Arguments:
-
- ProtocolGuid - The Protocol GUID to search for in the HOB List
-
- Interface - A pointer to the interface for the Protocol GUID
-
-Returns:
-
- EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
-
- EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- //
- // Get Hob list
- //
- Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **) &GuidHob.Raw);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
- if (END_OF_HOB_LIST (GuidHob)) {
- Status = EFI_NOT_FOUND;
- break;
- }
-
- if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {
- if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {
- Status = EFI_SUCCESS;
- *Interface = (VOID *) *(UINTN *) (GuidHob.Guid + 1);
- }
- }
-
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
-
-#endif
-
-EFI_STATUS
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->ConvertPointer (DebugDisposition, Address);
-}
-
-EFI_STATUS
-EfiConvertInternalPointer (
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Call EfiConvertPointer() to convert internal pointer.
-
-Arguments:
-
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return EfiConvertPointer (EFI_INTERNAL_POINTER, Address);
-}
-
-VOID
-EFIAPI
-EfiRuntimeLibFvbVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Convert all pointers in mFvbEntry after ExitBootServices.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- UINTN Index;
- if (mFvbEntry != NULL) {
- for (Index = 0; Index < MAX_FVB_COUNT; Index++) {
- if (NULL != mFvbEntry[Index].Fvb) {
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetBlockSize);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetPhysicalAddress);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetVolumeAttributes);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->SetVolumeAttributes);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->Read);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->Write);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->EraseBlocks);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb);
- }
-
- if (NULL != mFvbEntry[Index].FvbExtension) {
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].FvbExtension->EraseFvbCustomBlock);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].FvbExtension);
- }
- }
-
- EfiConvertInternalPointer ((VOID **) &mFvbEntry);
- }
-}
-
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Set AtRuntime flag as TRUE after ExitBootServices
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- mEfiAtRuntime = TRUE;
-}
-
-extern BOOLEAN gEfiFvbInitialized;
-
-VOID
-EFIAPI
-EfiRuntimeLibVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Fixup internal data so that EFI can be call in virtual mode.
- Call the passed in Child Notify event and convert any pointers in
- lib to virtual mode.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
-
- if (Context != NULL) {
- ChildNotifyEventHandler = (EFI_EVENT_NOTIFY) (UINTN) Context;
- ChildNotifyEventHandler (Event, NULL);
- }
-
- if (gEfiFvbInitialized) {
- EfiRuntimeLibFvbVirtualNotifyEvent (Event, Context);
- }
- //
- // Update global for Runtime Services Table and IO
- //
- EfiConvertInternalPointer ((VOID **) &gCpuIo);
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gReportStatusCode != NULL) {
- EfiConvertInternalPointer ((VOID **) &gReportStatusCode);
- }
-#endif
- EfiConvertInternalPointer ((VOID **) &mRT);
-
- //
- // Clear out BootService globals
- //
- gBS = NULL;
- gST = NULL;
- mEfiGoneVirtual = TRUE;
-}
-
-EFI_STATUS
-EfiInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY GoVirtualChildEvent
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- VOID *Registration;
-#endif
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
-
- Status = EfiLibGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- ASSERT_EFI_ERROR (Status);
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // Register EFI_STATUS_CODE_PROTOCOL notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- EFI_TPL_CALLBACK,
- OnStatusCodeInstall,
- NULL,
- &gEfiStatusCodeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->RegisterProtocolNotify (
- &gEfiStatusCodeRuntimeProtocolGuid,
- gEfiStatusCodeNotifyEvent,
- &Registration
- );
- ASSERT_EFI_ERROR (Status);
-
- gBS->SignalEvent (gEfiStatusCodeNotifyEvent);
-#endif
-
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &gCpuIo);
- if (EFI_ERROR (Status)) {
- gCpuIo = NULL;
- }
-
- //
- // Register our ExitBootServices () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- RuntimeDriverExitBootServices,
- NULL,
- &mRuntimeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- EfiRuntimeLibVirtualNotifyEvent,
- (VOID *) (UINTN) GoVirtualChildEvent,
- &mEfiVirtualNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiShutdownRuntimeDriverLib (
- VOID
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-{
- EFI_STATUS Status;
-
- if (!mRuntimeLibInitialized) {
- //
- // You must call EfiInitializeRuntimeDriverLib() first
- //
- return EFI_UNSUPPORTED;
- }
-
- mRuntimeLibInitialized = FALSE;
-
- //
- // Close our ExitBootServices () notify function
- //
- if (mRuntimeNotifyEvent != NULL) {
- Status = gBS->CloseEvent (mRuntimeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
- //
- // Close SetVirtualAddressMap () notify function
- //
- if (mEfiVirtualNotifyEvent != NULL) {
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // Close EfiStatusCodeRuntimeProtocol notify function
- //
- if (gEfiStatusCodeNotifyEvent != NULL) {
- Status = gBS->CloseEvent (gEfiStatusCodeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-#endif
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiInitializeSmmDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
- EFI_SMM_BASE_PROTOCOL *SmmBase;
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
-
- //
- // Check whether it is in SMM mode.
- //
- Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID**) &SmmBase);
- if (!EFI_ERROR (Status)) {
- SmmBase->InSmm (SmmBase, &mInSmm);
- }
-
- //
- // Directly locate SmmStatusCode protocol
- //
- Status = gBS->LocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, (VOID**) &gSmmStatusCodeProtocol);
- if (EFI_ERROR (Status)) {
- gSmmStatusCodeProtocol = NULL;
- }
-
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &gCpuIo);
- if (EFI_ERROR (Status)) {
- gCpuIo = NULL;
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if ExitBootServices () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If ExitBootServices () has been called
-
---*/
-{
- return mEfiAtRuntime;
-}
-
-BOOLEAN
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
-
---*/
-{
- return mEfiGoneVirtual;
-}
-//
-// The following functions hide the mRT local global from the call to
-// runtime service in the EFI system table.
-//
-EFI_STATUS
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetTime (Time, Capabilities);
-}
-
-EFI_STATUS
-EfiSetTime (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetTime (Time);
-}
-
-EFI_STATUS
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetWakeupTime (Enabled, Pending, Time);
-}
-
-EFI_STATUS
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetWakeupTime (Enable, Time);
-}
-
-EFI_STATUS
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-EFI_STATUS
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
-}
-
-EFI_STATUS
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_STATUS
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-
-/*++
-
-Routine Description:
-
- This code returns information about the EFI variables.
-
-Arguments:
-
- Attributes Attributes bitmask to specify the type of variables
- on which to return information.
- MaximumVariableStorageSize Pointer to the maximum size of the storage space available
- for the EFI variables associated with the attributes specified.
- RemainingVariableStorageSize Pointer to the remaining size of the storage space available
- for the EFI variables associated with the attributes specified.
- MaximumVariableSize Pointer to the maximum size of the individual EFI variables
- associated with the attributes specified.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->QueryVariableInfo (Attributes, MaximumVariableStorageSize, RemainingVariableStorageSize, MaximumVariableSize);
-}
-
-#endif
-
-EFI_STATUS
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetNextHighMonotonicCount (HighCount);
-}
-
-VOID
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-{
- mRT->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
-}
-
-EFI_STATUS
-EfiReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
-
- if (mInSmm) {
- if (gSmmStatusCodeProtocol == NULL) {
- return EFI_UNSUPPORTED;
- }
- Status = gSmmStatusCodeProtocol->ReportStatusCode (gSmmStatusCodeProtocol, CodeType, Value, Instance, CallerId, Data);
- return Status;
- }
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gReportStatusCode == NULL) {
- //
- // Because we've installed the protocol notification on EfiStatusCodeRuntimeProtocol,
- // running here indicates that the StatusCode driver has not started yet.
- //
- if (EfiAtRuntime ()) {
- //
- // Running here only when StatusCode driver never starts.
- //
- return EFI_UNSUPPORTED;
- }
-
- //
- // Try to get the PEI version of ReportStatusCode.
- //
- Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
- if (EFI_ERROR (Status) || (gReportStatusCode == NULL)) {
- return EFI_UNSUPPORTED;
- }
- }
- Status = gReportStatusCode (CodeType, Value, Instance, CallerId, Data);
-#else
- if (mRT == NULL) {
- return EFI_UNSUPPORTED;
- }
- //
- // Check whether EFI_RUNTIME_SERVICES has Tiano Extension
- //
- Status = EFI_UNSUPPORTED;
- if (mRT->Hdr.Revision == EFI_SPECIFICATION_VERSION &&
- mRT->Hdr.HeaderSize == sizeof (EFI_RUNTIME_SERVICES) &&
- mRT->ReportStatusCode != NULL) {
- Status = mRT->ReportStatusCode (CodeType, Value, Instance, CallerId, Data);
- }
-#endif
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Io.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Io.c
deleted file mode 100644
index 2a52906fc1..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Io.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Io.c
-
-Abstract:
-
- Light weight lib functions that wrape IoRead (), IoWrite, MemRead (),
- and MemWrite ().
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-
-UINT8
-IoRead8 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a one byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT8 Buffer;
-
- Buffer = 0;
- EfiIoRead (EfiCpuIoWidthUint8, Address, 1, &Buffer);
- return Buffer;
-}
-
-UINT16
-IoRead16 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a two byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT16 Buffer;
-
- Buffer = 0;
- EfiIoRead (EfiCpuIoWidthUint16, Address, 1, &Buffer);
- return Buffer;
-}
-
-UINT32
-IoRead32 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a four byte IO read
-
-Arguments:
- Address - IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT32 Buffer;
-
- Buffer = 0;
- EfiIoRead (EfiCpuIoWidthUint32, Address, 1, &Buffer);
- return Buffer;
-}
-
-VOID
-IoWrite8 (
- IN UINT64 Address,
- IN UINT8 Data
- )
-/*++
-
-Routine Description:
- Do a one byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiIoWrite (EfiCpuIoWidthUint8, Address, 1, &Data);
-}
-
-VOID
-IoWrite16 (
- IN UINT64 Address,
- IN UINT16 Data
- )
-/*++
-
-Routine Description:
- Do a two byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiIoWrite (EfiCpuIoWidthUint16, Address, 1, &Data);
-}
-
-VOID
-IoWrite32 (
- IN UINT64 Address,
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
- Do a four byte IO write
-
-Arguments:
- Address - IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiIoWrite (EfiCpuIoWidthUint32, Address, 1, &Data);
-}
-
-UINT8
-MemRead8 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a one byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT8 Buffer;
-
- Buffer = 0;
- EfiMemRead (EfiCpuIoWidthUint8, Address, 1, &Buffer);
- return Buffer;
-}
-
-UINT16
-MemRead16 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a two byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT16 Buffer;
-
- Buffer = 0;
- EfiMemRead (EfiCpuIoWidthUint16, Address, 1, &Buffer);
- return Buffer;
-}
-
-UINT32
-MemRead32 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a four byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT32 Buffer;
-
- Buffer = 0;
- EfiMemRead (EfiCpuIoWidthUint32, Address, 1, &Buffer);
- return Buffer;
-}
-
-UINT64
-MemRead64 (
- IN UINT64 Address
- )
-/*++
-
-Routine Description:
- Do a eight byte Memory mapped IO read
-
-Arguments:
- Address - Memory mapped IO address to read
-
-Returns:
- Data read
-
---*/
-{
- UINT64 Buffer;
-
- Buffer = 0;
- EfiMemRead (EfiCpuIoWidthUint64, Address, 1, &Buffer);
- return Buffer;
-}
-
-VOID
-MemWrite8 (
- IN UINT64 Address,
- IN UINT8 Data
- )
-/*++
-
-Routine Description:
- Do a one byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiMemWrite (EfiCpuIoWidthUint8, Address, 1, &Data);
-}
-
-VOID
-MemWrite16 (
- IN UINT64 Address,
- IN UINT16 Data
- )
-/*++
-
-Routine Description:
- Do a two byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiMemWrite (EfiCpuIoWidthUint16, Address, 1, &Data);
-}
-
-VOID
-MemWrite32 (
- IN UINT64 Address,
- IN UINT32 Data
- )
-/*++
-
-Routine Description:
- Do a four byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiMemWrite (EfiCpuIoWidthUint32, Address, 1, &Data);
-}
-
-VOID
-MemWrite64 (
- IN UINT64 Address,
- IN UINT64 Data
- )
-/*++
-
-Routine Description:
- Do a eight byte Memory mapped IO write
-
-Arguments:
- Address - Memory mapped IO address to write
- Data - Data to write to Address
-
-Returns:
- NONE
-
---*/
-{
- EfiMemWrite (EfiCpuIoWidthUint64, Address, 1, &Data);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/AsmCpuMisc.s b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/AsmCpuMisc.s
deleted file mode 100644
index 81837472bf..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/AsmCpuMisc.s
+++ /dev/null
@@ -1,44 +0,0 @@
-/// @file
-/// Contains an implementation of EcpEfiBreakPoint and EcpMemoryFence on Itanium-based
-/// architecture.
-///
-/// 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.
-///
-/// Module Name: AsmCpuMisc.s
-///
-///
-
-
-.text
-.proc EcpEfiBreakPoint
-.type EcpEfiBreakPoint, @function
-
-EcpEfiBreakPoint::
- break.i 0;;
- br.ret.dpnt b0;;
-
-.endp EcpEfiBreakPoint
-
-.proc EcpMemoryFence
-.type EcpMemoryFence, @function
-
-EcpMemoryFence::
- mf;; // memory access ordering
-
- // do we need the mf.a also here?
- mf.a // wait for any IO to complete?
-
- // not sure if we need serialization here, just put it, in case...
-
- srlz.d;;
- srlz.i;;
-
- br.ret.dpnt b0;;
-.endp EcpMemoryFence \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/EsalLib.s b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/EsalLib.s
deleted file mode 100644
index 27135e71e4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/EsalLib.s
+++ /dev/null
@@ -1,149 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// EsalLib.s
-//
-// Abstract:
-//
-//
-// Revision History:
-//
-//--
-
-.file "EsalLib.s"
-
-#include "IpfMacro.i"
-
-//
-// Exports
-//
-.globl GetEsalEntryPoint
-
-
-//-----------------------------------------------------------------------------
-//++
-// GetEsalEntryPoint
-//
-// Return Esal global and PSR register.
-//
-// On Entry :
-//
-//
-// Return Value:
-// r8 = EFI_SAL_SUCCESS
-// r9 = Physical Plabel
-// r10 = Virtual Plabel
-// r11 = psr
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (GetEsalEntryPoint)
-
- NESTED_SETUP (0,8,0,0)
-
-EsalCalcStart:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart), r8;;
- mov r9 = r8;;
- add r10 = 0x10, r8;;
- mov r11 = psr;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (GetEsalEntryPoint)
-
-
-
-
-
-//-----------------------------------------------------------------------------
-//++
-// SetEsalPhysicalEntryPoint
-//
-// Set the dispatcher entry point
-//
-// On Entry:
-// in0 = Physical address of Esal Dispatcher
-// in1 = Physical GP
-//
-// Return Value:
-// r8 = EFI_SAL_SUCCESS
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint)
-
- NESTED_SETUP (2,8,0,0)
-
-EsalCalcStart1:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart1), r8;;
- st8 [r8] = in0;;
- add r8 = 0x08, r8;;
- st8 [r8] = in1;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (SetEsalPhysicalEntryPoint)
-
-
-//-----------------------------------------------------------------------------
-//++
-// SetEsalVirtualEntryPoint
-//
-// Register physical address of Esal globals.
-//
-// On Entry :
-// in0 = Virtual address of Esal Dispatcher
-// in1 = Virtual GP
-//
-// Return Value:
-// r8 = EFI_SAL_ERROR
-//
-// As per static calling conventions.
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (SetEsalVirtualEntryPoint)
-
- NESTED_SETUP (2,8,0,0)
-
-EsalCalcStart2:
- mov r8 = ip;;
- add r8 = (EsalEntryPoint - EsalCalcStart2), r8;;
- add r8 = 0x10, r8;;
- st8 [r8] = in0;;
- add r8 = 0x08, r8;;
- st8 [r8] = in1;;
- mov r8 = r0;;
-
- NESTED_RETURN
-
-PROCEDURE_EXIT (SetEsalVirtualEntryPoint)
-
-
-
-
-.align 32
-EsalEntryPoint:
- data8 0 // Physical Entry
- data8 0 // GP
- data8 0 // Virtual Entry
- data8 0 // GP
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Fvb.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Fvb.c
deleted file mode 100644
index 7eb93a8d47..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Fvb.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- Fvb.c
-
-Abstract:
-
- Light weight lib to support Tiano Firmware Volume Block
- protocol abstraction at runtime.
-
- All these functions convert EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID
- class function to the Runtime Lib function. There is a 1 to 1 mapping.
-
- If you are using any of these lib functions.you must first call FvbInitialize ().
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include "SalApi.h"
-
-EFI_STATUS
-EfiFvbInitialize (
- VOID
- )
-/*++
-
-Routine Description:
- Initialize globals and register Fvb Protocol notification function.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
-//
-// The following functions wrap Fvb protocol in the Runtime Lib functions.
-// The Instance translates into Fvb instance. The Fvb order defined by HOBs and
-// thus the sequence of FVB protocol addition define Instance.
-//
-// EfiFvbInitialize () must be called before any of the following functions
-// must be called.
-//
-EFI_STATUS
-EfiFvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Reads specified number of bytes into a buffer from the specified block
-
-Arguments:
- Instance - The FV instance to be read from
- Lba - The logical block address to be read from
- Offset - Offset into the block at which to begin reading
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes read
- Buffer - Pointer to a caller allocated buffer that will be
- used to hold the data read
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, Read, Instance, Lba, Offset, (UINT64) NumBytes, (UINT64) Buffer, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Writes specified number of bytes from the input buffer to the block
-
-Arguments:
- Instance - The FV instance to be written to
- Lba - The starting logical block index to write to
- Offset - Offset into the block at which to begin writing
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes actually written
- Buffer - Pointer to a caller allocated buffer that contains
- the source for the write
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, Write, Instance, Lba, Offset, (UINT64) NumBytes, (UINT64) Buffer, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbEraseBlock (
- IN UINTN Instance,
- IN UINTN Lba
- )
-/*++
-
-Routine Description:
- Erases and initializes a firmware volume block
-
-Arguments:
- Instance - The FV instance to be erased
- Lba - The logical block index to be erased
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, EraseBlock, Instance, Lba, 0, 0, 0, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES *Attributes
- )
-/*++
-
-Routine Description:
- Retrieves attributes, insures positive polarity of attribute bits, returns
- resulting attributes in output parameter
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- returned
- Attributes - Output buffer which contains attributes
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, SetVolumeAttributes, Instance, (UINT64) Attributes, 0, 0, 0, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbSetVolumeAttributes (
- IN UINTN Instance,
- IN EFI_FVB_ATTRIBUTES Attributes
- )
-/*++
-
-Routine Description:
- Modifies the current settings of the firmware volume according to the
- input parameter.
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- modified
- Attributes - It is a pointer to EFI_FVB_ATTRIBUTES
- containing the desired firmware volume settings.
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, SetVolumeAttributes, Instance, (UINT64) (&Attributes), 0, 0, 0, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- BaseAddress - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
- that on successful return, contains the base address
- of the firmware volume.
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (&Guid, GetPhysicalAddress, Instance, (UINT64) BaseAddress, 0, 0, 0, 0, 0).Status;
-}
-
-EFI_STATUS
-EfiFvbGetBlockSize (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
- Retrieve the size of a logical block
-
-Arguments:
- Instance - The FV instance whose block size is going to be
- returned
- Lba - Indicates which block to return the size for.
- BlockSize - A pointer to a caller allocated UINTN in which
- the size of the block is returned
- NumOfBlocks - a 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
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (
- &Guid,
- GetBlockSize,
- Instance,
- Lba,
- (UINT64) BlockSize,
- (UINT64) NumOfBlocks,
- 0,
- 0,
- 0
- ).Status;
-}
-
-EFI_STATUS
-EfiFvbEraseCustomBlockRange (
- IN UINTN Instance,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- Instance - The FV instance to be erased
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetLastLba - Offset into the last block at which to end erasing
-
-Returns:
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_FV_BLOCK_SERVICES_PROTOCOL_GUID;
-
- return EfiCallEsalService (
- &Guid,
- EraseCustomBlockRange,
- Instance,
- StartLba,
- OffsetStartLba,
- LastLba,
- OffsetLastLba,
- 0,
- 0
- ).Status;
-}
-EFI_STATUS
-EfiFvbShutdown (
- VOID
- )
-/*++
-
-Routine Description:
- Release resources allocated in EfiFvbInitialize.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/IpfCpuCache.s b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/IpfCpuCache.s
deleted file mode 100644
index a5b2672b55..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/IpfCpuCache.s
+++ /dev/null
@@ -1,88 +0,0 @@
-//++
-// Copyright (c) 2004, 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.
-//
-// Module Name:
-//
-// IpfCpuCache.s
-//
-// Abstract:
-//
-// Contains Misc assembly procedures to support IPF CPU AP.
-//
-// Revision History:
-//
-//--
-
-.file "IpfCpuCache.s"
-
-#include "IpfMacro.i"
-#include "IpfDefines.h"
-
-//-----------------------------------------------------------------------------
-//++
-// Flush Cache
-//
-// Arguments :
-
-// Input = in0 = Starting Address to Flush.
-// Input = in1 = Length in bytes.
-// Input = b0 = return branch register.
-// On Entry :
-//
-// Return Value:
-//
-// VOID
-// SalFlushCache (
-// IN UINT64 BaseToFlush,
-// IN UINT64 LengthToFlush
-// );
-//
-//--
-//---------------------------------------------------------------------------
-PROCEDURE_ENTRY (SalFlushCache)
-
- NESTED_SETUP (5,8,0,0)
-
- mov loc2 = ar.lc
-
- mov loc3 = in0 // Start address.
- mov loc4 = in1;; // Length in bytes.
-
- cmp.eq p6,p7 = loc4, r0;; // If Length is zero then don't flush any cache
- (p6) br.spnt.many DoneFlushingC;;
-
- add loc4 = loc4,loc3
- mov loc5 = 1;;
- sub loc4 = loc4, loc5 ;; // the End address to flush
-
- dep loc3 = r0,loc3,0,5
- dep loc4 = r0,loc4,0,5;;
- shr loc3 = loc3,5
- shr loc4 = loc4,5;; // 32 byte cache line
-
- sub loc4 = loc4,loc3;; // total flush count, It should be add 1 but
- // the br.cloop will first execute one time
- mov loc3 = in0
- mov loc5 = 32
- mov ar.lc = loc4;;
-
-StillFlushingC:
- fc loc3;;
- sync.i;;
- srlz.i;;
- add loc3 = loc5,loc3;;
- br.cloop.sptk.few StillFlushingC;;
-
-DoneFlushingC:
- mov ar.lc = loc2
- NESTED_RETURN
-
-PROCEDURE_EXIT (SalFlushCache)
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Lock.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Lock.c
deleted file mode 100644
index fb17e8fc93..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/Lock.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- Lock.c
-
-Abstract:
-
- Support for locking lib services. These primitives may be implemented
- as Esal calls but since these result in small code that us position
- independent, we can use lib functions. ESAL calls have a significant
- software overhead and too deep nesting is bad for the stack.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-extern
-BOOLEAN
-EfiAtRuntime (
- VOID
- );
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. There is
- no concept of TPL at runtime hence priority is
- ignored.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - Ignored
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-{
- Lock->Tpl = Priority;
- Lock->OwnerTpl = 0;
- Lock->Lock = 0;
-}
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. For now,
- only allow one level of nesting.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-{
- if (Lock->Lock != 0) {
- //
- // Lock is already owned, so bail out
- //
- return EFI_ACCESS_DENIED;
- }
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
- }
-
- Lock->Lock += 1;
- return EFI_SUCCESS;
-}
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- Lock owned
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiAcquireLockOrFail (Lock);
-
- //
- // Lock was already locked.
- //
- ASSERT_EFI_ERROR (Status);
-}
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- Lock unowned
-
---*/
-{
- EFI_TPL Tpl;
-
- Tpl = Lock->OwnerTpl;
-
- ASSERT (Lock->Lock == 1);
- Lock->Lock -= 1;
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- gBS->RestoreTPL (Tpl);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/RuntimeLib.c
deleted file mode 100644
index d826b9000e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ipf/RuntimeLib.c
+++ /dev/null
@@ -1,1321 +0,0 @@
-/*++
-
-Copyright (c) 2004 - 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.
-
-Module Name:
-
- RuntimeLib.c
-
-Abstract:
-
- Light weight lib to support Tiano Sal drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalBootService)
-#include EFI_PROTOCOL_DEFINITION (ExtendedSalGuid)
-#include "IpfDefines.h"
-#include "SalApi.h"
-
-//
-// Worker functions in EsalLib.s
-//
-SAL_RETURN_REGS
-GetEsalEntryPoint (
- VOID
- );
-
-SAL_RETURN_REGS
-SetEsalPhysicalEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- );
-
-SAL_RETURN_REGS
-SetEsalVirtualEntryPoint (
- IN UINT64 EntryPoint,
- IN UINT64 Gp
- );
-
-VOID
-SalFlushCache (
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- );
-
-//
-// Module Globals. It's not valid to use these after the
-// EfiRuntimeLibVirtualNotifyEvent has fired.
-//
-static EFI_EVENT mEfiVirtualNotifyEvent;
-static EFI_RUNTIME_SERVICES *mRT;
-static EFI_PLABEL mPlabel;
-static EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService;
-static BOOLEAN mRuntimeLibInitialized = FALSE;
-
-VOID
-EFIAPI
-EfiRuntimeLibVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Fixup internal data so that EFI and SAL can be call in virtual mode.
- Call the passed in Child Notify event and convert any pointers in
- lib to virtual mode.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- EFI_EVENT_NOTIFY ChildNotify;
-
- if (Context != NULL) {
- //
- // Call child event
- //
- ChildNotify = (EFI_EVENT_NOTIFY) (UINTN) Context;
- ChildNotify (Event, NULL);
- }
-
- mRT->ConvertPointer (EFI_INTERNAL_POINTER, (VOID **) &mPlabel.EntryPoint);
- mRT->ConvertPointer (EFI_INTERNAL_POINTER | EFI_IPF_GP_POINTER, (VOID **) &mPlabel.GP);
-
- SetEsalVirtualEntryPoint (mPlabel.EntryPoint, mPlabel.GP);
-
- //
- // Clear out BootService globals
- //
- gBS = NULL;
- gST = NULL;
- mRT = NULL;
-
- //
- // Pointers don't work you must use a direct lib call
- //
-}
-
-EFI_STATUS
-EfiInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY GoVirtualChildEvent
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
- EFI_PLABEL *Plabel;
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- gBS = SystemTable->BootServices;
- mRT = SystemTable->RuntimeServices;
- Status = EfiLibGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- ASSERT_EFI_ERROR (Status);
-
- //
- // The protocol contains a function pointer, which is an indirect procedure call.
- // An indirect procedure call goes through a plabel, and pointer to a function is
- // a pointer to a plabel. To implement indirect procedure calls that can work in
- // both physical and virtual mode, two plabels are required (one physical and one
- // virtual). So lets grap the physical PLABEL for the EsalEntryPoint and store it
- // away. We cache it in a module global, so we can register the vitrual version.
- //
- Status = gBS->LocateProtocol (&gEfiExtendedSalBootServiceProtocolGuid, NULL, (VOID **) &mEsalBootService);
- ASSERT_EFI_ERROR (Status);
-
- Plabel = (EFI_PLABEL *) (UINTN) mEsalBootService->ExtendedSalProc;
-
- mPlabel.EntryPoint = Plabel->EntryPoint;
- mPlabel.GP = Plabel->GP;
-
- SetEsalPhysicalEntryPoint (mPlabel.EntryPoint, mPlabel.GP);
-
- //
- // Create a Virtual address change notification event. Pass in the callers
- // GoVirtualChildEvent so it's get passed to the event as contex.
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- EfiRuntimeLibVirtualNotifyEvent,
- (VOID *) GoVirtualChildEvent,
- &mEfiVirtualNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiShutdownRuntimeDriverLib (
- VOID
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-{
- EFI_STATUS Status;
-
- if (!mRuntimeLibInitialized) {
- //
- // You must call EfiInitializeRuntimeDriverLib() first
- //
- return EFI_UNSUPPORTED;
- }
-
- mRuntimeLibInitialized = FALSE;
-
- //
- // Close SetVirtualAddressMap () notify function
- //
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-RegisterEsalFunction (
- IN UINT64 FunctionId,
- IN EFI_GUID *ClassGuid,
- IN SAL_INTERNAL_EXTENDED_SAL_PROC Function,
- IN VOID *ModuleGlobal
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class Function and it's asociated global.
- This function is boot service only!
-
-Arguments:
- FunctionId - ID of function to register
- ClassGuid - GUID of function class
- Function - Function to register under ClassGuid/FunctionId pair
- ModuleGlobal - Module global for Function.
-
-Returns:
- EFI_SUCCESS - If ClassGuid/FunctionId Function was registered.
-
---*/
-{
- return mEsalBootService->AddExtendedSalProc (
- mEsalBootService,
- ClassGuid,
- FunctionId,
- Function,
- ModuleGlobal
- );
-}
-
-EFI_STATUS
-RegisterEsalClass (
- IN EFI_GUID *ClassGuid,
- IN VOID *ModuleGlobal,
- ...
- )
-/*++
-
-Routine Description:
-
- Register ESAL Class and it's asociated global.
- This function is boot service only!
-
-Arguments:
- ClassGuid - GUID of function class
- ModuleGlobal - Module global for Function.
- ... - SAL_INTERNAL_EXTENDED_SAL_PROC and FunctionId pairs. NULL
- indicates the end of the list.
-
-Returns:
- EFI_SUCCESS - All members of ClassGuid registered
-
---*/
-{
- VA_LIST Args;
- EFI_STATUS Status;
- SAL_INTERNAL_EXTENDED_SAL_PROC Function;
- UINT64 FunctionId;
- EFI_HANDLE NewHandle;
-
- VA_START (Args, ModuleGlobal);
-
- Status = EFI_SUCCESS;
- while (!EFI_ERROR (Status)) {
- Function = (SAL_INTERNAL_EXTENDED_SAL_PROC) VA_ARG (Args, SAL_INTERNAL_EXTENDED_SAL_PROC);
- if (Function == NULL) {
- break;
- }
-
- FunctionId = VA_ARG (Args, UINT64);
-
- Status = RegisterEsalFunction (FunctionId, ClassGuid, Function, ModuleGlobal);
- }
-
- VA_END (Args);
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- NewHandle = NULL;
- return gBS->InstallProtocolInterface (
- &NewHandle,
- ClassGuid,
- EFI_NATIVE_INTERFACE,
- NULL
- );
-}
-
-SAL_RETURN_REGS
-EfiCallEsalService (
- IN EFI_GUID *ClassGuid,
- IN UINT64 FunctionId,
- IN UINT64 Arg2,
- IN UINT64 Arg3,
- IN UINT64 Arg4,
- IN UINT64 Arg5,
- IN UINT64 Arg6,
- IN UINT64 Arg7,
- IN UINT64 Arg8
- )
-/*++
-
-Routine Description:
-
- Call module that is not linked direclty to this module. This code is IP
- relative and hides the binding issues of virtual or physical calling. The
- function that gets dispatched has extra arguments that include the registered
- module global and a boolean flag to indicate if the system is in virutal mode.
-
-Arguments:
- ClassGuid - GUID of function
- FunctionId - Function in ClassGuid to call
- Arg2 - Argument 2 ClassGuid/FunctionId defined
- Arg3 - Argument 3 ClassGuid/FunctionId defined
- Arg4 - Argument 4 ClassGuid/FunctionId defined
- Arg5 - Argument 5 ClassGuid/FunctionId defined
- Arg6 - Argument 6 ClassGuid/FunctionId defined
- Arg7 - Argument 7 ClassGuid/FunctionId defined
- Arg8 - Argument 8 ClassGuid/FunctionId defined
-
-Returns:
- Status of ClassGuid/FuncitonId
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- SAL_EXTENDED_SAL_PROC EsalProc;
-
- ReturnReg = GetEsalEntryPoint ();
- if (ReturnReg.Status != EFI_SAL_SUCCESS) {
- return ReturnReg;
- }
-
- if (ReturnReg.r11 & PSR_IT_MASK) {
- //
- // Virtual mode plabel to entry point
- //
- EsalProc = (SAL_EXTENDED_SAL_PROC) ReturnReg.r10;
- } else {
- //
- // Physical mode plabel to entry point
- //
- EsalProc = (SAL_EXTENDED_SAL_PROC) ReturnReg.r9;
- }
-
- return EsalProc (
- ClassGuid,
- FunctionId,
- Arg2,
- Arg3,
- Arg4,
- Arg5,
- Arg6,
- Arg7,
- Arg8
- );
-}
-
-EFI_STATUS
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->ConvertPointer (DebugDisposition, Address);
-}
-
-BOOLEAN
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID;
- SAL_RETURN_REGS ReturnReg;
-
- ReturnReg = EfiCallEsalService (&Guid, IsVirtual, 0, 0, 0, 0, 0, 0, 0);
-
- return (BOOLEAN) (ReturnReg.r9 == 1);
-}
-
-BOOLEAN
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if ExitBootService () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If ExitBootService () has been called
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_VIRTUAL_SERVICES_PROTOCOL_GUID;
- SAL_RETURN_REGS ReturnReg;
-
- ReturnReg = EfiCallEsalService (&Guid, IsEfiRuntime, 0, 0, 0, 0, 0, 0, 0);
-
- return (BOOLEAN) (ReturnReg.r9 == 1);
-}
-
-EFI_STATUS
-EfiReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID * CallerId,
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_STATUS_CODE_SERVICES_PROTOCOL_GUID;
- SAL_RETURN_REGS ReturnReg;
-
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- StatusCode,
- (UINT64) CodeType,
- (UINT64) Value,
- (UINT64) Instance,
- (UINT64) CallerId,
- (UINT64) Data,
- 0,
- 0
- );
-
- return (EFI_STATUS) ReturnReg.Status;
-}
-//
-// Sal Reset Driver Class
-//
-VOID
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_RESET_SERVICES_PROTOCOL_GUID;
-
- EfiCallEsalService (
- &Guid,
- ResetSystem,
- (UINT64) ResetType,
- (UINT64) ResetStatus,
- (UINT64) DataSize,
- (UINT64) ResetData,
- 0,
- 0,
- 0
- );
-}
-//
-// Sal MTC Driver Class
-//
-EFI_STATUS
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_MTC_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, GetNextHighMonotonicCount, (UINT64) HighCount, 0, 0, 0, 0, 0, 0);
- return (EFI_STATUS) ReturnReg.Status;
-}
-//
-// Sal Variable Driver Class
-//
-EFI_STATUS
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalGetVariable,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- (UINT64) Attributes,
- (UINT64) DataSize,
- (UINT64) Data,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalGetNextVariableName,
- (UINT64) VariableNameSize,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- 0,
- 0,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-EFI_STATUS
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalSetVariable,
- (UINT64) VariableName,
- (UINT64) VendorGuid,
- (UINT64) Attributes,
- (UINT64) DataSize,
- (UINT64) Data,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_STATUS
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-/*++
-
-Routine Description:
-
- This code returns information about the EFI variables.
-
-Arguments:
-
- Attributes Attributes bitmask to specify the type of variables
- on which to return information.
- MaximumVariableStorageSize Pointer to the maximum size of the storage space available
- for the EFI variables associated with the attributes specified.
- RemainingVariableStorageSize Pointer to the remaining size of the storage space available
- for the EFI variables associated with the attributes specified.
- MaximumVariableSize Pointer to the maximum size of the individual EFI variables
- associated with the attributes specified.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid = EFI_EXTENDED_SAL_VARIABLE_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (
- &Guid,
- EsalQueryVariableInfo,
- (UINT64) Attributes,
- (UINT64) MaximumVariableStorageSize,
- (UINT64) RemainingVariableStorageSize,
- (UINT64) MaximumVariableSize,
- 0,
- 0,
- 0
- );
- return (EFI_STATUS) ReturnReg.Status;
-}
-
-#endif
-
-//
-// Sal RTC Driver Class.
-//
-EFI_STATUS
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
- EFI_GUID Guid = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, GetTime, (UINT64) Time, (UINT64) Capabilities, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EfiSetTime (
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, SetTime, (UINT64) Time, 0, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, GetWakeupTime, (UINT64) Enabled, (UINT64) Pending, (UINT64) Time, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-EFI_STATUS
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-{
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_RTC_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, SetWakeupTime, (UINT64) Enable, (UINT64) Time, 0, 0, 0, 0, 0);
- return ReturnReg.Status;
-}
-
-
-
-//
-// Base IO Services
-//
-EFI_STATUS
-EfiIoRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO read into Buffer.
-
-Arguments:
- Width - Width of read transaction, and repeat operation to use
- Address - IO address to read
- Count - Number of times to read the IO address.
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- Status code
-
---*/
-{
-
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, IoRead, (UINT64) Width, Address, Count, (UINT64) Buffer, 0, 0, 0);
- ASSERT (ReturnReg.Status == EFI_SAL_SUCCESS);
-
- return ReturnReg.Status;
-
-}
-
-EFI_STATUS
-EfiIoWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- Status code
-
---*/
-{
-
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, IoWrite, (UINT64) Width, Address, Count, (UINT64) Buffer, 0, 0, 0);
-
- return ReturnReg.Status;
-
-}
-
-EFI_STATUS
-EfiMemRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a Memory mapped IO read into Buffer.
-
-Arguments:
- Width - Width of each read transaction.
- Address - Memory mapped IO address to read
- Count - Number of Width quanta to read
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- Status code
-
---*/
-{
-
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, MemRead, (UINT64) Width, Address, Count, (UINT64) Buffer, 0, 0, 0);
- ASSERT (ReturnReg.Status == EFI_SAL_SUCCESS);
-
- return ReturnReg.Status;
-
-}
-
-EFI_STATUS
-EfiMemWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a memory mapped IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- Status code
-
---*/
-{
-
- SAL_RETURN_REGS ReturnReg;
-
- EFI_GUID Guid = EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID;
-
- ReturnReg = EfiCallEsalService (&Guid, MemWrite, (UINT64) Width, Address, Count, (UINT64) Buffer, 0, 0, 0);
-
- return ReturnReg.Status;
-
-}
-
-
-#define EFI_PCI_ADDRESS_IPF(_seg, _bus, _devfunc, _reg) \
- (((_seg) << 24) | ((_bus) << 16) | ((_devfunc) << 8) | (_reg)) & 0xFFFFFFFF
-
-//
-// PCI Class Functions
-//
-UINT8
-PciRead8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
- SAL_RETURN_REGS Return;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- Return = EfiCallEsalService (&Guid, SalPciConfigRead, Address, 1, 0, 0, 0, 0, 0);
-
- return (UINT8) Return.r9;
-}
-
-
-UINT16
-PciRead16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
- SAL_RETURN_REGS Return;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- Return = EfiCallEsalService (&Guid, SalPciConfigRead, Address, 2, 0, 0, 0, 0, 0);
-
- return (UINT16) Return.r9;
-}
-
-UINT32
-PciRead32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
- SAL_RETURN_REGS Return;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- Return = EfiCallEsalService (&Guid, SalPciConfigRead, Address, 4, 0, 0, 0, 0, 0);
-
- return (UINT32) Return.r9;
-}
-
-VOID
-PciWrite8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT8 Data
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- EfiCallEsalService (&Guid, SalPciConfigWrite, Address, 1, Data, 0, 0, 0, 0);
-}
-
-VOID
-PciWrite16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT16 Data
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- None.
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- EfiCallEsalService (&Guid, SalPciConfigWrite, Address, 2, Data, 0, 0, 0, 0);
-}
-
-VOID
-PciWrite32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT32 Data
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_PCI_SERVICES_PROTOCOL_GUID;
- UINT64 Address;
-
- Address = EFI_PCI_ADDRESS_IPF (Segment, Bus, DevFunc, Register);
- EfiCallEsalService (&Guid, SalPciConfigWrite, Address, 4, Data, 0, 0, 0, 0);
-}
-
-//
-// Stall class functions
-//
-VOID
-EfiStall (
- IN UINTN Microseconds
- )
-/*++
-
-Routine Description:
- Delay for at least the request number of microseconds
-
-Arguments:
- Microseconds - Number of microseconds to delay.
-
-Returns:
- NONE
-
---*/
-{
- EFI_GUID Guid = EFI_EXTENDED_SAL_STALL_SERVICES_PROTOCOL_GUID;
-
- if (EfiAtRuntime ()) {
- EfiCallEsalService (&Guid, Stall, Microseconds, 4, 0, 0, 0, 0, 0);
- } else {
- gBS->Stall (Microseconds);
- }
-}
-//
-// Cache Flush Routine.
-//
-EFI_STATUS
-EfiCpuFlushCache (
- IN EFI_PHYSICAL_ADDRESS Start,
- IN UINT64 Length
- )
-/*++
-
-Routine Description:
-
- Flush cache with specified range.
-
-Arguments:
-
- Start - Start address
- Length - Length in bytes
-
-Returns:
-
- Status code
-
- EFI_SUCCESS - success
-
---*/
-{
- SalFlushCache (Start, Length);
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/LibGlobals.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/LibGlobals.c
deleted file mode 100644
index 91236d6e6e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/LibGlobals.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*++
-
-Copyright (c) 2004, 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.
-
-Module Name:
-
- LibGlobals.c
-
-Abstract:
-
- Lib Globals
-
- gBS - Pointer to the EFI Boot Services Table
- gST - Pointer to EFI System Table
- gRtErrorLevel - Error level used with DEBUG () macro
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
-
-//
-// Lib globals that can ONLY be used at BootServices time!
-//
-EFI_BOOT_SERVICES *gBS;
-EFI_SYSTEM_TABLE *gST;
-EFI_DXE_SERVICES *gDS = NULL;
-UINTN gRtErrorLevel = EFI_DBUG_MASK | EFI_D_LOAD;
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
deleted file mode 100644
index ac169a1166..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
+++ /dev/null
@@ -1,649 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- RtDevicePath.c
-
-Abstract:
-
- Device Path services. The thing to remember is device paths are built out of
- nodes. The device path is terminated by an end node that is length
- sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL)
- all over this file.
-
- The only place where multi-instance device paths are supported is in
- environment varibles. Multi-instance device paths should never be placed
- on a Handle.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include "RtDevicePath.h"
-#include EFI_GUID_DEFINITION (FrameworkDevicePath)
-#include EFI_PROTOCOL_DEFINITION (DevicePath)
-
-STATIC
-VOID *
-InternalAllocatePool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiBootServicesData, AllocationSize, &Memory);
- return Memory;
-}
-
-STATIC
-VOID *
-InternalAllocateCopyPool (
- IN UINTN AllocationSize,
- IN VOID *Buffer
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool and use a buffer provided by
- caller to fill it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
- Buffer - Buffer that will be filled into the buffer allocated
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = NULL;
- gBS->AllocatePool (EfiBootServicesData, AllocationSize, &Memory);
- if (Memory != NULL) {
- gBS->CopyMem (Memory, Buffer, AllocationSize);
- }
-
- return Memory;
-}
-
-STATIC
-VOID *
-InternalAllocateZeroPool (
- IN UINTN AllocationSize
- )
-/*++
-
-Routine Description:
-
- Allocate BootServicesData pool and zero it.
-
-Arguments:
-
- AllocationSize - The size to allocate
-
-Returns:
-
- Pointer of the buffer allocated.
-
---*/
-{
- VOID *Memory;
-
- Memory = InternalAllocatePool (AllocationSize);
- if (Memory != NULL) {
- gBS->SetMem (Memory, AllocationSize, 0);
- }
-
- return Memory;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDevicePathInstance (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- OUT UINTN *Size
- )
-/*++
-
-Routine Description:
- Function retrieves the next device path instance from a device path data structure.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
- Size - A pointer to the size of a device path instance in bytes.
-
-Returns:
-
- This function returns a pointer to the current device path instance.
- In addition, it returns the size in bytes of the current device path instance in Size,
- and a pointer to the next device path instance in DevicePath.
- If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- EFI_DEVICE_PATH_PROTOCOL *ReturnValue;
- UINT8 Temp;
-
- if (*DevicePath == NULL) {
- if (Size != NULL) {
- *Size = 0;
- }
-
- return NULL;
- }
-
- //
- // Find the end of the device path instance
- //
- DevPath = *DevicePath;
- while (!IsDevicePathEndType (DevPath)) {
- DevPath = NextDevicePathNode (DevPath);
- }
-
- //
- // Compute the size of the device path instance
- //
- if (Size != NULL) {
- *Size = ((UINTN) DevPath - (UINTN) (*DevicePath)) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
- }
-
- //
- // Make a copy and return the device path instance
- //
- Temp = DevPath->SubType;
- DevPath->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;
- ReturnValue = RtEfiDuplicateDevicePath (*DevicePath);
- DevPath->SubType = Temp;
-
- //
- // If DevPath is the end of an entire device path, then another instance
- // does not follow, so *DevicePath is set to NULL.
- //
- if (DevicePathSubType (DevPath) == END_ENTIRE_DEVICE_PATH_SUBTYPE) {
- *DevicePath = NULL;
- } else {
- *DevicePath = NextDevicePathNode (DevPath);
- }
-
- return ReturnValue;
-}
-
-BOOLEAN
-RtEfiIsDevicePathMultiInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
- Return TRUE is this is a multi instance device path.
-
-Arguments:
- DevicePath - A pointer to a device path data structure.
-
-
-Returns:
- TRUE - If DevicePath is multi instance. FALSE - If DevicePath is not multi
- instance.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Node;
-
- if (DevicePath == NULL) {
- return FALSE;
- }
-
- Node = DevicePath;
- while (!EfiIsDevicePathEnd (Node)) {
- if (EfiIsDevicePathEndInstance (Node)) {
- return TRUE;
- }
-
- Node = EfiNextDevicePathNode (Node);
- }
-
- return FALSE;
-}
-
-UINTN
-RtEfiDevicePathSize (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
-
- Calculate the space size of a device path.
-
-Arguments:
-
- DevicePath - A specified device path
-
-Returns:
-
- The size.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Start;
-
- if (DevicePath == NULL) {
- return 0;
- }
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Compute the size and add back in the size of the end device path structure
- //
- return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL);
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDevicePathFromHandle (
- IN EFI_HANDLE Handle
- )
-/*++
-
-Routine Description:
-
- Get the device path protocol interface installed on a specified handle.
-
-Arguments:
-
- Handle - a specified handle
-
-Returns:
-
- The device path protocol interface installed on that handle.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- DevicePath = NULL;
- gBS->HandleProtocol (
- Handle,
- &gEfiDevicePathProtocolGuid,
- (VOID *) &DevicePath
- );
- return DevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiDuplicateDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-/*++
-
-Routine Description:
-
- Duplicate a device path structure.
-
-Arguments:
-
- DevicePath - The device path to duplicated.
-
-Returns:
-
- The duplicated device path.
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN Size;
-
- if (DevicePath == NULL) {
- return NULL;
- }
-
- //
- // Compute the size
- //
- Size = RtEfiDevicePathSize (DevicePath);
- if (Size == 0) {
- return NULL;
- }
-
- //
- // Allocate space for duplicate device path
- //
- NewDevicePath = InternalAllocateCopyPool (Size, DevicePath);
-
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Src2
- )
-/*++
-
-Routine Description:
- Function is used to append a Src1 and Src2 together.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Src2 - A pointer to a device path data structure.
-
-Returns:
-
- A pointer to the new device path is returned.
- NULL is returned if space for the new device path could not be allocated from pool.
- It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.
-
---*/
-{
- UINTN Size;
- UINTN Size1;
- UINTN Size2;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath;
-
- //
- // If there's only 1 path, just duplicate it
- //
- if (!Src1) {
- ASSERT (!IsDevicePathUnpacked (Src2));
- return RtEfiDuplicateDevicePath (Src2);
- }
-
- if (!Src2) {
- ASSERT (!IsDevicePathUnpacked (Src1));
- return RtEfiDuplicateDevicePath (Src1);
- }
-
- //
- // Allocate space for the combined device path. It only has one end node of
- // length EFI_DEVICE_PATH_PROTOCOL
- //
- Size1 = RtEfiDevicePathSize (Src1);
- Size2 = RtEfiDevicePathSize (Src2);
- Size = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL);
-
- NewDevicePath = InternalAllocateCopyPool (Size, Src1);
-
- if (NewDevicePath != NULL) {
-
- //
- // Over write Src1 EndNode and do the copy
- //
- SecondDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));
- EfiCopyMem (SecondDevicePath, Src2, Size2);
- }
-
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePathNode (
- IN EFI_DEVICE_PATH_PROTOCOL *Src1,
- IN EFI_DEVICE_PATH_PROTOCOL *Node
- )
-/*++
-
-Routine Description:
- Function is used to append a device path node to the end of another device path.
-
-Arguments:
- Src1 - A pointer to a device path data structure.
-
- Node - A pointer to a device path data structure.
-
-Returns:
- This function returns a pointer to the new device path.
- If there is not enough temporary pool memory available to complete this function,
- then NULL is returned.
-
-
---*/
-{
- EFI_DEVICE_PATH_PROTOCOL *Temp;
- EFI_DEVICE_PATH_PROTOCOL *NextNode;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- UINTN NodeLength;
-
- //
- // Build a Node that has a terminator on it
- //
- NodeLength = DevicePathNodeLength (Node);
-
- Temp = InternalAllocateCopyPool (NodeLength + sizeof (EFI_DEVICE_PATH_PROTOCOL), Node);
- if (Temp == NULL) {
- return NULL;
- }
-
- //
- // Add and end device path node to convert Node to device path
- //
- NextNode = NextDevicePathNode (Temp);
- SetDevicePathEndNode (NextNode);
-
- //
- // Append device paths
- //
- NewDevicePath = RtEfiAppendDevicePath (Src1, Temp);
- gBS->FreePool (Temp);
- return NewDevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiFileDevicePath (
- IN EFI_HANDLE Device OPTIONAL,
- IN CHAR16 *FileName
- )
-/*++
-
-Routine Description:
-
- This function allocates a device path for a file and appends it to an existiong
- device path.
-
-Arguments:
- Device - A pointer to a device handle.
-
- FileName - A pointer to a Null-terminated Unicodestring.
-
-Returns:
- A device path contain the file name.
-
---*/
-{
- UINTN Size;
- FILEPATH_DEVICE_PATH *FilePath;
- EFI_DEVICE_PATH_PROTOCOL *Eop;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-
- for (Size = 0; FileName[Size] != 0; Size++)
- ;
- Size = (Size + 1) * 2;
-
- FilePath = InternalAllocateZeroPool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + sizeof (EFI_DEVICE_PATH_PROTOCOL));
-
- DevicePath = NULL;
-
- if (FilePath != NULL) {
-
- //
- // Build a file path
- //
- FilePath->Header.Type = MEDIA_DEVICE_PATH;
- FilePath->Header.SubType = MEDIA_FILEPATH_DP;
- SetDevicePathNodeLength (&FilePath->Header, Size + SIZE_OF_FILEPATH_DEVICE_PATH);
- EfiCopyMem (FilePath->PathName, FileName, Size);
- Eop = NextDevicePathNode (&FilePath->Header);
- SetDevicePathEndNode (Eop);
-
- //
- // Append file path to device's device path
- //
-
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) FilePath;
- if (Device != NULL) {
- DevicePath = RtEfiAppendDevicePath (
- RtEfiDevicePathFromHandle (Device),
- DevicePath
- );
-
- gBS->FreePool (FilePath);
- }
- }
-
- return DevicePath;
-}
-
-EFI_DEVICE_PATH_PROTOCOL *
-RtEfiAppendDevicePathInstance (
- IN EFI_DEVICE_PATH_PROTOCOL *Src,
- IN EFI_DEVICE_PATH_PROTOCOL *Instance
- )
-/*++
-
-Routine Description:
-
- Append a device path instance to another.
-
-Arguments:
-
- Src - The device path instance to be appended with.
- Instance - The device path instance appending the other.
-
-Returns:
-
- The contaction of these two.
-
---*/
-{
- UINT8 *Ptr;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- UINTN SrcSize;
- UINTN InstanceSize;
-
- if (Src == NULL) {
- return RtEfiDuplicateDevicePath (Instance);
- }
-
- SrcSize = RtEfiDevicePathSize (Src);
- InstanceSize = RtEfiDevicePathSize (Instance);
-
- Ptr = InternalAllocateCopyPool (SrcSize + InstanceSize, Src);
- if (Ptr != NULL) {
-
- DevPath = (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
-
- while (!IsDevicePathEnd (DevPath)) {
- DevPath = NextDevicePathNode (DevPath);
- }
- //
- // Convert the End to an End Instance, since we are
- // appending another instacne after this one its a good
- // idea.
- //
- DevPath->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE;
-
- DevPath = NextDevicePathNode (DevPath);
- EfiCopyMem (DevPath, Instance, InstanceSize);
- }
-
- return (EFI_DEVICE_PATH_PROTOCOL *) Ptr;
-}
-
-VOID
-EFIAPI
-RtEfiInitializeFwVolDevicepathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
- IN EFI_GUID *NameGuid
- )
-/*++
-
-Routine Description:
-
- Initialize a Firmware Volume (FV) Media Device Path node.
-
-Arguments:
-
- FvDevicePathNode - Pointer to a FV device path node to initialize
- NameGuid - FV file name to use in FvDevicePathNode
-
-Returns:
-
- None
-
---*/
-{
- FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
- FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
- SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
-
- EfiCopyMem (&FvDevicePathNode->NameGuid, NameGuid, sizeof(EFI_GUID));
-}
-
-EFI_GUID *
-EFIAPI
-RtEfiGetNameGuidFromFwVolDevicePathNode (
- IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
- )
-/*++
-
-Routine Description:
-
- Check to see if the Firmware Volume (FV) Media Device Path is valid.
-
-Arguments:
-
- FvDevicePathNode - Pointer to FV device path to check
-
-Returns:
-
- NULL - FvDevicePathNode is not valid.
- Other - FvDevicePathNode is valid and pointer to NameGuid was returned.
-
---*/
-{
- if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
- DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
- return &FvDevicePathNode->NameGuid;
- }
-
- return NULL;
-}
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Fvb.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Fvb.c
deleted file mode 100644
index 1224761ed6..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Fvb.c
+++ /dev/null
@@ -1,618 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-Module Name:
-
- Fvb.c
-
-Abstract:
-
- Firmware Volume Block Protocol Runtime Abstraction
-
- mFvbEntry is an array of Handle Fvb pairs. The Fvb Lib Instance matches the
- index in the mFvbEntry array. This should be the same sequence as the FVB's
- were described in the HOB. We have to remember the handle so we can tell if
- the protocol has been reinstalled and it needs updateing.
-
- If you are using any of these lib functions.you must first call FvbInitialize ().
-
-Key:
- FVB - Firmware Volume Block
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_PROTOCOL_DEFINITION (FvbExtension)
-
-//
-// Lib will ASSERT if more FVB devices than this are added to the system.
-//
-UINTN mFvbCount;
-VOID *mFvbRegistration;
-VOID *mFvbExtRegistration;
-//static EFI_EVENT mEfiFvbVirtualNotifyEvent;
-BOOLEAN gEfiFvbInitialized = FALSE;
-EFI_EVENT mFvbEvent;
-
-BOOLEAN
-IsMemoryRuntime (
- IN VOID *Address
- )
-/*++
-
-Routine Description:
- Check whether an address is runtime memory or not.
-
-Arguments:
-
- Address - The Address being checked.
-
-Returns:
- TRUE - The address is runtime memory.
- FALSE - The address is not runtime memory.
-
---*/
-{
- EFI_STATUS Status;
- UINT8 TmpMemoryMap[1];
- UINTN MapKey;
- UINTN DescriptorSize;
- UINT32 DescriptorVersion;
- UINTN MemoryMapSize;
- EFI_MEMORY_DESCRIPTOR *MemoryMap;
- EFI_MEMORY_DESCRIPTOR *MemoryMapPtr;
- BOOLEAN IsRuntime;
- UINTN Index;
-
- IsRuntime = FALSE;
-
- //
- // Get System MemoryMapSize
- //
- MemoryMapSize = 1;
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- (EFI_MEMORY_DESCRIPTOR *)TmpMemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- ASSERT (Status == EFI_BUFFER_TOO_SMALL);
- //
- // Enlarge space here, because we will allocate pool now.
- //
- MemoryMapSize += EFI_PAGE_SIZE;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- MemoryMapSize,
- (VOID**)&MemoryMap
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Get System MemoryMap
- //
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- ASSERT_EFI_ERROR (Status);
-
- MemoryMapPtr = MemoryMap;
- //
- // Search the request Address
- //
- for (Index = 0; Index < (MemoryMapSize / DescriptorSize); Index++) {
- if (((EFI_PHYSICAL_ADDRESS)(UINTN)Address >= MemoryMap->PhysicalStart) &&
- ((EFI_PHYSICAL_ADDRESS)(UINTN)Address < MemoryMap->PhysicalStart
- + LShiftU64 (MemoryMap->NumberOfPages, EFI_PAGE_SHIFT))) {
- //
- // Found it
- //
- if (MemoryMap->Attribute & EFI_MEMORY_RUNTIME) {
- IsRuntime = TRUE;
- }
- break;
- }
- //
- // Get next item
- //
- MemoryMap = (EFI_MEMORY_DESCRIPTOR *)((UINTN)MemoryMap + DescriptorSize);
- }
-
- //
- // Done
- //
- gBS->FreePool (MemoryMapPtr);
-
- return IsRuntime;
-}
-
-VOID
-EFIAPI
-FvbNotificationFunction (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
- Update mFvbEntry. Add new entry, or update existing entry if Fvb protocol is
- reinstalled.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
- None
-
---*/
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- EFI_HANDLE Handle;
- UINTN Index;
- UINTN UpdateIndex;
- EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb;
- EFI_FVB_EXTENSION_PROTOCOL *FvbExtension;
-
- while (TRUE) {
- BufferSize = sizeof (Handle);
- Status = gBS->LocateHandle (
- ByRegisterNotify,
- &gEfiFirmwareVolumeBlockProtocolGuid,
- mFvbRegistration,
- &BufferSize,
- &Handle
- );
- if (EFI_ERROR (Status)) {
- //
- // Exit Path of While Loop....
- //
- break;
- }
-
- UpdateIndex = MAX_FVB_COUNT;
- for (Index = 0; Index < mFvbCount; Index++) {
- if (mFvbEntry[Index].Handle == Handle) {
- //
- // If the handle is already in the table just update the protocol
- //
- UpdateIndex = Index;
- break;
- }
- }
-
- if (UpdateIndex == MAX_FVB_COUNT) {
- //
- // Use the next free slot for a new entry
- //
- UpdateIndex = mFvbCount;
- }
- //
- // The array does not have enough entries
- //
- ASSERT (UpdateIndex < MAX_FVB_COUNT);
-
- //
- // Get the interface pointer and if it's ours, skip it.
- // We check Runtime here, because it has no reason to register
- // a boot time FVB protocol.
- //
- Status = gBS->HandleProtocol (Handle, &gEfiFirmwareVolumeBlockProtocolGuid, (VOID **) &Fvb);
- ASSERT_EFI_ERROR (Status);
- if (IsMemoryRuntime (Fvb)) {
- //
- // Increase mFvbCount if we need to add a new entry
- //
- if (UpdateIndex == mFvbCount) {
- mFvbCount++;
- }
- mFvbEntry[UpdateIndex].Handle = Handle;
- mFvbEntry[UpdateIndex].Fvb = Fvb;
- mFvbEntry[UpdateIndex].FvbExtension = NULL;
-
- Status = gBS->HandleProtocol (Handle, &gEfiFvbExtensionProtocolGuid, (VOID **) &FvbExtension);
- if ((Status == EFI_SUCCESS) && IsMemoryRuntime (FvbExtension)) {
- mFvbEntry[UpdateIndex].FvbExtension = FvbExtension;
- }
- }
- }
-}
-
-EFI_STATUS
-EfiFvbInitialize (
- VOID
- )
-/*++
-
-Routine Description:
- Initialize globals and register Fvb Protocol notification function.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS - Fvb is successfully initialized
- others - Fail to initialize
-
---*/
-{
- UINTN Status;
- mFvbCount = 0;
-
- Status = gBS->AllocatePool (
- EfiRuntimeServicesData,
- (UINTN) sizeof (FVB_ENTRY) * MAX_FVB_COUNT,
- (VOID *) &mFvbEntry
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- EfiZeroMem (mFvbEntry, sizeof (FVB_ENTRY) * MAX_FVB_COUNT);
-
- mFvbEvent = RtEfiLibCreateProtocolNotifyEvent (
- &gEfiFirmwareVolumeBlockProtocolGuid,
- EFI_TPL_CALLBACK,
- FvbNotificationFunction,
- NULL,
- &mFvbRegistration
- );
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- // Status = gBS->CreateEvent (
- // EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- // EFI_TPL_NOTIFY,
- // EfiRuntimeLibFvbVirtualNotifyEvent,
- // NULL,
- // &mEfiFvbVirtualNotifyEvent
- // );
- // ASSERT_EFI_ERROR (Status);
- //
- gEfiFvbInitialized = TRUE;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiFvbShutdown (
- VOID
- )
-/*++
-
-Routine Description:
- Release resources allocated in EfiFvbInitialize.
-
-Arguments:
- None
-
-Returns:
- EFI_SUCCESS
-
---*/
-{
- gBS->FreePool ((VOID *) mFvbEntry);
-
- gBS->CloseEvent (mFvbEvent);
-
- gEfiFvbInitialized = FALSE;
-
- return EFI_SUCCESS;
-}
-
-//
-// The following functions wrap Fvb protocol in the Runtime Lib functions.
-// The Instance translates into Fvb instance. The Fvb order defined by HOBs and
-// thus the sequence of FVB protocol addition define Instance.
-//
-// EfiFvbInitialize () must be called before any of the following functions
-// must be called.
-//
-
-EFI_STATUS
-EfiFvbReadBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Reads specified number of bytes into a buffer from the specified block
-
-Arguments:
- Instance - The FV instance to be read from
- Lba - The logical block address to be read from
- Offset - Offset into the block at which to begin reading
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes read
- Buffer - Pointer to a caller allocated buffer that will be
- used to hold the data read
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->Read (mFvbEntry[Instance].Fvb, Lba, Offset, NumBytes, Buffer);
-}
-
-EFI_STATUS
-EfiFvbWriteBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-/*++
-
-Routine Description:
- Writes specified number of bytes from the input buffer to the block
-
-Arguments:
- Instance - The FV instance to be written to
- Lba - The starting logical block index to write to
- Offset - Offset into the block at which to begin writing
- NumBytes - Pointer that on input contains the total size of
- the buffer. On output, it contains the total number
- of bytes actually written
- Buffer - Pointer to a caller allocated buffer that contains
- the source for the write
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->Write (mFvbEntry[Instance].Fvb, Lba, Offset, NumBytes, Buffer);
-}
-
-EFI_STATUS
-EfiFvbEraseBlock (
- IN UINTN Instance,
- IN EFI_LBA Lba
- )
-/*++
-
-Routine Description:
- Erases and initializes a firmware volume block
-
-Arguments:
- Instance - The FV instance to be erased
- Lba - The logical block index to be erased
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->EraseBlocks (mFvbEntry[Instance].Fvb, Lba, -1);
-}
-
-EFI_STATUS
-EfiFvbGetVolumeAttributes (
- IN UINTN Instance,
- OUT EFI_FVB_ATTRIBUTES *Attributes
- )
-/*++
-
-Routine Description:
- Retrieves attributes, insures positive polarity of attribute bits, returns
- resulting attributes in output parameter
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- returned
- Attributes - Output buffer which contains attributes
-
-Returns:
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetVolumeAttributes (mFvbEntry[Instance].Fvb, Attributes);
-}
-
-EFI_STATUS
-EfiFvbSetVolumeAttributes (
- IN UINTN Instance,
- IN EFI_FVB_ATTRIBUTES Attributes
- )
-/*++
-
-Routine Description:
- Modifies the current settings of the firmware volume according to the
- input parameter.
-
-Arguments:
- Instance - The FV instance whose attributes is going to be
- modified
- Attributes - It is a pointer to EFI_FVB_ATTRIBUTES
- containing the desired firmware volume settings.
-
-Returns:
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->SetVolumeAttributes (mFvbEntry[Instance].Fvb, &Attributes);
-}
-
-EFI_STATUS
-EfiFvbGetPhysicalAddress (
- IN UINTN Instance,
- OUT EFI_PHYSICAL_ADDRESS *BaseAddress
- )
-/*++
-
-Routine Description:
- Retrieves the physical address of a memory mapped FV
-
-Arguments:
- Instance - The FV instance whose base address is going to be
- returned
- BaseAddress - Pointer to a caller allocated EFI_PHYSICAL_ADDRESS
- that on successful return, contains the base address
- of the firmware volume.
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetPhysicalAddress (mFvbEntry[Instance].Fvb, BaseAddress);
-}
-
-EFI_STATUS
-EfiFvbGetBlockSize (
- IN UINTN Instance,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumOfBlocks
- )
-/*++
-
-Routine Description:
- Retrieve the size of a logical block
-
-Arguments:
- Instance - The FV instance whose block size is going to be
- returned
- Lba - Indicates which block to return the size for.
- BlockSize - A pointer to a caller allocated UINTN in which
- the size of the block is returned
- NumOfBlocks - a 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
-
-Returns:
- EFI_SUCCESS - The firmware volume was read successfully and
- contents are in Buffer
-
- EFI_INVALID_PARAMETER - invalid parameter
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- return mFvbEntry[Instance].Fvb->GetBlockSize (mFvbEntry[Instance].Fvb, Lba, BlockSize, NumOfBlocks);
-}
-
-EFI_STATUS
-EfiFvbEraseCustomBlockRange (
- IN UINTN Instance,
- IN EFI_LBA StartLba,
- IN UINTN OffsetStartLba,
- IN EFI_LBA LastLba,
- IN UINTN OffsetLastLba
- )
-/*++
-
-Routine Description:
- Erases and initializes a specified range of a firmware volume
-
-Arguments:
- Instance - The FV instance to be erased
- StartLba - The starting logical block index to be erased
- OffsetStartLba - Offset into the starting block at which to
- begin erasing
- LastLba - The last logical block index to be erased
- OffsetLastLba - Offset into the last block at which to end erasing
-
-Returns:
-
- Status code
-
- EFI_INVALID_PARAMETER - invalid parameter
-
- EFI_UNSUPPORTED - not support
-
---*/
-{
- if (Instance >= mFvbCount) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (!(mFvbEntry[Instance].FvbExtension)) {
- return EFI_UNSUPPORTED;
- }
-
- if (!(mFvbEntry[Instance].FvbExtension->EraseFvbCustomBlock)) {
- return EFI_UNSUPPORTED;
- }
-
- return mFvbEntry[Instance].FvbExtension->EraseFvbCustomBlock (
- mFvbEntry[Instance].FvbExtension,
- StartLba,
- OffsetStartLba,
- LastLba,
- OffsetLastLba
- );
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/IoLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/IoLib.c
deleted file mode 100644
index cb0b7bb7f7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/IoLib.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
-
- IoLib.c
-
-Abstract:
-
- Light weight lib to support Tiano drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-
-extern EFI_CPU_IO_PROTOCOL *gCpuIo;
-
-EFI_STATUS
-EfiIoRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO read into Buffer.
-
-Arguments:
- Width - Width of read transaction, and repeat operation to use
- Address - IO address to read
- Count - Number of times to read the IO address.
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Io.Read (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiIoWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform an IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Io.Write (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiMemRead (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a Memory mapped IO read into Buffer.
-
-Arguments:
- Width - Width of each read transaction.
- Address - Memory mapped IO address to read
- Count - Number of Width quanta to read
- Buffer - Buffer to read data into. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Mem.Read (gCpuIo, Width, Address, Count, Buffer);
-}
-
-EFI_STATUS
-EfiMemWrite (
- IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-/*++
-
-Routine Description:
- Perform a memory mapped IO write into Buffer.
-
-Arguments:
- Width - Width of write transaction, and repeat operation to use
- Address - IO address to write
- Count - Number of times to write the IO address.
- Buffer - Buffer to write data from. size is Width * Count
-
-Returns:
- BugBug: Check with Mike to see if I can find this #define some ware else
-
---*/
-{
- return gCpuIo->Mem.Write (gCpuIo, Width, Address, Count, Buffer);
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Lock.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Lock.c
deleted file mode 100644
index 55b67f4956..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/Lock.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/*++
-
-Copyright (c) 2005, 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.
-
-Module Name:
-
- Lock.c
-
-Abstract:
-
- Support for locking lib services.
-
---*/
-
-#include "Tiano.h"
-#include "EfiDriverLib.h"
-
-extern
-BOOLEAN
-EfiAtRuntime (
- VOID
- );
-
-VOID
-EfiInitializeLock (
- IN OUT EFI_LOCK *Lock,
- IN EFI_TPL Priority
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
- Note on a check build ASSERT()s are used to ensure proper
- lock usage.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
- Priority - The task priority level of the lock
-
-
-Returns:
-
- An initialized Efi Lock structure.
-
---*/
-{
- Lock->Tpl = Priority;
- Lock->OwnerTpl = 0;
- Lock->Lock = 0;
-}
-
-EFI_STATUS
-EfiAcquireLockOrFail (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Initialize a basic mutual exclusion lock. Each lock
- provides mutual exclusion access at it's task priority
- level. Since there is no-premption (at any TPL) or
- multiprocessor support, acquiring the lock only consists
- of raising to the locks TPL.
-
-Arguments:
-
- Lock - The EFI_LOCK structure to initialize
-
-Returns:
-
- EFI_SUCCESS - Lock Owned.
- EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.
-
---*/
-{
- if (Lock->Lock != 0) {
- //
- // Lock is already owned, so bail out
- //
- return EFI_ACCESS_DENIED;
- }
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);
- }
-
- Lock->Lock += 1;
- return EFI_SUCCESS;
-}
-
-VOID
-EfiAcquireLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Raising to the task priority level of the mutual exclusion
- lock, and then acquires ownership of the lock.
-
-Arguments:
-
- Lock - The lock to acquire
-
-Returns:
-
- Lock owned
-
---*/
-{
- EFI_STATUS Status;
-
- Status = EfiAcquireLockOrFail (Lock);
-
- //
- // Lock was already locked.
- //
- ASSERT_EFI_ERROR (Status);
-}
-
-VOID
-EfiReleaseLock (
- IN EFI_LOCK *Lock
- )
-/*++
-
-Routine Description:
-
- Releases ownership of the mutual exclusion lock, and
- restores the previous task priority level.
-
-Arguments:
-
- Lock - The lock to release
-
-Returns:
-
- Lock unowned
-
---*/
-{
- EFI_TPL Tpl;
-
- Tpl = Lock->OwnerTpl;
-
- ASSERT (Lock->Lock == 1);
- Lock->Lock -= 1;
-
- if (!EfiAtRuntime ()) {
- //
- // The check is just debug code for core inplementation. It must
- // always be true in a driver
- //
- gBS->RestoreTPL (Tpl);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/PlatformIoLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/PlatformIoLib.c
deleted file mode 100644
index 4c3ffa7f0a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/PlatformIoLib.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/*++
-
-Copyright (c) 2005 - 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.
-
-Module Name:
-
- PlatformIoLib.c
-
-Abstract:
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-
-#define PCI_CONFIG_INDEX_PORT 0xcf8
-#define PCI_CONFIG_DATA_PORT 0xcfc
-#define REFRESH_CYCLE_TOGGLE_BIT 0x10
-
-UINT32
-GetPciAddress (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Constructs PCI Address 32 bits
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- PciAddress to be written to Config Port
-
---*/
-{
- UINT32 Data;
-
- Data = 0;
-
- Data = (((UINT32) Segment) << 24);
- Data |= (((UINT32) Bus) << 16);
- Data |= (((UINT32) DevFunc) << 8);
- Data |= (UINT32) Register;
-
- return Data;
-
-}
-
-UINT8
-PciRead8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT8 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint8, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-UINT16
-PciRead16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT16 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint16, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-UINT32
-PciRead32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle read
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
-
-Returns:
- Data read from PCI config space
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
- UINT32 Data;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return 0;
- }
-
- EfiIoRead (EfiCpuIoWidthUint32, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-
- return Data;
-}
-
-VOID
-PciWrite8 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT8 Data
- )
-/*++
-
-Routine Description:
- Perform an one byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint8, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-
-VOID
-PciWrite16 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT16 Data
- )
-/*++
-
-Routine Description:
- Perform an two byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint16, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-
-VOID
-PciWrite32 (
- UINT8 Segment,
- UINT8 Bus,
- UINT8 DevFunc,
- UINT8 Register,
- UINT32 Data
- )
-/*++
-
-Routine Description:
- Perform an four byte PCI config cycle write
-
-Arguments:
- Segment - PCI Segment ACPI _SEG
- Bus - PCI Bus
- DevFunc - PCI Device(7:3) and Func(2:0)
- Register - PCI config space register
- Data - Data to write
-
-Returns:
- NONE
-
---*/
-{
- EFI_STATUS Status;
- UINT32 PciAddress;
- UINT32 PciAddress1;
-
- PciAddress = GetPciAddress (Segment, Bus, DevFunc, Register);
- //
- // Set bit 31 for PCI config access
- //
- PciAddress1 = PciAddress;
- PciAddress = ((PciAddress & 0xFFFFFFFC) | (0x80000000));
-
- Status = EfiIoWrite (EfiCpuIoWidthUint32, PCI_CONFIG_INDEX_PORT, 1, &PciAddress);
-
- if (EFI_ERROR (Status)) {
- return ;
- }
-
- EfiIoWrite (EfiCpuIoWidthUint32, (PCI_CONFIG_DATA_PORT + (PciAddress1 & 0x3)), 1, &Data);
-}
-//
-// Delay Primative
-//
-VOID
-EfiStall (
- IN UINTN Microseconds
- )
-/*++
-
-Routine Description:
- Delay for at least the request number of microseconds
-
-Arguments:
- Microseconds - Number of microseconds to delay.
-
-Returns:
- NONE
-
---*/
-{
- UINT8 Data;
- UINT8 InitialState;
- UINTN CycleIterations;
-
- CycleIterations = 0;
- Data = 0;
- InitialState = 0;
-
- if (EfiAtRuntime ()) {
- //
- // The time-source is 30 us granular, so calibrate the timing loop
- // based on this baseline
- // Error is possible 30us.
- //
- CycleIterations = (Microseconds - 1) / 30 + 1;
-
- //
- // Use the DMA Refresh timer in port 0x61. Cheap but effective.
- // The only issue is that the granularity is 30us, and we want to
- // guarantee "at least" one full transition to avoid races.
- //
- //
- // _____________/----------\__________/--------
- //
- // |<--15us-->|<--15us-->|
- //
- // --------------------------------------------------> Time (us)
- //
- while (CycleIterations--) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- InitialState = Data;
-
- //
- // Capture first transition (strictly less than one period)
- //
- while (InitialState == Data) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- }
-
- InitialState = Data;
- //
- // Capture next transition (guarantee at least one full pulse)
- //
- while (InitialState == Data) {
- EfiIoRead (EfiCpuIoWidthUint8, 0x61, 1, &Data);
- Data &= REFRESH_CYCLE_TOGGLE_BIT;
- }
- }
- } else {
- gBS->Stall (Microseconds);
- }
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
deleted file mode 100644
index 75e69784fa..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/*++
-
-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
-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:
-
- RuntimeLib.c
-
-Abstract:
-
- Light weight lib to support Tiano drivers.
-
---*/
-
-#include "Tiano.h"
-#include "EfiRuntimeLib.h"
-#include "PeiHob.h"
-#include EFI_PROTOCOL_DEFINITION (CpuIo)
-#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
-#include EFI_GUID_DEFINITION (StatusCodeCallerId)
-#include EFI_GUID_DEFINITION (Hob)
-#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
-#include EFI_PROTOCOL_DEFINITION (SmmStatusCode)
-#include EFI_PROTOCOL_DEFINITION (SmmBase)
-
-//
-// Driver Lib Module Globals
-//
-static EFI_RUNTIME_SERVICES *mRT;
-static EFI_EVENT mRuntimeNotifyEvent = NULL;
-static EFI_EVENT mEfiVirtualNotifyEvent = NULL;
-static BOOLEAN mRuntimeLibInitialized = FALSE;
-static BOOLEAN mEfiGoneVirtual = FALSE;
-static BOOLEAN mInSmm = FALSE;
-
-//
-// Runtime Global, but you should use the Lib functions
-//
-EFI_CPU_IO_PROTOCOL *gCpuIo;
-BOOLEAN mEfiAtRuntime = FALSE;
-FVB_ENTRY *mFvbEntry;
-EFI_SMM_STATUS_CODE_PROTOCOL *gSmmStatusCodeProtocol = NULL;
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_REPORT_STATUS_CODE gReportStatusCode = NULL;
-EFI_EVENT gEfiStatusCodeNotifyEvent = NULL;
-
-VOID
-EFIAPI
-OnStatusCodeInstall (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- EFI_STATUS_CODE_PROTOCOL *StatusCode;
-
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **) &StatusCode);
- if (!EFI_ERROR (Status)) {
- gReportStatusCode = StatusCode->ReportStatusCode;
- }
-}
-
-EFI_STATUS
-GetPeiProtocol (
- IN EFI_GUID *ProtocolGuid,
- IN VOID **Interface
- )
-/*++
-
-Routine Description:
-
- Searches for a Protocol Interface passed from PEI through a HOB
-
-Arguments:
-
- ProtocolGuid - The Protocol GUID to search for in the HOB List
-
- Interface - A pointer to the interface for the Protocol GUID
-
-Returns:
-
- EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
-
- EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
-
---*/
-{
- EFI_STATUS Status;
- EFI_PEI_HOB_POINTERS GuidHob;
-
- //
- // Get Hob list
- //
- Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **) &GuidHob.Raw);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
- if (END_OF_HOB_LIST (GuidHob)) {
- Status = EFI_NOT_FOUND;
- break;
- }
-
- if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {
- if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {
- Status = EFI_SUCCESS;
- *Interface = (VOID *) *(UINTN *) (GuidHob.Guid + 1);
- }
- }
-
- GuidHob.Raw = GET_NEXT_HOB (GuidHob);
- }
-
- return Status;
-}
-
-#endif
-
-EFI_STATUS
-EfiConvertPointer (
- IN UINTN DebugDisposition,
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Determines the new virtual address that is to be used on subsequent memory accesses.
-
-Arguments:
-
- DebugDisposition - Supplies type information for the pointer being converted.
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->ConvertPointer (DebugDisposition, Address);
-}
-
-EFI_STATUS
-EfiConvertInternalPointer (
- IN OUT VOID *Address
- )
-/*++
-
-Routine Description:
-
- Call EfiConvertPointer() to convert internal pointer.
-
-Arguments:
-
- Address - A pointer to a pointer that is to be fixed to be the value needed
- for the new virtual address mappings being applied.
-
-Returns:
-
- Status code
-
---*/
-{
- return EfiConvertPointer (EFI_INTERNAL_POINTER, Address);
-}
-
-VOID
-EFIAPI
-EfiRuntimeLibFvbVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Convert all pointers in mFvbEntry after ExitBootServices.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- UINTN Index;
- if (mFvbEntry != NULL) {
- for (Index = 0; Index < MAX_FVB_COUNT; Index++) {
- if (NULL != mFvbEntry[Index].Fvb) {
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetBlockSize);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetPhysicalAddress);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->GetVolumeAttributes);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->SetVolumeAttributes);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->Read);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->Write);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb->EraseBlocks);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].Fvb);
- }
-
- if (NULL != mFvbEntry[Index].FvbExtension) {
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].FvbExtension->EraseFvbCustomBlock);
- EfiConvertInternalPointer ((VOID **) &mFvbEntry[Index].FvbExtension);
- }
- }
-
- EfiConvertInternalPointer ((VOID **) &mFvbEntry);
- }
-}
-
-VOID
-EFIAPI
-RuntimeDriverExitBootServices (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Set AtRuntime flag as TRUE after ExitBootServices
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- mEfiAtRuntime = TRUE;
-}
-
-extern BOOLEAN gEfiFvbInitialized;
-
-VOID
-EFIAPI
-EfiRuntimeLibVirtualNotifyEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- Fixup internal data so that EFI can be call in virtual mode.
- Call the passed in Child Notify event and convert any pointers in
- lib to virtual mode.
-
-Arguments:
-
- Event - The Event that is being processed
-
- Context - Event Context
-
-Returns:
-
- None
-
---*/
-{
- EFI_EVENT_NOTIFY ChildNotifyEventHandler;
-
- if (Context != NULL) {
- ChildNotifyEventHandler = (EFI_EVENT_NOTIFY) (UINTN) Context;
- ChildNotifyEventHandler (Event, NULL);
- }
-
- if (gEfiFvbInitialized) {
- EfiRuntimeLibFvbVirtualNotifyEvent (Event, Context);
- }
- //
- // Update global for Runtime Services Table and IO
- //
- EfiConvertInternalPointer ((VOID **) &gCpuIo);
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gReportStatusCode != NULL) {
- EfiConvertInternalPointer ((VOID **) &gReportStatusCode);
- }
-#endif
- EfiConvertInternalPointer ((VOID **) &mRT);
-
- //
- // Clear out BootService globals
- //
- gBS = NULL;
- gST = NULL;
- mEfiGoneVirtual = TRUE;
-}
-
-EFI_STATUS
-EfiInitializeRuntimeDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN EFI_EVENT_NOTIFY GoVirtualChildEvent
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
- GoVirtualChildEvent - Caller can register a virtual notification event.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- VOID *Registration;
-#endif
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
-
- Status = EfiLibGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
- ASSERT_EFI_ERROR (Status);
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // Register EFI_STATUS_CODE_PROTOCOL notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- EFI_TPL_CALLBACK,
- OnStatusCodeInstall,
- NULL,
- &gEfiStatusCodeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->RegisterProtocolNotify (
- &gEfiStatusCodeRuntimeProtocolGuid,
- gEfiStatusCodeNotifyEvent,
- &Registration
- );
- ASSERT_EFI_ERROR (Status);
-
- gBS->SignalEvent (gEfiStatusCodeNotifyEvent);
-#endif
-
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &gCpuIo);
- if (EFI_ERROR (Status)) {
- gCpuIo = NULL;
- }
-
- //
- // Register our ExitBootServices () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
- EFI_TPL_NOTIFY,
- RuntimeDriverExitBootServices,
- NULL,
- &mRuntimeNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Register SetVirtualAddressMap () notify function
- //
- Status = gBS->CreateEvent (
- EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
- EFI_TPL_NOTIFY,
- EfiRuntimeLibVirtualNotifyEvent,
- (VOID *) (UINTN) GoVirtualChildEvent,
- &mEfiVirtualNotifyEvent
- );
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiShutdownRuntimeDriverLib (
- VOID
- )
-/*++
-
-Routine Description:
-
- This routine will free some resources which have been allocated in
- EfiInitializeRuntimeDriverLib(). If a runtime driver exits with an error,
- it must call this routine to free the allocated resource before the exiting.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Shotdown the Runtime Driver Lib successfully
- EFI_UNSUPPORTED - Runtime Driver lib was not initialized at all
-
---*/
-{
- EFI_STATUS Status;
-
- if (!mRuntimeLibInitialized) {
- //
- // You must call EfiInitializeRuntimeDriverLib() first
- //
- return EFI_UNSUPPORTED;
- }
-
- mRuntimeLibInitialized = FALSE;
-
- //
- // Close our ExitBootServices () notify function
- //
- if (mRuntimeNotifyEvent != NULL) {
- Status = gBS->CloseEvent (mRuntimeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
- //
- // Close SetVirtualAddressMap () notify function
- //
- if (mEfiVirtualNotifyEvent != NULL) {
- Status = gBS->CloseEvent (mEfiVirtualNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- //
- // Close EfiStatusCodeRuntimeProtocol notify function
- //
- if (gEfiStatusCodeNotifyEvent != NULL) {
- Status = gBS->CloseEvent (gEfiStatusCodeNotifyEvent);
- ASSERT_EFI_ERROR (Status);
- }
-#endif
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EfiInitializeSmmDriverLib (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- Intialize runtime Driver Lib if it has not yet been initialized.
-
-Arguments:
-
- ImageHandle - The firmware allocated handle for the EFI image.
-
- SystemTable - A pointer to the EFI System Table.
-
-Returns:
-
- EFI_STATUS always returns EFI_SUCCESS except EFI_ALREADY_STARTED if already started.
-
---*/
-{
- EFI_STATUS Status;
- EFI_SMM_BASE_PROTOCOL *SmmBase;
-
- if (mRuntimeLibInitialized) {
- return EFI_ALREADY_STARTED;
- }
-
- mRuntimeLibInitialized = TRUE;
-
- gST = SystemTable;
- ASSERT (gST != NULL);
-
- gBS = SystemTable->BootServices;
- ASSERT (gBS != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
-
- //
- // Check whether it is in SMM mode.
- //
- Status = gBS->LocateProtocol (&gEfiSmmBaseProtocolGuid, NULL, (VOID**) &SmmBase);
- if (!EFI_ERROR (Status)) {
- SmmBase->InSmm (SmmBase, &mInSmm);
- }
-
- //
- // Directly locate SmmStatusCode protocol
- //
- Status = gBS->LocateProtocol (&gEfiSmmStatusCodeProtocolGuid, NULL, (VOID**) &gSmmStatusCodeProtocol);
- if (EFI_ERROR (Status)) {
- gSmmStatusCodeProtocol = NULL;
- }
-
- Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, (VOID **) &gCpuIo);
- if (EFI_ERROR (Status)) {
- gCpuIo = NULL;
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-EfiAtRuntime (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if ExitBootServices () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If ExitBootServices () has been called
-
---*/
-{
- return mEfiAtRuntime;
-}
-
-BOOLEAN
-EfiGoneVirtual (
- VOID
- )
-/*++
-
-Routine Description:
- Return TRUE if SetVirtualAddressMap () has been called
-
-Arguments:
- NONE
-
-Returns:
- TRUE - If SetVirtualAddressMap () has been called
-
---*/
-{
- return mEfiGoneVirtual;
-}
-//
-// The following functions hide the mRT local global from the call to
-// runtime service in the EFI system table.
-//
-EFI_STATUS
-EfiGetTime (
- OUT EFI_TIME *Time,
- OUT EFI_TIME_CAPABILITIES *Capabilities
- )
-/*++
-
-Routine Description:
-
- Returns the current time and date information, and the time-keeping
- capabilities of the hardware platform.
-
-Arguments:
-
- Time - A pointer to storage to receive a snapshot of the current time.
- Capabilities - An optional pointer to a buffer to receive the real time clock device's
- capabilities.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetTime (Time, Capabilities);
-}
-
-EFI_STATUS
-EfiSetTime (
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the current local time and date information.
-
-Arguments:
-
- Time - A pointer to the current time.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetTime (Time);
-}
-
-EFI_STATUS
-EfiGetWakeupTime (
- OUT BOOLEAN *Enabled,
- OUT BOOLEAN *Pending,
- OUT EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Returns the current wakeup alarm clock setting.
-
-Arguments:
-
- Enabled - Indicates if the alarm is currently enabled or disabled.
- Pending - Indicates if the alarm signal is pending and requires acknowledgement.
- Time - The current alarm setting.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetWakeupTime (Enabled, Pending, Time);
-}
-
-EFI_STATUS
-EfiSetWakeupTime (
- IN BOOLEAN Enable,
- IN EFI_TIME *Time
- )
-/*++
-
-Routine Description:
-
- Sets the system wakeup alarm clock time.
-
-Arguments:
-
- Enable - Enable or disable the wakeup alarm.
- Time - If Enable is TRUE, the time to set the wakeup alarm for.
- If Enable is FALSE, then this parameter is optional, and may be NULL.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetWakeupTime (Enable, Time);
-}
-
-EFI_STATUS
-EfiGetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID * VendorGuid,
- OUT UINT32 *Attributes OPTIONAL,
- IN OUT UINTN *DataSize,
- OUT VOID *Data
- )
-/*++
-
-Routine Description:
-
- Returns the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - If not NULL, a pointer to the memory location to return the
- attributes bitmask for the variable.
- DataSize - On input, the size in bytes of the return Data buffer.
- On output the size of data returned in Data.
- Data - The buffer to return the contents of the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-EFI_STATUS
-EfiGetNextVariableName (
- IN OUT UINTN *VariableNameSize,
- IN OUT CHAR16 *VariableName,
- IN OUT EFI_GUID *VendorGuid
- )
-/*++
-
-Routine Description:
-
- Enumerates the current variable names.
-
-Arguments:
-
- VariableNameSize - The size of the VariableName buffer.
- VariableName - On input, supplies the last VariableName that was returned
- by GetNextVariableName().
- On output, returns the Nullterminated Unicode string of the
- current variable.
- VendorGuid - On input, supplies the last VendorGuid that was returned by
- GetNextVariableName().
- On output, returns the VendorGuid of the current variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
-}
-
-EFI_STATUS
-EfiSetVariable (
- IN CHAR16 *VariableName,
- IN EFI_GUID *VendorGuid,
- IN UINT32 Attributes,
- IN UINTN DataSize,
- IN VOID *Data
- )
-/*++
-
-Routine Description:
-
- Sets the value of a variable.
-
-Arguments:
-
- VariableName - A Null-terminated Unicode string that is the name of the
- vendor's variable.
- VendorGuid - A unique identifier for the vendor.
- Attributes - Attributes bitmask to set for the variable.
- DataSize - The size in bytes of the Data buffer.
- Data - The contents for the variable.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
-}
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
-EFI_STATUS
-EfiQueryVariableInfo (
- IN UINT32 Attributes,
- OUT UINT64 *MaximumVariableStorageSize,
- OUT UINT64 *RemainingVariableStorageSize,
- OUT UINT64 *MaximumVariableSize
- )
-
-/*++
-
-Routine Description:
-
- This code returns information about the EFI variables.
-
-Arguments:
-
- Attributes Attributes bitmask to specify the type of variables
- on which to return information.
- MaximumVariableStorageSize Pointer to the maximum size of the storage space available
- for the EFI variables associated with the attributes specified.
- RemainingVariableStorageSize Pointer to the remaining size of the storage space available
- for the EFI variables associated with the attributes specified.
- MaximumVariableSize Pointer to the maximum size of the individual EFI variables
- associated with the attributes specified.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->QueryVariableInfo (Attributes, MaximumVariableStorageSize, RemainingVariableStorageSize, MaximumVariableSize);
-}
-
-#endif
-
-
-EFI_STATUS
-EfiGetNextHighMonotonicCount (
- OUT UINT32 *HighCount
- )
-/*++
-
-Routine Description:
-
- Returns the next high 32 bits of the platform's monotonic counter.
-
-Arguments:
-
- HighCount - Pointer to returned value.
-
-Returns:
-
- Status code
-
---*/
-{
- return mRT->GetNextHighMonotonicCount (HighCount);
-}
-
-VOID
-EfiResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData
- )
-/*++
-
-Routine Description:
-
- Resets the entire platform.
-
-Arguments:
-
- ResetType - The type of reset to perform.
- ResetStatus - The status code for the reset.
- DataSize - The size, in bytes, of ResetData.
- ResetData - A data buffer that includes a Null-terminated Unicode string, optionally
- followed by additional binary data.
-
-Returns:
-
- None
-
---*/
-{
- mRT->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
-}
-
-EFI_STATUS
-EfiReportStatusCode (
- IN EFI_STATUS_CODE_TYPE CodeType,
- IN EFI_STATUS_CODE_VALUE Value,
- IN UINT32 Instance,
- IN EFI_GUID *CallerId OPTIONAL,
- IN EFI_STATUS_CODE_DATA *Data OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Status Code reporter
-
-Arguments:
-
- CodeType - Type of Status Code.
-
- Value - Value to output for Status Code.
-
- Instance - Instance Number of this status code.
-
- CallerId - ID of the caller of this status code.
-
- Data - Optional data associated with this status code.
-
-Returns:
-
- Status code
-
---*/
-{
- EFI_STATUS Status;
-
- if (mInSmm) {
- if (gSmmStatusCodeProtocol == NULL) {
- return EFI_UNSUPPORTED;
- }
- Status = gSmmStatusCodeProtocol->ReportStatusCode (gSmmStatusCodeProtocol, CodeType, Value, Instance, CallerId, Data);
- return Status;
- }
-
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gReportStatusCode == NULL) {
- //
- // Because we've installed the protocol notification on EfiStatusCodeRuntimeProtocol,
- // running here indicates that the StatusCode driver has not started yet.
- //
- if (EfiAtRuntime ()) {
- //
- // Running here only when StatusCode driver never starts.
- //
- return EFI_UNSUPPORTED;
- }
-
- //
- // Try to get the PEI version of ReportStatusCode.
- //
- Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
- if (EFI_ERROR (Status) || (gReportStatusCode == NULL)) {
- return EFI_UNSUPPORTED;
- }
- }
- Status = gReportStatusCode (CodeType, Value, Instance, CallerId, Data);
-#else
- if (mRT == NULL) {
- return EFI_UNSUPPORTED;
- }
- //
- // Check whether EFI_RUNTIME_SERVICES has Tiano Extension
- //
- Status = EFI_UNSUPPORTED;
- if (mRT->Hdr.Revision == EFI_SPECIFICATION_VERSION &&
- mRT->Hdr.HeaderSize == sizeof (EFI_RUNTIME_SERVICES) &&
- mRT->ReportStatusCode != NULL) {
- Status = mRT->ReportStatusCode (CodeType, Value, Instance, CallerId, Data);
- }
-#endif
- return Status;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.S b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.S
deleted file mode 100644
index d3d70012ac..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#------------------------------------------------------------------------------
-#
-# 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.
-#
-# Module Name:
-#
-# RuntimeLibAsm.S
-#
-# Abstract:
-#
-#
-#------------------------------------------------------------------------------
-#include <EfiBind.h>
-
-.text
-
-.globl ASM_PFX(EfiCpuFlushCache)
-#------------------------------------------------------------------------------
-#EFI_STATUS
-#EfiCpuFlushCache (
-# IN EFI_PHYSICAL_ADDRESS Start,
-# IN UINT64 Length
-# );
-#------------------------------------------------------------------------------
-
-ASM_PFX(EfiCpuFlushCache):
- wbinvd
- mov $0, %rax
- ret
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.asm b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.asm
deleted file mode 100644
index 880906984c..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLibAsm.asm
+++ /dev/null
@@ -1,37 +0,0 @@
-;------------------------------------------------------------------------------
-;
-; 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.
-;
-; Module Name:
-;
-; RuntimeLibAsm.asm
-;
-; Abstract:
-;
-;
-;------------------------------------------------------------------------------
-
-.code
-
-;------------------------------------------------------------------------------
-;EFI_STATUS
-;EfiCpuFlushCache (
-; IN EFI_PHYSICAL_ADDRESS Start,
-; IN UINT64 Length
-; );
-;------------------------------------------------------------------------------
-
-EfiCpuFlushCache PROC PUBLIC
- wbinvd
- mov rax, 0
- ret
-EfiCpuFlushCache ENDP
-
-END \ No newline at end of file
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h
deleted file mode 100644
index 350b1374f7..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmDefinition.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/** @file
- Header file to define EFI SMM Base2 Protocol in the PI 1.2 specification.
-
- The thunk implementation for SmmScriptLib will ultilize the SmmSaveState Protocol to save SMM
- runtime s3 boot Script. This header file is to definied PI SMM related definition to locate
- SmmSaveState Protocol
-
- Copyright (c) 2010 - 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.
-
-**/
-
-#ifndef _PI_SMM_DEFINITION_H_
-#define _PI_SMM_DEFINITION_H_
-
-typedef struct _EFI_SMM_CPU_IO2_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL;
-
-///
-/// Width of the SMM CPU I/O operations
-///
-typedef enum {
- SMM_IO_UINT8 = 0,
- SMM_IO_UINT16 = 1,
- SMM_IO_UINT32 = 2,
- SMM_IO_UINT64 = 3
-} EFI_SMM_IO_WIDTH;
-
-/**
- Provides the basic memory and I/O interfaces used toabstract accesses to devices.
-
- The I/O operations are carried out exactly as requested. The caller is responsible for any alignment
- and I/O width issues that the bus, device, platform, or type of I/O might require.
-
- @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
- @param[in] Width Signifies the width of the I/O operations.
- @param[in] Address The base address of the I/O operations.
- The caller is responsible for aligning the Address if required.
- @param[in] Count The number of I/O operations to perform.
- @param[in,out] Buffer For read operations, the destination buffer to store the results.
- For write operations, the source buffer from which to write data.
-
- @retval EFI_SUCCESS The data was read from or written to the device.
- @retval EFI_UNSUPPORTED The Address is not valid for this system.
- @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_CPU_IO2)(
- IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
- IN EFI_SMM_IO_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- );
-
-typedef struct {
- ///
- /// This service provides the various modalities of memory and I/O read.
- ///
- EFI_SMM_CPU_IO2 Read;
- ///
- /// This service provides the various modalities of memory and I/O write.
- ///
- EFI_SMM_CPU_IO2 Write;
-} EFI_SMM_IO_ACCESS2;
-
-///
-/// SMM CPU I/O 2 Protocol provides CPU I/O and memory access within SMM.
-///
-struct _EFI_SMM_CPU_IO2_PROTOCOL {
- EFI_SMM_IO_ACCESS2 Mem; ///< Allows reads and writes to memory-mapped I/O space.
- EFI_SMM_IO_ACCESS2 Io; ///< Allows reads and writes to I/O space.
-};
-typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2;
-/**
- Adds, updates, or removes a configuration table entry from the System Management System Table.
-
- The SmmInstallConfigurationTable() function is used to maintain the list
- of configuration tables that are stored in the System Management System
- Table. The list is stored as an array of (GUID, Pointer) pairs. The list
- must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.
-
- @param[in] SystemTable A pointer to the SMM System Table (SMST).
- @param[in] Guid A pointer to the GUID for the entry to add, update, or remove.
- @param[in] Table A pointer to the buffer of the table to add.
- @param[in] TableSize The size of the table to install.
-
- @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.
- @retval EFI_INVALID_PARAMETER Guid is not valid.
- @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.
- @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2)(
- IN CONST EFI_SMM_SYSTEM_TABLE2 *SystemTable,
- IN CONST EFI_GUID *Guid,
- IN VOID *Table,
- IN UINTN TableSize
- );
-/**
- Function prototype for invoking a function on an Application Processor.
-
- This definition is used by the UEFI MP Serices Protocol, and the
- PI SMM System Table.
-
- @param[in,out] Buffer Pointer to private data buffer.
-**/
-typedef
-VOID
-(EFIAPI *EFI_AP_PROCEDURE)(
- IN OUT VOID *Buffer
- );
-/**
- The SmmStartupThisAp() lets the caller to get one distinct application processor
- (AP) in the enabled processor pool to execute a caller-provided code stream
- while in SMM. It runs the given code on this processor and reports the status.
- It must be noted that the supplied code stream will be run only on an enabled
- processor which has also entered SMM.
-
- @param[in] Procedure A pointer to the code stream to be run on the designated AP of the system.
- @param[in] CpuNumber The zero-based index of the processor number of the AP on which the code stream is supposed to run.
- @param[in,out] ProcArguments Allow the caller to pass a list of parameters to the code that is run by the AP.
-
- @retval EFI_SUCCESS The call was successful and the return parameters are valid.
- @retval EFI_INVALID_PARAMETER The input arguments are out of range.
- @retval EFI_INVALID_PARAMETER The CPU requested is not available on this SMI invocation.
- @retval EFI_INVALID_PARAMETER The CPU cannot support an additional service invocation.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_STARTUP_THIS_AP)(
- IN EFI_AP_PROCEDURE Procedure,
- IN UINTN CpuNumber,
- IN OUT VOID *ProcArguments OPTIONAL
- );
-
-/**
- Function prototype for protocol install notification.
-
- @param[in] Protocol Points to the protocol's unique identifier.
- @param[in] Interface Points to the interface instance.
- @param[in] Handle The handle on which the interface was installed.
-
- @return Status Code
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_NOTIFY_FN)(
- IN CONST EFI_GUID *Protocol,
- IN VOID *Interface,
- IN EFI_HANDLE Handle
- );
-
-/**
- Register a callback function be called when a particular protocol interface is installed.
-
- The SmmRegisterProtocolNotify() function creates a registration Function that is to be
- called whenever a protocol interface is installed for Protocol by
- SmmInstallProtocolInterface().
-
- @param[in] Protocol The unique ID of the protocol for which the event is to be registered.
- @param[in] Function Points to the notification function.
- @param[out] Registration A pointer to a memory location to receive the registration value.
-
- @retval EFI_SUCCESS Successfully returned the registration record that has been added.
- @retval EFI_INVALID_PARAMETER One or more of Protocol, Function and Registration is NULL.
- @retval EFI_OUT_OF_RESOURCES Not enough memory resource to finish the request.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_REGISTER_PROTOCOL_NOTIFY)(
- IN CONST EFI_GUID *Protocol,
- IN EFI_SMM_NOTIFY_FN Function,
- OUT VOID **Registration
- );
-
-/**
- Manage SMI of a particular type.
-
- @param[in] HandlerType Points to the handler type or NULL for root SMI handlers.
- @param[in] Context Points to an optional context buffer.
- @param[in,out] CommBuffer Points to the optional communication buffer.
- @param[in,out] CommBufferSize Points to the size of the optional communication buffer.
-
- @retval EFI_WARN_INTERRUPT_SOURCE_PENDING Interrupt source was processed successfully but not quiesced.
- @retval EFI_INTERRUPT_PENDING One or more SMI sources could not be quiesced.
- @retval EFI_NOT_FOUND Interrupt source was not handled or quiesced.
- @retval EFI_SUCCESS Interrupt source was handled and quiesced.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_INTERRUPT_MANAGE)(
- IN CONST EFI_GUID *HandlerType,
- IN CONST VOID *Context OPTIONAL,
- IN OUT VOID *CommBuffer OPTIONAL,
- IN OUT UINTN *CommBufferSize OPTIONAL
- );
-
-/**
- Main entry point for an SMM handler dispatch or communicate-based callback.
-
- @param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().
- @param[in] Context Points to an optional handler context which was specified when the
- handler was registered.
- @param[in,out] CommBuffer A pointer to a collection of data in memory that will
- be conveyed from a non-SMM environment into an SMM environment.
- @param[in,out] CommBufferSize The size of the CommBuffer.
-
- @retval EFI_SUCCESS The interrupt was handled and quiesced. No other handlers
- should still be called.
- @retval EFI_WARN_INTERRUPT_SOURCE_QUIESCED The interrupt has been quiesced but other handlers should
- still be called.
- @retval EFI_WARN_INTERRUPT_SOURCE_PENDING The interrupt is still pending and other handlers should still
- be called.
- @retval EFI_INTERRUPT_PENDING The interrupt could not be quiesced.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT2)(
- IN EFI_HANDLE DispatchHandle,
- IN CONST VOID *Context OPTIONAL,
- IN OUT VOID *CommBuffer OPTIONAL,
- IN OUT UINTN *CommBufferSize OPTIONAL
- );
-
-/**
- Registers a handler to execute within SMM.
-
- @param[in] Handler Handler service funtion pointer.
- @param[in] HandlerType Points to the handler type or NULL for root SMI handlers.
- @param[out] DispatchHandle On return, contains a unique handle which can be used to later
- unregister the handler function.
-
- @retval EFI_SUCCESS SMI handler added successfully.
- @retval EFI_INVALID_PARAMETER Handler is NULL or DispatchHandle is NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_INTERRUPT_REGISTER)(
- IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
- IN CONST EFI_GUID *HandlerType OPTIONAL,
- OUT EFI_HANDLE *DispatchHandle
- );
-
-/**
- Unregister a handler in SMM.
-
- @param[in] DispatchHandle The handle that was specified when the handler was registered.
-
- @retval EFI_SUCCESS Handler function was successfully unregistered.
- @retval EFI_INVALID_PARAMETER DispatchHandle does not refer to a valid handle.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_INTERRUPT_UNREGISTER)(
- IN EFI_HANDLE DispatchHandle
- );
-
-///
-/// Processor information and functionality needed by SMM Foundation.
-///
-typedef struct _EFI_SMM_ENTRY_CONTEXT {
- EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
- ///
- /// A number between zero and the NumberOfCpus field. This field designates which
- /// processor is executing the SMM Foundation.
- ///
- UINTN CurrentlyExecutingCpu;
- ///
- /// The number of current operational processors in the platform. This is a 1 based
- /// counter. This does not indicate the number of processors that entered SMM.
- ///
- UINTN NumberOfCpus;
- ///
- /// Points to an array, where each element describes the number of bytes in the
- /// corresponding save state specified by CpuSaveState. There are always
- /// NumberOfCpus entries in the array.
- ///
- UINTN *CpuSaveStateSize;
- ///
- /// Points to an array, where each element is a pointer to a CPU save state. The
- /// corresponding element in CpuSaveStateSize specifies the number of bytes in the
- /// save state area. There are always NumberOfCpus entries in the array.
- ///
- VOID **CpuSaveState;
-} EFI_SMM_ENTRY_CONTEXT;
-
-/**
- This function is the main entry point to the SMM Foundation.
-
- @param[in] SmmEntryContext Processor information and functionality needed by SMM Foundation.
-**/
-typedef
-VOID
-(EFIAPI *EFI_SMM_ENTRY_POINT)(
- IN CONST EFI_SMM_ENTRY_CONTEXT *SmmEntryContext
- );
-
-///
-/// System Management System Table (SMST)
-///
-/// The System Management System Table (SMST) is a table that contains a collection of common
-/// services for managing SMRAM allocation and providing basic I/O services. These services are
-/// intended for both preboot and runtime usage.
-///
-struct _EFI_SMM_SYSTEM_TABLE2 {
- ///
- /// The table header for the SMST.
- ///
- EFI_TABLE_HEADER Hdr;
- ///
- /// A pointer to a NULL-terminated Unicode string containing the vendor name.
- /// It is permissible for this pointer to be NULL.
- ///
- CHAR16 *SmmFirmwareVendor;
- ///
- /// The particular revision of the firmware.
- ///
- UINT32 SmmFirmwareRevision;
-
- EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable;
-
- ///
- /// I/O Service
- ///
- EFI_SMM_CPU_IO2_PROTOCOL SmmIo;
-
- ///
- /// Runtime memory services
- ///
- EFI_ALLOCATE_POOL SmmAllocatePool;
- EFI_FREE_POOL SmmFreePool;
- EFI_ALLOCATE_PAGES SmmAllocatePages;
- EFI_FREE_PAGES SmmFreePages;
-
- ///
- /// MP service
- ///
- EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
-
- ///
- /// CPU information records
- ///
-
- ///
- /// A number between zero and and the NumberOfCpus field. This field designates
- /// which processor is executing the SMM infrastructure.
- ///
- UINTN CurrentlyExecutingCpu;
- ///
- /// The number of current operational processors in the platform. This is a 1 based counter.
- ///
- UINTN NumberOfCpus;
- ///
- /// Points to an array, where each element describes the number of bytes in the
- /// corresponding save state specified by CpuSaveState. There are always
- /// NumberOfCpus entries in the array.
- ///
- UINTN *CpuSaveStateSize;
- ///
- /// Points to an array, where each element is a pointer to a CPU save state. The
- /// corresponding element in CpuSaveStateSize specifies the number of bytes in the
- /// save state area. There are always NumberOfCpus entries in the array.
- ///
- VOID **CpuSaveState;
-
- ///
- /// Extensibility table
- ///
-
- ///
- /// The number of UEFI Configuration Tables in the buffer SmmConfigurationTable.
- ///
- UINTN NumberOfTableEntries;
- ///
- /// A pointer to the UEFI Configuration Tables. The number of entries in the table is
- /// NumberOfTableEntries.
- ///
- EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
-
- ///
- /// Protocol services
- ///
- EFI_INSTALL_PROTOCOL_INTERFACE SmmInstallProtocolInterface;
- EFI_UNINSTALL_PROTOCOL_INTERFACE SmmUninstallProtocolInterface;
- EFI_HANDLE_PROTOCOL SmmHandleProtocol;
- EFI_SMM_REGISTER_PROTOCOL_NOTIFY SmmRegisterProtocolNotify;
- EFI_LOCATE_HANDLE SmmLocateHandle;
- EFI_LOCATE_PROTOCOL SmmLocateProtocol;
-
- ///
- /// SMI Management functions
- ///
- EFI_SMM_INTERRUPT_MANAGE SmiManage;
- EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister;
- EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister;
-};
-
-#define EFI_SMM_BASE2_PROTOCOL_GUID \
- { \
- 0xf4ccbfb7, 0xf6e0, 0x47fd, {0x9d, 0xd4, 0x10, 0xa8, 0xf1, 0x50, 0xc1, 0x91 } \
- }
-
-typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL;
-
-/**
- Service to indicate whether the driver is currently executing in the SMM Initialization phase.
-
- This service is used to indicate whether the driver is currently executing in the SMM Initialization
- phase. For SMM drivers, this will return TRUE in InSmram while inside the driver's entry point and
- otherwise FALSE. For combination SMM/DXE drivers, this will return FALSE in the DXE launch. For the
- SMM launch, it behaves as an SMM driver.
-
- @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.
- @param[out] InSmram Pointer to a Boolean which, on return, indicates that the driver is
- currently executing inside of SMRAM (TRUE) or outside of SMRAM (FALSE).
-
- @retval EFI_SUCCESS The call returned successfully.
- @retval EFI_INVALID_PARAMETER InSmram was NULL.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_INSIDE_OUT2)(
- IN CONST EFI_SMM_BASE2_PROTOCOL *This,
- OUT BOOLEAN *InSmram
- )
-;
-
-/**
- Returns the location of the System Management Service Table (SMST).
-
- This function returns the location of the System Management Service Table (SMST). The use of the
- API is such that a driver can discover the location of the SMST in its entry point and then cache it in
- some driver global variable so that the SMST can be invoked in subsequent handlers.
-
- @param[in] This The EFI_SMM_BASE2_PROTOCOL instance.
- @param[in,out] Smst On return, points to a pointer to the System Management Service Table (SMST).
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_INVALID_PARAMETER Smst was invalid.
- @retval EFI_UNSUPPORTED Not in SMM.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_SMM_GET_SMST_LOCATION2)(
- IN CONST EFI_SMM_BASE2_PROTOCOL *This,
- IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst
- )
-;
-
-///
-/// EFI SMM Base2 Protocol is utilized by all SMM drivers to locate the SMM infrastructure
-/// services and determine whether the driver is being invoked inside SMRAM or outside of SMRAM.
-///
-struct _EFI_SMM_BASE2_PROTOCOL {
- EFI_SMM_INSIDE_OUT2 InSmm;
- EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation;
-};
-
-
-#endif
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmS3SaveState.h b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmS3SaveState.h
deleted file mode 100644
index 3c29165644..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/PiSmmS3SaveState.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/** @file
- Header file to define SMM S3 Save State Protocol as in PI1.2 Specification VOLUME 5 Standard.
-
- The thunk implementation for SmmScriptLib will ultilize the SmmSaveState Protocol to save SMM
- runtime s3 boot Script. This header file is to definiedSMM S3 Save State Protocol
-
- Copyright (c) 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.
-
-**/
-#ifndef __PI_SMM_S3_SAVE_STATE_H__
-#define __PI_SMM_S3_SAVE_STATE_H__
-
-#define EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID \
- {0x320afe62, 0xe593, 0x49cb, { 0xa9, 0xf1, 0xd4, 0xc2, 0xf4, 0xaf, 0x1, 0x4c }}
-
-typedef VOID *EFI_S3_BOOT_SCRIPT_POSITION;
-
-typedef struct _EFI_S3_SMM_SAVE_STATE_PROTOCOL EFI_S3_SAVE_STATE_PROTOCOL;
-
-/**
- Record operations that need to be replayed during an S3 resume.
-
- This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
- assumed this protocol has platform specific mechanism to store the OpCode set and replay them
- during the S3 resume.
-
- @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
- @param[in] OpCode The operation code (opcode) number.
- @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
- definition of each opcode.
-
- @retval EFI_SUCCESS The operation succeeded. A record was added into the specified
- script table.
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_S3_SAVE_STATE_WRITE)(
- IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
- IN UINT16 OpCode,
- ...
-);
-
-/**
- Record operations that need to be replayed during an S3 resume.
-
- This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
- assumed this protocol has platform specific mechanism to store the OpCode set and replay them
- during the S3 resume.
- The opcode is inserted before or after the specified position in the boot script table. If Position is
- NULL then that position is after the last opcode in the table (BeforeOrAfter is TRUE) or before
- the first opcode in the table (BeforeOrAfter is FALSE). The position which is pointed to by
- Position upon return can be used for subsequent insertions.
-
- This function has a variable parameter list. The exact parameter list depends on the OpCode that is
- passed into the function. If an unsupported OpCode or illegal parameter list is passed in, this
- function returns EFI_INVALID_PARAMETER.
- If there are not enough resources available for storing more scripts, this function returns
- EFI_OUT_OF_RESOURCES.
- OpCode values of 0x80 - 0xFE are reserved for implementation specific functions.
-
- @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
- @param[in] BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position
- in the boot script table specified by Position. If Position is NULL or points to
- NULL then the new opcode is inserted at the beginning of the table (if TRUE) or end
- of the table (if FALSE).
- @param[in, out] Position On entry, specifies the position in the boot script table where the opcode will be
- inserted, either before or after, depending on BeforeOrAfter. On exit, specifies
- the position of the inserted opcode in the boot script table.
- @param[in] OpCode The operation code (opcode) number. See "Related Definitions" in Write() for the
- defined opcode types.
- @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
- definition of each opcode.
-
- @retval EFI_SUCCESS The operation succeeded. An opcode was added into the script.
- @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value.
- @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script table.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_S3_SAVE_STATE_INSERT)(
- IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
- IN BOOLEAN BeforeOrAfter,
- IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
- IN UINT16 OpCode,
- ...
-);
-
-/**
- Find a label within the boot script table and, if not present, optionally create it.
-
- If the label Label is already exists in the boot script table, then no new label is created, the
- position of the Label is returned in *Position and EFI_SUCCESS is returned.
- If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be
- created before or after the specified position and EFI_SUCCESS is returned.
- If the label Label does not already exist and CreateIfNotFound is FALSE, then
- EFI_NOT_FOUND is returned.
-
- @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
- @param[in] BeforeOrAfter Specifies whether the label is stored before (TRUE) or after (FALSE) the position in
- the boot script table specified by Position. If Position is NULL or points to
- NULL then the new label is inserted at the beginning of the table (if TRUE) or end of
- the table (if FALSE).
- @param[in] CreateIfNotFound Specifies whether the label will be created if the label does not exists (TRUE) or not (FALSE).
- @param[in, out] Position On entry, specifies the position in the boot script table where the label will be inserted,
- either before or after, depending on BeforeOrAfter. On exit, specifies the position
- of the inserted label in the boot script table.
- @param[in] Label Points to the label which will be inserted in the boot script table.
-
- @retval EFI_SUCCESS The label already exists or was inserted.
- @retval EFI_NOT_FOUND The label did not already exist and CreateifNotFound was FALSE.
- @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value.
- @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_S3_SAVE_STATE_LABEL)(
- IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
- IN BOOLEAN BeforeOrAfter,
- IN BOOLEAN CreateIfNotFound,
- IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
- IN CONST CHAR8 *Label
-);
-
-/**
- Compare two positions in the boot script table and return their relative position.
-
- This function compares two positions in the boot script table and returns their relative positions. If
- Position1 is before Position2, then -1 is returned. If Position1 is equal to Position2,
- then 0 is returned. If Position1 is after Position2, then 1 is returned.
-
- @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
- @param[in] Position1 The positions in the boot script table to compare.
- @param[in] Position2 The positions in the boot script table to compare.
- @param[out] RelativePosition On return, points to the result of the comparison.
-
- @retval EFI_SUCCESS The label already exists or was inserted.
- @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_S3_SAVE_STATE_COMPARE)(
- IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
- IN EFI_S3_BOOT_SCRIPT_POSITION Position1,
- IN EFI_S3_BOOT_SCRIPT_POSITION Position2,
- OUT UINTN *RelativePosition
-);
-
-typedef struct _EFI_S3_SMM_SAVE_STATE_PROTOCOL {
- EFI_S3_SAVE_STATE_WRITE Write;
- EFI_S3_SAVE_STATE_INSERT Insert;
- EFI_S3_SAVE_STATE_LABEL Label;
- EFI_S3_SAVE_STATE_COMPARE Compare;
-} EFI_S3_SMM_SAVE_STATE_PROTOCOL;
-
-
-#endif // __S3_SAVE_STATE_H__
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.c b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.c
deleted file mode 100644
index c74b3d5b7e..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.c
+++ /dev/null
@@ -1,498 +0,0 @@
-/** @file
- Thunk implmentation for SmmScriptLib.
-
- SmmScriptLib in Framework implementation is to save S3 Boot Script in SMM runtime.
- The thunk implementation for SmmScriptLib will ultilize the SmmSaveState Protocol to save SMM
- runtime s3 boot Script.
-
- Copyright (c) 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 "SmmScriptLib.h"
-
-//
-// Define the SmmS3SaveState Protocol GUID.
-//
-EFI_GUID mEfiS3SmmSaveStateProtocolGuid = EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID;
-EFI_GUID mEfiSmmBase2ProtocolGuid = EFI_SMM_BASE2_PROTOCOL_GUID;
-EFI_S3_SMM_SAVE_STATE_PROTOCOL *mS3SmmSaveState = NULL;
-EFI_SMM_SYSTEM_TABLE2 *gSmst = NULL;
-
-/**
- Internal function to add IO write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptIoWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINTN Count;
- UINT8 *Buffer;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Count = VA_ARG (Marker, UINTN);
- Buffer = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_IO_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-}
-/**
- Internal function to add IO read/write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptIoReadWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINT8 *Data;
- UINT8 *DataMask;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Data = VA_ARG (Marker, UINT8 *);
- DataMask = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-}
-/**
- Internal function to add memory read/write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptMemReadWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINT8 *Data;
- UINT8 *DataMask;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Data = VA_ARG (Marker, UINT8 *);
- DataMask = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-}
-/**
- Internal function to PciCfg read/write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptPciCfgReadWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINT8 *Data;
- UINT8 *DataMask;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Data = VA_ARG (Marker, UINT8 *);
- DataMask = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE,
- Width,
- Address,
- Data,
- DataMask
- );
-}
-/**
- Internal function to add PciCfg write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptPciCfgWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINTN Count;
- UINT8 *Buffer;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Count = VA_ARG (Marker, UINTN);
- Buffer = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-}
-/**
- Internal function to add stall opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptStall (
- IN VA_LIST Marker
- )
-{
- UINT32 Duration;
-
- Duration = VA_ARG (Marker, UINT32);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_STALL_OPCODE,
- Duration
- );
-}
-/**
- Internal function to add Save jmp address according to DISPATCH_OPCODE.
- We ignore "Context" parameter
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptDispatch (
- IN VA_LIST Marker
- )
-{
- VOID *EntryPoint;
-
- EntryPoint = (VOID*)(UINTN)VA_ARG (Marker, EFI_PHYSICAL_ADDRESS);
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_DISPATCH_OPCODE,
- EntryPoint
- );
-}
-/**
- Internal function to add memory write opcode to the table.
-
- @param Marker The variable argument list to get the opcode
- and associated attributes.
-
- @retval EFI_OUT_OF_RESOURCES Not enough resource to do operation.
- @retval EFI_SUCCESS Opcode is added.
-
-**/
-EFI_STATUS
-BootScriptMemWrite (
- IN VA_LIST Marker
- )
-{
- EFI_BOOT_SCRIPT_WIDTH Width;
- UINT64 Address;
- UINTN Count;
- UINT8 *Buffer;
-
- Width = VA_ARG (Marker, EFI_BOOT_SCRIPT_WIDTH);
- Address = VA_ARG (Marker, UINT64);
- Count = VA_ARG (Marker, UINTN);
- Buffer = VA_ARG (Marker, UINT8 *);
-
- return mS3SmmSaveState->Write (
- mS3SmmSaveState,
- EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE,
- Width,
- Address,
- Count,
- Buffer
- );
-}
-/**
- Adds a record into a specified Framework boot script table.
-
- This function is used to store a boot script record into a given boot
- script table in SMM runtime. The parameter is the same with definitionin BootScriptSave Protocol.
-
- @param ScriptTable Pointer to the script table to write to. In the thunk implementation, this parameter is ignored
- since the boot script table is maintained by BootScriptLib.
- @param Type Not used.
- @param OpCode The operation code (opcode) number.
- @param ... Argument list that is specific to each opcode.
-
- @retval EFI_SUCCESS The operation succeeded. A record was added into the
- specified script table.
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
- If the opcode is unknow or not supported because of the PCD
- Feature Flags.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptWrite (
- IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
- IN UINTN Type,
- IN UINT16 OpCode,
- ...
- )
-{
- EFI_STATUS Status;
- VA_LIST Marker;
-
- if (mS3SmmSaveState == NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Build script according to opcode
- //
- switch (OpCode) {
-
- case EFI_BOOT_SCRIPT_IO_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptIoWrite (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptIoReadWrite (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptMemReadWrite (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptPciCfgReadWrite (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_STALL_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptStall (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_DISPATCH_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptDispatch (Marker);
- VA_END (Marker);
- break;
-
-
- case EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptPciCfgWrite (Marker);
- VA_END (Marker);
- break;
-
- case EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE:
- VA_START (Marker, OpCode);
- Status = BootScriptMemWrite (Marker);
- VA_END (Marker);
- break;
-
- default:
- Status = EFI_INVALID_PARAMETER;
- break;
- }
-
- return Status;
-}
-/**
- Intialize Boot Script table.
-
- This function should be called in SMM mode. The Thunk implementation is try to
- locate SmmSaveState protocol.
-
- @param SystemTable Pointer to the EFI sytem table
- @param SmmScriptTablePages The expected ScriptTable page number
- @param SmmScriptTableBase The returned ScriptTable base address
-
- @retval EFI_OUT_OF_RESOURCES No resource to do the initialization.
- @retval EFI_SUCCESS Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeSmmScriptLib (
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINTN SmmScriptTablePages,
- OUT EFI_PHYSICAL_ADDRESS *SmmScriptTableBase
- )
-{
- EFI_STATUS Status;
- BOOLEAN InSmm;
- EFI_SMM_BASE2_PROTOCOL *InternalSmmBase2;
-
- InternalSmmBase2 = NULL;
- //
- // The boot Script table is maintained by DxeBootScript Lib. so there is no need to
- // allocate the table here and directly return zero
- //
- if (SmmScriptTableBase == NULL) {
- return EFI_INVALID_PARAMETER;
- }
- *SmmScriptTableBase = 0;
- //
- // Retrieve SMM Base2 Protocol
- //
- Status = SystemTable->BootServices->LocateProtocol (
- &mEfiSmmBase2ProtocolGuid,
- NULL,
- (VOID **) &InternalSmmBase2
- );
- ASSERT_EFI_ERROR (Status);
- ASSERT (InternalSmmBase2 != NULL);
-
- //
- // Check to see if we are already in SMM
- //
- InternalSmmBase2->InSmm (InternalSmmBase2, &InSmm);
-
- if (!InSmm) {
- //
- // We are not in SMM, Directly return;
- //
- return EFI_SUCCESS;
- }
-
- //
- // We are in SMM, retrieve the pointer to SMM System Table
- //
- InternalSmmBase2->GetSmstLocation (InternalSmmBase2, &gSmst);
-
- ASSERT (gSmst != NULL);
- //
- // Locate Smm S3 Save State protocol to do the boot script save operation.
- //
- Status = gSmst->SmmLocateProtocol (
- &mEfiS3SmmSaveStateProtocolGuid,
- NULL,
- (VOID**)&mS3SmmSaveState
- );
- return Status;
-}
-/**
- Create Boot Script table.
-
- It will be ignore and just return EFI_SUCCESS since the boot script table is
- maintained by DxeBootScriptLib. Create Table is not needed.
-
- @param ScriptTable Pointer to the boot script table to create.
- @param Type The type of table to creat.
-
-
- @retval EFI_SUCCESS Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptCreateTable (
- IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
- IN UINTN Type
- )
-{
- return EFI_SUCCESS;
-}
-/**
- Close Boot Script table.
-
- It will be ignore and just return EFI_SUCCESS since the boot script table
- is maintained by DxeBootScriptLib.
-
- @param ScriptTableBase Pointer to the boot script table to create.
- @param ScriptTablePtr Pointer to the script table to write to.
- @param Type The type of table to creat.
-
- @retval EFI_SUCCESS Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptCloseTable (
- IN EFI_SMM_SCRIPT_TABLE ScriptTableBase,
- IN EFI_SMM_SCRIPT_TABLE ScriptTablePtr,
- IN UINTN Type
- )
-{
- return EFI_SUCCESS;
-}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.h b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.h
deleted file mode 100644
index 0a50afe9fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/** @file
- This is an thunk implementation of the BootScript at run time.
-
- SmmScriptLib in Framework implementation is to save S3 Boot Script in SMM runtime.
- Here is the header file to define the API in this thunk library.
-
- Copyright (c) 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.
-
-**/
-
-#ifndef _SMM_SCRIPT_SAVE_H_
-#define _SMM_SCRIPT_SAVE_H_
-
-#include "Tiano.h"
-#include "EfiBootScript.h"
-#include "PiSmmDefinition.h"
-#include "PiSmmS3SaveState.h"
-
-
-typedef EFI_PHYSICAL_ADDRESS EFI_SMM_SCRIPT_TABLE;
-/**
- Intialize Boot Script table.
-
- This function should be called in SMM mode. The Thunk implementation is try to
- locate SmmSaveState protocol.
-
- @param SystemTable Pointer to the EFI sytem table
- @param SmmScriptTablePages The expected ScriptTable page number
- @param SmmScriptTableBase The returned ScriptTable base address
-
- @retval EFI_OUT_OF_RESOURCES No resource to do the initialization.
- @retval EFI_SUCCESS Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeSmmScriptLib (
- IN EFI_SYSTEM_TABLE *SystemTable,
- IN UINTN SmmScriptTablePages,
- OUT EFI_PHYSICAL_ADDRESS *SmmScriptTableBase
- );
-/**
- Create Boot Script table.
-
- It will be ignore and just return EFI_SUCCESS since the boot script table is
- maintained by DxeBootScriptLib. Create Table is not needed.
-
- @param ScriptTable Pointer to the boot script table to create.
- @param Type The type of table to creat.
-
-
- @retval EFI_SUCCESS Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptCreateTable (
- IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
- IN UINTN Type
- );
-/**
- Adds a record into a specified Framework boot script table.
-
- This function is used to store a boot script record into a given boot
- script table in SMM runtime. The parameter is the same with definitionin BootScriptSave Protocol.
-
- @param ScriptTable Pointer to the script table to write to. In the thunk implementation, this parameter is ignored
- since the boot script table is maintained by BootScriptLib.
- @param Type Not used.
- @param OpCode The operation code (opcode) number.
- @param ... Argument list that is specific to each opcode.
-
- @retval EFI_SUCCESS The operation succeeded. A record was added into the
- specified script table.
- @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
- If the opcode is unknow or not supported because of the PCD
- Feature Flags.
- @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptWrite (
- IN OUT EFI_SMM_SCRIPT_TABLE *ScriptTable,
- IN UINTN Type,
- IN UINT16 OpCode,
- ...
- );
-/**
- Close Boot Script table.
-
- It will be ignore and just return EFI_SUCCESS since the boot script table
- is maintained by DxeBootScriptLib.
-
- @param ScriptTableBase Pointer to the boot script table to create.
- @param ScriptTablePtr Pointer to the script table to write to.
- @param Type The type of table to creat.
-
- @retval EFI_SUCCESS - Function has completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-SmmBootScriptCloseTable (
- IN EFI_SMM_SCRIPT_TABLE ScriptTableBase,
- IN EFI_SMM_SCRIPT_TABLE ScriptTablePtr,
- IN UINTN Type
- );
-
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.inf b/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.inf
deleted file mode 100644
index 0df2af8dd4..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Smm/SmmScriptLib/SmmScriptLib.inf
+++ /dev/null
@@ -1,43 +0,0 @@
-## @file
-#
-# Copyright (c) 2010 - 2011, 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]
-BASE_NAME = SmmScriptLib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- SmmScriptLib.c
- SmmScriptLib.h
- PiSmmDefinition.h
- PiSmmS3SaveState.h
-
-
-[includes.common]
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- .
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EFI_SOURCE)
- $(EDK_SOURCE)/Foundation/Core/Dxe
- $(EFI_SOURCE)/Library/Smm/Include
-
-[libraries.common]
- EdkFrameworkProtocolLib
- GuidLib
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
deleted file mode 100644
index dd1cb289fc..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
+++ /dev/null
@@ -1,76 +0,0 @@
-#*****************************************************************************
-#*
-#* 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.
-#*
-#* Module Name:
-#*
-#* Fx.asm
-#*
-#* Abstract:
-#*
-#* AsmFxRestore and AsmFxSave function
-#*
-#include <EfiBind.h>
-#------------------------------------------------------------------------------
-
- .586P:
- #.MODEL flat,C
- .xmm:
- .code:
-#------------------------------------------------------------------------------
-.globl ASM_PFX(AsmFxSave)
-.globl ASM_PFX(AsmFxRestore)
-#------------------------------------------------------------------------------
-# VOID
-# AsmFxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFxSave):
- movl 4(%esp), %eax
- fxsave (%eax)
- ret
-#AsmFxSave ENDP
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmFxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFxRestore):
- movl 4(%esp), %eax
- fxrstor (%eax)
- ret
-#AsmFxRestore ENDP
-
-#------------------------------------------------------------------------------
-# UINTN
-# AsmGetEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmGetEflags):
- pushfl
- pop %eax
- ret
-#AsmGetEflags ENDP
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmSetEflags (
-# IN UINTN Eflags
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmSetEflags):
- push 4(%esp)
- popfl
- ret
-#AsmSetEflags ENDP
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm
deleted file mode 100644
index 7f3f275b37..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm
+++ /dev/null
@@ -1,75 +0,0 @@
-;*****************************************************************************
-;*
-;* 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.
-;*
-;* Module Name:
-;*
-;* Fx.asm
-;*
-;* Abstract:
-;*
-;* AsmFxRestore and AsmFxSave function
-;*
-;*****************************************************************************
-
- .586P
- .model flat,C
- .xmm
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmFxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-AsmFxSave PROC
- mov eax, [esp + 4]
- fxsave [eax]
- ret
-AsmFxSave ENDP
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmFxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-AsmFxRestore PROC
- mov eax, [esp + 4]
- fxrstor [eax]
- ret
-AsmFxRestore ENDP
-
-;------------------------------------------------------------------------------
-; UINTN
-; AsmGetEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmGetEflags PROC
- pushfd
- pop eax
- ret
-AsmGetEflags ENDP
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmSetEflags (
-; IN UINTN Eflags
-; );
-;------------------------------------------------------------------------------
-AsmSetEflags PROC
- push [esp + 4]
- popfd
- ret
-AsmSetEflags ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
deleted file mode 100644
index cf7776a6a3..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
+++ /dev/null
@@ -1,189 +0,0 @@
-#*****************************************************************************
-#*
-#* Copyright (c) 2006 - 2011, 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.
-#*
-#* Module Name:
-#*
-#* Thunk.asm
-#*
-#* Abstract:
-#*
-#* Real mode thunk
-#*
-#*****************************************************************************
-#include <EfiBind.h>
-
- .686p:
-
-.globl ASM_PFX(mCode16Size)
-
-.data
-mCode16Size: .long _TEXT16SIZE
-
-.data
-
-NullSegSel: .quad 0
-_16BitCsSel:
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f # 16-bit segment
- .byte 0
-_16BitSsSel:
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f # 16-bit segment
- .byte 0
-
-_16Gdtr:
- .word _16Gdtr - NullSegSel - 1
- .long NullSegSel
-
-
-.text
-
-
-ASM_PFX(Thunk16):
- push %ebp
- push %ebx
- push %esi
- push %edi
- push %ds
- push %es
- push %fs
- push %gs
- mov 0x24(%esp),%esi
- movzwl 0x32(%esi),%edx
- mov 0xc(%esi),%edi
- add $0xffffffb0,%edi
- push %edi #; save stack offset
- imul $0x10,%edx,%eax #; eax <- edx*16
- add %eax,%edi #; edi <- linear address of 16-bit stack
- push $0xd
- pop %ecx
- rep movsl %ds:(%esi),%es:(%edi) #; copy context to 16-bit stack
- #; copy eflags to stack frame
- mov -12(%esi), %eax
- mov %eax, -72(%edi)
- pop %ebx #; ebx <- 16-bit stack offset
- mov $L_Lable1,%eax
- stos %eax,%es:(%edi)
- movl %cs,%eax
- stos %ax,%es:(%edi)
- mov 0x28(%esp),%eax
- stos %ax,%es:(%edi)
- mov %esp,%eax
- stos %eax,%es:(%edi)
- movl %ss,%eax
- stos %ax,%es:(%edi)
- sgdtl (%edi)
- sidtl 0x24(%esp)
- mov %cr0,%esi
- mov %esi,0x6(%edi) #; save CR0
- and $0x7ffffffe,%esi #; esi <- CR0 to set
- mov %cr4,%eax
- mov %eax,0xa(%edi) #; save CR4
- and $0xcf,%al #; clear PAE & PSE
- mov %edx,%edi #; edi <- 16-bit stack segment
- mov 0x2c(%esp),%edx
- shl $0x10,%edx
- push %edx
- pop %edx
- mov $(_16BitSsSel - NullSegSel),%dx
- lgdtl _16Gdtr #bugbug mismatch.
- .byte 0xea
- .long L_16Bit #bugbug mismatch.
- .word _16BitCsSel - NullSegSel
-L_16Bit:
- .byte 0x66
- movw %dx,%ss
- mov %esi,%cr0
- mov %eax,%cr4
- .byte 0x67
- .byte 0xff
- .byte 0x6c
- .byte 0x24
- .byte 0xfc
-
-L_Lable1:
- xor %eax,%eax
- movw %ss,%ax
- shl $0x4,%eax
- add %esp,%eax
- lss 0x3c(%esp),%esp
- lidtl 0x24(%esp)
- pop %gs
- pop %fs
- pop %es
- pop %ds
- pop %edi
- pop %esi
- pop %ebx
- pop %ebp
- ret
-
-.code16
-_Code16Addr:
-ASM_PFX(RealMode):
- movw %di, %ss # set up stack
- movl %ebx, %esp
- lidt %cs:_16Idtr - _Code16Addr #lidt fword ptr cs:[_16Idtr - _Code16Addr]
- .byte 0x66
- popaw
- popw %ds
- popw %es
- popw %fs
- popw %gs
- sub 60, %esp
- popfw
- testw $1, 74(%esp) #(_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
-
- jz 1f
- pushf # push Flags when it's INT#
-1:
- pushw %cs
-# push @FarCallRet - _Code16Addr
- .byte 0x68 # push /iw
- .word FarCallRet - _Code16Addr
- jz 2f
- ljmp *66(%esp) #[esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-2:
- ljmp *64(%esp) #[esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-FarCallRet:
- add 60, %esp
- pushfl
- pushw %gs
- pushw %fs
- pushw %es
- pushw %ds
- pushal
- cli
- .byte 0x66 # sizeof (IA32_REGS) = 13 * 4 = 52
- lgdt 66(%esp) #lgdt (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedGdtr
- mov 76(%esp), %eax
- movl %eax, %cr4
- mov 72(%esp), %eax
- movl %eax, %cr0 # restore CR0
- ljmpl *52(%esp)
-#RealMode ENDP
-
-.text
-_16Idtr:
- .word 0x3ff #_16Idtr FWORD (1 SHL 10) - 1
- .byte 0x00
-
-_TEXT16END:
-
-_TEXT16SIZE = _TEXT16END - _Code16Addr
-
-
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
deleted file mode 100644
index 0a796ed236..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
+++ /dev/null
@@ -1,209 +0,0 @@
-;*****************************************************************************
-;*
-;* Copyright (c) 2006 - 2011, 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.
-;*
-;* Module Name:
-;*
-;* Thunk.asm
-;*
-;* Abstract:
-;*
-;* Real mode thunk
-;*
-;*****************************************************************************
-
- .686p
-
-EXTERNDEF C mCode16Size:DWORD
-
-CONST SEGMENT FLAT "DATA" READONLY
-
-mCode16Size DD _TEXT16SIZE
-
-CONST ENDS
-
-_DATA SEGMENT FLAT "DATA"
-
-NullSegSel DQ 0
-_16BitCsSel LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment
- DB 0
-_16BitSsSel LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment
- DB 0
-
-_16Gdtr LABEL FWORD
- DW $ - offset NullSegSel - 1
- DD offset NullSegSel
-
-_DATA ENDS
-
-_TEXT SEGMENT FLAT "CODE" PARA
-
-STACK_PARAM_SIZE EQU 16
-
-IA32_REGS STRUC 4t
-_EDI DD ?
-_ESI DD ?
-_EBP DD ?
-_ESP DD ?
-_EBX DD ?
-_EDX DD ?
-_ECX DD ?
-_EAX DD ?
-_DS DW ?
-_ES DW ?
-_FS DW ?
-_GS DW ?
-_EFLAGS DD ?
-_EIP DD ?
-_CS DW ?
-_SS DW ?
-IA32_REGS ENDS
-
-_STK16 STRUC 1t
-RetEip DD ?
-RetCs DW ?
-ThunkFlags DW ?
-SavedEsp DD ?
-SavedSs DW ?
-SavedGdtr FWORD ?
-SavedCr0 DD ?
-SavedCr4 DD ?
-_STK16 ENDS
-
- ASSUME ds:_DATA
-
-__Thunk16 PROC USES ebp ebx esi edi ds es fs gs
- ASSUME esi:PTR IA32_REGS
- mov esi, [esp + 36]
- movzx edx, [esi]._SS
- mov edi, [esi]._ESP
- add edi, - sizeof (_STK16) - sizeof (IA32_REGS)
- push edi ; save stack offset
- imul eax, edx, 16 ; eax <- edx*16
- add edi, eax ; edi <- linear address of 16-bit stack
- push sizeof (IA32_REGS) / 4
- pop ecx
- rep movsd ; copy context to 16-bit stack
-
- ; copy eflags to stack frame
- mov eax, [esi - sizeof(IA32_REGS)]._EFLAGS
- mov [edi - sizeof(IA32_REGS) - STACK_PARAM_SIZE - 4], eax
-
- pop ebx ; ebx <- 16-bit stack offset
- mov eax, offset @F ; return offset
- stosd
- mov eax, cs ; return segment
- stosw
- mov eax, [esp + 40] ; THUNK flags
- stosw
- mov eax, esp
- stosd ; save esp
- mov eax, ss ; save ss
- stosw
- sgdt fword ptr [edi] ; save GDTR
- sidt fword ptr [esp + 36] ; save IDTR
- mov esi, cr0
- mov [edi + 6], esi ; save CR0
- and esi, NOT 80000001h ; esi <- CR0 to set
- mov eax, cr4
- mov [edi + 10], eax ; save CR4
- and al, NOT 30h ; clear PAE & PSE
- mov edi, edx ; edi <- 16-bit stack segment
- mov edx, [esp + 44]
- shl edx, 16
- push edx
- pop edx
- mov dx, _16BitSsSel - NullSegSel
- lgdt _16Gdtr ; load 16-bit GDTR
- DB 0eah
- DD offset @16Bit
- DW _16BitCsSel - NullSegSel ; jmp far 8:@16Bit
-@16Bit:
- mov ss, dx
- mov cr0, esi ; disable protected mode
- mov cr4, eax ; disable PAE & PSE
- db 67h, 0FFh, 06Ch, 024h, 0FCh ; jmp dword ptr [esp-4]
-@@:
- xor eax, eax
- mov ax, ss
- shl eax, 4
- add eax, esp ; eax <- address of 16-bit stack
- lss esp, fword ptr (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedEsp
- lidt fword ptr [esp + 36] ; restore IDTR
- ret
-__Thunk16 ENDP
-
-_TEXT ENDS
-
-_TEXT16 SEGMENT USE16 "CODE" PARA
-
-_Code16Addr PROC C
-_Code16Addr ENDP
-
-RealMode PROC
- mov ss, di ; set up stack
- mov esp, ebx
- lidt fword ptr cs:[_16Idtr - _Code16Addr]
- popad
- pop ds
- pop es
- pop fs
- pop gs
- sub esp, (sizeof(IA32_REGS) - 12) + STACK_PARAM_SIZE + 4
- popfd
- test (_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
- jz @F
- pushf ; push Flags when it's INT#
-@@:
- push cs
-; push @FarCallRet - _Code16Addr
- DB 68h ; push /iw
- DW @FarCallRet - _Code16Addr
- jz @F
- jmp fword ptr [esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-@@:
- jmp fword ptr [esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-@FarCallRet:
- add esp, (sizeof(IA32_REGS) - 12) + STACK_PARAM_SIZE + 4
- pushfd
- push gs
- push fs
- push es
- push ds
- pushad
- cli
- DB 66h
- lgdt (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedGdtr
- mov eax, (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedCr4
- mov cr4, eax
- mov eax, (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedCr0
- mov cr0, eax ; restore CR0
- jmp fword ptr (_STK16 ptr [esp + sizeof (IA32_REGS)]).RetEip
-RealMode ENDP
-
-_16Idtr FWORD (1 SHL 10) - 1
-
-_TEXT16END:
-
-_TEXT16SIZE = _TEXT16END - _Code16Addr
-
-_TEXT16 ENDS
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
deleted file mode 100644
index 6c16e25e4b..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
+++ /dev/null
@@ -1,355 +0,0 @@
-/*++
-
-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.
-
-Module Name:
-
- Thunk16Lib.h
-
-Abstract:
-
- Real Mode Thunk Header file
-
---*/
-
-#ifndef __THUNK_16_LIB_H__
-#define __THUNK_16_LIB_H__
-#include "Tiano.h"
-
-//
-// Thunk Flags
-//
-#define THUNK_SAVE_FP_STATE 0x1
-#define THUNK_USER_STACK 0x2
-#define THUNK_INTERRUPT 0x10000
-
-//
-// Byte packed structure for 16-bit Real Mode FLAGS
-//
-typedef union {
- struct {
- UINT32 CF:1; // Carry Flag
- UINT32 Reserved_0:1; // Reserved
- UINT32 PF:1; // Parity Flag
- UINT32 Reserved_1:1; // Reserved
- UINT32 AF:1; // Auxiliary Carry Flag
- UINT32 Reserved_2:1; // Reserved
- UINT32 ZF:1; // Zero Flag
- UINT32 SF:1; // Sign Flag
- UINT32 TF:1; // Trap Flag
- UINT32 IF:1; // Interrupt Enable Flag
- UINT32 DF:1; // Direction Flag
- UINT32 OF:1; // Overflow Flag
- UINT32 IOPL:2; // I/O Privilege Level
- UINT32 NT:1; // Nested Task
- UINT32 Reserved_3:1; // Reserved
- } Bits;
- UINTN UintN;
-} IA32_FLAGS16;
-
-//
-// Byte packed structure for EFLAGS
-// 32-bits on IA32
-// 64-bits on X64
-//
-
-typedef union {
- struct {
- UINT32 CF:1; // Carry Flag
- UINT32 Reserved_0:1; // Reserved
- UINT32 PF:1; // Parity Flag
- UINT32 Reserved_1:1; // Reserved
- UINT32 AF:1; // Auxiliary Carry Flag
- UINT32 Reserved_2:1; // Reserved
- UINT32 ZF:1; // Zero Flag
- UINT32 SF:1; // Sign Flag
- UINT32 TF:1; // Trap Flag
- UINT32 IF:1; // Interrupt Enable Flag
- UINT32 DF:1; // Direction Flag
- UINT32 OF:1; // Overflow Flag
- UINT32 IOPL:2; // I/O Privilege Level
- UINT32 NT:1; // Nested Task
- UINT32 Reserved_3:1; // Reserved
- UINT32 RF:1; // Resume Flag
- UINT32 VM:1; // Virtual 8086 Mode
- UINT32 AC:1; // Alignment Check
- UINT32 VIF:1; // Virtual Interrupt Flag
- UINT32 VIP:1; // Virtual Interrupt Pending
- UINT32 ID:1; // ID Flag
- UINT32 Reserved_4:10; // Reserved
- } Bits;
- UINTN UintN;
-} IA32_EFLAGS32;
-
-//
-// Byte packed structure for an FP/SSE/SSE2 context
-//
-typedef struct {
- UINT8 Buffer[512];
-} IA32_FX_BUFFER;
-
-//
-// Structures for the 16-bit real mode thunks
-//
-typedef struct {
- UINT32 Reserved1;
- UINT32 Reserved2;
- UINT32 Reserved3;
- UINT32 Reserved4;
- UINT8 BL;
- UINT8 BH;
- UINT16 Reserved5;
- UINT8 DL;
- UINT8 DH;
- UINT16 Reserved6;
- UINT8 CL;
- UINT8 CH;
- UINT16 Reserved7;
- UINT8 AL;
- UINT8 AH;
- UINT16 Reserved8;
-} IA32_BYTE_REGS;
-
-typedef struct {
- UINT16 DI;
- UINT16 Reserved1;
- UINT16 SI;
- UINT16 Reserved2;
- UINT16 BP;
- UINT16 Reserved3;
- UINT16 SP;
- UINT16 Reserved4;
- UINT16 BX;
- UINT16 Reserved5;
- UINT16 DX;
- UINT16 Reserved6;
- UINT16 CX;
- UINT16 Reserved7;
- UINT16 AX;
- UINT16 Reserved8;
- UINT16 DS;
- UINT16 ES;
- UINT16 FS;
- UINT16 GS;
- IA32_FLAGS16 Flags;
- UINT16 IP;
- UINT16 Reserved10;
- UINT16 CS;
- UINT16 SS;
-} IA32_WORD_REGS;
-
-typedef struct {
- UINT32 EDI;
- UINT32 ESI;
- UINT32 EBP;
- UINT32 ESP;
- UINT32 EBX;
- UINT32 EDX;
- UINT32 ECX;
- UINT32 EAX;
- UINT16 DS;
- UINT16 ES;
- UINT16 FS;
- UINT16 GS;
- IA32_EFLAGS32 EFLAGS;
- UINT32 EIP;
- UINT16 CS;
- UINT16 SS;
-} IA32_DWORD_REGS;
-
-typedef union {
- IA32_DWORD_REGS E;
- IA32_WORD_REGS X;
- IA32_BYTE_REGS H;
-} IA32_REGISTER_SET;
-
-//
-// Byte packed structure for an 16-bit real mode thunks
-//
-typedef struct {
- UINT32 RealModeBuffer;
- UINT32 DefaultStack;
-} THUNK_CONTEXT;
-
-//
-// 16-bit thunking services
-//
-
-UINTN
-EFIAPI
-AsmThunk16GetProperties (
- OUT UINTN *MinimumStackSize OPTIONAL
- )
-/*++
-
-Routine Description:
-
- Returns the properties of this real mode thunk implementation. Currently
- there are 2 properties has been defined, the minimum real mode buffer size
- and the minimum stack size.
-
-Arguments:
-
- MinimumStackSize - The minimum size required for a 16-bit stack.
-
-Returns:
-
- The minimum size of the real mode buffer needed by this thunk implementation
- is returned.
-
---*/
-;
-
-THUNK_CONTEXT *
-EFIAPI
-AsmThunk16SetProperties (
- OUT THUNK_CONTEXT *ThunkContext,
- IN VOID *RealModeBuffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- Tell this real mode thunk implementation the address and size of the real
- mode buffer needed.
-
-Arguments:
-
- ThunkContext - The thunk context whose properties to set.
- RealModeBuffer - The address of the buffer allocated by caller. It should be
- aligned on a 16-byte boundary.
- This buffer must be in identity mapped pages.
- BufferSize - The size of RealModeBuffer. Must be larger than the minimum
- size required as returned by AsmThunk16GetProperties().
-
-Returns:
-
- None
-
---*/
-;
-
-BOOLEAN
-AsmThunk16SetUserStack (
- IN THUNK_CONTEXT *ThunkContext,
- IN VOID *Stack,
- IN UINTN StackSize
- );
-
-VOID
-EFIAPI
-AsmThunk16Destroy (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-/*++
-
-Routine Description:
-
- Reset all internal states to their initial values. The caller should not
- release the real mode buffer until after a call to this function.
-
-Arguments:
-
- ThunkContext - The thunk context to destroy.
-
-Returns:
-
- None
-
---*/
-;
-
-IA32_REGISTER_SET *
-EFIAPI
-AsmThunk16FarCall86 (
- IN THUNK_CONTEXT *ThunkContext,
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 ThunkFlags
- )
-/*++
-
-Routine Description:
-
- Make a far call to 16-bit code.
-
- NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts
- disabled because of GDTR and IDTR manipulations.
- This function must be placed in identity mapped pages.
-
-Arguments:
-
- ThunkContext - Thunk context to use.
- RegisterSet - CPU registers would be set to the values contained in this
- structure before making the far call. Then CPU registers are
- copied back to this structure.
- CS:EIP points to the real mode code being called on input.
- SS:ESP points to the real mode stack if THUNK_USER_STACK is
- set on input, otherwise ignored.
- EFlages is ignored on input.
- On output, values of CS, EIP, SS and ESP should be ignored.
- ThunkFlags - 2 flags have currently been defined, THUNK_SAVE_FP_STATE and
- THUNK_USER_STACK.
- THUNK_SAVE_FP_STATE - FPU state would be saved/restored
- before/after calling real mode code.
- THUNK_USER_STACK - The stack specified by SS:ESP would be
- used instead of the default stack.
-
-Returns:
-
- RegisterSet is returned.
-
---*/
-;
-
-IA32_REGISTER_SET *
-EFIAPI
-AsmThunk16Int86 (
- IN THUNK_CONTEXT *ThunkContext,
- IN UINT8 IntNumber,
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 ThunkFlags
- )
-/*++
-
-Routine Description:
-
- Invoke a 16-bit interrupt handler.
-
- NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts
- disabled because of GDTR and IDTR manipulations.
- This function must be placed in identity mapped pages.
-
-Arguments:
-
- ThunkContext - Thunk context to use.
- IntNumber - The ordinal of the interrupt handler ranging from 0 to 255.
- RegisterSet - CPU registers would be set to the values contained in this
- structure before making the far call. Then CPU registers are
- copied back to this structure.
- SS:ESP points to the real mode stack if THUNK_USER_STACK is
- set on input, otherwise ignored.
- EFlages is ignored on input.
- On output, values of CS, EIP, SS and ESP should be ignored.
- ThunkFlags - 2 flags have currently been defined, THUNK_SAVE_FP_STATE and
- THUNK_USER_STACK.
- THUNK_SAVE_FP_STATE - FPU state would be saved/restored
- before/after calling real mode code.
- THUNK_USER_STACK - The stack specified by SS:ESP would be
- used instead of the default stack.
-
-Returns:
-
- RegisterSet is returned.
-
---*/
-;
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.inf b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.inf
deleted file mode 100644
index 9c1552c1e8..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# Thunk16Lib.inf
-#
-# Abstract:
-#
-#--*/
-
-[defines]
-BASE_NAME = Thunk16Lib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- X86Thunk.c
-
-[sources.ia32]
- Ia32/Thunk16.asm
- Ia32/Fx.asm
-
-[sources.x64]
- X64/Thunk16.asm
- X64/Fx.asm
-
-[includes.common]
- .
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
-
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib_Edk2.inf
deleted file mode 100644
index d46967fd66..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib_Edk2.inf
+++ /dev/null
@@ -1,57 +0,0 @@
-#/*++
-#
-# 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.
-#
-# Module Name:
-#
-# Thunk16Lib.inf
-#
-# Abstract:
-#
-#--*/
-
-[defines]
-BASE_NAME = Thunk16Lib
-COMPONENT_TYPE = LIBRARY
-
-[sources.common]
- X86Thunk.c
-
-[sources.ia32]
- Ia32/Thunk16.asm | MSFT
- Ia32/Thunk16.asm | INTEL
- Ia32/Thunk16.S | GCC
- Ia32/Fx.asm | MSFT
- Ia32/Fx.asm | INTEL
- Ia32/Fx.S | GCC
-
-[sources.x64]
- X64/Thunk16.asm | MSFT
- X64/Thunk16.asm | INTEL
- X64/Thunk16.S | GCC
- X64/Fx.asm | MSFT
- X64/Fx.asm | INTEL
- X64/Fx.S | GCC
-
-[includes.common]
- .
- $(EDK_SOURCE)/Foundation/Framework
- $(EDK_SOURCE)/Foundation/Efi
- $(EDK_SOURCE)/Foundation
- $(EDK_SOURCE)/Foundation/Include
- $(EDK_SOURCE)/Foundation/Efi/Include
- $(EDK_SOURCE)/Foundation/Framework/Include
- $(EDK_SOURCE)/Foundation/Include/IndustryStandard
- $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-
-[libraries.common]
-
-
-[nmake.common]
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
deleted file mode 100644
index 20193a63fe..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
+++ /dev/null
@@ -1,70 +0,0 @@
-#*****************************************************************************
-#*
-#* 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.
-#*
-#* Module Name:
-#*
-#* Fx.S
-#*
-#* Abstract:
-#*
-#* AsmFxRestore and AsmFxSave function
-#*
-#*****************************************************************************
-#include <EfiBind.h>
-
-.globl ASM_PFX(AsmFxSave)
-.globl ASM_PFX(AsmFxRestore)
-
- .text
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmFxSave (
-# OUT IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFxSave):
- fxsave (%rcx)
- retq
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmFxRestore (
-# IN CONST IA32_FX_BUFFER *Buffer
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmFxRestore):
- fxrstor (%rcx)
- retq
-
-#------------------------------------------------------------------------------
-# UINTN
-# AsmGetEflags (
-# VOID
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmGetEflags):
- pushfq
- popq %rax
- ret
-#AsmGetEflags ENDP
-
-#------------------------------------------------------------------------------
-# VOID
-# AsmSetEflags (
-# IN UINTN Eflags
-# );
-#------------------------------------------------------------------------------
-ASM_PFX(AsmSetEflags):
- pushq %rcx
- popfq
- ret
-#AsmSetEflags ENDP
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm
deleted file mode 100644
index ab4a97f23a..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm
+++ /dev/null
@@ -1,70 +0,0 @@
-;*****************************************************************************
-;*
-;* 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.
-;*
-;* Module Name:
-;*
-;* Fx.asm
-;*
-;* Abstract:
-;*
-;* AsmFxRestore and AsmFxSave function
-;*
-;*****************************************************************************
-
- .code
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmFxSave (
-; OUT IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-AsmFxSave PROC
- fxsave [rcx]
- ret
-AsmFxSave ENDP
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmFxRestore (
-; IN CONST IA32_FX_BUFFER *Buffer
-; );
-;------------------------------------------------------------------------------
-AsmFxRestore PROC
- fxrstor [rcx]
- ret
-AsmFxRestore ENDP
-
-;------------------------------------------------------------------------------
-; UINTN
-; AsmGetEflags (
-; VOID
-; );
-;------------------------------------------------------------------------------
-AsmGetEflags PROC
- pushfq
- pop rax
- ret
-AsmGetEflags ENDP
-
-;------------------------------------------------------------------------------
-; VOID
-; AsmSetEflags (
-; IN UINTN Eflags
-; );
-;------------------------------------------------------------------------------
-AsmSetEflags PROC
- push rcx
- popfq
- ret
-AsmSetEflags ENDP
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
deleted file mode 100644
index f77388d811..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
+++ /dev/null
@@ -1,244 +0,0 @@
-#*****************************************************************************
-#*
-#* 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.
-#*
-#* Module Name:
-#*
-#* Thunk.S
-#*
-#* Abstract:
-#*
-#* Real mode thunk
-#*
-#*****************************************************************************
-#include <EfiBind.h>
-
-#ifndef __APPLE__
-
- .data
-
-.globl ASM_PFX(mCode16Size)
-
-.data
-mCode16Size: .long _Code16End - _Code16Addr
-
-
-NullSegSel: .quad 0
-_16CsSegSel:
- .word -1
- .word 0
- .byte 0
- .byte 0x9b
- .byte 0x8f #16-bit segment
- .byte 0
-_16DsSegSel:
- .word -1
- .word 0
- .byte 0
- .byte 0x93
- .byte 0x8f #16-bit segment
- .byte 0
-
-_16Gdtr:
- .word _16Gdtr - NullSegSel - 1
- .long NullSegSel
- .code:
-
-#IA32_REGS STRUC 4t
-#_EDI DD ?
-#_ESI DD ?
-#_EBP DD ?
-#_ESP DD ?
-#_EBX DD ?
-#_EDX DD ?
-#_ECX DD ?
-#_EAX DD ?
-#_DS DW ?
-#_ES DW ?
-#_FS DW ?
-#_GS DW ?
-#_RFLAGS DQ ?
-#_EIP DD ?
-#_CS DW ?
-#_SS DW ?
-#IA32_REGS ENDS
-
-#_STK16 STRUC 1t
-#RetEip DD ?
-#RetCs DW ?
-#ThunkFlags DW ?
-#SavedGdtr FWORD ?
-#Resvd1 DW ?
-#SavedCr0 DD ?
-#SavedCr4 DD ?
-#_STK16 ENDS
-
-ASM_PFX(Thunk16):
- push %rbp
- push %rbx
- push %rsi
- push %rdi
- push %r12
- push %r13
- push %r14
- push %r15
- pushq %fs
- pushq %gs
- movl %ds,%r12d
- movl %es,%r13d
- movl %ss,%r14d
- mov %rsp,%r15
- mov %rcx,%rsi
- movzwq 0x36(%rsi),%r10 #movzx r10, (IA32_REGS ptr [rsi])._SS
- xor %rdi,%rdi
- mov 0xc(%rsi),%edi #mov edi, (IA32_REGS ptr [rsi])._ESP
- add $0xffffffffffffffb0,%rdi #add rdi, - sizeof (IA32_REGS) - sizeof (_STK16)
- push %rdi
- imul $0x10,%r10,%rax
- add %rax,%rdi
- pushq $0xe #push sizeof (IA32_REGS) / 4
- pop %rcx
- rep movsl %ds:(%rsi),%es:(%rdi)
- #; copy eflags to stack frame
- mov -16(%rsi), %rax
- mov %rax, -80(%rsi)
- pop %rbx #rbx <- 16-bit stack offset
- lea Label,%eax #42 <_Thunk16+0x42>
- stos %eax,%es:(%rdi)
- movl %cs,%eax #return segment
- stos %ax,%es:(%rdi)
- mov %edx,%eax #THUNK Flags
- stos %ax,%es:(%rdi)
- sgdt 0x58(%rsp) #save GDTR
- mov 0x58(%rsp),%rax
- stos %rax,%es:(%rdi)
- mov %cr0,%rax #save CR0
- mov %eax,%esi #esi <- CR0 to set
- stos %eax,%es:(%rdi)
- mov %cr4,%rax #save CR4
- stos %eax,%es:(%rdi)
- sidt 0x58(%rsp) #save IDTR
- and $0x7ffffffe,%esi #clear PE & PG bits
- mov %r10,%rdi #rdi <- 16-bit stack segment
- shl $0x10,%r8
- push %r8 #far jmp address
- lea Label_16Bit,%eax
- push %rax
- movw $0x8,0x4(%rsp)
- lgdt _16Gdtr #bugbug: may not match.
- lret
-Label_16Bit:
- .byte 0x66
- movl $0xc0000080,%ecx
- mov %rsi,%cr0 #disable PE & PG
- rdmsr
- and $0xfe,%ah
- wrmsr #clear LME bit
- mov %cr4,%rax
- and $0xcf,%al #clear PAE & PSE
- mov %rax,%cr4
- lret
-
-Label:
- xor %rax,%rax
- movw %ss,%ax
- shl $0x4,%eax
- add %esp,%eax
- mov %r15,%rsp
- lidt 0x58(%rsp)
- movl %r12d,%ds
- movl %r13d,%es
- movl %r14d,%ss
- popq %gs
- popq %fs
- pop %r15
- pop %r14
- pop %r13
- pop %r12
- pop %rdi
- pop %rsi
- pop %rbx
- pop %rbp
- retq
-
-
- .p2align 4
-
-_Code16Addr:
-ASM_PFX(RealMode):
- movl %edi,%ss
- mov %bx,%sp #set up 16-bit stack
- .byte 0x2e
- .byte 0x0f
- .byte 0x01
- .byte 0x1e
- .word _16Idtr - _Code16Addr #lidt _16Idtr
- .byte 0x66
- .byte 0x61 #popad
- .byte 0x1f #pop ds
- .byte 0x07 #pop es
- popq %fs
- popq %gs
- sub 64, %esp
- .byte 0x66, 0x9d #popfd
- add $0x4,%esp #skip high part of RFLAGS
- .byte 0x67 #; test (_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
- .byte 0xf7
- .byte 0x44
- .byte 0x24
- .byte 0x4e
- .byte 0x01
- .byte 0x00
- jz 1f
- pushfq #pushf, actually, when it's INT#
-1:
- .byte 0x0e #push cs
- .byte 0x68 #push /iw
- .word FarCallRet - _Code16Addr
- jz 2f
- .byte 0x66
- ljmp *70(%esp)
-2:
- .byte 0x66
- ljmp *68(%esp)
-FarCallRet:
- add 64, %esp
- .byte 0x66
- push $0x00 #push a dword of zero
- .byte 0x66
- pushf #pushfd, actually
- pushq %gs
- pushq %fs
- .byte 0x06 #push %es
- .byte 0x1e #push %ds
- .byte 0x66
- .byte 0x60
- cli
- .byte 0x66 #sizeof (IA32_REGS) = 13 * 4 = 52
- lgdt 64(%esp) #lgdt (_STK16 ptr [esp + sizeof (IA32_REGS)]).SavedGdtr
- .byte 0x66
- mov 76(%esp), %eax
- mov %rax, %cr4
- .byte 0x66
- mov $0xc0000080, %ecx
- rdmsr
- orb $1, %ah
- wrmsr
- .byte 0x66
- mov 72(%esp), %eax
- mov %rax, %cr0 #restore CR0
- .byte 0x66
- ljmpl *52(%esp)
-
-_16Idtr:
- .word 0x3ff #FWORD (1 SHL 10) - 1
- .byte 0x00
-
-#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
deleted file mode 100644
index 6b74bbe7cb..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
+++ /dev/null
@@ -1,228 +0,0 @@
-;*****************************************************************************
-;*
-;* 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.
-;*
-;* Module Name:
-;*
-;* Thunk.asm
-;*
-;* Abstract:
-;*
-;* Real mode thunk
-;*
-;*****************************************************************************
-
-EXTERNDEF mCode16Size:QWORD
-
- .const
-
-mCode16Size DQ _Code16End - _Code16Addr
-
- .data
-
-NullSegSel DQ 0
-_16CsSegSel LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 9bh
- DB 8fh ; 16-bit segment
- DB 0
-_16DsSegSel LABEL QWORD
- DW -1
- DW 0
- DB 0
- DB 93h
- DB 8fh ; 16-bit segment
- DB 0
-
-_16Gdtr LABEL FWORD
- DW $ - offset NullSegSel - 1
- DQ offset NullSegSel
-
- .code
-
-STACK_PARAM_SIZE EQU 16
-
-IA32_REGS STRUC 4t
-_EDI DD ?
-_ESI DD ?
-_EBP DD ?
-_ESP DD ?
-_EBX DD ?
-_EDX DD ?
-_ECX DD ?
-_EAX DD ?
-_DS DW ?
-_ES DW ?
-_FS DW ?
-_GS DW ?
-_RFLAGS DQ ?
-_EIP DD ?
-_CS DW ?
-_SS DW ?
-IA32_REGS ENDS
-
-_STK16 STRUC 1t
-RetEip DD ?
-RetCs DW ?
-ThunkFlags DW ?
-SavedGdtr FWORD ?
-Resvd1 DW ?
-SavedCr0 DD ?
-SavedCr4 DD ?
-_STK16 ENDS
-
-_Thunk16 PROC USES rbp rbx rsi rdi r12 r13 r14 r15
-
- push fs
- push gs
-
- mov r12d, ds
- mov r13d, es
- mov r14d, ss
- mov r15, rsp
- mov rsi, rcx
- movzx r10, (IA32_REGS ptr [rsi])._SS
- xor rdi, rdi
- mov edi, (IA32_REGS ptr [rsi])._ESP
- add rdi, - sizeof (IA32_REGS) - sizeof (_STK16)
- push rdi
- imul rax, r10, 16
- add rdi, rax
- push sizeof (IA32_REGS) / 4
- pop rcx
- rep movsd
-
- ; copy eflags to stack frame
- mov rax, (IA32_REGS ptr [rsi - sizeof(IA32_REGS)])._RFLAGS
- mov [rdi - sizeof(IA32_REGS) - STACK_PARAM_SIZE - 8], rax
-
- pop rbx ; rbx <- 16-bit stack offset
- lea eax, @F ; return offset
- stosd
- mov eax, cs ; return segment
- stosw
- mov eax, edx ; THUNK Flags
- stosw
- sgdt fword ptr [rsp + 58h] ; save GDTR
- mov rax, [rsp + 58h]
- stosq
- mov rax, cr0 ; save CR0
- mov esi, eax ; esi <- CR0 to set
- stosd
- mov rax, cr4 ; save CR4
- stosd
- sidt fword ptr [rsp + 58h] ; save IDTR
- and esi, 07ffffffeh ; clear PE & PG bits
- mov rdi, r10 ; rdi <- 16-bit stack segment
-
- shl r8, 16
- push r8 ; far jmp address
- lea eax, @16Bit
- push rax
- mov word ptr [rsp + 4], 8
- lgdt _16Gdtr
- retf
-@16Bit:
- DB 66h
- mov ecx, 0c0000080h
- mov cr0, rsi ; disable PE & PG
- rdmsr
- and ah, NOT 1
- wrmsr ; clear LME bit
- mov rax, cr4
- and al, NOT 30h ; clear PAE & PSE
- mov cr4, rax
- retf
-@@:
- xor rax, rax
- mov ax, ss
- shl eax, 4
- add eax, esp ; rax <- address of 16-bit stack
- mov rsp, r15
- lidt fword ptr [rsp + 58h] ; restore IDTR
- mov ds, r12d
- mov es, r13d
- mov ss, r14d
- pop gs
- pop fs
- ret
-_Thunk16 ENDP
-
- ALIGN 10h
-
-_Code16Addr PROC
-_Code16Addr ENDP
-
-RealMode PROC
- mov ss, edi
- mov sp, bx ; set up 16-bit stack
- DB 2eh, 0fh, 1, 1eh
- DW _16Idtr - _Code16Addr ; lidt _16Idtr
- DB 66h, 61h ; popad
- DB 1fh ; pop ds
- DB 7 ; pop es
- pop fs
- pop gs
- sub esp, (sizeof(IA32_REGS) - 16) + STACK_PARAM_SIZE + 8
-
- DB 66h, 9Dh ; popfd
- add esp, 4 ; skip high part of RFLAGS
- DB 67h, 0f7h, 44h, 24h ; test (_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
- DB (STACK_PARAM_SIZE + sizeof(IA32_REGS) + 6)
- DB 1, 0
- jz @F
- pushfq ; pushf, actually, when it's INT#
-@@:
- DB 0eh ; push cs
- DB 68h ; push /iw
- DW @FarCallRet - _Code16Addr
- jz @F
- DB 66h
- jmp fword ptr [esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-@@:
- DB 66h
- jmp fword ptr [esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
-@FarCallRet:
- add esp, (sizeof(IA32_REGS) - 16) + STACK_PARAM_SIZE + 8
- DB 66h
- push 0 ; push a dword of zero
- pushf ; pushfd, actually
- push gs
- push fs
- DB 6 ; push es
- DB 1eh ; push ds
- DB 66h, 60h ; pushad
- cli
-
- DB 66h
- lgdt (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedGdtr
- DB 66h
- mov eax, (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedCr4
- mov cr4, rax
- DB 66h
- mov ecx, 0c0000080h
- rdmsr
- or ah, 1
- wrmsr ; set LME
- DB 66h
- mov eax, (_STK16 ptr [esp + sizeof(IA32_REGS)]).SavedCr0
- mov cr0, rax
- DB 66h
- jmp fword ptr (_STK16 ptr [esp + sizeof(IA32_REGS)]).RetEip
-
-RealMode ENDP
-
-_16Idtr FWORD (1 SHL 10) - 1
-
-_Code16End:
-
- END
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
deleted file mode 100644
index 7f562cf484..0000000000
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
+++ /dev/null
@@ -1,395 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2011, 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.
-
-
-Module Name:
-
- x86Thunk.c
-
-Abstract:
-
- Real Mode Thunk Functions
-
---*/
-
-#include "Thunk16Lib.h"
-#include "EfiCommonLib.h"
-
-extern CONST UINTN mCode16Size;
-
-extern
-IA32_REGISTER_SET *
-EFIAPI
-_Thunk16 (
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 ThunkFlags,
- IN UINT32 RealModeCs
- );
-
-extern
-VOID
-EFIAPI
-_Code16Addr (
- VOID
- );
-
-VOID
-EFIAPI
-AsmFxRestore (
- IN CONST IA32_FX_BUFFER *Buffer
- );
-
-VOID
-EFIAPI
-AsmFxSave (
- OUT IA32_FX_BUFFER *Buffer
- );
-
-UINTN
-EFIAPI
-AsmGetEflags (
- VOID
- );
-
-VOID
-EFIAPI
-AsmSetEflags (
- IN UINTN Eflags
- );
-
-//
-// Implementation
-//
-STATIC
-IA32_REGISTER_SET *
-AsmThunk16 (
- IN THUNK_CONTEXT *ThunkContext,
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 ThunkFlags
- )
-/*++
-
-Routine Description:
-
- Do the 16-bit thunk code.
-
- NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts
- disabled because of GDTR and IDTR manipulations.
- This function must be placed in identity mapped pages.
-
-Arguments:
-
- ThunkContext - Thunk context to use.
- RegisterSet - CPU registers would be set to the values contained in this
- structure before making the far call. Then CPU registers are
- copied back to this structure.
- SS:ESP points to the real mode stack if THUNK_USER_STACK is
- set on input, otherwise ignored.
- EFlages is ignored on input.
- On output, values of CS, EIP, SS and ESP should be ignored.
- ThunkFlags - 2 flags have currently been defined, THUNK_SAVE_FP_STATE and
- THUNK_USER_STACK.
- THUNK_SAVE_FP_STATE - FPU state would be saved/restored
- before/after calling real mode code.
- THUNK_USER_STACK - The stack specified by SS:ESP would be
- used instead of the default stack.
-
-Returns:
-
- RegisterSet is returned.
-
---*/
-{
- IA32_FX_BUFFER *FpSavedState;
- UINT8 FpBuffer[sizeof (*FpSavedState) + 0x10];
- UINTN Eflags;
-
- FpSavedState = (IA32_FX_BUFFER*)(((UINTN)FpBuffer + 0xf) & ~0xf);
-
- if (!(ThunkFlags & THUNK_USER_STACK)) {
- RegisterSet->E.ESP = (UINT16)ThunkContext->DefaultStack;
- RegisterSet->E.SS = (UINT16)((ThunkContext->DefaultStack >> 4) & 0xf000);
- }
-
- if (ThunkFlags & THUNK_SAVE_FP_STATE) {
- AsmFxSave (FpSavedState);
- }
-
- Eflags = AsmGetEflags ();
-
- EfiCommonLibCopyMem (
- RegisterSet,
- _Thunk16 (
- RegisterSet,
- (UINT16)(ThunkFlags >> 16),
- ThunkContext->RealModeBuffer >> 4
- ),
- sizeof (*RegisterSet)
- );
-
- AsmSetEflags (Eflags);
-
- if (ThunkFlags & THUNK_SAVE_FP_STATE) {
- AsmFxRestore (FpSavedState);
- }
-
- return RegisterSet;
-}
-
-UINTN
-EFIAPI
-AsmThunk16GetProperties (
- OUT UINTN *MinimumStackSize
- )
-/*++
-
-Routine Description:
-
- Returns the properties of this real mode thunk implementation. Currently
- there are 2 properties has been defined, the minimum real mode buffer size
- and the minimum stack size.
-
-Arguments:
-
- MinimumStackSize - The minimum size required for a 16-bit stack.
-
-Returns:
-
- The minimum size of the real mode buffer needed by this thunk implementation
- is returned.
-
---*/
-{
- //
- // This size should be large enough to hold the register set as well as saved
- // CPU contexts including GDTR, CR0 and CR4
- //
- if (MinimumStackSize) {
- *MinimumStackSize = sizeof (IA32_REGISTER_SET) + 0x200;
- }
-
- return mCode16Size;
-}
-
-THUNK_CONTEXT *
-EFIAPI
-AsmThunk16SetProperties (
- OUT THUNK_CONTEXT *ThunkContext,
- IN VOID *RealModeBuffer,
- IN UINTN BufferSize
- )
-/*++
-
-Routine Description:
-
- Tell this real mode thunk implementation the address and size of the real
- mode buffer needed.
-
-Arguments:
-
- ThunkContext - The thunk context whose properties to set.
- RealModeBuffer - The address of the buffer allocated by caller. It should be
- aligned on a 16-byte boundary.
- This buffer must be in identity mapped pages.
- BufferSize - The size of RealModeBuffer. Must be larger than the minimum
- size required as returned by AsmThunk16GetProperties().
-
-Returns:
-
- None
-
---*/
-{
- BufferSize &= ~3;
-
- ThunkContext->RealModeBuffer = (UINT32)(UINTN)RealModeBuffer;
- ThunkContext->DefaultStack = (UINT32)(ThunkContext->RealModeBuffer + BufferSize);
- EfiCommonLibCopyMem (RealModeBuffer, (VOID*)(UINTN)_Code16Addr, mCode16Size);
-
- return ThunkContext;
-}
-
-#pragma pack (1)
-
-typedef struct {
- UINT32 EDI;
- UINT32 ESI;
- UINT32 EBP;
- UINT32 ESP;
- UINT32 EBX;
- UINT32 EDX;
- UINT32 ECX;
- UINT32 EAX;
- UINT16 DS;
- UINT16 ES;
- UINT16 FS;
- UINT16 GS;
- UINTN EFLAGS;
- UINT32 EIP;
- UINT16 CS;
- UINT16 SS;
-} IA32_REGS;
-
-typedef struct {
- UINT16 Limit;
- UINT32 Base;
-} IA32_DESC;
-
-typedef struct {
- UINT32 RetEip;
- UINT16 RetCs;
- UINT16 ThunkFlags;
-#ifdef EFI32
- UINT32 SavedEsp;
- UINT16 SavedSs;
-#endif
- IA32_DESC SavedGdtr;
-#ifdef EFIX64
- UINT16 Resvd1;
-#endif
- UINT32 SavedCr0;
- UINT32 SavedCr4;
-} _STK16;
-#pragma pack ()
-
-#define STACK_PARAM_SIZE 16
-
-BOOLEAN
-AsmThunk16SetUserStack (
- IN THUNK_CONTEXT *ThunkContext,
- IN VOID *Stack,
- IN UINTN StackSize
- )
-{
- if (StackSize > STACK_PARAM_SIZE) {
- return FALSE;
- }
-
- EfiCommonLibCopyMem ((VOID *)(UINTN)(ThunkContext->DefaultStack - sizeof(_STK16) - sizeof(IA32_REGS) - STACK_PARAM_SIZE), Stack, StackSize);
-
- return TRUE;
-}
-
-VOID
-EFIAPI
-AsmThunk16Destroy (
- IN OUT THUNK_CONTEXT *ThunkContext
- )
-/*++
-
-Routine Description:
-
- Reset all internal states to their initial values. The caller should not
- release the real mode buffer until after a call to this function.
-
-Arguments:
-
- ThunkContext - The thunk context to destroy.
-
-Returns:
-
- None
-
---*/
-{
- ThunkContext->RealModeBuffer = 0;
-}
-
-IA32_REGISTER_SET *
-EFIAPI
-AsmThunk16FarCall86 (
- IN THUNK_CONTEXT *ThunkContext,
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 Flags
- )
-/*++
-
-Routine Description:
-
- Make a far call to 16-bit code.
-
- NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts
- disabled because of GDTR and IDTR manipulations.
- This function must be placed in identity mapped pages.
-
-Arguments:
-
- ThunkContext - Thunk context to use.
- RegisterSet - CPU registers would be set to the values contained in this
- structure before making the far call. Then CPU registers are
- copied back to this structure.
- CS:EIP points to the real mode code being called on input.
- SS:ESP points to the real mode stack if THUNK_USER_STACK is
- set on input, otherwise ignored.
- EFlages is ignored on input.
- On output, values of CS, EIP, SS and ESP should be ignored.
- ThunkFlags - THUNK_USER_STACK: The stack specified by SS:ESP would be
- used instead of the default stack.
-
-Returns:
-
- RegisterSet is returned.
-
---*/
-{
- return AsmThunk16 (ThunkContext, RegisterSet, Flags);
-}
-
-IA32_REGISTER_SET *
-EFIAPI
-AsmThunk16Int86 (
- IN THUNK_CONTEXT *ThunkContext,
- IN UINT8 IntNumber,
- IN OUT IA32_REGISTER_SET *RegisterSet,
- IN UINT32 Flags
- )
-/*++
-
-Routine Description:
-
- Invoke a 16-bit interrupt handler.
-
- NOTE: This function must be called on TPL_HIGH_LEVEL or with interrupts
- disabled because of GDTR and IDTR manipulations.
- This function must be placed in identity mapped pages.
-
-Arguments:
-
- ThunkContext - Thunk context to use.
- IntNumber - The ordinal of the interrupt handler ranging from 0 to 255.
- RegisterSet - CPU registers would be set to the values contained in this
- structure before making the far call. Then CPU registers are
- copied back to this structure.
- SS:ESP points to the real mode stack if THUNK_USER_STACK is
- set on input, otherwise ignored.
- EFlages is ignored on input.
- On output, values of CS, EIP, SS and ESP should be ignored.
- ThunkFlags - THUNK_USER_STACK: The stack specified by SS:ESP would be
- used instead of the default stack.
-
-Returns:
-
- RegisterSet is returned.
-
---*/
-{
- UINT32 *VectorBase;
-
- //
- // The base address of legacy interrupt vector table is 0.
- // We use this base address to get the legacy interrupt handler.
- //
- VectorBase = 0;
- RegisterSet->E.EIP = (UINT16)(VectorBase)[IntNumber];
- RegisterSet->E.CS = (UINT16)((VectorBase)[IntNumber] >> 16);
-
- return AsmThunk16 (ThunkContext, RegisterSet, Flags | THUNK_INTERRUPT);
-}