summaryrefslogtreecommitdiffstats
path: root/EdkCompatibilityPkg/Foundation
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-26 01:54:49 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-11-26 01:54:49 +0000
commit3e99020dbf0a159e34b84e7ae9125f2e368d5390 (patch)
tree0eb6339318f7bf7da1b679b8009cf267b2234566 /EdkCompatibilityPkg/Foundation
parent68bb5ce77e51cf35791e46f2202e36da97e5e6be (diff)
downloadedk2-3e99020dbf0a159e34b84e7ae9125f2e368d5390.tar.gz
edk2-3e99020dbf0a159e34b84e7ae9125f2e368d5390.tar.bz2
edk2-3e99020dbf0a159e34b84e7ae9125f2e368d5390.zip
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11094 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Foundation')
-rw-r--r--EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S4
-rw-r--r--EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm4
-rw-r--r--EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c4
-rw-r--r--EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S4
-rw-r--r--EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm4
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h25
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h5
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h48
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h44
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h6
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h11
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h29
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf4
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h16
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h76
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h20
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c27
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h36
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h29
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h6
-rw-r--r--EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h8
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h28
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h90
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h55
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h8
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h11
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h10
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h25
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf7
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h56
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h66
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c4
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h13
-rw-r--r--EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h3
-rw-r--r--EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h5
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/EfiSpec.h14
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/EfiTpm.h7
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h28
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h158
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h12
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h24
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/Tiano.h12
-rw-r--r--EdkCompatibilityPkg/Foundation/Include/TianoHii.h7
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c29
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c179
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c101
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf3
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf1
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c5
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h18
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h31
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf3
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c154
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c805
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h222
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c35
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c160
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c95
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h18
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h13
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h19
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h18
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c15
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c32
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c8
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c257
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c166
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c100
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm6
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c9
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c10
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S2
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm2
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c17
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c14
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h12
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c82
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c16
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c5
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c176
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c30
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c176
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S24
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S18
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm21
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h9
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm26
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S20
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm24
-rw-r--r--EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c96
-rw-r--r--EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h4
-rw-r--r--EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h17
114 files changed, 3701 insertions, 901 deletions
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S
index 35cb4957c4..acc2b2e9c9 100644
--- a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S
+++ b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S
@@ -1,6 +1,6 @@
#/*++
#
-#Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+#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
@@ -157,7 +157,7 @@ L2:
# VOID
# )
ASM_PFX(EfiEnableCache):
- invd
+ wbinvd
movl %cr0, %eax
andl $0x9fffffff, %eax
movl %eax, %cr0
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm
index 38d3c49744..878be4d80a 100644
--- a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm
+++ b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm
@@ -1,6 +1,6 @@
;/*++
;
-;Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+;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
@@ -140,7 +140,7 @@ EfiDisableCache ENDP
; VOID
; )
EfiEnableCache PROC C PUBLIC
- invd
+ wbinvd
mov eax, cr0
and eax, 09fffffffh
mov cr0, eax
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c
index 6572bbd8f5..b4dc7e0b22 100644
--- a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c
+++ b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -118,7 +118,7 @@ VOID
EfiEnableCache (VOID)
{
__asm {
- invd
+ wbinvd
mov eax, cr0
and eax, 09fffffffh
mov cr0, eax
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S
index 380ff936a1..38c663e131 100644
--- a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S
+++ b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#*
-#* Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+#* 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
@@ -151,7 +151,7 @@ ASM_PFX(EfiDisableCache):
# );
#------------------------------------------------------------------------------
ASM_PFX(EfiEnableCache):
- invd
+ wbinvd
mov %cr0,%rax
and $0xffffffff9fffffff,%rax
mov %rax,%cr0
diff --git a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm
index ab4daedfdc..adb0fa73f3 100644
--- a/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm
+++ b/EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm
@@ -2,7 +2,7 @@ TITLE Cpu.asm: Assembly code for the x64 resources
;------------------------------------------------------------------------------
;*
-;* Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
+;* 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
@@ -150,7 +150,7 @@ EfiDisableCache ENDP
; );
;------------------------------------------------------------------------------
EfiEnableCache PROC PUBLIC
- invd
+ wbinvd
mov rax, cr0
and rax, 09fffffffh
mov cr0, rax
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h
index ea54c4bc0f..4bde7d2610 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+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
@@ -214,7 +214,6 @@ typedef struct {
UINT8 DeviceProtocol;
} USB_CLASS_DEVICE_PATH;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
#define MSG_USB_WWID_DP 0x10
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
@@ -231,7 +230,6 @@ typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
UINT8 Lun;
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
-#endif
#define MSG_SATA_DP 0x12
typedef struct {
@@ -330,8 +328,6 @@ typedef struct {
UINT32 FlowControlMap;
} UART_FLOW_CONTROL_DEVICE_PATH;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-
#define DEVICE_PATH_MESSAGING_SAS \
{ 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d} }
@@ -345,8 +341,6 @@ typedef struct {
UINT16 RelativeTargetPort;
} SAS_DEVICE_PATH;
-#endif
-
#define MSG_ISCSI_DP 0x13
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
@@ -428,8 +422,6 @@ typedef struct {
EFI_GUID Protocol;
} MEDIA_PROTOCOL_DEVICE_PATH;
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-
#define MEDIA_FV_DP 0x07
typedef struct {
EFI_DEVICE_PATH_PROTOCOL Header;
@@ -449,7 +441,6 @@ typedef struct {
UINT64 StartingOffset;
UINT64 EndingOffset;
} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
-#endif
//
// BBS Device Path
@@ -509,10 +500,8 @@ typedef union {
F1394_DEVICE_PATH F1394;
USB_DEVICE_PATH Usb;
USB_CLASS_DEVICE_PATH UsbClass;
- #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
USB_WWID_DEVICE_PATH UsbWwid;
DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;
- #endif
I2O_DEVICE_PATH I2O;
MAC_ADDR_DEVICE_PATH MacAddr;
IPv4_DEVICE_PATH Ipv4;
@@ -520,9 +509,7 @@ typedef union {
INFINIBAND_DEVICE_PATH InfiniBand;
UART_DEVICE_PATH Uart;
UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
- #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
SAS_DEVICE_PATH Sas;
- #endif
ISCSI_DEVICE_PATH Iscsi;
HARDDRIVE_DEVICE_PATH HardDrive;
CDROM_DEVICE_PATH CD;
@@ -530,12 +517,10 @@ typedef union {
FILEPATH_DEVICE_PATH FilePath;
MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
- #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
MEDIA_FW_VOL_DEVICE_PATH PiwgFirmwareVolume;
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH PiwgFirmwareFile;
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
Offset;
- #endif
BBS_BBS_DEVICE_PATH Bbs;
} EFI_DEV_PATH;
@@ -563,10 +548,8 @@ typedef union {
F1394_DEVICE_PATH *F1394;
USB_DEVICE_PATH *Usb;
USB_CLASS_DEVICE_PATH *UsbClass;
- #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
USB_WWID_DEVICE_PATH *UsbWwid;
DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;
- #endif
I2O_DEVICE_PATH *I2O;
MAC_ADDR_DEVICE_PATH *MacAddr;
IPv4_DEVICE_PATH *Ipv4;
@@ -575,9 +558,7 @@ typedef union {
UART_DEVICE_PATH *Uart;
UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
- #if (EFI_SPECIFICATION_VERSION >= 0x00020000)
SAS_DEVICE_PATH *Sas;
- #endif
ISCSI_DEVICE_PATH *Iscsi;
HARDDRIVE_DEVICE_PATH *HardDrive;
@@ -586,10 +567,10 @@ typedef union {
FILEPATH_DEVICE_PATH *FilePath;
MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
- #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
MEDIA_FW_VOL_DEVICE_PATH *PiwgFirmwareVolume;
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *PiwgFirmwareFile;
- #endif
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
+ *Offset;
BBS_BBS_DEVICE_PATH *Bbs;
UINT8 *Raw;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h
index 9ddd1b3568..1db119b298 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -58,6 +58,9 @@ Abstract:
#define EFI_INCOMPATIBLE_VERSION EFIERR (25)
#define EFI_SECURITY_VIOLATION EFIERR (26)
#define EFI_CRC_ERROR EFIERR (27)
+#define EFI_END_OF_MEDIA EFIERR (28)
+#define EFI_END_OF_FILE EFIERR (31)
+#define EFI_INVALID_LANGUAGE EFIERR (32)
#define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1)
#define EFI_WARN_DELETE_FAILURE EFIWARN (2)
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h
index 30e001963c..fd15d4f179 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -59,13 +59,13 @@ typedef struct {
#define EFI_HII_PACKAGE_TYPE_ALL 0x00
#define EFI_HII_PACKAGE_TYPE_GUID 0x01
-#define EFI_HII_PACKAGE_FORM 0x02
-#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03
+#define EFI_HII_PACKAGE_FORMS 0x02
#define EFI_HII_PACKAGE_STRINGS 0x04
#define EFI_HII_PACKAGE_FONTS 0x05
#define EFI_HII_PACKAGE_IMAGES 0x06
#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
+#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09
#define EFI_HII_PACKAGE_END 0xDF
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
@@ -108,6 +108,7 @@ typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
// Font Package
//
+#define EFI_HII_FONT_STYLE_NORMAL 0x00000000
#define EFI_HII_FONT_STYLE_BOLD 0x00000001
#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000
@@ -237,8 +238,8 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
// String Package
//
-#define UEFI_CONFIG_LANG L"x-UEFI"
-#define UEFI_CONFIG_LANG2 L"x-i-UEFI" // BUGBUG, spec need to be updated.
+#define UEFI_CONFIG_LANG "x-UEFI"
+#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
typedef struct _EFI_HII_STRING_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
@@ -697,14 +698,14 @@ typedef struct _EFI_IFR_VARSTORE {
typedef struct _EFI_IFR_VARSTORE_EFI {
EFI_IFR_OP_HEADER Header;
- UINT16 VarStoreId;
+ EFI_VARSTORE_ID VarStoreId;
EFI_GUID Guid;
UINT32 Attributes;
} EFI_IFR_VARSTORE_EFI;
typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
EFI_IFR_OP_HEADER Header;
- UINT16 VarStoreId;
+ EFI_VARSTORE_ID VarStoreId;
EFI_GUID Guid;
} EFI_IFR_VARSTORE_NAME_VALUE;
@@ -713,8 +714,13 @@ typedef struct _EFI_IFR_FORM_SET {
EFI_GUID Guid;
EFI_STRING_ID FormSetTitle;
EFI_STRING_ID Help;
+ UINT8 Flags;
+ EFI_GUID ClassGuid[1];
} EFI_IFR_FORM_SET;
+#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
+ { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
+
typedef struct _EFI_IFR_END {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END;
@@ -805,7 +811,7 @@ typedef struct _EFI_IFR_REF4 {
typedef struct _EFI_IFR_RESET_BUTTON {
EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
+ EFI_IFR_STATEMENT_HEADER Statement;
EFI_DEFAULT_ID DefaultId;
} EFI_IFR_RESET_BUTTON;
@@ -1273,7 +1279,7 @@ typedef enum {
EfiKeyB8,
EfiKeyB9,
EfiKeyB10,
- EfiKeyRshift,
+ EfiKeyRShift,
EfiKeyUpArrow,
EfiKeyOne,
EfiKeyTwo,
@@ -1396,16 +1402,16 @@ typedef struct {
// EFI_HII_KEYBOARD_LAYOUT Layout[];
} EFI_HII_KEYBOARD_PACKAGE_HDR;
-typedef struct {
- CHAR16 Language[3];
- CHAR16 Space;
- CHAR16 DescriptionString[1];
-} EFI_DESCRIPTION_STRING;
+//typedef struct {
+// CHAR16 Language[]; // RFC4646 Language Code
+// CHAR16 Space;
+// CHAR16 DescriptionString[];
+//} EFI_DESCRIPTION_STRING;
-typedef struct {
- UINT16 DescriptionCount;
- EFI_DESCRIPTION_STRING DescriptionString[1];
-} EFI_DESCRIPTION_STRING_BUNDLE;
+//typedef struct {
+// UINT16 DescriptionCount;
+// EFI_DESCRIPTION_STRING DescriptionString[];
+//} EFI_DESCRIPTION_STRING_BUNDLE;
//
// Modifier values
@@ -1425,7 +1431,7 @@ typedef struct {
#define EFI_LEFT_SHIFT_MODIFIER 0x000C
#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
#define EFI_CAPS_LOCK_MODIFIER 0x000E
-#define EFI_NUM_LOCK _MODIFIER 0x000F
+#define EFI_NUM_LOCK_MODIFIER 0x000F
#define EFI_LEFT_ARROW_MODIFIER 0x0010
#define EFI_RIGHT_ARROW_MODIFIER 0x0011
#define EFI_DOWN_ARROW_MODIFIER 0x0012
@@ -1458,6 +1464,10 @@ typedef struct {
#define EFI_PAUSE_MODIFIER 0x0025
#define EFI_BREAK_MODIFIER 0x0026
+#define EFI_LEFT_LOGO_MODIFIER 0x0027
+#define EFI_RIGHT_LOGO_MODIFIER 0x0028
+#define EFI_MENU_MODIFIER 0x0029
+
#pragma pack()
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h
index fa6dc424c3..90f7b75b47 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -623,6 +623,48 @@ typedef struct {
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
//
+// Resource Format
+//
+typedef struct {
+ UINT32 Characteristics;
+ UINT32 TimeDateStamp;
+ UINT16 MajorVersion;
+ UINT16 MinorVersion;
+ UINT16 NumberOfNamedEntries;
+ UINT16 NumberOfIdEntries;
+// EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[];
+} EFI_IMAGE_RESOURCE_DIRECTORY;
+
+typedef struct {
+ union {
+ struct {
+ UINT32 NameOffset:31;
+ UINT32 NameIsString:1;
+ } s;
+ UINT32 Id;
+ } u1;
+ union {
+ UINT32 OffsetToData;
+ struct {
+ UINT32 OffsetToDirectory:31;
+ UINT32 DataIsDirectory:1;
+ } s;
+ } u2;
+} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
+
+typedef struct {
+ UINT16 Length;
+ CHAR16 String[1];
+} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
+
+typedef struct {
+ UINT32 OffsetToData;
+ UINT32 Size;
+ UINT32 CodePage;
+ UINT32 Reserved;
+} EFI_IMAGE_RESOURCE_DATA_ENTRY;
+
+//
// Header format for TE images
//
typedef struct {
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h
index 3fba60ff5d..5de817e091 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -90,11 +90,11 @@ typedef UINT64 EFI_LBA;
// EFI Constants. They may exist in other build structures, so #ifndef them.
//
#ifndef TRUE
-#define TRUE ((BOOLEAN) 1 == 1)
+#define TRUE ((BOOLEAN) (1 == 1))
#endif
#ifndef FALSE
-#define FALSE ((BOOLEAN) 0 == 1)
+#define FALSE ((BOOLEAN) (0 == 1))
#endif
#ifndef NULL
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h
index ac914f7508..0767b8a4a1 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -185,9 +185,16 @@ typedef struct {
UINT32 IoAlign;
EFI_LBA LastBlock;
+
+ EFI_LBA LowestAlignedLba;
+ UINT32 LogicalBlocksPerPhysicalBlock;
} EFI_BLOCK_IO_MEDIA;
-#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
+#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
+#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001
+
+#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV1 ((UINTN)&((EFI_BLOCK_IO_MEDIA *)0)->LastBlock + sizeof(EFI_LBA))
+#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV2 sizeof(EFI_BLOCK_IO_MEDIA)
struct _EFI_BLOCK_IO_PROTOCOL {
UINT64 Revision;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h
index 6a3a42bd9d..19c6d5a09d 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -50,12 +50,13 @@ EFI_STATUS
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
- This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
- Language - A pointer to a three character ISO 639-2 language identifier.
- This is the language of the driver name that that the caller
- is requesting, and it must match one of the languages specified
- in SupportedLanguages. The number of languages supported by a
- driver is up to the driver writer.
+ This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.
+ Language - A pointer to a Null-terminated ASCII string array indicating the
+ language. This is the language of the driver name that the caller
+ is requesting, and it must match one of the languages specified in
+ SupportedLanguages. The number of languages supported by a
+ driver is up to the driver writer. Language is specified in RFC
+ 4646 language code format.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
@@ -86,7 +87,7 @@ EFI_STATUS
that is being managed by an EFI Driver.
Arguments:
- This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
+ This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
@@ -96,12 +97,12 @@ EFI_STATUS
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
- Language - A pointer to a three character ISO 639-2 language
- identifier. This is the language of the controller name
- that that the caller is requesting, and it must match one
- of the languages specified in SupportedLanguages. The
- number of languages supported by a driver is up to the
- driver writer.
+ Language - A pointer to a Null-terminated ASCII string array indicating the
+ language. This is the language of the driver name that the caller
+ is requesting, and it must match one of the languages specified in
+ SupportedLanguages. The number of languages supported by a
+ driver is up to the driver writer. Language is specified in RFC
+ 4646 language code format.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language specified
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf b/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf
index 854efb354e..e99e26de27 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -117,6 +117,8 @@ COMPONENT_TYPE= LIBRARY
HiiFont/HiiFont.c
HiiImage/HiiImage.h
HiiImage/HiiImage.c
+ HiiPackageList/HiiPackageList.h
+ HiiPackageList/HiiPackageList.c
HiiString/HiiString.h
HiiString/HiiString.c
Ip4/Ip4.h
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
index 8cb526613e..b319aae973 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -138,8 +138,7 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The data associated with the Handle was removed from
the HII database.
- EFI_NOT_FOUND - The specified PackageList could not be found in database.
- EFI_INVALID_PARAMETER - The Handle was not valid.
+ EFI_NOT_FOUND - The specified Handle is not in database.
--*/
;
@@ -166,8 +165,8 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The HII database was successfully updated.
EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database.
- EFI_INVALID_PARAMETER - Handle or PackageList was NULL.
- EFI_NOT_FOUND - The Handle was not valid or could not be found in database.
+ EFI_INVALID_PARAMETER - PackageList was NULL.
+ EFI_NOT_FOUND - The specified Handle is not in database.
--*/
;
@@ -203,12 +202,16 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The matching handles are outputed successfully.
+ HandleBufferLength is updated with the actual length.
EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that
Handle is too small to support the number of handles.
HandleBufferLength is updated with a value that will
enable the data to fit.
EFI_NOT_FOUND - No matching handle could not be found in database.
EFI_INVALID_PARAMETER - Handle or HandleBufferLength was NULL.
+ EFI_INVALID_PARAMETER - PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
+ PackageGuid is not NULL, PackageType is a EFI_HII_
+ PACKAGE_TYPE_GUID but PackageGuid is NULL.
--*/
;
@@ -312,7 +315,8 @@ EFI_STATUS
Returns:
EFI_SUCCESS - Notification is unregistered successfully.
- EFI_INVALID_PARAMETER - The Handle is invalid.
+ EFI_NOT_FOUND - The incoming notification handle does not exist
+ in current hii database.
--*/
;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h
index 36f5a872eb..46c922cf12 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -53,9 +53,9 @@ typedef struct _EFI_HII_ROW_INFO {
} EFI_HII_ROW_INFO;
typedef struct {
- UINT32 FontStyle;
- UINT16 FontSize; // character cell size in pixels
- CHAR16 FontName[1];
+ EFI_HII_FONT_STYLE FontStyle;
+ UINT16 FontSize; // character cell height in pixels
+ CHAR16 FontName[1];
} EFI_FONT_INFO;
typedef struct _EFI_FONT_DISPLAY_INFO {
@@ -65,25 +65,25 @@ typedef struct _EFI_FONT_DISPLAY_INFO {
EFI_FONT_INFO FontInfo;
} EFI_FONT_DISPLAY_INFO;
-#define EFI_HII_OUT_FLAG_CLIP 0x00000001
-#define EFI_HII_OUT_FLAG_WRAP 0x00000002
-#define EFI_HII_OUT_FLAG_CLEAN_Y 0x00000004
-#define EFI_HII_OUT_FLAG_CLEAN_X 0x00000008
-#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
-#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
-#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
-#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
-
-#define EFI_FONT_INFO_SYS_FONT 0x00000001
-#define EFI_FONT_INFO_SYS_SIZE 0x00000002
-#define EFI_FONT_INFO_SYS_STYLE 0x00000004
-#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
-#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
-#define EFI_FONT_INFO_RESIZE 0x00001000
-#define EFI_FONT_INFO_RESTYLE 0x00002000
-#define EFI_FONT_INFO_ANY_FONT 0x00010000
-#define EFI_FONT_INFO_ANY_SIZE 0x00020000
-#define EFI_FONT_INFO_ANY_STYLE 0x00040000
+#define EFI_HII_OUT_FLAG_CLIP 0x00000001
+#define EFI_HII_OUT_FLAG_WRAP 0x00000002
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008
+#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
+#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
+#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
+#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
+
+#define EFI_FONT_INFO_SYS_FONT 0x00000001
+#define EFI_FONT_INFO_SYS_SIZE 0x00000002
+#define EFI_FONT_INFO_SYS_STYLE 0x00000004
+#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
+#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
+#define EFI_FONT_INFO_RESIZE 0x00001000
+#define EFI_FONT_INFO_RESTYLE 0x00002000
+#define EFI_FONT_INFO_ANY_FONT 0x00010000
+#define EFI_FONT_INFO_ANY_SIZE 0x00020000
+#define EFI_FONT_INFO_ANY_STYLE 0x00040000
typedef
EFI_STATUS
@@ -109,7 +109,7 @@ EFI_STATUS
Flags - Describes how the string is to be drawn.
String - Points to the null-terminated string to be displayed.
StringInfo - Points to the string output information, including the color and font.
- If NULL, then the string will be output in the default system font and color.
+ If NULL, then the string will be output in the default system font and color.
Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels
wide and Height pixels high. The string will be drawn onto this image and
EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a
@@ -132,7 +132,8 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The string was successfully rendered.
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.
- EFI_INVALID_PARAMETER - The String was NULL.
+ EFI_INVALID_PARAMETER - The String or Blt was NULL.
+ EFI_INVALID_PARAMETER - Flags were invalid combination.
--*/
;
@@ -166,7 +167,7 @@ EFI_STATUS
Language - Points to the language for the retrieved string. If NULL, then the current system
language is used.
StringInfo - Points to the string output information, including the color and font.
- If NULL, then the string will be output in the default system font and color.
+ If NULL, then the string will be output in the default system font and color.
Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels
wide and Height pixels high. The string will be drawn onto this image and
EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a
@@ -187,9 +188,12 @@ EFI_STATUS
is possible when character display is normalized that some character cells overlap.
Returns:
- EFI_SUCCESS - The string was successfully rendered.
+ EFI_SUCCESS - The string was successfully rendered.
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.
- EFI_INVALID_PARAMETER - The String was NULL.
+ EFI_INVALID_PARAMETER - The Blt or PackageList was NULL.
+ EFI_INVALID_PARAMETER - Flags were invalid combination.
+ EFI_NOT_FOUND - The specified PackageList is not in the Database or the stringid is not
+ in the specified PackageList.
--*/
;
@@ -233,7 +237,7 @@ EFI_STATUS
(EFIAPI *EFI_HII_GET_FONT_INFO) (
IN CONST EFI_HII_FONT_PROTOCOL *This,
IN OUT EFI_FONT_HANDLE *FontHandle,
- IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL
OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,
IN CONST EFI_STRING String OPTIONAL
)
@@ -246,11 +250,13 @@ EFI_STATUS
Arguments:
This - A pointer to the EFI_HII_FONT_PROTOCOL instance.
- FontHandle - On entry, points to the font handle returned by a
- previous call to GetFontInfo() or NULL to start with the
+ FontHandle - On entry, points to the font handle returned by a previous
+ call to GetFontInfo() or points to NULL to start with the
first font. On return, points to the returned font handle or
- points to NULL if there are no more matching fonts.
- StringInfoIn - Upon entry, points to the font to return information about.
+ points to NULL if there are no more matching fonts.
+ StringInfoIn - Upon entry, points to the font to return information about.
+ If NULL, then the information about the system default
+ font will be returned.
StringInfoOut - Upon return, contains the matching font's information.
If NULL, then no information is returned.
It's caller's responsibility to free this buffer.
@@ -261,10 +267,10 @@ EFI_STATUS
Returns:
EFI_SUCCESS - Matching font returned successfully.
EFI_NOT_FOUND - No matching font was found.
- EFI_INVALID_PARAMETER - StringInfoIn is NULL.
+ EFI_INVALID_PARAMETER - StringInfoIn->FontInfoMask is an invalid combination.
EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the request.
---*/
+--*/
;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h
index 1eb4e6fab0..0a27599e8a 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -45,7 +45,7 @@ typedef struct _EFI_IMAGE_INPUT {
UINT32 Flags;
UINT16 Width;
UINT16 Height;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Bitmap[1];
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;
} EFI_IMAGE_INPUT;
#define EFI_IMAGE_TRANSPARENT 0x00000001
@@ -101,8 +101,7 @@ EFI_STATUS
IN CONST EFI_HII_IMAGE_PROTOCOL *This,
IN EFI_HII_HANDLE PackageList,
IN EFI_IMAGE_ID ImageId,
- OUT EFI_IMAGE_INPUT *Image,
- OUT UINTN *ImageSize
+ OUT EFI_IMAGE_INPUT *Image
)
/*++
@@ -115,14 +114,14 @@ EFI_STATUS
PackageList - Handle of the package list where this image will be searched.
ImageId - The image's id,, which is unique within PackageList.
Image - Points to the image.
- ImageSize - On entry, points to the size of the buffer pointed to by Image, in bytes. On return,
- points to the length of the image, in bytes.
Returns:
EFI_SUCCESS - The new image was returned successfully.
EFI_NOT_FOUND - The image specified by ImageId is not available.
- EFI_BUFFER_TOO_SMALL - The buffer specified by ImageSize is too small to hold the image.
+ The specified PackageList is not in the database.
EFI_INVALID_PARAMETER - The Image or ImageSize was NULL.
+ EFI_OUT_OF_RESOURCES - The bitmap could not be retrieved because there was not
+ enough memory.
--*/
;
@@ -149,7 +148,8 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The new image was updated successfully.
- EFI_NOT_FOUND - The image specified by ImageId is not in the database.
+ EFI_NOT_FOUND - The image specified by ImageId is not in the database.
+ The specified PackageList is not in the database.
EFI_INVALID_PARAMETER - The Image was NULL.
--*/
@@ -233,7 +233,9 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The image was successfully drawn.
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt.
- EFI_INVALID_PARAMETER - The Image was NULL.
+ EFI_NOT_FOUND - The image specified by ImageId is not in the database.
+ The specified PackageList is not in the database.
+ EFI_INVALID_PARAMETER - The Blt was NULL.
--*/
;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c
new file mode 100644
index 0000000000..aa424ab700
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c
@@ -0,0 +1,27 @@
+/*++
+
+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:
+
+ HiiPackageList.c
+
+Abstract:
+
+ EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.
+
+--*/
+
+#include "EfiSpec.h"
+#include EFI_PROTOCOL_DEFINITION (HiiPackageList)
+
+EFI_GUID gEfiHiiPackageListProtocolGuid = EFI_HII_PACKAGE_LIST_PROTOCOL_GUID;
+
+EFI_GUID_STRING(&gEfiHiiPackageListProtocolGuid, "HII Package List Protocol", "HII Package List 2.1 protocol");
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h
new file mode 100644
index 0000000000..a3d057a018
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h
@@ -0,0 +1,36 @@
+/*++
+
+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:
+
+ HiiPackageList.h
+
+Abstract:
+
+ EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.
+
+--*/
+
+#ifndef _HII_PACKAGE_LIST_H_
+#define _HII_PACKAGE_LIST_H_
+
+#include "EfiHii.h"
+
+#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \
+ { \
+ 0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc} \
+ }
+
+typedef EFI_HII_PACKAGE_LIST_HEADER * EFI_HII_PACKAGE_LIST_PROTOCOL;
+
+extern EFI_GUID gEfiHiiPackageListProtocolGuid;
+
+#endif
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h
index c243d9e680..0c27218b38 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -54,6 +54,8 @@ EFI_STATUS
Routine Description:
This function adds the string String to the group of strings owned by PackageList, with the
specified font information StringFontInfo and returns a new string id.
+ The new string identifier is guaranteed to be unique within the package list.
+ That new string identifier is reserved for all languages in the package list.
Arguments:
This - A pointer to the EFI_HII_STRING_PROTOCOL instance.
@@ -104,13 +106,19 @@ EFI_STATUS
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.
- StringFontInfo - If not NULL, points to the string's font information.
- It's caller's responsibility to free this buffer.
+ points to the length of the string, in bytes.
+ StringFontInfo - Points to a buffer that will be callee allocated and will
+ have the string's font information into this buffer.
+ The caller is responsible for freeing this buffer.
+ If the parameter is NULL a buffer will not be allocated
+ and the string font information will not be returned.
Returns:
EFI_SUCCESS - The string was returned successfully.
EFI_NOT_FOUND - The string specified by StringId is not available.
+ The specified PackageList is not in the database.
+ EFI_INVALID_LANGUAGE - The string specified by StringId is available but
+ not in the specified language.
EFI_BUFFER_TOO_SMALL - The buffer specified by StringSize is too small to
hold the string.
EFI_INVALID_PARAMETER - The String or Language or StringSize was NULL.
@@ -147,7 +155,8 @@ EFI_STATUS
Returns:
EFI_SUCCESS - The string was updated successfully.
- EFI_NOT_FOUND - The string specified by StringId is not in the database.
+ EFI_NOT_FOUND - The string specified by StringId is not in the database.
+ The specified PackageList is not in the database.
EFI_INVALID_PARAMETER - The String or Language was NULL.
EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
@@ -182,6 +191,7 @@ EFI_STATUS
EFI_BUFFER_TOO_SMALL - The LanguagesSize is too small to hold the list of
supported languages. LanguageSize is updated to
contain the required size.
+ EFI_NOT_FOUND - The specified PackageList is not in the database.
--*/
;
@@ -220,9 +230,12 @@ EFI_STATUS
EFI_BUFFER_TOO_SMALL - The buffer specified by SecondLanguagesSize is
too small to hold the returned information.
SecondLanguageSize is updated to hold the size of
- the buffer required.
-
---*/
+ the buffer required.
+ EFI_INVALID_LANGUAGE - The language specified by FirstLanguage is not
+ present in the specified package list.
+ EFI_NOT_FOUND - The specified PackageList is not in the Database.
+
+--*/
;
//
// Interface structure for the EFI_HII_STRING_PROTOCOL
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h
index 0263bf04f4..3e315c0bb2 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
+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
@@ -15,7 +15,7 @@ Module Name:
Abstract:
- UEFI IPv4 protocol.
+ EFI_IP4_PROTOCOL definition in UEFI 2.2 specification.
--*/
@@ -80,7 +80,7 @@ typedef struct _EFI_IP4_ICMP_TYPE {
typedef struct {
BOOLEAN IsStarted;
UINT32 MaxPacketSize;
-
+
EFI_IP4_CONFIG_DATA ConfigData;
BOOLEAN IsConfigured;
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h
index d9f0032559..6abd11d5bf 100644
--- a/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h
+++ b/EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -35,6 +35,8 @@ Abstract:
EFI_FORWARD_DECLARATION (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
EFI_FORWARD_DECLARATION (EFI_FILE);
+typedef struct _EFI_FILE *EFI_FILE_HANDLE;
+typedef struct _EFI_FILE EFI_FILE_PROTOCOL;
typedef
EFI_STATUS
@@ -356,7 +358,7 @@ EFI_STATUS
;
#define EFI_FILE_HANDLE_REVISION 0x00010000
-typedef struct _EFI_FILE {
+struct _EFI_FILE {
UINT64 Revision;
EFI_FILE_OPEN Open;
EFI_FILE_CLOSE Close;
@@ -368,7 +370,7 @@ typedef struct _EFI_FILE {
EFI_FILE_GET_INFO GetInfo;
EFI_FILE_SET_INFO SetInfo;
EFI_FILE_FLUSH Flush;
-} *EFI_FILE_HANDLE;
+};
extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h
index a4b83c33d9..482e69e114 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -140,7 +140,9 @@ typedef enum _EFI_MEMORY_ARRAY_TYPE {
EfiMemoryTypeRdram = 0x11,
EfiMemoryTypeDdr = 0x12,
EfiMemoryTypeDdr2 = 0x13,
- EfiMemoryTypeDdr2FbDimm = 0x14
+ EfiMemoryTypeDdr2FbDimm = 0x14,
+ EfiMemoryTypeDdr3 = 0x18,
+ EfiMemoryTypeFbd2 = 0x19
} EFI_MEMORY_ARRAY_TYPE;
typedef struct {
@@ -189,6 +191,8 @@ typedef struct {
UINT16 MemorySpeed;
EFI_MEMORY_STATE MemoryState;
UINT8 MemoryAttributes;
+ UINT8 MemoryBankConnections;
+ UINT8 MemoryErrorStatus;
} EFI_MEMORY_ARRAY_LINK;
@@ -304,11 +308,15 @@ typedef struct {
typedef struct {
UINT8 Five :1;
- UINT8 There :1;
+ UINT8 Three :1;
UINT8 Two :1;
UINT8 Reserved :5;
} EFI_MEMORY_MODULE_VOLTAGE_TYPE;
+//
+// EFI_MEMORY_CONTROLLER_INFORMATION is obsolete
+// Use EFI_MEMORY_CONTROLLER_INFORMATION_DATA instead
+//
typedef struct {
EFI_MEMORY_ERROR_DETECT_METHOD_TYPE ErrorDetectingMethod;
EFI_MEMORY_ERROR_CORRECT_CAPABILITY ErrorCorrectingCapability;
@@ -323,6 +331,20 @@ typedef struct {
UINT16 *MemoryModuleConfigHandles;
} EFI_MEMORY_CONTROLLER_INFORMATION;
+typedef struct {
+ EFI_MEMORY_ERROR_DETECT_METHOD_TYPE ErrorDetectingMethod;
+ EFI_MEMORY_ERROR_CORRECT_CAPABILITY ErrorCorrectingCapability;
+ EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE MemorySupportedInterleave;
+ EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE MemoryCurrentInterleave;
+ UINT8 MaxMemoryModuleSize;
+ EFI_MEMORY_SPEED_TYPE MemorySpeedType;
+ EFI_MEMORY_SUPPORTED_TYPE MemorySupportedType;
+ EFI_MEMORY_MODULE_VOLTAGE_TYPE MemoryModuleVoltage;
+ UINT8 NumberofMemorySlot;
+ EFI_MEMORY_ERROR_CORRECT_CAPABILITY EnabledCorrectingCapability;
+ EFI_INTER_LINK_DATA MemoryModuleConfig[1];
+} EFI_MEMORY_CONTROLLER_INFORMATION_DATA;
+
//
// Memory. Error Information - SMBIOS Type 18
//
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h
index 56124059a6..d7545afc8b 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -261,6 +261,7 @@ typedef enum {
typedef struct {
UINT32 RecordType :1;
+ UINT32 Type :7;
UINT32 Reserved :24;
} EFI_MISC_ELEMENT_TYPE;
@@ -417,7 +418,7 @@ typedef enum {
EfiSlotTypeApg2X = 0x10,
EfiSlotTypeAgp4X = 0x11,
EfiSlotTypePciX = 0x12,
- EfiSlotTypeAgp4x = 0x13,
+ EfiSlotTypeAgp8X = 0x13,
EfiSlotTypePC98C20 = 0xA0,
EfiSlotTypePC98C24 = 0xA1,
EfiSlotTypePC98E = 0xA2,
@@ -428,7 +429,13 @@ typedef enum {
EfiSlotTypePciExpressX2 = 0xA7,
EfiSlotTypePciExpressX4 = 0xA8,
EfiSlotTypePciExpressX8 = 0xA9,
- EfiSlotTypePciExpressX16 = 0xAA
+ EfiSlotTypePciExpressX16 = 0xAA,
+ EfiSlotTypePciExpressGen2 = 0xAB,
+ EfiSlotTypePciExpressGen2X1 = 0xAC,
+ EfiSlotTypePciExpressGen2X2 = 0xAD,
+ EfiSlotTypePciExpressGen2X4 = 0xAE,
+ EfiSlotTypePciExpressGen2X8 = 0xAF,
+ EfiSlotTypePciExpressGen2X16 = 0xB0
} EFI_MISC_SLOT_TYPE;
typedef enum {
@@ -595,6 +602,7 @@ typedef struct {
EFI_INTER_LINK_DATA GroupLink;
UINT16 GroupId;
UINT16 GroupElementId;
+ UINT8 ItemType;
} EFI_MISC_GROUP_ITEM_SET_DATA;
//
@@ -711,7 +719,12 @@ typedef struct {
//
// Misc. Hardware Security - SMBIOS Type 24
//
-#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER 0x00000012
+#define EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER 0x00000012
+
+//
+// Backward Compatibility
+//
+#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER
typedef enum {
EfiHardwareSecurityStatusDisabled = 0,
@@ -966,6 +979,7 @@ typedef struct {
EFI_INTER_LINK_DATA ManagementDeviceLink;
EFI_INTER_LINK_DATA ManagementDeviceComponentLink;
EFI_INTER_LINK_DATA ManagementDeviceThresholdLink;
+ UINT8 ComponentType;
} EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION;
//
@@ -1013,7 +1027,7 @@ typedef struct {
} POWER_SUPPLY_CHARACTERISTICS;
typedef struct {
- UINT8 PowerUnitGroup;
+ UINT16 PowerUnitGroup;
STRING_REF PowerSupplyLocation;
STRING_REF PowerSupplyDeviceName;
STRING_REF PowerSupplyManufacturer;
@@ -1098,18 +1112,62 @@ typedef struct {
// Misc. System Event Log - SMBIOS Type 15
//
#define EFI_MISC_SYSTEM_EVENT_LOG_RECORD_NUMBER 0x00000020
+
+typedef enum {
+ EfiEventLogTypeReserved1 = 0,
+ EfiEventLogTypeSingleBitEccMemoryError = 1,
+ EfiEventLogTypeMultiBitEccMemoryError = 2,
+ EfiEventLogTypeParityMemoryError = 3,
+ EfiEventLogTypeBusTimeOut = 4,
+ EfiEventLogTypeIoChannelCheck = 5,
+ EfiEventLogTypeSoftwareNmi = 6,
+ EfiEventLogTypePostMemoryResize = 7,
+ EfiEventLogTypePostError = 8,
+ EfiEventLogTypePciParityError = 9,
+ EfiEventLogTypePciSystemError = 0xA,
+ EfiEventLogTypeCpuFailure = 0xB,
+ EfiEventLogTypeEisaFailSafeTimerTimeOut = 0xC,
+ EfiEventLogTypeCorrectableMemoryLogDisabled = 0xD,
+ EfiEventLogTypeLoggingDisabled = 0xE,
+ EfiEventLogTypeReserved2 = 0xF,
+ EfiEventLogTypeSystemLimitExceeded = 0x10,
+ EfiEventLogTypeAsynchronousHardwareTimerExpired = 0x11,
+ EfiEventLogTypeSystemConfigurationInformation = 0x12,
+ EfiEventLogTypeHardDiskInformation = 0x13,
+ EfiEventLogTypeSystemReconfigured = 0x14,
+ EfiEventLogTypeUncorrectableCpuComplexError = 0x15,
+ EfiEventLogTypeLogAreaResetCleared = 0x16,
+ EfiEventLogTypeSystemBoot = 0x17,
+ EfiEventLogTypeEndOfLog = 0xFF
+} EFI_MISC_LOG_TYPE;
+
+typedef enum {
+ EfiEventLogDataFormatTypeNone = 0,
+ EfiEventLogDataFormatTypeHandle = 1,
+ EfiEventLogDataFormatTypeMultipleEvent = 2,
+ EfiEventLogDataFormatTypeMultipleEventHandle = 3,
+ EfiEventLogDataFormatTypePostResultsBitmap = 4,
+ EfiEventLogDataFormatTypeSystemManagement = 5,
+ EfiEventLogDataFormatTypeMultipleEventSystemManagement = 6
+} EFI_MISC_VARIABLE_DATA_FORMAT_TYPE;
+
+typedef struct {
+ UINT8 LogType;
+ UINT8 DataFormatType;
+} EFI_MISC_EVENT_LOG_TYPE;
+
typedef struct {
- //SMBIOS_STRUCTURE_HDR Header;
- UINT16 LogAreaLength;
- UINT16 LogHeaderStartOffset;
- UINT16 LogDataStartOffset;
- UINT8 AccessMethod;
- UINT8 LogStatus;
- UINT32 LogChangeToken;
- UINT32 AccessMethodAddress;
- UINT8 LogHeaderFormat;
- UINT8 NumberOfSupportedLogType;
- UINT8 LengthOfLogDescriptor;
+ UINT16 LogAreaLength;
+ UINT16 LogHeaderStartOffset;
+ UINT16 LogDataStartOffset;
+ UINT8 AccessMethod;
+ UINT8 LogStatus;
+ UINT32 LogChangeToken;
+ UINT32 AccessMethodAddress;
+ UINT8 LogHeaderFormat;
+ UINT8 NumberOfSupportedLogType;
+ UINT8 LengthOfLogDescriptor;
+ EFI_PHYSICAL_ADDRESS EventLogTypeDescriptors; // Pointer to EFI_MISC_EVENT_LOG_TYPE
} EFI_MISC_SYSTEM_EVENT_LOG;
//
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h
index fc094b7b9c..f55bd30830 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -49,6 +49,7 @@ typedef STRING_REF EFI_PROCESSOR_MANUFACTURER_DATA;
typedef STRING_REF EFI_PROCESSOR_SERIAL_NUMBER_DATA;
typedef STRING_REF EFI_PROCESSOR_ASSET_TAG_DATA;
+
typedef STRING_REF EFI_PROCESSOR_PART_NUMBER_DATA;
typedef struct {
@@ -159,6 +160,10 @@ typedef enum {
EfiProcessorFamilyPowerPC620 = 0x25,
EfiProcessorFamilyPowerPC704 = 0x26,
EfiProcessorFamilyPowerPC750 = 0x27,
+ EfiProcessorFamilyIntelCoreDuo = 0x28,
+ EfiProcessorFamilyIntelCoreDuoMobile = 0x29,
+ EfiProcessorFamilyIntelCoreSoloMobile = 0x2A,
+ EfiProcessorFamilyIntelAtom = 0x2B,
EfiProcessorFamilyAlpha2 = 0x30,
EfiProcessorFamilyAlpha21064 = 0x31,
EfiProcessorFamilyAlpha21066 = 0x32,
@@ -201,6 +206,12 @@ typedef enum {
EfiProcessorFamilyDualCoreAmdOpteron = 0x87,
EfiProcessorFamilyAmdAthlon64X2DualCore = 0x88,
EfiProcessorFamilyAmdTurion64X2Mobile = 0x89,
+ EfiProcessorFamilyQuadCoreAmdOpteron = 0x8A,
+ EfiProcessorFamilyThirdGenerationAmdOpteron = 0x8B,
+ EfiProcessorFamilyAmdPhenomFxQuadCore = 0x8C,
+ EfiProcessorFamilyAmdPhenomX4QuadCore = 0x8D,
+ EfiProcessorFamilyAmdPhenomX2DualCore = 0x8E,
+ EfiProcessorFamilyAmdAthlonX2DualCore = 0x8F,
EfiProcessorFamilyPARISC = 0x90,
EfiProcessorFamilyPaRisc8500 = 0x91,
EfiProcessorFamilyPaRisc8000 = 0x92,
@@ -209,6 +220,21 @@ typedef enum {
EfiProcessorFamilyPaRisc7100LC = 0x95,
EfiProcessorFamilyPaRisc7100 = 0x96,
EfiProcessorFamilyV30 = 0xA0,
+ EfiProcessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
+ EfiProcessorFamilyDualCoreIntelXeon3000Series = 0xA2,
+ EfiProcessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
+ EfiProcessorFamilyDualCoreIntelXeon5100Series = 0xA4,
+ EfiProcessorFamilyDualCoreIntelXeon5000Series = 0xA5,
+ EfiProcessorFamilyDualCoreIntelXeonLV = 0xA6,
+ EfiProcessorFamilyDualCoreIntelXeonULV = 0xA7,
+ EfiProcessorFamilyDualCoreIntelXeon7100Series = 0xA8,
+ EfiProcessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
+ EfiProcessorFamilyQuadCoreIntelXeon = 0xAA,
+ EfiProcessorFamilyDualCoreIntelXeon5200Series = 0xAB,
+ EfiProcessorFamilyDualCoreIntelXeon7200Series = 0xAC,
+ EfiProcessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
+ EfiProcessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
+ EfiProcessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
EfiProcessorFamilyPentiumIIIXeon = 0xB0,
EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,
EfiProcessorFamilyPentium4 = 0xB2,
@@ -222,9 +248,17 @@ typedef enum {
EfiProcessorFamilyIntelCeleronD = 0xBA,
EfiProcessorFamilyIntelPentiumD = 0xBB,
EfiProcessorFamilyIntelPentiumEx = 0xBC,
- EfiProcessorFamilyIntelCoreBrand = 0xBD,
+ EfiProcessorFamilyIntelCoreSolo = 0xBD, // SMBIOS spec 2.6 correct this value
EfiProcessorFamilyReserved = 0xBE,
EfiProcessorFamilyIntelCore2 = 0xBF,
+ EfiProcessorFamilyIntelCore2Solo = 0xC0,
+ EfiProcessorFamilyIntelCore2Extreme = 0xC1,
+ EfiProcessorFamilyIntelCore2Quad = 0xC2,
+ EfiProcessorFamilyIntelCore2ExtremeMobile = 0xC3,
+ EfiProcessorFamilyIntelCore2DuoMobile = 0xC4,
+ EfiProcessorFamilyIntelCore2SoloMobile = 0xC5,
+ EfiProcessorFamilyIntelCoreI7 = 0xC6,
+ EfiProcessorFamilyDualCoreIntelCeleron = 0xC7,
EfiProcessorFamilyIBM390 = 0xC8,
EfiProcessorFamilyG4 = 0xC9,
EfiProcessorFamilyG5 = 0xCA,
@@ -234,6 +268,20 @@ typedef enum {
EfiProcessorFamilyViaC7D = 0xD3,
EfiProcessorFamilyViaC7 = 0xD4,
EfiProcessorFamilyViaEden = 0xD5,
+ EfiProcessorFamilyMultiCoreIntelXeon = 0xD6,
+ EfiProcessorFamilyDualCoreIntelXeon3Series = 0xD7,
+ EfiProcessorFamilyQuadCoreIntelXeon3Series = 0xD8,
+ EfiProcessorFamilyDualCoreIntelXeon5Series = 0xDA,
+ EfiProcessorFamilyQuadCoreIntelXeon5Series = 0xDB,
+ EfiProcessorFamilyDualCoreIntelXeon7Series = 0xDD,
+ EfiProcessorFamilyQuadCoreIntelXeon7Series = 0xDE,
+ EfiProcessorFamilyMultiCoreIntelXeon7Series = 0xDF,
+ EfiProcessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
+ EfiProcessorFamilyAmdPhenomTripleCore = 0xE7,
+ EfiProcessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
+ EfiProcessorFamilyAmdTurionDualCoreMobile = 0xE9,
+ EfiProcessorFamilyAmdAthlonDualCore = 0xEA,
+ EfiProcessorFamilyAmdSempronSI = 0xEB,
EfiProcessorFamilyi860 = 0xFA,
EfiProcessorFamilyi960 = 0xFB,
EfiProcessorFamilyIndicatorFamily2 = 0xFE
@@ -314,7 +362,8 @@ typedef enum {
EfiProcessorSocketLGA775 = 0x15,
EfiProcessorSocketS1 = 0x16,
EfiProcessorSocketAm2 = 0x17,
- EfiProcessorSocketF = 0x18
+ EfiProcessorSocketF = 0x18,
+ EfiProcessorSocketLGA1366 = 0x19
} EFI_PROCESSOR_SOCKET_TYPE_DATA;
typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h b/EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h
index f2e996a794..cae8aec161 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -59,6 +59,11 @@ typedef struct {
VOID* CapsulePtr[1];
} EFI_CAPSULE_TABLE;
+//
+// This struct is deprecated because VendorTable entries physical address will not be fixed up when
+// transitioning from preboot to runtime phase. So we don't need CapsuleInfoTable to record capsule
+// GUIDs any more for runtime convert.
+//
typedef struct {
UINT32 CapsuleGuidNumber;
EFI_GUID CapsuleGuidPtr[1];
@@ -66,6 +71,7 @@ typedef struct {
//
// This GUID is used for collecting all capsules' Guids who install in ConfigTable.
+// This GUID is deprecated as well.
//
#define EFI_CAPSULE_INFO_GUID \
{ \
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h b/EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
index c5c180d337..1db788670f 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -50,11 +50,10 @@ typedef enum {
} EFI_PEI_PCI_CFG_PPI_WIDTH;
#define EFI_PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) \
- ( ((bus) << 24) | \
- ((dev) << 16) | \
- ((func) << 8) | \
- ((reg) < 256 ? (reg): ((UINT64)(reg) << 32)))
-
+ (UINT64) ((((UINTN) (bus)) << 24) | \
+ (((UINTN) (dev)) << 16) | \
+ (((UINTN) (func)) << 8) | \
+ ((reg) < 256 ? ((UINTN) (reg)): ((UINT64) (reg) << 32)))
#if (PI_SPECIFICATION_VERSION < 0x00010000)
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h b/EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h
index 5d1ce1f63f..e37baeb10c 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -361,8 +361,8 @@ EFI_STATUS
(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN EFI_FV_FILETYPE SearchType,
- IN CONST EFI_PEI_FV_HANDLE *FwVolHeader,
- IN OUT EFI_PEI_FILE_HANDLE **FileHandle
+ IN CONST EFI_PEI_FV_HANDLE FvHandle,
+ IN OUT EFI_PEI_FILE_HANDLE *FileHandle
);
typedef
@@ -370,7 +370,7 @@ EFI_STATUS
(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (
IN CONST EFI_PEI_SERVICES **PeiServices,
IN EFI_SECTION_TYPE SectionType,
- IN EFI_PEI_FILE_HANDLE *FileHandle,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
OUT VOID **SectionData
);
@@ -443,7 +443,7 @@ EFI_STATUS
typedef
EFI_STATUS
(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (
- IN EFI_PEI_FV_HANDLE *VolumeHandle,
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
OUT EFI_FV_INFO *VolumeInfo
);
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h b/EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h
index c8eec3d946..4f6cb395d6 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -22,28 +22,11 @@ Abstract:
#ifndef _TIANO_SPEC_DEVICE_PATH_H
#define _TIANO_SPEC_DEVICE_PATH_H
-#pragma pack(1)
+#include "EfiDevicePath.h"
-#if (EFI_SPECIFICATION_VERSION <= 0x00020000)
//
-// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
-// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
-// EFI 1.10 and UEFI 2.10.
+// MEDIA_FW_VOL_FILEPATH_DEVICE_PATH and MEDIA_FW_VOL_DEVICE_PATH are defined in
+// EfiDevicePath.h
//
-#define MEDIA_FV_FILEPATH_DP 0x06
-typedef struct {
- EFI_DEVICE_PATH_PROTOCOL Header;
- EFI_GUID NameGuid;
-} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
-#endif
-
-
-#if (EFI_SPECIFICATION_VERSION > 0x00020000)
-//
-// EFI Specification extension on Media Device Path was added to UEFI 2.1 specification,
-// so the definition is moved to EfiDevicePath.h
-//
-#endif
-#pragma pack()
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf b/EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf
index b391215839..cba842faa1 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -102,4 +102,7 @@ COMPONENT_TYPE= LIBRARY
GuidedSectionExtraction/GuidedSectionExtraction.c
EcpPciCfg/EcpPciCfg.h
EcpPciCfg/EcpPciCfg.c
-
+ TemporaryRamSupport/TemporaryRamSupport.h
+ TemporaryRamSupport/TemporaryRamSupport.c
+ LoadedImage/LoadedImage.h
+ LoadedImage/LoadedImage.c
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h b/EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h
index 006a4fb23a..e3740169ae 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -77,7 +77,7 @@ EFI_STATUS
(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME) (
IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
IN CONST EFI_GUID *FileName,
- IN EFI_PEI_FV_HANDLE FvHandle,
+ IN OUT EFI_PEI_FV_HANDLE *FvHandle,
OUT EFI_PEI_FILE_HANDLE *FileHandle
);
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c
new file mode 100644
index 0000000000..09d4a8ba0f
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c
@@ -0,0 +1,30 @@
+/*++
+
+Copyright (c) 2009 - 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:
+
+ LoadedImage.c
+
+Abstract:
+
+ The file describes the PPI which notifies other drivers
+ of the PEIM being initialized by the PEI Dispatcher.
+
+--*/
+
+#include "Tiano.h"
+#include "PeiBind.h"
+#include "PeiApi.h"
+#include EFI_PPI_DEFINITION (LoadedImage)
+
+EFI_GUID gEfiPeiLoadedImagePpiGuid = EFI_PEI_LOADED_IMAGE_PPI_GUID;
+
+EFI_GUID_STRING(&gEfiPeiLoadedImagePpiGuid, "LoadedImagePpi", "LoadedImage PPI");
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h
new file mode 100644
index 0000000000..909b1091d4
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h
@@ -0,0 +1,56 @@
+/*++
+
+Copyright (c) 2009 - 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:
+
+ LoadedImage.h
+
+Abstract:
+
+ The file describes the PPI which notifies other drivers
+ of the PEIM being initialized by the PEI Dispatcher.
+
+--*/
+
+#ifndef __LOADED_IMAGE_PPI_H__
+#define __LOADED_IMAGE_PPI_H__
+
+#include "Tiano.h"
+
+#define EFI_PEI_LOADED_IMAGE_PPI_GUID \
+ { 0xc1fcd448, 0x6300, 0x4458, {0xb8, 0x64, 0x28, 0xdf, 0x01, 0x53, 0x64, 0xbc} }
+
+typedef struct _EFI_PEI_LOADED_IMAGE_PPI EFI_PEI_LOADED_IMAGE_PPI;
+
+///
+/// This interface is installed by the PEI Dispatcher after the image has been
+/// loaded and after all security checks have been performed,
+/// to notify other PEIMs of the files which are being loaded.
+///
+struct _EFI_PEI_LOADED_IMAGE_PPI {
+ ///
+ /// Address of the image at the address where it will be executed.
+ ///
+ EFI_PHYSICAL_ADDRESS ImageAddress;
+ ///
+ /// Size of the image as it will be executed.
+ ///
+ UINT64 ImageSize;
+ ///
+ /// File handle from which the image was loaded.
+ /// Can be NULL, indicating the image was not loaded from a handle.
+ ///
+ EFI_PEI_FILE_HANDLE FileHandle;
+};
+
+extern EFI_GUID gEfiPeiLoadedImagePpiGuid;
+
+#endif
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c
new file mode 100644
index 0000000000..b4a2b86645
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c
@@ -0,0 +1,30 @@
+/*++
+
+Copyright (c) 2009 - 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:
+
+ TemporaryRamSupport.c
+
+Abstract:
+
+ This file declares Temporary RAM Support PPI.
+ This Ppi provides the service that migrates temporary RAM into permanent memory.
+
+--*/
+
+#include "Tiano.h"
+#include "PeiBind.h"
+#include "PeiApi.h"
+#include EFI_PPI_DEFINITION (TemporaryRamSupport)
+
+EFI_GUID gEfiTemporaryRamSupportPpiGuid = TEMPORARY_RAM_SUPPORT_PPI_GUID;
+
+EFI_GUID_STRING(&gEfiTemporaryRamSupportPpiGuid, "TemporaryRamSupportPpi", "TemporaryRamSupport PPI");
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h
new file mode 100644
index 0000000000..635c3f8f25
--- /dev/null
+++ b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h
@@ -0,0 +1,66 @@
+/*++
+
+Copyright (c) 2009 - 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:
+
+ TemporaryRamSupport.h
+
+Abstract:
+
+ This file declares Temporary RAM Support PPI.
+ This Ppi provides the service that migrates temporary RAM into permanent memory.
+
+--*/
+
+#ifndef __TEMPORARY_RAM_SUPPORT_H__
+#define __TEMPORARY_RAM_SUPPORT_H__
+
+#include "Tiano.h"
+
+#define TEMPORARY_RAM_SUPPORT_PPI_GUID \
+ { \
+ 0xdbe23aa9, 0xa345, 0x4b97, {0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} \
+ }
+
+/**
+ This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
+ permanent memory.
+
+ @param PeiServices Pointer to the PEI Services Table.
+ @param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
+ Temporary RAM contents.
+ @param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
+ Temporary RAM contents.
+ @param CopySize Amount of memory to migrate from temporary to permanent memory.
+
+ @retval EFI_SUCCESS The data was successfully returned.
+ @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when TemporaryMemoryBase > PermanentMemoryBase.
+
+ **/
+typedef
+EFI_STATUS
+(EFIAPI * TEMPORARY_RAM_MIGRATION)(
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
+ IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
+ IN UINTN CopySize
+);
+
+///
+/// This service abstracts the ability to migrate contents of the platform early memory store.
+///
+typedef struct {
+ TEMPORARY_RAM_MIGRATION TemporaryRamMigration;
+} TEMPORARY_RAM_SUPPORT_PPI;
+
+extern EFI_GUID gEfiTemporaryRamSupportPpiGuid;
+
+#endif
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c b/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c
index ffa2f5b362..30cff849db 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c
+++ b/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -27,5 +27,7 @@ Abstract:
#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;
+EFI_GUID gEfiFirmwareVolumeBlock2ProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;
EFI_GUID_STRING(&gEfiFirmwareVolumeBlockProtocolGuid, "FirmwareVolumeBlock Protocol", "Firmware Volume Block protocol");
+EFI_GUID_STRING(&gEfiFirmwareVolumeBlock2ProtocolGuid, "FirmwareVolumeBlock2 Protocol", "Firmware Volume Block2 protocol");
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h b/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h
index d431aedc5d..a2fd4e9d7a 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+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
@@ -40,6 +40,8 @@ Abstract:
EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL);
+typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL;
+
typedef
EFI_STATUS
(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h b/EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h
index c28852c64b..6e3691cb3b 100644
--- a/EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h
+++ b/EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -174,10 +174,17 @@ typedef struct {
UINT16 command_set_feature_enb_86; // word 86
UINT16 command_set_feature_default; // word 87
UINT16 ultra_dma_mode; // word 88
- UINT16 reserved_89_127[39];
+ UINT16 reserved_89_105[17];
+ UINT16 phy_logic_sector_support; // word 106
+ UINT16 reserved_107_116[10];
+ UINT16 logic_sector_size_lo; // word 117
+ UINT16 logic_sector_size_hi; // word 118
+ UINT16 reserved_119_127[9];
UINT16 security_status;
UINT16 vendor_data_129_159[31];
- UINT16 reserved_160_255[96];
+ UINT16 reserved_160_208[49];
+ UINT16 alignment_logic_in_phy_blocks; // word 209
+ UINT16 reserved_210_255[46];
} EFI_ATA_IDENTIFY_DATA;
#pragma pack()
diff --git a/EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h b/EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h
index 4c1462712c..a2e6fd4f5b 100644
--- a/EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h
+++ b/EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -28,6 +28,7 @@ Abstract:
0x3c699197, 0x93c, 0x4c69, {0xb0, 0x6b, 0x12, 0x8a, 0xe3, 0x48, 0x1d, 0xc9} \
}
+#pragma pack(1)
typedef struct {
UINT8 AddressSpaceId;
UINT8 RegisterBitWidth;
@@ -52,7 +53,6 @@ typedef struct {
// Following structure defines ACPI Description information.
// This information is platform specific, may be consumed by DXE generic driver.
//
-#pragma pack(1)
typedef struct _EFI_ACPI_DESCRIPTION {
//
// For Timer
diff --git a/EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h b/EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h
index 8e5025161f..396d89cbd4 100644
--- a/EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h
+++ b/EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -20,6 +20,7 @@ Abstract:
--*/
#ifndef _PCI_OPTION_ROM_TABLE_GUID_H_
+#define _PCI_OPTION_ROM_TABLE_GUID_H_
#define EFI_PCI_OPTION_ROM_TABLE_GUID \
{ 0x7462660f, 0x1cbd, 0x48da, {0xad, 0x11, 0x91, 0x71, 0x79, 0x13, 0x83, 0x1c} }
diff --git a/EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h b/EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h
index 7fc640de96..57f91b7ff3 100644
--- a/EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h
+++ b/EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -75,6 +75,9 @@ typedef struct {
#ifdef EFI_NT_EMULATOR
VOID **ModHandle;
#endif
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+ EFI_PHYSICAL_ADDRESS HiiResourceData;
+#endif
} EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT;
typedef
diff --git a/EdkCompatibilityPkg/Foundation/Include/EfiSpec.h b/EdkCompatibilityPkg/Foundation/Include/EfiSpec.h
index d64c2b2b56..31b50deb8b 100644
--- a/EdkCompatibilityPkg/Foundation/Include/EfiSpec.h
+++ b/EdkCompatibilityPkg/Foundation/Include/EfiSpec.h
@@ -33,19 +33,5 @@ Abstract:
#include "EfiApi.h"
#include "EfiDevicePath.h"
-//
-// 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)
-//
-// 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 TIANO_RELEASE_VERSION versions
-#endif
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Include/EfiTpm.h b/EdkCompatibilityPkg/Foundation/Include/EfiTpm.h
index 6d03ec4896..07a7fec735 100644
--- a/EdkCompatibilityPkg/Foundation/Include/EfiTpm.h
+++ b/EdkCompatibilityPkg/Foundation/Include/EfiTpm.h
@@ -25,7 +25,12 @@ Abstract:
#define _EFI_TPM_H_
#include "Tiano.h"
-#include "IndustryStandard/Tpm12.h"
+
+//
+// The start of TPM return codes
+//
+#define TPM_BASE (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))
+#include "Tpm12.h"
//
// Standard event types
diff --git a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h
index 89b3015713..901bd52ea7 100644
--- a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h
+++ b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -22,6 +22,32 @@ Abstract:
#include "Tiano.h"
+//
+// Reference SMBIOS 2.6, chapter 3.1.2.
+// For v2.1 and later, handle values in the range 0FF00h to 0FFFFh are reserved for
+// use by this specification.
+//
+#define SMBIOS_HANDLE_RESERVED_BEGIN 0xFF00
+
+//
+// Reference SMBIOS 2.6, chapter 3.1.3
+// Each text string is limited to 64 significant characters due to system MIF limitations
+//
+#define SMBIOS_STRING_MAX_LENGTH 64
+
+//
+// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.43.
+// Upper-level software that interprets the SMBIOS structure-table should bypass an
+// Inactive structure just like a structure type that the software does not recognize.
+//
+#define SMBIOS_TYPE_INACTIVE 0x007E
+
+//
+// End-of-table type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.44.
+// The end-of-table indicator is used in the last physical structure in a table
+//
+#define SMBIOS_TYPE_END_OF_TABLE 0x007F
+
#pragma pack(1)
typedef UINT8 SMBIOS_TABLE_STRING;
diff --git a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h
index 0ba14cecfb..aa54b384ee 100644
--- a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h
+++ b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h
@@ -15,7 +15,7 @@ Module Name:
Abstract:
- TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)
+ TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103)
See http://trustedcomputinggroup.org for latest specification updates
@@ -39,6 +39,7 @@ Abstract:
typedef UINT8 TPM_AUTH_DATA_USAGE;
typedef UINT8 TPM_PAYLOAD_TYPE;
typedef UINT8 TPM_VERSION_BYTE;
+typedef UINT8 TPM_DA_STATE;
typedef UINT16 TPM_TAG;
typedef UINT16 TPM_PROTOCOL_ID;
typedef UINT16 TPM_STARTUP_TYPE;
@@ -144,6 +145,9 @@ typedef UINT32 TPM_FAMILY_OPERATION;
#define TPM_TAG_CMK_SIGTICKET ((TPM_STRUCTURE_TAG) 0x0034)
#define TPM_TAG_CMK_MA_APPROVAL ((TPM_STRUCTURE_TAG) 0x0035)
#define TPM_TAG_QUOTE_INFO2 ((TPM_STRUCTURE_TAG) 0x0036)
+#define TPM_TAG_DA_INFO ((TPM_STRUCTURE_TAG) 0x0037)
+#define TPM_TAG_DA_LIMITED ((TPM_STRUCTURE_TAG) 0x0038)
+#define TPM_TAG_DA_ACTION_TYPE ((TPM_STRUCTURE_TAG) 0x0039)
//
// Part 2, section 4: TPM Types
@@ -190,6 +194,7 @@ typedef UINT32 TPM_FAMILY_OPERATION;
#define TPM_ET_DEL_KEY_BLOB ((UINT16) 0x0009) // The entity is a delegate key blob
#define TPM_ET_COUNTER ((UINT16) 0x000A) // The entity is a counter
#define TPM_ET_NV ((UINT16) 0x000B) // The entity is a NV index
+#define TPM_ET_OPERATOR ((UINT16) 0x000C) // The entity is the operator
#define TPM_ET_RESERVED_HANDLE ((UINT16) 0x0040) // Reserved. This value avoids collisions with the handle MSB setting.
//
// TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable
@@ -323,8 +328,6 @@ typedef TPM_DIGEST TPM_DIRVALUE; // This SHALL be the value of
typedef TPM_DIGEST TPM_HMAC;
typedef TPM_DIGEST TPM_PCRVALUE; // The value inside of the PCR
typedef TPM_DIGEST TPM_AUDITDIGEST; // This SHALL be the value of the current internal audit state
-typedef TPM_DIGEST TPM_DAA_TPM_SEED; // This SHALL be a random value generated by a TPM immediately after the EK is installed in that TPM, whenever an EK is installed in that TPM
-typedef TPM_DIGEST TPM_DAA_CONTEXT_SEED; // This SHALL be a random value
//
// Part 2, section 5.5: TPM_NONCE
@@ -333,6 +336,9 @@ typedef struct tdTPM_NONCE{
UINT8 nonce[20];
} TPM_NONCE;
+typedef TPM_NONCE TPM_DAA_TPM_SEED; // This SHALL be a random value generated by a TPM immediately after the EK is installed in that TPM, whenever an EK is installed in that TPM
+typedef TPM_NONCE TPM_DAA_CONTEXT_SEED; // This SHALL be a random value
+
//
// Part 2, section 5.6: TPM_AUTHDATA
//
@@ -393,7 +399,8 @@ typedef struct tdTPM_KEY_HANDLE_LIST {
#define TPM_ES_NONE ((TPM_ENC_SCHEME) 0x0001)
#define TPM_ES_RSAESPKCSv15 ((TPM_ENC_SCHEME) 0x0002)
#define TPM_ES_RSAESOAEP_SHA1_MGF1 ((TPM_ENC_SCHEME) 0x0003)
-#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004)
+#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004) // rev94 defined
+#define TPM_ES_SYM_CTR ((TPM_ENC_SCHEME) 0x0004)
#define TPM_ES_SYM_OFB ((TPM_ENC_SCHEME) 0x0005)
#define TPM_SS_NONE ((TPM_SIG_SCHEME) 0x0001)
@@ -584,6 +591,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
BOOLEAN readSRKPub;
BOOLEAN tpmEstablished;
BOOLEAN maintenanceDone;
+ BOOLEAN disableFullDALogicInfo;
} TPM_PERMANENT_FLAGS;
//
@@ -608,6 +616,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
#define TPM_PF_READSRKPUB ((TPM_CAPABILITY_AREA) 17)
#define TPM_PF_TPMESTABLISHED ((TPM_CAPABILITY_AREA) 18)
#define TPM_PF_MAINTENANCEDONE ((TPM_CAPABILITY_AREA) 19)
+#define TPM_PF_DISABLEFULLDALOGICINFO ((TPM_CAPABILITY_AREA) 20)
//
// Part 2, section 7.2: TPM_STCLEAR_FLAGS
@@ -655,10 +664,11 @@ typedef struct tdTPM_STANY_FLAGS{
//
// Part 2, section 7.4: TPM_PERMANENT_DATA
//
-//#define TPM_MIN_COUNTERS 4 // the minimum number of counters is 4
-//#define TPM_DELEGATE_KEY TPM_KEY
-//#define TPM_NUM_PCR 16
-//#define TPM_MAX_NV_WRITE_NOOWNER 64
+#define TPM_MIN_COUNTERS 4 // the minimum number of counters is 4
+#define TPM_DELEGATE_KEY TPM_KEY
+#define TPM_NUM_PCR 16
+#define TPM_MAX_NV_WRITE_NOOWNER 64
+
//typedef struct tdTPM_PERMANENT_DATA
//{
// TPM_STRUCTURE_TAG tag;
@@ -686,20 +696,62 @@ typedef struct tdTPM_STANY_FLAGS{
// UINT32 noOwnerNVWrite;
// TPM_CMK_DELEGATE restrictDelegate;
// TPM_DAA_TPM_SEED tpmDAASeed;
+// TPM_NONCE daaProff;
+// TPM_KEY daaBlobKey;
//} TPM_PERMANENT_DATA;
//
+// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability
+//
+#define TPM_PD_REVMAJOR ((TPM_CAPABILITY_AREA) 1)
+#define TPM_PD_REVMINOR ((TPM_CAPABILITY_AREA) 2)
+#define TPM_PD_TPMPROOF ((TPM_CAPABILITY_AREA) 3)
+#define TPM_PD_OWNERAUTH ((TPM_CAPABILITY_AREA) 4)
+#define TPM_PD_OPERATORAUTH ((TPM_CAPABILITY_AREA) 5)
+#define TPM_PD_MANUMAINTPUB ((TPM_CAPABILITY_AREA) 6)
+#define TPM_PD_ENDORSEMENTKEY ((TPM_CAPABILITY_AREA) 7)
+#define TPM_PD_SRK ((TPM_CAPABILITY_AREA) 8)
+#define TPM_PD_DELEGATEKEY ((TPM_CAPABILITY_AREA) 9)
+#define TPM_PD_CONTEXTKEY ((TPM_CAPABILITY_AREA) 10)
+#define TPM_PD_AUDITMONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 11)
+#define TPM_PD_MONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 12)
+#define TPM_PD_PCRATTRIB ((TPM_CAPABILITY_AREA) 13)
+#define TPM_PD_ORDINALAUDITSTATUS ((TPM_CAPABILITY_AREA) 14)
+#define TPM_PD_AUTHDIR ((TPM_CAPABILITY_AREA) 15)
+#define TPM_PD_RNGSTATE ((TPM_CAPABILITY_AREA) 16)
+#define TPM_PD_FAMILYTABLE ((TPM_CAPABILITY_AREA) 17)
+#define TPM_DELEGATETABLE ((TPM_CAPABILITY_AREA) 18)
+#define TPM_PD_EKRESET ((TPM_CAPABILITY_AREA) 19)
+#define TPM_PD_MAXNVBUFSIZE ((TPM_CAPABILITY_AREA) 20)
+#define TPM_PD_LASTFAMILYID ((TPM_CAPABILITY_AREA) 21)
+#define TPM_PD_NOOWNERNVWRITE ((TPM_CAPABILITY_AREA) 22)
+#define TPM_PD_RESTRICTDELEGATE ((TPM_CAPABILITY_AREA) 23)
+#define TPM_PD_TPMDAASEED ((TPM_CAPABILITY_AREA) 24)
+#define TPM_PD_DAAPROOF ((TPM_CAPABILITY_AREA) 25)
+
+//
// Part 2, section 7.5: TPM_STCLEAR_DATA
// available inside TPM only
//
-//typedef struct tdTPM_STCLEAR_DATA
-//{
-// TPM_STRUCTURE_TAG tag;
-// TPM_NONCE contextNonceKey;
-// TPM_COUNT_ID countID;
-// UINT32 ownerReference;
-// BOOLEAN disableResetLock;
-//} TPM_STCLEAR_DATA;
+ typedef struct tdTPM_STCLEAR_DATA{
+ TPM_STRUCTURE_TAG tag;
+ TPM_NONCE contextNonceKey;
+ TPM_COUNT_ID countID;
+ UINT32 ownerReference;
+ BOOLEAN disableResetLock;
+ TPM_PCRVALUE PCR[TPM_NUM_PCR];
+ UINT32 deferredPhysicalPresence;
+ }TPM_STCLEAR_DATA;
+
+//
+// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability
+//
+#define TPM_SD_CONTEXTNONCEKEY ((TPM_CAPABILITY_AREA)0x00000001)
+#define TPM_SD_COUNTID ((TPM_CAPABILITY_AREA)0x00000002)
+#define TPM_SD_OWNERREFERENCE ((TPM_CAPABILITY_AREA)0x00000003)
+#define TPM_SD_DISABLERESETLOCK ((TPM_CAPABILITY_AREA)0x00000004)
+#define TPM_SD_PCR ((TPM_CAPABILITY_AREA)0x00000005)
+#define TPM_SD_DEFERREDPHYSICALPRESENCE ((TPM_CAPABILITY_AREA)0x00000006)
//
// Part 2, section 7.6: TPM_STANY_DATA
@@ -717,6 +769,16 @@ typedef struct tdTPM_STANY_FLAGS{
//} TPM_STANY_DATA;
//
+// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability
+//
+#define TPM_AD_CONTEXTNONCESESSION ((TPM_CAPABILITY_AREA) 1)
+#define TPM_AD_AUDITDIGEST ((TPM_CAPABILITY_AREA) 2)
+#define TPM_AD_CURRENTTICKS ((TPM_CAPABILITY_AREA) 3)
+#define TPM_AD_CONTEXTCOUNT ((TPM_CAPABILITY_AREA) 4)
+#define TPM_AD_CONTEXTLIST ((TPM_CAPABILITY_AREA) 5)
+#define TPM_AD_SESSIONS ((TPM_CAPABILITY_AREA) 6)
+
+//
// Part 2, section 8: PCR Structures
//
@@ -1137,7 +1199,9 @@ typedef struct tdTPM_AUDIT_EVENT_OUT
//
// Part 2, section 16: Return Codes
//
-#define TPM_BASE 0
+#ifndef TPM_BASE
+#error "TPM Error Codes require definition of TPM_BASE"
+#endif
#define TPM_VENDOR_ERROR TPM_Vendor_Specific32
#define TPM_NON_FATAL 0x00000800
@@ -1498,12 +1562,14 @@ typedef struct tdTPM_NV_DATA_PUBLIC
//
//
-// Part 2, section 20.3: Owner Permissions Settings for per1 bits
+// Part 2, section 20.2.1: Owner Permissions Settings for per1 bits
//
#define TPM_DELEGATE_SetOrdinalAuditStatus (((UINT32)1)<<30)
#define TPM_DELEGATE_DirWriteAuth (((UINT32)1)<<29)
#define TPM_DELEGATE_CMK_ApproveMA (((UINT32)1)<<28)
+#define TPM_DELEGATE_NV_WriteValue (((UINT32)1)<<27)
#define TPM_DELEGATE_CMK_CreateTicket (((UINT32)1)<<26)
+#define TPM_DELEGATE_NV_ReadValue (((UINT32)1)<<25)
#define TPM_DELEGATE_Delegate_LoadOwnerDelegation (((UINT32)1)<<24)
#define TPM_DELEGATE_DAA_Join (((UINT32)1)<<23)
#define TPM_DELEGATE_AuthorizeMigrationKey (((UINT32)1)<<22)
@@ -1514,6 +1580,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
#define TPM_DELEGATE_ResetLockValue (((UINT32)1)<<17)
#define TPM_DELEGATE_OwnerClear (((UINT32)1)<<16)
#define TPM_DELEGATE_DisableOwnerClear (((UINT32)1)<<15)
+#define TPM_DELEGATE_NV_DefineSpace (((UINT32)1)<<14)
#define TPM_DELEGATE_OwnerSetDisable (((UINT32)1)<<13)
#define TPM_DELEGATE_SetCapability (((UINT32)1)<<12)
#define TPM_DELEGATE_MakeIdentity (((UINT32)1)<<11)
@@ -1530,7 +1597,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
#define TPM_DELEGATE_DAA_Sign (((UINT32)1)<<0)
//
-// Part 2, section 20.3: Key Permissions Settings for per1 bits
+// Part 2, section 20.2.3: Key Permissions Settings for per1 bits
//
#define TPM_KEY_DELEGATE_CMK_ConvertMigration (((UINT32)1)<<28)
#define TPM_KEY_DELEGATE_TickStampBlob (((UINT32)1)<<27)
@@ -1723,6 +1790,15 @@ typedef struct tdTPM_DELEGATE_KEY_BLOB
#define TPM_CAP_PROP_INPUT_BUFFER ((TPM_CAPABILITY_AREA) 0x00000124)
//
+// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability
+//
+#define TPM_SET_PERM_FLAGS ((TPM_CAPABILITY_AREA) 0x00000001)
+#define TPM_SET_PERM_DATA ((TPM_CAPABILITY_AREA) 0x00000002)
+#define TPM_SET_STCLEAR_FLAGS ((TPM_CAPABILITY_AREA) 0x00000003)
+#define TPM_SET_STCLEAR_DATA ((TPM_CAPABILITY_AREA) 0x00000004)
+#define TPM_SET_STANY_FLAGS ((TPM_CAPABILITY_AREA) 0x00000005)
+#define TPM_SET_STANY_DATA ((TPM_CAPABILITY_AREA) 0x00000006)
+
// Part 2, section 21.6: TPM_CAP_VERSION_INFO
// [size_is(vendorSpecificSize)] BYTE* vendorSpecific;
//
@@ -1737,6 +1813,50 @@ typedef struct tdTPM_CAP_VERSION_INFO {
} TPM_CAP_VERSION_INFO;
//
+// Part 2, section 21.10: TPM_DA_ACTION_TYPE
+//
+typedef struct tdTPM_DA_ACTION_TYPE {
+ TPM_STRUCTURE_TAG tag;
+ UINT32 actions;
+} TPM_DA_ACTION_TYPE;
+
+#define TPM_DA_ACTION_FAILURE_MODE (((UINT32)1)<<3)
+#define TPM_DA_ACTION_DEACTIVATE (((UINT32)1)<<2)
+#define TPM_DA_ACTION_DISABLE (((UINT32)1)<<1)
+#define TPM_DA_ACTION_TIMEOUT (((UINT32)1)<<0)
+
+//
+// Part 2, section 21.7: TPM_DA_INFO
+//
+typedef struct tdTPM_DA_INFO {
+ TPM_STRUCTURE_TAG tag;
+ TPM_DA_STATE state;
+ UINT16 currentCount;
+ UINT16 thresholdCount;
+ TPM_DA_ACTION_TYPE actionAtThreshold;
+ UINT32 actionDependValue;
+ UINT32 vendorDataSize;
+ UINT8 *vendorData;
+} TPM_DA_INFO;
+
+//
+// Part 2, section 21.8: TPM_DA_INFO_LIMITED
+//
+typedef struct tdTPM_DA_INFO_LIMITED {
+ TPM_STRUCTURE_TAG tag;
+ TPM_DA_STATE state;
+ TPM_DA_ACTION_TYPE actionAtThreshold;
+ UINT32 vendorDataSize;
+ UINT8 *vendorData;
+} TPM_DA_INFO_LIMITED;
+
+//
+// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability
+//
+#define TPM_DA_STATE_INACTIVE ((UINT8)0x00)
+#define TPM_DA_STATE_ACTIVE ((UINT8)0x01)
+
+//
// Part 2, section 22: DAA Structures
//
diff --git a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h
index 0957c86d25..e1be8f5a87 100644
--- a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h
+++ b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -25,6 +25,16 @@ Revision History
#include "pci22.h"
+//
+// PCI_CLASS_MASS_STORAGE
+//
+#define PCI_CLASS_MASS_STORAGE_ATA 0x05
+
+//
+// PCI_CLASS_SERIAL
+//
+#define PCI_CLASS_SERIAL_IB 0x06
+
#define PCI_EXP_MAX_CONFIG_OFFSET 0x1000
#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
diff --git a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h
index 2c2025583b..0ae3bfd336 100644
--- a/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h
+++ b/EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -56,6 +56,7 @@ Revision History
#define EFI_SCSI_OP_READ6 0x08
#define EFI_SCSI_OP_READ10 0x28
#define EFI_SCSI_OP_READ_CAPACITY 0x25
+#define EFI_SCSI_OP_READ_CAPACITY16 0x9e
#define EFI_SCSI_OP_READ_DEFECT 0x37
#define EFI_SCSI_OP_READ_LONG 0x3e
#define EFI_SCSI_OP_REASSIGN_BLK 0x07
@@ -238,6 +239,27 @@ typedef struct {
UINT8 BlockSize0;
} EFI_SCSI_DISK_CAPACITY_DATA;
+typedef struct {
+ UINT8 LastLba7;
+ UINT8 LastLba6;
+ UINT8 LastLba5;
+ UINT8 LastLba4;
+ UINT8 LastLba3;
+ UINT8 LastLba2;
+ UINT8 LastLba1;
+ UINT8 LastLba0;
+ UINT8 BlockSize3;
+ UINT8 BlockSize2;
+ UINT8 BlockSize1;
+ UINT8 BlockSize0;
+ UINT8 Protection;
+ UINT8 LogicPerPhysical;
+ UINT8 LowestAlignLogic2;
+ UINT8 LowestAlignLogic1;
+ UINT8 Reserved[16];
+} EFI_SCSI_DISK_CAPACITY_DATA16;
+
+
#pragma pack()
//
// Sense Key
diff --git a/EdkCompatibilityPkg/Foundation/Include/Tiano.h b/EdkCompatibilityPkg/Foundation/Include/Tiano.h
index f26515251c..159936fa75 100644
--- a/EdkCompatibilityPkg/Foundation/Include/Tiano.h
+++ b/EdkCompatibilityPkg/Foundation/Include/Tiano.h
@@ -27,18 +27,6 @@ Abstract:
#ifndef _TIANO_H_
#define _TIANO_H_
-//
-// 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
-#elif (EFI_SPECIFICATION_VERSION <= 0x00020000)
- #define TIANO_EXTENSION_FLAG
-#endif
#include "TianoCommon.h"
#include "TianoApi.h"
diff --git a/EdkCompatibilityPkg/Foundation/Include/TianoHii.h b/EdkCompatibilityPkg/Foundation/Include/TianoHii.h
index fd97e4215a..ba17702d15 100644
--- a/EdkCompatibilityPkg/Foundation/Include/TianoHii.h
+++ b/EdkCompatibilityPkg/Foundation/Include/TianoHii.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -50,6 +50,11 @@ Revision History
//
#define EFI_IFR_TIANO_GUID \
{ 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }
+//
+// ClassGuid for Front Page
+//
+#define EFI_HII_FRONT_PAGE_CLASS_GUID \
+ { 0x94d411b7, 0x7669, 0x45c3, {0xba, 0x3b, 0xf3, 0xa5, 0x8a, 0x71, 0x56, 0x81} }
#pragma pack(1)
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
index d0aef2f1b6..72f19fbca7 100644
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -34,8 +34,8 @@ COMPONENT_TYPE = LIBRARY
memset.c | GCC
[sources.x64]
- x64/memcpyRep1.asm | MSFT
- x64/memcpyRep1.asm | INTEL
+ x64/memcpyRep4.asm | MSFT
+ x64/memcpyRep4.asm | INTEL
x64/memsetRep4.asm | MSFT
x64/memsetRep4.asm | INTEL
memcpy.c | GCC
diff --git a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
index 909ee60936..bbe3f33d5d 100644
--- a/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -34,7 +34,7 @@ COMPONENT_TYPE = LIBRARY
[sources.x64]
memcpy.c | GCC
- x64/memcpyRep1.asm
+ x64/memcpyRep4.asm
x64/memsetRep4.asm
# x64/memcpy.asm
# x64/memset.asm
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
index 568ac12613..daa01a29a7 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -502,13 +502,6 @@ Routine Description:
Initialize a Firmware Volume (FV) Media Device Path node.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability.
-
Arguments:
FvDevicePathNode - Pointer to a FV device path node to initialize
@@ -520,12 +513,6 @@ Returns:
--*/
{
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
-
FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
@@ -544,15 +531,6 @@ Routine Description:
Check to see if the Firmware Volume (FV) Media Device Path is valid.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability. The return value to this
- function points to a location in FvDevicePathNode and it does not allocate
- new memory for the GUID pointer that is returned.
-
Arguments:
FvDevicePathNode - Pointer to FV device path to check
@@ -564,11 +542,6 @@ Returns:
--*/
{
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
return &FvDevicePathNode->NameGuid;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
index 3de6c59dc2..ef10d41702 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -21,6 +21,18 @@ Abstract:
#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
@@ -50,6 +62,10 @@ Returns:
--*/
{
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ VOID *Registration;
+#endif
+
gST = SystemTable;
ASSERT (gST != NULL);
@@ -70,6 +86,21 @@ Returns:
(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
//
@@ -78,55 +109,107 @@ Returns:
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
+ IN CHAR8 *Language1,
+ IN CHAR8 *Language2
)
/*++
Routine Description:
- Compare whether two names of languages are identical.
+ 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 - Name of language 1
- Language2 - Name of language 2
+ Language1 - The first language code to be tested.
+ Language2 - The second language code to be tested.
Returns:
- TRUE - same
- FALSE - not same
+ TRUE - Language code match.
+ FALSE - Language code mismatch.
--*/
{
UINTN Index;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- for (Index = 0; (Language1[Index] != 0) && (Language2[Index] != 0); Index++) {
- if (Language1[Index] != Language2[Index]) {
- return FALSE;
- }
+ //
+ // Compare first two bytes of language tag
+ //
+ if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {
+ return FALSE;
}
- if (((Language1[Index] == 0) && (Language2[Index] == 0)) ||
- ((Language1[Index] == 0) && (Language2[Index] != ';')) ||
- ((Language1[Index] == ';') && (Language2[Index] != 0)) ||
- ((Language1[Index] == ';') && (Language2[Index] != ';'))) {
- return TRUE;
+ if (IsIso639LanguageCode (Language1)) {
+ //
+ // ISO639-2 language code, compare the third byte of language tag
+ //
+ return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);
}
- return FALSE;
-#else
- for (Index = 0; Index < 3; Index++) {
- if (Language1[Index] != Language2[Index]) {
- return 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 TRUE;
-#endif
+ return FALSE;
}
STATIC
@@ -134,19 +217,39 @@ 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.
+
+--*/
{
-#ifdef LANGUAGE_RFC_3066 // LANGUAGE_RFC_3066
- for (; (*Languages != 0) && (*Languages != ';'); Languages++)
- ;
+ UINTN Index;
- if (*Languages == ';') {
- Languages++;
+ if (IsIso639LanguageCode (Languages)) {
+ //
+ // ISO639-2 language code
+ //
+ return (Languages + 3);
}
- return Languages;
-#else // LANGUAGE_ISO_639_2
- return (Languages + 3);
-#endif
+ //
+ // Search in RFC4646 language code list
+ //
+ for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);
+ if (Languages[Index] == ';') {
+ Index++;
+ }
+ return (Languages + Index);
}
EFI_STATUS
@@ -217,7 +320,7 @@ Returns:
return EFI_UNSUPPORTED;
}
- SupportedLanguages = NextSupportedLanguage(SupportedLanguages);
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
}
return EFI_UNSUPPORTED;
@@ -326,7 +429,7 @@ Returns:
//
// Allocate space for a copy of the Language specifier
//
- NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrLen(Language) + 1, Language);
+ NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrSize (Language), Language);
if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
gBS->FreePool (NewUnicodeStringTable);
return EFI_OUT_OF_RESOURCES;
@@ -372,7 +475,7 @@ Returns:
return EFI_SUCCESS;
}
- SupportedLanguages = NextSupportedLanguage(SupportedLanguages);
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
}
return EFI_UNSUPPORTED;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
index 547c203a83..e5b84d205a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -19,12 +19,85 @@ 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)
-STATIC EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
+
+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 *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
+ }
+ }
+
+ GuidHob.Raw = GET_NEXT_HOB (GuidHob);
+ }
+
+ return Status;
+}
+
#endif
EFI_STATUS
@@ -59,18 +132,28 @@ Returns:
{
EFI_STATUS Status;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gStatusCode == NULL) {
+#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;
}
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
+
+ //
+ // Try to get the PEI version of ReportStatusCode.
+ //
+ Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
+ if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
}
- Status = gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);
- return Status;
+ Status = gReportStatusCode (Type, Value, Instance, CallerId, Data);
#else
if (gRT == NULL) {
return EFI_UNSUPPORTED;
@@ -84,8 +167,8 @@ Returns:
gRT->ReportStatusCode != NULL) {
Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);
}
- return Status;
#endif
+ return Status;
}
EFI_STATUS
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
index 63e09d0087..5cbbe02104 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -41,7 +41,6 @@ COMPONENT_TYPE = LIBRARY
$(EDK_SOURCE)/Foundation/Include/IndustryStandard
$(EDK_SOURCE)/Foundation/Core/Dxe
$(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib
[libraries.common]
EfiGuidLib
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
index 47b084e09b..a6b7f06a50 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
@@ -30,7 +30,6 @@ COMPONENT_TYPE = LIBRARY
[includes.common]
$(EDK_SOURCE)/Foundation/Framework
$(EDK_SOURCE)/Foundation/Efi
-# $(EFI_SOURCE)/Framework
.
$(EDK_SOURCE)/Foundation/Include
$(EDK_SOURCE)/Foundation/Efi/Include
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
index b913d3fac2..9d4260768c 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -23,7 +23,6 @@ Revision History:
#define IS_DIGIT(Ch) (((Ch) >= L'0') && ((Ch) <= L'9'))
-STATIC
EFI_STATUS
EfiStringToValue (
OUT UINT64 *Val,
@@ -37,8 +36,6 @@ Routine Description:
The returned value is 64-bit.
The string is expected in decimal format,
the string is parsed and format verified.
- This function is missing from the libs. One day it maybe
- replaced with a lib function when it'll become available.
Arguments:
Val - pointer to the variable to store the value to
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
index bd8de3a1cf..c417242552 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
@@ -106,10 +106,8 @@ typedef struct {
CHAR16 *UnicodeString;
} EFI_UNICODE_STRING_TABLE;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-#define LANGUAGE_RFC_3066
#define LANGUAGE_CODE_ENGLISH "en-US"
#else
-#define LANGUAGE_ISO_639_2
#define LANGUAGE_CODE_ENGLISH "eng"
#endif
@@ -1179,13 +1177,6 @@ EfiInitializeFwVolDevicepathNode (
Routine Description:
Initialize a Firmware Volume (FV) Media Device Path node.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability.
-
Arguments:
FvDevicePathNode - Pointer to a FV device path node to initialize
NameGuid - FV file name to use in FvDevicePathNode
@@ -1202,15 +1193,6 @@ EfiGetNameGuidFromFwVolDevicePathNode (
Routine Description:
Check to see if the Firmware Volume (FV) Media Device Path is valid.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability. The return value to this
- function points to a location in FvDevicePathNode and it does not allocate
- new memory for the GUID pointer that is returned.
-
Arguments:
FvDevicePathNode - Pointer to FV device path to check
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
index 7cfeffe5fb..946742cb17 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -202,4 +202,33 @@ Returns:
--*/
;
+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/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
index c70fb87e79..ae771b13a5 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -41,7 +41,6 @@ COMPONENT_TYPE = LIBRARY
$(EDK_SOURCE)/Foundation/Include/IndustryStandard
$(EDK_SOURCE)/Foundation/Core/Dxe
$(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib
[libraries.common]
EfiGuidLib
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
index 90afafe837..c41a85c38d 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
@@ -37,6 +37,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = {
},
EFI_IFR_TIANO_GUID,
},
+ 0,
0
},
{
@@ -181,22 +182,23 @@ Returns:
{
EFI_STATUS Status;
HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath;
- UINT64 MonotonicCount;
VendorDevicePath = EfiLibAllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);
if (VendorDevicePath == NULL) {
return EFI_OUT_OF_RESOURCES;
}
- gBS->GetNextMonotonicCount (&MonotonicCount);
- VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;
+ //
+ // Use memory address as unique ID to distinguish from different device paths
+ //
+ VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);
*DriverHandle = NULL;
- Status = gBS->InstallProtocolInterface (
+ Status = gBS->InstallMultipleProtocolInterfaces (
DriverHandle,
&gEfiDevicePathProtocolGuid,
- EFI_NATIVE_INTERFACE,
- VendorDevicePath
+ VendorDevicePath,
+ NULL
);
if (EFI_ERROR (Status)) {
return Status;
@@ -240,7 +242,7 @@ Returns:
&gEfiDevicePathProtocolGuid,
DevicePath
);
-
+ gBS->FreePool (DevicePath);
return Status;
}
@@ -511,6 +513,7 @@ Arguments:
Returns:
EFI_SUCCESS - Successfully extract Class for specified Hii handle.
+ EFI_NOT_FOUND - Class not found.
--*/
{
@@ -525,10 +528,12 @@ Returns:
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
@@ -574,7 +579,7 @@ Returns:
Package = ((UINT8 *) HiiPackageList) + Offset;
EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) {
+ if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
//
// Search Class Opcode in this Form Package
//
@@ -602,6 +607,139 @@ Returns:
//
// 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)) {
+ 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;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
index fbb46075c4..355935322c 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -26,7 +26,6 @@ Abstract:
//
UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";
-STATIC
EFI_STATUS
GetPackageDataFromPackageList (
IN EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList,
@@ -72,7 +71,6 @@ GetPackageDataFromPackageList (
return EFI_SUCCESS;
}
-STATIC
EFI_STATUS
UpdateFormPackageData (
IN EFI_GUID *FormSetGuid,
@@ -86,17 +84,15 @@ UpdateFormPackageData (
OUT UINT32 *TempBufferSize
)
{
- UINTN AddSize;
UINT8 *BufferPos;
EFI_HII_PACKAGE_HEADER PackageHeader;
- UINTN Offset;
+ UINT32 Offset;
EFI_IFR_OP_HEADER *IfrOpHdr;
BOOLEAN GetFormSet;
BOOLEAN GetForm;
UINT8 ExtendOpCode;
UINT16 LabelNumber;
BOOLEAN Updated;
- EFI_IFR_OP_HEADER *AddOpCode;
if ((TempBuffer == NULL) || (TempBufferSize == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -122,7 +118,7 @@ UpdateFormPackageData (
GetForm = FALSE;
Updated = FALSE;
- while (Offset < PackageHeader.Length) {
+ while (!Updated && Offset < PackageHeader.Length) {
EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);
BufferPos += IfrOpHdr->Length;
*TempBufferSize += IfrOpHdr->Length;
@@ -132,6 +128,8 @@ UpdateFormPackageData (
if (FormSetGuid != NULL) {
if (EfiCompareMem (&((EFI_IFR_FORM_SET *) IfrOpHdr)->Guid, FormSetGuid, sizeof (EFI_GUID)) == 0) {
GetFormSet = TRUE;
+ } else {
+ GetFormSet = FALSE;
}
}
break;
@@ -139,17 +137,24 @@ UpdateFormPackageData (
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 || Updated) {
+ if (!GetFormSet || !GetForm) {
//
// Go to the next Op-Code
//
- Offset += IfrOpHdr->Length;
- IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
- continue;
+ break;
+ }
+
+ if (!EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid)) {
+ //
+ // GUID mismatch, skip this op-code
+ //
+ break;
}
ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
@@ -158,29 +163,18 @@ UpdateFormPackageData (
//
// Go to the next Op-Code
//
- Offset += IfrOpHdr->Length;
- IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
- continue;
+ break;
}
- if (Insert && (Data != NULL)) {
+ if (Insert) {
//
- // insert the DataCount amount of opcodes to TempBuffer if Data is NULL remove
- // DataCount amount of opcodes unless runing into a label.
+ // Insert data after current Label, skip myself
//
- AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;
- AddSize = 0;
- while (AddSize < Data->Offset) {
- EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);
- BufferPos += AddOpCode->Length;
- *TempBufferSize += AddOpCode->Length;
-
- AddSize += AddOpCode->Length;
- AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);
- }
+ Offset += IfrOpHdr->Length;
+ IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
} else {
//
- // Search the next Label.
+ // Replace data between two paired Label, try to find the next Label.
//
while (TRUE) {
Offset += IfrOpHdr->Length;
@@ -193,33 +187,28 @@ UpdateFormPackageData (
IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
if (IfrOpHdr->OpCode == EFI_IFR_GUID_OP) {
ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
- if (ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {
+ if (EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid) && ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {
break;
}
}
}
+ }
- if (Data != NULL) {
- AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;
- AddSize = 0;
- while (AddSize < Data->Offset) {
- EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);
- BufferPos += AddOpCode->Length;
- *TempBufferSize += AddOpCode->Length;
-
- AddSize += AddOpCode->Length;
- AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);
- }
- }
-
- //
- // copy the next label
- //
- EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);
- BufferPos += IfrOpHdr->Length;
- *TempBufferSize += IfrOpHdr->Length;
+ //
+ // 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 :
@@ -250,6 +239,68 @@ Fail:
}
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
@@ -339,7 +390,7 @@ Returns:
Status = GetPackageDataFromPackageList (HiiPackageList, Index, &PackageLength, &Package);
if (Status == EFI_SUCCESS) {
EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
- if ((PackageHeader.Type == EFI_HII_PACKAGE_FORM) && !Updated) {
+ 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) {
@@ -644,7 +695,376 @@ ExtractDefault(
return EFI_SUCCESS;
}
-STATIC
+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)) {
+ 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)) {
+ 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,
@@ -668,7 +1088,7 @@ Returns:
UINT8 Temp;
UINTN SwapCount;
- SwapCount = (BufferSize - 1) / 2;
+ SwapCount = BufferSize / 2;
for (Index = 0; Index < SwapCount; Index++) {
Temp = Buffer[Index];
Buffer[Index] = Buffer[BufferSize - 1 - Index];
@@ -676,6 +1096,31 @@ Returns:
}
}
+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,
@@ -704,10 +1149,14 @@ Returns:
NewBuffer = EfiLibAllocateCopyPool (BufferSize, Buffer);
SwapBuffer (NewBuffer, BufferSize);
- StrBufferLen = (BufferSize + 1) * sizeof (CHAR16);
+ 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;
}
@@ -741,13 +1190,139 @@ Returns:
ConvertedStrLen = 0;
Status = HexStringToBuf (Buffer, BufferSize, Str, &ConvertedStrLen);
if (!EFI_ERROR (Status)) {
- SwapBuffer (Buffer, ConvertedStrLen);
+ 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,
@@ -811,10 +1386,10 @@ Returns:
DevicePathSize = EfiDevicePathSize (DevicePath);
//
- // GUID=<HexCh>32&NAME=<Alpha>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
- // | 5 | 32 | 6 | NameStrLen | 6 | DevicePathStrLen |
+ // GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
+ // | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
//
- BufferSize = (5 + 32 + 6 + NameStrLen + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
+ BufferSize = (5 + 32 + 6 + NameStrLen * 4 + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
if (*StrBufferLen < BufferSize) {
*StrBufferLen = BufferSize;
return EFI_BUFFER_TOO_SMALL;
@@ -829,11 +1404,15 @@ Returns:
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) {
- EfiStrCpy (StrPtr, Name);
- StrPtr += NameStrLen;
+ BufferSize = (NameStrLen * 4 + 1) * sizeof (CHAR16);
+ UnicodeToConfigString (StrPtr, &BufferSize, Name);
+ StrPtr += (NameStrLen * 4);
}
EfiStrCpy (StrPtr, L"&PATH=");
@@ -844,6 +1423,105 @@ Returns:
}
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,
@@ -965,7 +1643,7 @@ Returns:
HeaderLen = EfiStrLen (ConfigHdr);
BufferLen = 0x4000;
- ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);
+ ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
StringPtr = ConfigResp + HeaderLen;
*StringPtr = L'&';
@@ -981,7 +1659,7 @@ Returns:
);
if (Status == EFI_BUFFER_TOO_SMALL) {
gBS->FreePool (ConfigResp);
- ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);
+ ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
StringPtr = ConfigResp + HeaderLen;
*StringPtr = L'&';
@@ -1116,7 +1794,7 @@ Returns:
&Progress
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (ConfigResp);
+ gBS->FreePool (ConfigRequest);
return Status;
}
@@ -1133,9 +1811,10 @@ Returns:
&BufferSize,
StringPtr,
FALSE,
- NULL,
- NULL
+ 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
index bd85764d4a..3de0efb651 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -78,10 +78,13 @@ typedef struct {
} IFR_OPTION;
#pragma pack()
+#pragma pack(1)
typedef struct {
VENDOR_DEVICE_PATH VendorDevicePath;
- UINT32 MonotonicCount;
+ UINT32 Reserved;
+ UINT64 UniqueId;
} HII_VENDOR_DEVICE_PATH_NODE;
+#pragma pack()
typedef struct {
HII_VENDOR_DEVICE_PATH_NODE Node;
@@ -280,7 +283,8 @@ CreateOneOfOptionOpCode (
IN IFR_OPTION *OptionsList,
IN UINT8 Type,
IN OUT EFI_HII_UPDATE_DATA *Data
- );
+ )
+;
EFI_STATUS
CreateOneOfOpCode (
@@ -600,6 +604,53 @@ ExtractDefault(
;
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
@@ -644,6 +695,49 @@ Returns:
;
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,
@@ -690,6 +784,64 @@ Returns:
;
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,
@@ -720,6 +872,29 @@ Returns:
;
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,
@@ -1094,6 +1269,47 @@ Returns:
;
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
index c46bc7d73e..2c454de951 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -394,9 +394,7 @@ CreateOrderedListOpCode (
return EFI_INVALID_PARAMETER;
}
- if ((OrderedListFlags != 0) &&
- (OrderedListFlags != EFI_IFR_UNIQUE_SET) &&
- (OrderedListFlags != EFI_IFR_NO_EMPTY_SET)) {
+ if ((OrderedListFlags & (~(EFI_IFR_UNIQUE_SET | EFI_IFR_NO_EMPTY_SET))) != 0) {
return EFI_INVALID_PARAMETER;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
index 0a5739965a..ece78bfb44 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
@@ -555,20 +555,37 @@ IfrLibNewString (
if (Languages == NULL) {
return EFI_NOT_FOUND;
}
+
+ if (StringId == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ *StringId = 0;
LangStrings = Languages;
while (*LangStrings != 0) {
GetNextLanguage (&LangStrings, Lang);
- Status = gIfrLibHiiString->NewString (
- gIfrLibHiiString,
- PackageList,
- StringId,
- Lang,
- NULL,
- String,
- NULL
- );
+ 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;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
index 7968995794..be5bf00f7c 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
@@ -23,6 +23,81 @@ Abstract:
#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;
//
@@ -31,27 +106,38 @@ STATIC EFI_EVENT _mDriverExitBootServicesNotifyEvent;
// 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.
//
-
-#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
+#if defined(__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__)
extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;
#endif
-#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-extern EFI_COMPONENT_NAME2_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;
-#else
+#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
-#endif
-#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__)
extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;
#endif
+#endif
-#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
+#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__
@@ -60,23 +146,41 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverMode
NULL,
#endif
-#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
+#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
&__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,
#else
NULL,
#endif
-#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
&__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,
#else
NULL,
#endif
-#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
+#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
}
};
@@ -249,15 +353,15 @@ ProcessLibraryConstructorList (
// NOTE: the constructors must be called according to dependency order
//
// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
+// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
+// DxeServicesTableLib DxeServicesTableLibConstructor()
// DxeIoLibCpuIo IoLibConstructor()
// DxeSalLib DxeSalLibConstructor(), IPF only
// EdkDxeRuntimeDriverLib RuntimeDriverLibConstruct()
-// DxeHobLib HobLibConstructor()
+// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
// UefiDriverModelLib UefiDriverModelLibConstructor()
+// DxeHobLib HobLibConstructor()
// DxeSmbusLib SmbusLibConstructor()
-// DxeServicesTableLib DxeServicesTableLibConstructor()
-// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
//
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
@@ -265,6 +369,16 @@ ProcessLibraryConstructorList (
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);
@@ -280,8 +394,8 @@ ProcessLibraryConstructorList (
ASSERT_EFI_ERROR (Status);
#endif
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
- Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
+#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
+ Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
ASSERT_EFI_ERROR (Status);
#endif
@@ -290,16 +404,6 @@ ProcessLibraryConstructorList (
ASSERT_EFI_ERROR (Status);
#endif
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
- Status = DxeServicesTableLibConstructor (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);
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
index c83b28efbb..13cddfbe1d 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
@@ -83,23 +83,18 @@ ProcessLibraryConstructorList (
// here
//
// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
+// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
+// DxeServicesTableLib DxeServicesTableLibConstructor()
// DxeIoLibCpuIo IoLibConstructor
+// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
// DxeHobLib HobLibConstructor()
// DxeSmbusLib SmbusLibConstructor()
-// DxeServicesTableLib DxeServicesTableLibConstructor()
-// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
-// check here: check lib usage
+
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
Status = UefiBootServicesTableLibConstructor (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_UEFI_RUNTIME_SERVICES_TABLE_LIB__
Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
ASSERT_EFI_ERROR (Status);
@@ -110,6 +105,11 @@ ProcessLibraryConstructorList (
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);
@@ -321,14 +321,26 @@ _ModuleEntryPoint (
EFI_HANDLE Handle;
//
- // Call constructor for all libraries
+ // Cache a pointer to the Boot Services Table
//
- ProcessLibraryConstructorList (ImageHandle, SystemTable);
+ mBS = SystemTable->BootServices;
//
- // Cache a pointer to the Boot Services Table
+ // Initialize gBS as ASSERT needs it
+ // Both DxeReportStatusCodeLib and SmmRuntimeDxeReportStatusCodeLib implementations
+ // Can handle this cleanly before lib constructors are called.
//
- mBS = SystemTable->BootServices;
+ gBS = mBS;
+
+ //
+ // Retrieve the Loaded Image Protocol
+ //
+ Status = mBS->HandleProtocol (
+ ImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID*)&LoadedImage
+ );
+ ASSERT_EFI_ERROR (Status);
//
// Retrieve SMM Base Protocol
@@ -350,27 +362,6 @@ _ModuleEntryPoint (
//
if (!InSmm) {
//
- // Retrieve the Loaded Image Protocol
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID*)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Install the unload handler
- //
- Status = mBS->HandleProtocol (
- ImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **)&LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- LoadedImage->Unload = _DriverUnloadHandler;
-
- //
// Retrieve the Device Path Protocol from the DeviceHandle tha this driver was loaded from
//
Status = mBS->HandleProtocol (
@@ -391,18 +382,34 @@ _ModuleEntryPoint (
//
Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
ASSERT_EFI_ERROR (Status);
- } else {
-
- //
- // 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
+ 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);
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
index b3b1f0ef73..321e5fb0ec 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
@@ -333,6 +333,15 @@ Abstract:
#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__
@@ -490,15 +499,6 @@ Abstract:
#endif
//
-// DxeServicesTableLib
-//
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
- #ifndef __EDKII_GLUE_UEFI_LIB__
- #define __EDKII_GLUE_UEFI_LIB__
- #endif
-#endif
-
-//
// BasePrintLib
//
#ifdef __EDKII_GLUE_BASE_PRINT_LIB__
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
index 2650379ba9..3513f87d69 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -33,10 +33,15 @@ Abstract:
// 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 0x7100
+#define EDKII_GLUE_LIBRARY_VERSION 0x9300
//
@@ -120,7 +125,9 @@ Abstract:
// 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
@@ -142,7 +149,9 @@ Abstract:
// 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/EdkIIGlueUefi.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
index 5482785b77..8c4e2ae946 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -173,4 +173,6 @@ Abstract:
#include "Library/EdkIIGlueUefiLib.h"
#include "Library/EdkIIGlueUefiRuntimeServicesTableLib.h"
+extern UINT8 _gEdkIIGlueDriverModelProtocolSelection;
+
#endif
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
index 9bb057f5ab..ef947fa7eb 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -34,15 +34,14 @@ Abstract:
// Data structure that declares pointers to the Driver Model
// Protocols.
//
-typedef struct {
- const EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- const EFI_COMPONENT_NAME2_PROTOCOL *ComponentName;
-#else
- const EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
-#endif
- const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration;
- const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics;
+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;
//
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
index 15d5f2e730..48c8f5e8be 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -585,13 +585,6 @@ EfiCreateEventReadyToBootEx (
/**
Initialize a Firmware Volume (FV) Media Device Path node.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for Tiano extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability.
-
@param FvDevicePathNode Pointer to a FV device path node to initialize
@param NameGuid FV file name to use in FvDevicePathNode
@@ -606,15 +599,6 @@ GlueEfiInitializeFwVolDevicepathNode (
/**
Check to see if the Firmware Volume (FV) Media Device Path is valid
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for Tiano extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability. The return value to this
- function points to a location in FvDevicePathNode and it does not allocate
- new memory for the GUID pointer that is returned.
-
@param FvDevicePathNode Pointer to FV device path to check.
@retval NULL FvDevicePathNode is not valid.
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
index 4caec5f371..9562460e0f 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -51,7 +51,7 @@ GlueCompareMem (
IN UINTN Length
)
{
- if (Length == 0) {
+ if (Length == 0 || DestinationBuffer == SourceBuffer) {
return 0;
}
ASSERT (DestinationBuffer != NULL);
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
index 6cc2da31b0..387a6835a6 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -29,7 +29,7 @@ Abstract:
STATIC EFI_EVENT mEfiVirtualNotifyEvent;
STATIC BOOLEAN mEfiGoneVirtual = FALSE;
STATIC BOOLEAN mEfiAtRuntime = FALSE;
-EFI_RUNTIME_SERVICES *mRT;
+EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
/**
Set AtRuntime flag as TRUE after ExitBootServices
@@ -44,6 +44,11 @@ RuntimeDriverExitBootServices (
IN VOID *Context
)
{
+ //
+ // Clear out BootService globals
+ //
+ gBS = NULL;
+
mEfiAtRuntime = TRUE;
}
@@ -76,7 +81,7 @@ RuntimeLibVirtualNotifyEvent (
//
// Update global for Runtime Services Table and IO
//
- EfiConvertPointer (0, (VOID **) &mRT);
+ EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
mEfiGoneVirtual = TRUE;
}
@@ -99,8 +104,8 @@ RuntimeDriverLibConstruct (
EFI_STATUS Status;
ASSERT (SystemTable != NULL);
- mRT = SystemTable->RuntimeServices;
- ASSERT (mRT != NULL);
+ mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
+ ASSERT (mRTEdkDxeRuntimeDriverLib != NULL);
//
// Register SetVirtualAddressMap () notify function
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
index 1fcfddb585..c57588c770 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -50,11 +50,11 @@ Returns:
--*/
{
- mRT->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
+ mRTEdkDxeRuntimeDriverLib->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
}
//
-// The following functions hide the mRT local global from the call to
+// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
// runtime service in the EFI system table.
//
EFI_STATUS
@@ -82,7 +82,7 @@ Returns:
--*/
{
- return mRT->GetTime (Time, Capabilities);
+ return mRTEdkDxeRuntimeDriverLib->GetTime (Time, Capabilities);
}
EFI_STATUS
@@ -106,7 +106,7 @@ Returns:
--*/
{
- return mRT->SetTime (Time);
+ return mRTEdkDxeRuntimeDriverLib->SetTime (Time);
}
EFI_STATUS
@@ -134,7 +134,7 @@ Returns:
--*/
{
- return mRT->GetWakeupTime (Enabled, Pending, Time);
+ return mRTEdkDxeRuntimeDriverLib->GetWakeupTime (Enabled, Pending, Time);
}
EFI_STATUS
@@ -161,7 +161,7 @@ Returns:
--*/
{
- return mRT->SetWakeupTime (Enable, Time);
+ return mRTEdkDxeRuntimeDriverLib->SetWakeupTime (Enable, Time);
}
@@ -199,7 +199,7 @@ Returns:
--*/
{
- return mRT->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
+ return mRTEdkDxeRuntimeDriverLib->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
}
EFI_STATUS
@@ -232,7 +232,7 @@ Returns:
--*/
{
- return mRT->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
+ return mRTEdkDxeRuntimeDriverLib->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
}
EFI_STATUS
@@ -265,7 +265,7 @@ Returns:
--*/
{
- return mRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
+ return mRTEdkDxeRuntimeDriverLib->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
}
EFI_STATUS
@@ -289,7 +289,7 @@ Returns:
--*/
{
- return mRT->GetNextHighMonotonicCount (HighCount);
+ return mRTEdkDxeRuntimeDriverLib->GetNextHighMonotonicCount (HighCount);
}
EFI_STATUS
@@ -316,7 +316,7 @@ Returns:
--*/
{
- return mRT->ConvertPointer (DebugDisposition, Address);
+ return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
}
EFI_STATUS
@@ -399,7 +399,7 @@ EfiSetVirtualAddressMap (
IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
)
{
- return mRT->SetVirtualAddressMap (
+ return mRTEdkDxeRuntimeDriverLib->SetVirtualAddressMap (
MemoryMapSize,
DescriptorSize,
DescriptorVersion,
@@ -417,7 +417,7 @@ EfiUpdateCapsule (
)
{
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRT->UpdateCapsule (
+ return mRTEdkDxeRuntimeDriverLib->UpdateCapsule (
CapsuleHeaderArray,
CapsuleCount,
ScatterGatherList
@@ -437,7 +437,7 @@ EfiQueryCapsuleCapabilities (
)
{
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRT->QueryCapsuleCapabilities (
+ return mRTEdkDxeRuntimeDriverLib->QueryCapsuleCapabilities (
CapsuleHeaderArray,
CapsuleCount,
MaximumCapsuleSize,
@@ -459,7 +459,7 @@ EfiQueryVariableInfo (
)
{
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- return mRT->QueryVariableInfo (
+ return mRTEdkDxeRuntimeDriverLib->QueryVariableInfo (
Attributes,
MaximumVariableStorageSize,
RemainingVariableStorageSize,
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
index 8f154a888c..e0f4deb6ce 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -26,7 +26,7 @@ Abstract:
// Driver Lib Module Globals
//
static EFI_EVENT mEfiVirtualNotifyEvent;
-EFI_RUNTIME_SERVICES *mRT;
+EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
VOID
EFIAPI
@@ -95,7 +95,7 @@ Returns:
//
// Update global for Runtime Services Table
//
- EfiConvertPointer (0, (VOID **) &mRT);
+ EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
}
EFI_STATUS
@@ -126,7 +126,7 @@ Returns:
{
EFI_STATUS Status;
- mRT = SystemTable->RuntimeServices;
+ mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
//
// Register SetVirtualAddressMap () notify function
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
index bcaa7448bd..a270fc5508 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -70,7 +70,7 @@ Returns:
//
-// The following functions hide the mRT local global from the call to
+// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
// runtime service in the EFI system table.
//
EFI_STATUS
@@ -415,7 +415,7 @@ Returns:
--*/
{
- return mRT->ConvertPointer (DebugDisposition, Address);
+ return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
}
EFI_STATUS
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
index 2d8e4e7760..287f525cb9 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -25,6 +25,6 @@ Abstract:
#include "EdkIIGlueDxe.h"
-extern EFI_RUNTIME_SERVICES *mRT;
+extern EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
#endif //__RUNTIMELIBINTERNAL_H__
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
index cd8da602b8..c82736c74b 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -22,13 +22,6 @@ Abstract:
#include "EdkIIGlueUefi.h"
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- #define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID gEfiComponentName2ProtocolGuid
- #define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL
-#else
- #define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID gEfiComponentNameProtocolGuid
- #define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
-#endif
/**
The constructor function installs the standard EFI Driver Model Protocols.
@@ -46,7 +39,7 @@ UefiDriverModelLibConstructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status = EFI_UNSUPPORTED;
EFI_HANDLE DriverBindingHandle;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
@@ -60,16 +53,17 @@ UefiDriverModelLibConstructor (
// EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
//
- //
- // The Driver Binding Protocol must never be NULL
- //
- ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
+ //
+ // The Driver Binding Protocol must never be NULL
+ //
+ ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
- //
- // 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()
- //
+ //
+ // 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) {
@@ -82,7 +76,7 @@ UefiDriverModelLibConstructor (
Status = gBS->InstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
NULL
);
}
@@ -98,7 +92,7 @@ UefiDriverModelLibConstructor (
Status = gBS->InstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
NULL
);
@@ -117,7 +111,7 @@ UefiDriverModelLibConstructor (
Status = gBS->InstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
NULL
);
@@ -135,7 +129,7 @@ UefiDriverModelLibConstructor (
Status = gBS->InstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &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
@@ -143,18 +137,95 @@ UefiDriverModelLibConstructor (
}
}
}
+ } // selection == 1 or 3
- //
- // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
- //
- ASSERT_EFI_ERROR (Status);
+ if ((_gEdkIIGlueDriverModelProtocolSelection == 2) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
+ if (_gDriverModelProtocolList[0].DriverDiagnostics2== NULL) {
+ if (_gDriverModelProtocolList[0].DriverConfiguration2== NULL) {
+ if (_gDriverModelProtocolList[0].ComponentName2== NULL) {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &DriverBindingHandle,
+ &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
+ NULL
+ );
+ } else {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &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->InstallMultipleProtocolInterfaces (
+ &DriverBindingHandle,
+ &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
+ &gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
+ NULL
+ );
+ } else {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &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->InstallMultipleProtocolInterfaces (
+ &DriverBindingHandle,
+ &gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
+ &gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
+ NULL
+ );
+ } else {
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &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->InstallMultipleProtocolInterfaces (
+ &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->InstallMultipleProtocolInterfaces (
+ &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
- //
- // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
- //
- DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding;
- DriverBinding->ImageHandle = ImageHandle;
- DriverBinding->DriverBindingHandle = DriverBindingHandle;
+ //
+ // ASSERT if the call to InstallMultipleProtocolInterfaces() failed
+ //
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
+ //
+ DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding;
+ DriverBinding->ImageHandle = ImageHandle;
+ DriverBinding->DriverBindingHandle = DriverBindingHandle;
return EFI_SUCCESS;
@@ -176,7 +247,7 @@ UefiDriverModelLibDestructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status = EFI_UNSUPPORTED;
EFI_HANDLE DriverBindingHandle;
//
@@ -184,21 +255,22 @@ UefiDriverModelLibDestructor (
// EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
//
- //
- // The Driver Binding Protocol must never be NULL
- //
- ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
+ //
+ // 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;
+ //
+ // 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()
- //
+ //
+ // 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) {
@@ -211,7 +283,7 @@ UefiDriverModelLibDestructor (
Status = gBS->UninstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
NULL
);
}
@@ -227,7 +299,7 @@ UefiDriverModelLibDestructor (
Status = gBS->UninstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
NULL
);
@@ -246,7 +318,7 @@ UefiDriverModelLibDestructor (
Status = gBS->UninstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
NULL
);
@@ -264,7 +336,7 @@ UefiDriverModelLibDestructor (
Status = gBS->UninstallMultipleProtocolInterfaces (
&DriverBindingHandle,
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
- &EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
+ &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
@@ -272,11 +344,88 @@ UefiDriverModelLibDestructor (
}
}
}
+ } // 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);
+ //
+ // ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
+ //
+ ASSERT_EFI_ERROR (Status);
return EFI_SUCCESS;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
index b8852e43f3..cdfea2daf3 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -17,32 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
/**
- Compare whether two names of languages are identical.
-
- @param Language1 Name of language 1.
- @param Language2 Name of language 2.
-
- @retval TRUE Language 1 and language 2 are the same.
- @retval FALSE Language 1 and language 2 are not the same.
-
-**/
-STATIC
-BOOLEAN
-CompareIso639LanguageCode (
- IN CONST CHAR8 *Language1,
- IN CONST CHAR8 *Language2
- )
-{
- UINT32 Name1;
- UINT32 Name2;
-
- Name1 = ReadUnaligned24 ((CONST UINT32 *) Language1);
- Name2 = ReadUnaligned24 ((CONST UINT32 *) Language2);
-
- return (BOOLEAN) (Name1 == Name2);
-}
-
-/**
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
@@ -510,6 +484,130 @@ EfiTestChildHandle (
}
/**
+ 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
@@ -566,13 +664,13 @@ LookupUnicodeString (
// Make sure Language is in the set of Supported Languages
//
while (*SupportedLanguages != 0) {
- if (CompareIso639LanguageCode (Language, SupportedLanguages)) {
+ if (CompareLanguageCode (Language, SupportedLanguages)) {
//
// Search the Unicode String Table for the matching Language specifier
//
while (UnicodeStringTable->Language != NULL) {
- if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {
+ if (CompareLanguageCode (Language, UnicodeStringTable->Language)) {
//
// A matching string was found, so return it
@@ -587,7 +685,7 @@ LookupUnicodeString (
return EFI_UNSUPPORTED;
}
- SupportedLanguages += 3;
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
}
return EFI_UNSUPPORTED;
@@ -664,7 +762,7 @@ AddUnicodeString (
// Make sure Language is a member of SupportedLanguages
//
while (*SupportedLanguages != 0) {
- if (CompareIso639LanguageCode (Language, SupportedLanguages)) {
+ if (CompareLanguageCode (Language, SupportedLanguages)) {
//
// Determine the size of the Unicode String Table by looking for a NULL Language entry
@@ -673,7 +771,7 @@ AddUnicodeString (
if (*UnicodeStringTable != NULL) {
OldUnicodeStringTable = *UnicodeStringTable;
while (OldUnicodeStringTable->Language != NULL) {
- if (CompareIso639LanguageCode (Language, OldUnicodeStringTable->Language)) {
+ if (CompareLanguageCode (Language, OldUnicodeStringTable->Language)) {
return EFI_ALREADY_STARTED;
}
@@ -707,7 +805,7 @@ AddUnicodeString (
//
// Allocate space for a copy of the Language specifier
//
- NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language);
+ NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (AsciiStrSize (Language), Language);
if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
(gBS->FreePool) (NewUnicodeStringTable);
return EFI_OUT_OF_RESOURCES;
@@ -753,7 +851,7 @@ AddUnicodeString (
return EFI_SUCCESS;
}
- SupportedLanguages += 3;
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
}
return EFI_UNSUPPORTED;
diff --git a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
index c995b92bc9..bccb35a44b 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -67,7 +67,7 @@ GlueEfiCreateEventLegacyBoot (
{
return EfiCreateEventLegacyBootEx (
EFI_TPL_CALLBACK,
- InternalEmptyFuntion,
+ NULL,
NULL,
LegacyBootEvent
);
@@ -101,29 +101,50 @@ EfiCreateEventLegacyBootEx (
OUT EFI_EVENT *LegacyBootEvent
)
{
- EFI_STATUS Status;
+ 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 (
- EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
+ EventType,
NotifyTpl,
- NotifyFunction,
+ 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 (
- EVENT_NOTIFY_SIGNAL,
+ EventType,
NotifyTpl,
- NotifyFunction,
+ WorkerNotifyFunction,
NotifyContext,
&gEfiEventLegacyBootGuid,
LegacyBootEvent
@@ -157,7 +178,7 @@ GlueEfiCreateEventReadyToBoot (
{
return EfiCreateEventReadyToBootEx (
EFI_TPL_CALLBACK,
- InternalEmptyFuntion,
+ NULL,
NULL,
ReadyToBootEvent
);
@@ -191,29 +212,51 @@ EfiCreateEventReadyToBootEx (
OUT EFI_EVENT *ReadyToBootEvent
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ UINT32 EventType;
+ EFI_EVENT_NOTIFY WorkerNotifyFunction;
ASSERT (ReadyToBootEvent != NULL);
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)
+#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 (
- EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
+ EventType,
NotifyTpl,
- NotifyFunction,
+ 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 (
- EVENT_NOTIFY_SIGNAL,
+ EventType,
NotifyTpl,
- NotifyFunction,
+ WorkerNotifyFunction,
NotifyContext,
&gEfiEventReadyToBootGuid,
ReadyToBootEvent
@@ -274,15 +317,6 @@ EfiSignalEventLegacyBoot (
/**
Check to see if the Firmware Volume (FV) Media Device Path is valid
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability. The return value to this
- function points to a location in FvDevicePathNode and it does not allocate
- new memory for the GUID pointer that is returned.
-
@param FvDevicePathNode Pointer to FV device path to check.
@retval NULL FvDevicePathNode is not valid.
@@ -297,11 +331,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode (
{
ASSERT (FvDevicePathNode != NULL);
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
return (EFI_GUID *) &FvDevicePathNode->NameGuid;
@@ -314,13 +343,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode (
/**
Initialize a Firmware Volume (FV) Media Device Path node.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability.
-
@param FvDevicePathNode Pointer to a FV device path node to initialize
@param NameGuid FV file name to use in FvDevicePathNode
@@ -335,16 +357,10 @@ GlueEfiInitializeFwVolDevicepathNode (
ASSERT (FvDevicePathNode != NULL);
ASSERT (NameGuid != NULL);
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
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);
+ CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
index 8aff8813ad..722c9a9664 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -60,7 +60,7 @@ COMPONENT_TYPE = LIBRARY
Math.c
[sources.x64]
- X64/EfiCopyMemRep1.asm
+ X64/EfiCopyMemRep4.asm
X64/EfiSetMemRep4.asm
X64/EfiZeroMemRep4.asm
# X64/EfiCopyMem.asm
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
index a6f930dacf..fd183c1d6a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
@@ -1,6 +1,6 @@
#/*++
#
-# Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -85,14 +85,14 @@ COMPONENT_TYPE = LIBRARY
Math.c
[sources.x64]
- X64/EfiCopyMemRep1.asm | MSFT
+ 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/EfiCopyMemRep1.asm | INTEL
+ X64/EfiCopyMemRep4.asm | INTEL
X64/EfiSetMemRep4.asm | INTEL
X64/EfiZeroMemRep4.asm | INTEL
# X64/EfiCopyMem.asm | INTEL
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
index ed41ff994d..580c3fe94b 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
@@ -75,16 +75,16 @@ ASM_PFX(EfiCommonLibCopyMem):
movl %esi, %eax
addl %ecx, %eax # Source + Count
cmpl %edi, %eax
- jle _StartByteCopy
+ jbe _StartByteCopy
movl %edi, %eax
addl %ecx, %eax # Dest + Count
cmpl %esi, %eax
- jle _StartByteCopy
+ jbe _StartByteCopy
cmpl %edi, %esi
je _CopyMemDone
- jl _CopyOverlapped # too bad -- overlaps
+ jb _CopyOverlapped # too bad -- overlaps
# Pick up misaligned start bytes to get destination pointer 4-byte aligned
_StartByteCopy:
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
index 7cf8b7f630..275e29b0c5 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
@@ -73,16 +73,16 @@ EfiCommonLibCopyMem PROC
mov eax, esi
add eax, ecx ; Source + Count
cmp eax, edi
- jle _StartByteCopy
+ jbe _StartByteCopy
mov eax, edi
add eax, ecx ; Dest + Count
cmp eax, esi
- jle _StartByteCopy
+ jbe _StartByteCopy
cmp esi, edi
je _CopyMemDone
- jl _CopyOverlapped ; too bad -- overlaps
+ jb _CopyOverlapped ; too bad -- overlaps
; Pick up misaligned start bytes to get destination pointer 4-byte aligned
_StartByteCopy:
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
index 0acfdc9e5c..cb6b8ffe89 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -58,20 +58,21 @@ Returns:
; 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
- jle _StartByteCopy
+ jbe _StartByteCopy
mov eax, edi
add eax, ecx ; Dest + Count
cmp eax, esi
- jle _StartByteCopy
+ jbe _StartByteCopy
cmp esi, edi
je _CopyMemDone
- jl _CopyOverlapped ; too bad -- overlaps
+ jb _CopyOverlapped ; too bad -- overlaps
; Pick up misaligned start bytes to get destination pointer 4-byte aligned
_StartByteCopy:
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
index 9a15288f5c..595c008a04 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -104,13 +104,13 @@ _CopyBlocks:
copyxmm:
movdqu xmm0, OWORD PTR ds:[esi]
- movdqu QWORD PTR ds:[edi], xmm0
+ movdqu OWORD PTR ds:[edi], xmm0
movdqu xmm1, OWORD PTR ds:[esi+16]
- movdqu QWORD PTR ds:[edi+16], xmm1
+ movdqu OWORD PTR ds:[edi+16], xmm1
movdqu xmm2, OWORD PTR ds:[esi+32]
- movdqu QWORD PTR ds:[edi+32], xmm2
+ movdqu OWORD PTR ds:[edi+32], xmm2
movdqu xmm3, OWORD PTR ds:[esi+48]
- movdqu QWORD PTR ds:[edi+48], xmm3
+ movdqu OWORD PTR ds:[edi+48], xmm3
add edi, 64
add esi, 64
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
index b22609afb3..a40c56bcb1 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
@@ -65,11 +65,13 @@ ASM_PFX(Power10U64):
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
index b7d3373fd3..b6e25320d4 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
@@ -64,11 +64,13 @@ Power10U64 PROC
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
index c74e7933dd..2a31fe133e 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -56,11 +56,13 @@ Returns:
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
index a931b533ea..c558869149 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
+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
@@ -76,6 +76,21 @@ Returns:
}
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
index 5356e235e8..ef68647569 100644
--- a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
+++ b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
+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
@@ -20,8 +20,8 @@ Abstract:
#include "Tiano.h"
#include "pei.h"
#include "cpuio.h"
-#include "pcicfg.h"
-#include "pcicfg2.h"
+#include EFI_PPI_CONSUMER (PciCfg)
+#include EFI_PPI_CONSUMER (PciCfg2)
#include EFI_PROTOCOL_CONSUMER (PciRootBridgeIo)
//
@@ -68,8 +68,6 @@ Returns:
--*/
{
- EFI_STATUS Status;
-
mPeiServices = NULL;
CpuIoPpi = NULL;
PciCfgPpi = NULL;
@@ -136,7 +134,7 @@ Returns:
EFI_STATUS Status;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
- if (mPeiServices == NULL) {
+ if (mPeiServices != NULL) {
//
// The function is called in PEI phase, use PEI interfaces
//
@@ -197,7 +195,7 @@ Returns:
EFI_STATUS Status;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
- if (mPeiServices == NULL) {
+ if (mPeiServices != NULL) {
//
// The function is called in PEI phase, use PEI interfaces
//
@@ -260,7 +258,7 @@ Returns:
UINT8 *Buffer8;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
- if (mPeiServices == NULL) {
+ if (mPeiServices != NULL) {
//
// The function is called in PEI phase, use PEI interfaces
//
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h b/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
index b2fde2721d..8fd3f93247 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -195,8 +195,8 @@ EFI_STATUS
EFIAPI
PeiLibFfsFindNextFile (
IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE FwVolHeader,
- IN OUT EFI_PEI_FILE_HANDLE *FileHeader
+ IN EFI_PEI_FV_HANDLE FvHandle,
+ IN OUT EFI_PEI_FILE_HANDLE *FileHandle
)
/*++
@@ -207,7 +207,7 @@ Routine Description:
Arguments:
SearchType - Filter to find only file of this type.
- FwVolHeader - Pointer to the current FV to search.
+ FvHandle - Pointer to the current FV to search.
FileHandle - Pointer to the file matching SearchType in FwVolHeader.
- NULL if file not found
@@ -271,7 +271,7 @@ Returns:
EFI_STATUS
EFIAPI
PeiLibFfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE *VolumeHandle,
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
OUT EFI_FV_INFO *VolumeInfo
)
/*++
@@ -464,7 +464,7 @@ MigrateIdtTable (
Routine Description:
- Migrate IDT from temporary memory to real memory where preceded with 4 bytes for
+ Migrate IDT from CAR to real memory where preceded with 4 bytes for
storing PeiService pointer.
Arguments:
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
index bc4ca8ee66..1904902c78 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
@@ -70,7 +70,7 @@ PeCoffLoaderLoadImage (
EFI_STATUS
EFIAPI
PeCoffLoaderUnloadImage (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
);
#if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)
@@ -565,7 +565,10 @@ Returns:
// 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);
+ 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;
@@ -1013,6 +1016,12 @@ Returns:
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;
@@ -1368,6 +1377,73 @@ Returns:
}
}
+#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
@@ -1378,7 +1454,7 @@ Returns:
EFI_STATUS
EFIAPI
PeCoffLoaderUnloadImage (
- IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
+ IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
/*++
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
index 824ab4b8ce..11ae5a17f0 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+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
@@ -383,8 +383,8 @@ EFI_STATUS
EFIAPI
PeiLibFfsFindNextFile (
IN EFI_FV_FILETYPE SearchType,
- IN EFI_PEI_FV_HANDLE FwVolHeader,
- IN OUT EFI_PEI_FILE_HANDLE *FileHeader
+ IN EFI_PEI_FV_HANDLE FvHandle,
+ IN OUT EFI_PEI_FILE_HANDLE *FileHandle
)
/*++
@@ -395,9 +395,9 @@ Routine Description:
Arguments:
SearchType - Filter to find only file of this type.
- FwVolHeader - Pointer to the current FV to search.
+ FvHandle - Pointer to the current FV to search.
FileHandle - Pointer to the file matching SearchType in FwVolHeader.
- - NULL if file not found
+ - NULL if file not found
Returns:
EFI_STATUS
@@ -407,7 +407,7 @@ Returns:
EFI_PEI_SERVICES **PeiServices;
PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, &FwVolHeader, &FileHeader);
+ return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, FvHandle, FileHandle);
}
@@ -471,13 +471,13 @@ Returns:
EFI_PEI_SERVICES **PeiServices;
PeiServices = GetPeiServicesTablePointer();
- return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, &FfsFileHeader, SectionData);
+ return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, (EFI_PEI_FILE_HANDLE)FfsFileHeader, SectionData);
}
EFI_STATUS
EFIAPI
PeiLibFfsGetVolumeInfo (
- IN EFI_PEI_FV_HANDLE *VolumeHandle,
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
OUT EFI_FV_INFO *VolumeInfo
)
/*++
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
index 9e01b2cd9e..884ec1cc27 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005, Intel Corporation. All rights reserved.<BR>
+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
@@ -35,6 +35,8 @@ typedef struct {
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/Processor.c b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
index aa366c2a1f..c930486183 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005 - 2008, Intel Corporation. All rights reserved.<BR>
+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
@@ -84,8 +84,6 @@ Returns:
--*/
{
*This = &mTransferControl;
- mTransferControl.SetJump = TransferControlSetJump;
- mTransferControl.LongJump = TransferControlLongJump;
return EFI_SUCCESS;
}
@@ -112,7 +110,6 @@ Returns:
--*/
{
*This = &mFlushInstructionCache;
- mFlushInstructionCache.Flush = FlushInstructionCacheFlush;
return EFI_SUCCESS;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
index b6be0b2f60..418400c15a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
@@ -1,6 +1,6 @@
;------------------------------------------------------------------------------
;
-; Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
+; 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
@@ -73,6 +73,8 @@ _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
@@ -116,6 +118,19 @@ TransferControlSetJump PROC
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
@@ -134,6 +149,19 @@ TransferControlSetJump ENDP
;
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
diff --git a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
index 5253c0e2d1..2d464488cc 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
#
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# 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
@@ -99,6 +99,19 @@ ASM_PFX(TransferControlSetJump):
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
@@ -115,7 +128,20 @@ ASM_PFX(TransferControlSetJump):
#
#
ASM_PFX(TransferControlLongJump):
- # set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
+ # 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
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
index 9807b45035..29cdeb967a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
+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
@@ -21,9 +21,11 @@ Abstract:
#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)
//
@@ -43,7 +45,81 @@ BOOLEAN mEfiAtRuntime = FALSE;
FVB_ENTRY *mFvbEntry;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
+
+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 *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
+ }
+ }
+
+ GuidHob.Raw = GET_NEXT_HOB (GuidHob);
+ }
+
+ return Status;
+}
+
#endif
EFI_STATUS
@@ -214,9 +290,8 @@ Returns:
//
EfiConvertInternalPointer ((VOID **) &gCpuIo);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gStatusCode != NULL) {
- EfiConvertInternalPointer ((VOID **) &gStatusCode->ReportStatusCode);
- EfiConvertInternalPointer ((VOID **) &gStatusCode);
+ if (gReportStatusCode != NULL) {
+ EfiConvertInternalPointer ((VOID **) &gReportStatusCode);
}
#endif
EfiConvertInternalPointer ((VOID **) &mRT);
@@ -256,6 +331,9 @@ Returns:
--*/
{
EFI_STATUS Status;
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ VOID *Registration;
+#endif
if (mRuntimeLibInitialized) {
return EFI_ALREADY_STARTED;
@@ -275,10 +353,26 @@ Returns:
ASSERT_EFI_ERROR (Status);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status)) {
- gStatusCode = NULL;
- }
+ //
+ // 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);
@@ -363,6 +457,16 @@ Returns:
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;
}
@@ -390,6 +494,9 @@ Returns:
--*/
{
EFI_STATUS Status;
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ VOID *Registration;
+#endif
if (mRuntimeLibInitialized) {
return EFI_ALREADY_STARTED;
@@ -406,10 +513,26 @@ Returns:
ASSERT (mRT != NULL);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status)) {
- gStatusCode = NULL;
- }
+ //
+ // 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);
@@ -761,8 +884,8 @@ 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
+ IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
/*++
@@ -788,19 +911,30 @@ Returns:
--*/
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gStatusCode == NULL) {
+#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;
}
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
+
+ //
+ // Try to get the PEI version of ReportStatusCode.
+ //
+ Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
+ if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
}
- Status = gStatusCode->ReportStatusCode (CodeType, Value, Instance, CallerId, Data);
+ Status = gReportStatusCode (CodeType, Value, Instance, CallerId, Data);
#else
if (mRT == NULL) {
return EFI_UNSUPPORTED;
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
index c94ee431ef..ac169a1166 100644
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
+++ b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+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
@@ -599,13 +599,6 @@ Routine Description:
Initialize a Firmware Volume (FV) Media Device Path node.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability.
-
Arguments:
FvDevicePathNode - Pointer to a FV device path node to initialize
@@ -617,11 +610,6 @@ Returns:
--*/
{
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
@@ -640,15 +628,6 @@ Routine Description:
Check to see if the Firmware Volume (FV) Media Device Path is valid.
- Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
- so as we move to UEFI 2.0 support we must use a mechanism that conforms with
- the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
- device path is defined for PIWG extensions of device path. If the code
- is compiled to conform with the UEFI 2.0 specification use the new device path
- else use the old form for backwards compatability. The return value to this
- function points to a location in FvDevicePathNode and it does not allocate
- new memory for the GUID pointer that is returned.
-
Arguments:
FvDevicePathNode - Pointer to FV device path to check
@@ -660,16 +639,11 @@ Returns:
--*/
{
- //
- // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
- // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
- // EFI 1.10 and UEFI 2.10.
- //
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
return &FvDevicePathNode->NameGuid;
}
- return NULL;
+ return NULL;
}
diff --git a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
index 8771e2bcd3..11b36e056d 100644
--- a/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
+++ b/EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2005 - 2008, Intel Corporation. All rights reserved.<BR>
+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
@@ -21,9 +21,11 @@ Abstract:
#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)
//
@@ -43,7 +45,81 @@ BOOLEAN mEfiAtRuntime = FALSE;
FVB_ENTRY *mFvbEntry;
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
-static EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
+
+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 *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
+ }
+ }
+
+ GuidHob.Raw = GET_NEXT_HOB (GuidHob);
+ }
+
+ return Status;
+}
+
#endif
EFI_STATUS
@@ -214,9 +290,8 @@ Returns:
//
EfiConvertInternalPointer ((VOID **) &gCpuIo);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gStatusCode != NULL) {
- EfiConvertInternalPointer ((VOID **) &gStatusCode->ReportStatusCode);
- EfiConvertInternalPointer ((VOID **) &gStatusCode);
+ if (gReportStatusCode != NULL) {
+ EfiConvertInternalPointer ((VOID **) &gReportStatusCode);
}
#endif
EfiConvertInternalPointer ((VOID **) &mRT);
@@ -256,6 +331,9 @@ Returns:
--*/
{
EFI_STATUS Status;
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ VOID *Registration;
+#endif
if (mRuntimeLibInitialized) {
return EFI_ALREADY_STARTED;
@@ -275,10 +353,26 @@ Returns:
ASSERT_EFI_ERROR (Status);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status)) {
- gStatusCode = NULL;
- }
+ //
+ // 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);
@@ -363,6 +457,16 @@ Returns:
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;
}
@@ -390,6 +494,9 @@ Returns:
--*/
{
EFI_STATUS Status;
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ VOID *Registration;
+#endif
if (mRuntimeLibInitialized) {
return EFI_ALREADY_STARTED;
@@ -406,10 +513,26 @@ Returns:
ASSERT (mRT != NULL);
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status)) {
- gStatusCode = NULL;
- }
+ //
+ // 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);
@@ -761,8 +884,8 @@ 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
+ IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
/*++
@@ -788,19 +911,30 @@ Returns:
--*/
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
- if (gStatusCode == NULL) {
+#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;
}
- Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
- if (EFI_ERROR (Status) || gStatusCode == NULL) {
+
+ //
+ // Try to get the PEI version of ReportStatusCode.
+ //
+ Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
+ if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
}
- Status = gStatusCode->ReportStatusCode (CodeType, Value, Instance, CallerId, Data);
+ Status = gReportStatusCode (CodeType, Value, Instance, CallerId, Data);
#else
if (mRT == NULL) {
return EFI_UNSUPPORTED;
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
index fcf7ff44d4..dd1cb289fc 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
@@ -1,6 +1,6 @@
#*****************************************************************************
#*
-#* Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+#* 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
@@ -51,4 +51,26 @@ ASM_PFX(AsmFxRestore):
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
index e07b52a46c..7f3f275b37 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm
@@ -1,6 +1,6 @@
;*****************************************************************************
;*
-;* Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+;* 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
@@ -48,4 +48,28 @@ AsmFxRestore PROC
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
index d1feb9972e..55415d8703 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
@@ -1,6 +1,6 @@
#*****************************************************************************
#*
-#* Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+#* 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
@@ -72,6 +72,9 @@ ASM_PFX(Thunk16):
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)
@@ -140,20 +143,23 @@ ASM_PFX(RealMode):
popw %es
popw %fs
popw %gs
- addw $4, %sp # skip EFlags
- testw $1, 14(%esp) #(_STK16 ptr [esp + 8]).ThunkFlags, 1
+ sub 60, %esp
+ popfw
+ testw $1, 74(%esp) #(_STK16 ptr [esp + STACK_PARAM_SIZE + sizeof(IA32_REGS)]).ThunkFlags, 1
+
jz 1f
- pushf
+ pushf # push Flags when it's INT#
1:
pushw %cs
# push @FarCallRet - _Code16Addr
.byte 0x68 # push /iw
.word FarCallRet - _Code16Addr
jz 2f
- ljmp *6(%esp) #bugbug
+ ljmp *66(%esp) #[esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
2:
- ljmp *4(%esp) #bugbug
+ ljmp *64(%esp) #[esp + 4 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
FarCallRet:
+ add 60, %esp
pushfl
pushw %gs
pushw %fs
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
index 410347764a..76c1317469 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
@@ -1,6 +1,6 @@
;*****************************************************************************
;*
-;* Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+;* 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
@@ -55,6 +55,8 @@ _DATA ENDS
_TEXT SEGMENT FLAT "CODE" PARA
+STACK_PARAM_SIZE EQU 16
+
IA32_REGS STRUC 4t
_EDI DD ?
_ESI DD ?
@@ -99,6 +101,11 @@ __Thunk16 PROC USES ebp ebx esi edi ds es fs gs
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
@@ -158,20 +165,22 @@ RealMode PROC
pop es
pop fs
pop gs
- add sp, 4 ; skip EFlags
- test (_STK16 ptr [esp + 8]).ThunkFlags, 1
+ 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
+ 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]
+ jmp fword ptr [esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
@@:
- jmp fword ptr [esp + 4]
+ 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
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
index 8a865616c1..6c16e25e4b 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -237,6 +237,13 @@ Returns:
--*/
;
+BOOLEAN
+AsmThunk16SetUserStack (
+ IN THUNK_CONTEXT *ThunkContext,
+ IN VOID *Stack,
+ IN UINTN StackSize
+ );
+
VOID
EFIAPI
AsmThunk16Destroy (
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
index 30c76974e2..c0807bc523 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
@@ -41,8 +41,30 @@ ASM_PFX(AsmFxSave):
# IN CONST IA32_FX_BUFFER *Buffer
# );
#------------------------------------------------------------------------------
-
ASM_PFX(AsmFxRestore):
fxrstor (%rcx)
retq
- \ No newline at end of file
+
+#------------------------------------------------------------------------------
+# 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
index f9c2e4d57b..ab4a97f23a 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm
@@ -1,6 +1,6 @@
;*****************************************************************************
;*
-;* Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+;* 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
@@ -43,4 +43,28 @@ AsmFxRestore PROC
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
index 888801b1ab..10f3a34c19 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
@@ -1,6 +1,6 @@
#*****************************************************************************
#*
-#* Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
+#* 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
@@ -106,6 +106,9 @@ ASM_PFX(Thunk16):
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)
@@ -183,27 +186,30 @@ ASM_PFX(RealMode):
.byte 0x07 #pop es
popq %fs
popq %gs
- add $0x8,%esp #skip RFLAGS
- .byte 0x67 #test [esp + 0eh], 1
+ 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 0x0e
+ .byte 0x4e
.byte 0x01
.byte 0x00
jz 1f
- pushfq #pushf, actually
+ pushfq #pushf, actually, when it's INT#
1:
.byte 0x0e #push cs
.byte 0x68 #push /iw
.word FarCallRet - _Code16Addr
jz 2f
.byte 0x66
- ljmp *6(%esp)
+ ljmp *70(%esp)
2:
.byte 0x66
- ljmp *4(%esp)
+ ljmp *68(%esp)
FarCallRet:
+ add 64, %esp
.byte 0x66
push $0x00 #push a dword of zero
.byte 0x66
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
index b6a8f86879..0638d5faa8 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
@@ -1,6 +1,6 @@
;*****************************************************************************
;*
-;* Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+;* 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
@@ -49,6 +49,8 @@ _16Gdtr LABEL FWORD
.code
+STACK_PARAM_SIZE EQU 16
+
IA32_REGS STRUC 4t
_EDI DD ?
_ESI DD ?
@@ -98,6 +100,11 @@ _Thunk16 PROC USES rbp rbx rsi rdi r12 r13 r14 r15
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
@@ -165,22 +172,27 @@ RealMode PROC
DB 7 ; pop es
pop fs
pop gs
+ sub esp, (sizeof(IA32_REGS) - 16) + STACK_PARAM_SIZE + 8
- add esp, 8 ; skip RFLAGS
- DB 67h, 0f7h, 44h, 24h, 0eh, 1, 0 ; test [esp + 0eh], 1
+ 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
+ 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]
+ jmp fword ptr [esp + 6 + STACK_PARAM_SIZE + sizeof(IA32_REGS) - 8]
@@:
DB 66h
- jmp fword ptr [esp + 4]
+ 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
diff --git a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
index c9aafd36aa..ed24663b48 100644
--- a/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
+++ b/EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -53,6 +53,18 @@ AsmFxSave (
OUT IA32_FX_BUFFER *Buffer
);
+UINTN
+EFIAPI
+AsmGetEflags (
+ VOID
+ );
+
+VOID
+EFIAPI
+AsmSetEflags (
+ IN UINTN Eflags
+ );
+
//
// Implementation
//
@@ -98,6 +110,7 @@ Returns:
{
IA32_FX_BUFFER *FpSavedState;
UINT8 FpBuffer[sizeof (*FpSavedState) + 0x10];
+ UINTN Eflags;
FpSavedState = (IA32_FX_BUFFER*)(((UINTN)FpBuffer + 0xf) & ~0xf);
@@ -110,6 +123,8 @@ Returns:
AsmFxSave (FpSavedState);
}
+ Eflags = AsmGetEflags ();
+
EfiCommonLibCopyMem (
RegisterSet,
_Thunk16 (
@@ -120,6 +135,8 @@ Returns:
sizeof (*RegisterSet)
);
+ AsmSetEflags (Eflags);
+
if (ThunkFlags & THUNK_SAVE_FP_STATE) {
AsmFxRestore (FpSavedState);
}
@@ -200,6 +217,67 @@ Returns:
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 (
@@ -253,12 +331,8 @@ Arguments:
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.
+ ThunkFlags - THUNK_USER_STACK: The stack specified by SS:ESP would be
+ used instead of the default stack.
Returns:
@@ -298,12 +372,8 @@ Arguments:
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.
+ ThunkFlags - THUNK_USER_STACK: The stack specified by SS:ESP would be
+ used instead of the default stack.
Returns:
diff --git a/EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h b/EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h
index f6f2c44fb7..c52ef47f73 100644
--- a/EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h
+++ b/EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -68,7 +68,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) (
IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
- OUT EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
+ IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
)
/*++
diff --git a/EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h b/EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h
index c9c96f762c..56e03e2266 100644
--- a/EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h
+++ b/EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -42,7 +42,7 @@ enum {
IP4_CONFIG_SOURCE_MAX,
IP4_NIC_NAME_LENGTH = 64,
- MAX_IP4_CONFIG_IN_VARIABLE = 16
+ MAX_IP4_CONFIG_IN_VARIABLE = 128
};
//
diff --git a/EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h b/EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h
index 84d244555e..e0290c0b0a 100644
--- a/EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h
+++ b/EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h
@@ -1,6 +1,6 @@
/*++
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
+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
@@ -111,8 +111,8 @@ typedef
EFI_STATUS
(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (
IN EFI_TCG_PROTOCOL *This,
- IN UINT32 TpmInputParamterBlockSize,
- IN UINT8 *TpmInputParamterBlock,
+ IN UINT32 TpmInputParameterBlockSize,
+ IN UINT8 *TpmInputParameterBlock,
IN UINT32 TpmOutputParameterBlockSize,
IN UINT8 *TpmOutputParameterBlock
);
@@ -121,7 +121,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (
IN EFI_TCG_PROTOCOL *This,
- IN UINT8 *HashData,
+ IN EFI_PHYSICAL_ADDRESS HashData,
IN UINT64 HashDataLen,
IN TCG_ALGORITHM_ID AlgorithmId,
IN OUT TCG_PCR_EVENT *TCGLogData,
@@ -160,9 +160,16 @@ EFI_STATUS
IN CHAR8 *ActionString
);
-typedef struct tdEFI_TCG_PLATFORM_PROTOCOL {
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_MEASURE_GPT_TABLE) (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+typedef struct _EFI_TCG_PLATFORM_PROTOCOL {
EFI_TCG_MEASURE_PE_IMAGE MeasurePeImage;
EFI_TCG_MEASURE_ACTION MeasureAction;
+ EFI_TCG_MEASURE_GPT_TABLE MeasureGptTable;
} EFI_TCG_PLATFORM_PROTOCOL;
extern EFI_GUID gEfiTcgPlatformProtocolGuid;