Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Nov 2010 01:54:49 +0000 (01:54 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 26 Nov 2010 01:54:49 +0000 (01:54 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11094 6f19259b-4bc3-4df7-8a09-765794883524

183 files changed:
EdkCompatibilityPkg/EDK_Snapshot.txt [deleted file]
EdkCompatibilityPkg/EdkCompatibilityPkg.dec
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.S
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.asm
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/IA32/CpuIA32.c
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.S
EdkCompatibilityPkg/Foundation/Cpu/Pentium/CpuIA32Lib/X64/Cpu.asm
EdkCompatibilityPkg/Foundation/Efi/Include/EfiDevicePath.h
EdkCompatibilityPkg/Foundation/Efi/Include/EfiError.h
EdkCompatibilityPkg/Foundation/Efi/Include/EfiHii.h
EdkCompatibilityPkg/Foundation/Efi/Include/EfiImage.h
EdkCompatibilityPkg/Foundation/Efi/Include/EfiTypes.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/BlockIo/BlockIo.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/ComponentName2/ComponentName2.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/EfiProtocolLib.inf
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiDatabase/HiiDatabase.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiFont/HiiFont.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiImage/HiiImage.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiString/HiiString.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/Ip4/Ip4.h
EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleFileSystem/SimpleFileSystem.h
EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMemory.h
EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassMisc.h
EdkCompatibilityPkg/Foundation/Framework/Guid/DataHubRecords/DataHubSubClassProcessor.h
EdkCompatibilityPkg/Foundation/Framework/Include/EfiCapsule.h
EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
EdkCompatibilityPkg/Foundation/Framework/Include/PeiApi.h
EdkCompatibilityPkg/Foundation/Framework/Include/TianoSpecDevicePath.h
EdkCompatibilityPkg/Foundation/Framework/Ppi/EdkFrameworkPpiLib.inf
EdkCompatibilityPkg/Foundation/Framework/Ppi/FirmwareVolume/FirmwareVolume.h
EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.c
EdkCompatibilityPkg/Foundation/Framework/Protocol/FirmwareVolumeBlock/FirmwareVolumeBlock.h
EdkCompatibilityPkg/Foundation/Framework/Protocol/IdeControllerInit/IdeControllerInit.h
EdkCompatibilityPkg/Foundation/Guid/AcpiDescription/AcpiDescription.h
EdkCompatibilityPkg/Foundation/Guid/PciOptionRomTable/PciOptionRomTable.h
EdkCompatibilityPkg/Foundation/Guid/PeiPeCoffLoader/PeiPeCoffLoader.h
EdkCompatibilityPkg/Foundation/Include/EfiSpec.h
EdkCompatibilityPkg/Foundation/Include/EfiTpm.h
EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Smbios.h
EdkCompatibilityPkg/Foundation/Include/IndustryStandard/Tpm12.h
EdkCompatibilityPkg/Foundation/Include/IndustryStandard/pci23.h
EdkCompatibilityPkg/Foundation/Include/IndustryStandard/scsi.h
EdkCompatibilityPkg/Foundation/Include/Tiano.h
EdkCompatibilityPkg/Foundation/Include/TianoHii.h
EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib.inf
EdkCompatibilityPkg/Foundation/Library/CompilerStub/CompilerStubLib_Edk2.inf
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/DevicePath.c
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/EfiDriverLib.c
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiDriverLib/ReportStatusCode.c
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiIfrSupportLib/EfiIfrSupportLib.inf
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiScriptLib/EfiScriptLib.inf
EdkCompatibilityPkg/Foundation/Library/Dxe/EfiUiLib/EfiUiLib.c
EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiDriverLib.h
EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiUiLib.h
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiEfiIfrSupportLib.inf
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrCommon.c
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrForm.c
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrLibrary.h
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrOpCodeCreation.c
EdkCompatibilityPkg/Foundation/Library/Dxe/UefiEfiIfrSupportLib/UefiIfrString.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueDxeDriverEntryPoint.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/EntryPoints/EdkIIGlueSmmDriverEntryPoint.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Common/EdkIIGlueDependencies.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueConfig.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/EdkIIGlueUefi.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiDriverModelLib.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueUefiLib.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BaseMemoryLib/CompareMemWrapper.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeLib.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Common/RuntimeService.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeLib.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/Ipf/RuntimeService.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/EdkDxeRuntimeDriverLib/RuntimeLibInternal.h
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiDriverModelLib/UefiDriverModelLib.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiLib.c
EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiLib/UefiNotTiano.c
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib.inf
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.S
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.asm
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMem.c
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemSSE2.c
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.S
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.asm
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/Power10U64.c
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Math.c
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Misc.c
EdkCompatibilityPkg/Foundation/Library/Pei/Include/PeiLib.h
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeCoffLoader.c
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/PeiLib.c
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/EfiJump.h
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.Asm
EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/ProcessorAsms.S
EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/Ia32/RuntimeLib.c
EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/RtDevicePath.c
EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/X64/RuntimeLib.c
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Fx.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/Ia32/Thunk16.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/Thunk16Lib.h
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Fx.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.S
EdkCompatibilityPkg/Foundation/Library/Thunk16/X64/Thunk16.asm
EdkCompatibilityPkg/Foundation/Library/Thunk16/X86Thunk.c
EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl/ConsoleControl.h
EdkCompatibilityPkg/Foundation/Protocol/NicIp4Config/NicIp4Config.h
EdkCompatibilityPkg/Foundation/Protocol/TcgService/TcgService.h
EdkCompatibilityPkg/Sample/CommonTools.env
EdkCompatibilityPkg/Sample/Platform/Common.dsc
EdkCompatibilityPkg/Sample/Platform/EdkIIGlueLibAll.dsc
EdkCompatibilityPkg/Sample/Platform/Generic/Pei/Capsule/Capsule.h
EdkCompatibilityPkg/Sample/Tools/Source/Common/FvLib.c
EdkCompatibilityPkg/Sample/Tools/Source/Common/ParseInf.c
EdkCompatibilityPkg/Sample/Tools/Source/Common/ParseInf.h
EdkCompatibilityPkg/Sample/Tools/Source/EfiCompress/EfiCompressMain.c
EdkCompatibilityPkg/Sample/Tools/Source/EfiRom/EfiRom.c
EdkCompatibilityPkg/Sample/Tools/Source/FwImage/fwimage.c
EdkCompatibilityPkg/Sample/Tools/Source/GenAprioriFile/GenAprioriFile.c
EdkCompatibilityPkg/Sample/Tools/Source/GenCRC32Section/GenCRC32Section.c
EdkCompatibilityPkg/Sample/Tools/Source/GenDepex/GenDepex.c
EdkCompatibilityPkg/Sample/Tools/Source/GenDepex/GenDepex.h
EdkCompatibilityPkg/Sample/Tools/Source/GenFfsFile/GenFfsFile.c
EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageExe.c
EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageExe.h
EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLib.c
EdkCompatibilityPkg/Sample/Tools/Source/GenFvImage/GenFvImageLibInternal.h
EdkCompatibilityPkg/Sample/Tools/Source/GenSection/GenSection.c
EdkCompatibilityPkg/Sample/Tools/Source/GenTEImage/GenTEImage.c
EdkCompatibilityPkg/Sample/Tools/Source/GuidChk/GuidChk.c
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/FindFiles.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/HiiPack.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/HiiPack.h [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/IfrParse.h [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/Makefile [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/StringParse.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/HiiPack/StringParse.h [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/MakeDeps/MakeDeps.c
EdkCompatibilityPkg/Sample/Tools/Source/Makefile
EdkCompatibilityPkg/Sample/Tools/Source/ModifyInf/ModifyInf.c
EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/FWVolume.c
EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/Makefile
EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/MultiThread.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/MultiThread.h [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/ProcessDsc.c
EdkCompatibilityPkg/Sample/Tools/Source/SetStamp/SetStamp.c
EdkCompatibilityPkg/Sample/Tools/Source/SplitFile/splitfile.c
EdkCompatibilityPkg/Sample/Tools/Source/StrGather/StrGather.c
EdkCompatibilityPkg/Sample/Tools/Source/StrGather/StrGather.h
EdkCompatibilityPkg/Sample/Tools/Source/StrGather/StringDB.c
EdkCompatibilityPkg/Sample/Tools/Source/StrGather/StringDB.h
EdkCompatibilityPkg/Sample/Tools/Source/Strip/strip.c
EdkCompatibilityPkg/Sample/Tools/Source/UefiHiiPack/HiiPack.c [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/UefiHiiPack/Makefile [new file with mode: 0644]
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.c
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StrGather.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.c
EdkCompatibilityPkg/Sample/Tools/Source/UefiStrGather/StringDB.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/EfiVfr.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.cpp
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrCompiler.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrError.cpp
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrError.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrFormPkg.cpp
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrFormPkg.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrSyntax.g
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrUtilityLib.cpp
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/VfrUtilityLib.h
EdkCompatibilityPkg/Sample/Tools/Source/UefiVfrCompile/makefile
EdkCompatibilityPkg/Sample/Tools/Source/VfrCompile/EfiVfr.h
EdkCompatibilityPkg/Sample/Tools/Source/VfrCompile/VfrCompile.g
EdkCompatibilityPkg/Sample/Tools/Source/VfrCompile/VfrServices.cpp
EdkCompatibilityPkg/Sample/Tools/Source/VfrCompile/makefile
EdkCompatibilityPkg/Sample/Version.env

diff --git a/EdkCompatibilityPkg/EDK_Snapshot.txt b/EdkCompatibilityPkg/EDK_Snapshot.txt
deleted file mode 100644 (file)
index efc15da..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Notes:\r
-  This EDK Compatibility Package is based on the EDK 1.03 release found at http://edk.tianocore.org.\r
-  It is compatibile with EDK 1.01 with the following exception:\r
-\r
-\r
-13:49 2008-1-24\r
-\r
-  This Edk Compatibility Package is updated to the EDK 1.04 release found at http://edk.tianocore.org.\r
-  \r
-  
\ No newline at end of file
index bda1bcd7b7a434b4d8f7b1ee2ab905cee6a0c314..6240bfde57aad556e15ddfda7e25b20e332d23ad 100644 (file)
@@ -3,7 +3,7 @@
 # in UEFI 2.0 + Framework 0.9x mode. This package also provides Thunk modules that enable Framework 0.9x modules to work with UEFI2.3/PI1.2 EDK II Cores.\r
 # EdkCompatibilityPkg is based on the EDK 1.01 release, found at http://edk.tianocore.org. This package only \r
 # contains the header files and libraries found in the original EDK. EdkCompatibilityPkg code is ANSI C compliant, so the modules can be built with GCC tool-chains. \r
-# This package also incorporates bug fixes released in EDK 1.04.\r
+# This package also incorporates bug fixes released in EDK 1.06.\r
 # \r
 # Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #\r
index 35cb4957c487bef5052bd478009ee6f75ffb9b80..acc2b2e9c9dee70963e198ee0207b977ae0e2567 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-#Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+#Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #This program and the accompanying materials                          \r
 #are licensed and made available under the terms and conditions of the BSD License         \r
 #which accompanies this distribution.  The full text of the license may be found at        \r
@@ -157,7 +157,7 @@ L2:
 #  VOID\r
 #  )\r
 ASM_PFX(EfiEnableCache):\r
-    invd\r
+    wbinvd\r
     movl  %cr0, %eax\r
     andl  $0x9fffffff, %eax\r
     movl  %eax, %cr0\r
index 38d3c49744ee4038c5a4079e06e4bd9d1862c104..878be4d80a0accfb632318c824fd9c4865a43655 100644 (file)
@@ -1,6 +1,6 @@
 ;/*++\r
 ;\r
-;Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+;Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 ;This program and the accompanying materials                          \r
 ;are licensed and made available under the terms and conditions of the BSD License         \r
 ;which accompanies this distribution.  The full text of the license may be found at        \r
@@ -140,7 +140,7 @@ EfiDisableCache  ENDP
 ;  VOID\r
 ;  )\r
 EfiEnableCache PROC C PUBLIC\r
-    invd\r
+    wbinvd\r
     mov   eax, cr0\r
     and   eax, 09fffffffh         \r
     mov   cr0, eax\r
index 6572bbd8f5699e2e532e324f3bd4445114b1afcc..b4dc7e0b226881dfa3f319133894d531a3e66d1b 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -118,7 +118,7 @@ VOID
 EfiEnableCache (VOID)\r
 {\r
   __asm {\r
-    invd\r
+    wbinvd\r
     mov   eax, cr0\r
     and   eax, 09fffffffh         \r
     mov   cr0, eax\r
index 380ff936a11c7923576f23b6291efa499f61c654..38c663e1314403f4b9d2f40744307fe908260e44 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #*\r
-#*   Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #*   This program and the accompanying materials                          \r
 #*   are licensed and made available under the terms and conditions of the BSD License         \r
 #*   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -151,7 +151,7 @@ ASM_PFX(EfiDisableCache):
 #   );\r
 #------------------------------------------------------------------------------\r
 ASM_PFX(EfiEnableCache):\r
-      invd   \r
+      wbinvd   \r
       mov    %cr0,%rax\r
       and    $0xffffffff9fffffff,%rax\r
       mov    %rax,%cr0\r
index ab4daedfdcfa63cbb58e0a274dd87244757d939f..adb0fa73f32c13f5a73dbb5d81df636acefcc403 100644 (file)
@@ -2,7 +2,7 @@ TITLE   Cpu.asm: Assembly code for the x64 resources
 \r
 ;------------------------------------------------------------------------------\r
 ;*\r
-;*   Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>\r
+;*   Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 ;*   This program and the accompanying materials                          \r
 ;*   are licensed and made available under the terms and conditions of the BSD License         \r
 ;*   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -150,7 +150,7 @@ EfiDisableCache ENDP
 ;   );\r
 ;------------------------------------------------------------------------------\r
 EfiEnableCache PROC    PUBLIC\r
-    invd\r
+    wbinvd\r
     mov   rax, cr0\r
     and   rax, 09fffffffh         \r
     mov   cr0, rax\r
index ea54c4bc0f419b131604c044f21d4379c3bc0f0b..4bde7d26109a8180aebf1bc3ab3af529c2662364 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
  \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -214,7 +214,6 @@ typedef struct {
   UINT8                           DeviceProtocol;\r
 } USB_CLASS_DEVICE_PATH;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
 #define MSG_USB_WWID_DP           0x10\r
 typedef struct {\r
   EFI_DEVICE_PATH_PROTOCOL        Header;\r
@@ -231,7 +230,6 @@ typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;\r
   UINT8                           Lun;\r
 } DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
-#endif\r
 \r
 #define MSG_SATA_DP               0x12\r
 typedef struct {\r
@@ -330,8 +328,6 @@ typedef struct {
   UINT32                          FlowControlMap;\r
 } UART_FLOW_CONTROL_DEVICE_PATH;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-\r
 #define DEVICE_PATH_MESSAGING_SAS \\r
     { 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d} }\r
 \r
@@ -345,8 +341,6 @@ typedef struct {
   UINT16                          RelativeTargetPort;\r
 } SAS_DEVICE_PATH;\r
 \r
-#endif\r
-\r
 #define MSG_ISCSI_DP              0x13\r
 typedef struct {\r
   EFI_DEVICE_PATH_PROTOCOL        Header;\r
@@ -428,8 +422,6 @@ typedef struct {
   EFI_GUID                        Protocol;\r
 } MEDIA_PROTOCOL_DEVICE_PATH;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
-\r
 #define MEDIA_FV_DP  0x07\r
 typedef struct {\r
   EFI_DEVICE_PATH_PROTOCOL  Header;\r
@@ -449,7 +441,6 @@ typedef struct {
   UINT64                    StartingOffset;\r
   UINT64                    EndingOffset;\r
 } MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;\r
-#endif\r
 \r
 //\r
 // BBS Device Path\r
@@ -509,10 +500,8 @@ typedef union {
   F1394_DEVICE_PATH                    F1394;\r
   USB_DEVICE_PATH                      Usb;\r
   USB_CLASS_DEVICE_PATH                UsbClass;\r
-  #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   USB_WWID_DEVICE_PATH                 UsbWwid;\r
   DEVICE_LOGICAL_UNIT_DEVICE_PATH      LogicUnit;\r
-  #endif\r
   I2O_DEVICE_PATH                      I2O;\r
   MAC_ADDR_DEVICE_PATH                 MacAddr;\r
   IPv4_DEVICE_PATH                     Ipv4;\r
@@ -520,9 +509,7 @@ typedef union {
   INFINIBAND_DEVICE_PATH               InfiniBand;\r
   UART_DEVICE_PATH                     Uart;\r
   UART_FLOW_CONTROL_DEVICE_PATH        UartFlowControl;\r
-  #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   SAS_DEVICE_PATH                      Sas;\r
-  #endif\r
   ISCSI_DEVICE_PATH                    Iscsi;\r
   HARDDRIVE_DEVICE_PATH                HardDrive;\r
   CDROM_DEVICE_PATH                    CD;\r
@@ -530,12 +517,10 @@ typedef union {
   FILEPATH_DEVICE_PATH                 FilePath;\r
   MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;\r
 \r
-  #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
   MEDIA_FW_VOL_DEVICE_PATH             PiwgFirmwareVolume;\r
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH    PiwgFirmwareFile;\r
   MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH\r
                                        Offset;\r
-  #endif\r
 \r
   BBS_BBS_DEVICE_PATH                  Bbs;\r
 } EFI_DEV_PATH;\r
@@ -563,10 +548,8 @@ typedef union {
   F1394_DEVICE_PATH                    *F1394;\r
   USB_DEVICE_PATH                      *Usb;\r
   USB_CLASS_DEVICE_PATH                *UsbClass;\r
-  #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   USB_WWID_DEVICE_PATH                 *UsbWwid;\r
   DEVICE_LOGICAL_UNIT_DEVICE_PATH      *LogicUnit;\r
-  #endif\r
   I2O_DEVICE_PATH                      *I2O;\r
   MAC_ADDR_DEVICE_PATH                 *MacAddr;\r
   IPv4_DEVICE_PATH                     *Ipv4;\r
@@ -575,9 +558,7 @@ typedef union {
   UART_DEVICE_PATH                     *Uart;\r
   UART_FLOW_CONTROL_DEVICE_PATH        *UartFlowControl;\r
 \r
-  #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   SAS_DEVICE_PATH                      *Sas;\r
-  #endif\r
   ISCSI_DEVICE_PATH                    *Iscsi;\r
 \r
   HARDDRIVE_DEVICE_PATH                *HardDrive;\r
@@ -586,10 +567,10 @@ typedef union {
   FILEPATH_DEVICE_PATH                 *FilePath;\r
   MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;\r
 \r
-  #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
   MEDIA_FW_VOL_DEVICE_PATH             *PiwgFirmwareVolume;\r
   MEDIA_FW_VOL_FILEPATH_DEVICE_PATH    *PiwgFirmwareFile;\r
-  #endif\r
+  MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH\r
+                                       *Offset;\r
 \r
   BBS_BBS_DEVICE_PATH                  *Bbs;\r
   UINT8                                *Raw;\r
index 9ddd1b3568743d885bd6405baafa9de7faadf174..1db119b2986e33f6537d8b9e67714be16d1f1588 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -58,6 +58,9 @@ Abstract:
 #define EFI_INCOMPATIBLE_VERSION  EFIERR (25)\r
 #define EFI_SECURITY_VIOLATION    EFIERR (26)\r
 #define EFI_CRC_ERROR             EFIERR (27)\r
+#define EFI_END_OF_MEDIA          EFIERR (28)\r
+#define EFI_END_OF_FILE           EFIERR (31)\r
+#define EFI_INVALID_LANGUAGE      EFIERR (32)\r
 \r
 #define EFI_WARN_UNKNOWN_GLYPH    EFIWARN (1)\r
 #define EFI_WARN_DELETE_FAILURE   EFIWARN (2)\r
index 30e001963c43cbf9b7d627e07a0bd066f9bf33f5..fd15d4f179947e22f52914d86e0d96fe49da8744 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -59,13 +59,13 @@ typedef struct {
 \r
 #define EFI_HII_PACKAGE_TYPE_ALL             0x00\r
 #define EFI_HII_PACKAGE_TYPE_GUID            0x01\r
-#define EFI_HII_PACKAGE_FORM                 0x02\r
-#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x03\r
+#define EFI_HII_PACKAGE_FORMS                0x02\r
 #define EFI_HII_PACKAGE_STRINGS              0x04\r
 #define EFI_HII_PACKAGE_FONTS                0x05\r
 #define EFI_HII_PACKAGE_IMAGES               0x06\r
 #define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07\r
 #define EFI_HII_PACKAGE_DEVICE_PATH          0x08\r
+#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x09\r
 #define EFI_HII_PACKAGE_END                  0xDF\r
 #define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0\r
 #define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF\r
@@ -108,6 +108,7 @@ typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
 // Font Package\r
 //\r
 \r
+#define EFI_HII_FONT_STYLE_NORMAL            0x00000000\r
 #define EFI_HII_FONT_STYLE_BOLD              0x00000001\r
 #define EFI_HII_FONT_STYLE_ITALIC            0x00000002\r
 #define EFI_HII_FONT_STYLE_EMBOSS            0x00010000\r
@@ -237,8 +238,8 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
 // String Package\r
 //\r
 \r
-#define UEFI_CONFIG_LANG  L"x-UEFI"\r
-#define UEFI_CONFIG_LANG2 L"x-i-UEFI"     // BUGBUG, spec need to be updated.\r
+#define UEFI_CONFIG_LANG   "x-UEFI"\r
+#define UEFI_CONFIG_LANG_2 "x-i-UEFI"\r
 \r
 typedef struct _EFI_HII_STRING_PACKAGE_HDR {\r
   EFI_HII_PACKAGE_HEADER  Header;\r
@@ -697,14 +698,14 @@ typedef struct _EFI_IFR_VARSTORE {
 \r
 typedef struct _EFI_IFR_VARSTORE_EFI {\r
   EFI_IFR_OP_HEADER        Header;\r
-  UINT16                   VarStoreId;\r
+  EFI_VARSTORE_ID          VarStoreId;\r
   EFI_GUID                 Guid;\r
   UINT32                   Attributes;\r
 } EFI_IFR_VARSTORE_EFI;\r
 \r
 typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {\r
   EFI_IFR_OP_HEADER        Header;\r
-  UINT16                   VarStoreId;\r
+  EFI_VARSTORE_ID          VarStoreId;\r
   EFI_GUID                 Guid;\r
 } EFI_IFR_VARSTORE_NAME_VALUE;\r
 \r
@@ -713,8 +714,13 @@ typedef struct _EFI_IFR_FORM_SET {
   EFI_GUID                 Guid;\r
   EFI_STRING_ID            FormSetTitle;\r
   EFI_STRING_ID            Help;\r
+  UINT8                    Flags;\r
+  EFI_GUID                 ClassGuid[1];\r
 } EFI_IFR_FORM_SET;\r
 \r
+#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \\r
+  { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }\r
+\r
 typedef struct _EFI_IFR_END {\r
   EFI_IFR_OP_HEADER        Header;\r
 } EFI_IFR_END;\r
@@ -805,7 +811,7 @@ typedef struct _EFI_IFR_REF4 {
 \r
 typedef struct _EFI_IFR_RESET_BUTTON {\r
   EFI_IFR_OP_HEADER        Header;\r
-  EFI_IFR_QUESTION_HEADER  Question;\r
+  EFI_IFR_STATEMENT_HEADER Statement;\r
   EFI_DEFAULT_ID           DefaultId;\r
 } EFI_IFR_RESET_BUTTON;\r
 \r
@@ -1273,7 +1279,7 @@ typedef enum {
   EfiKeyB8,\r
   EfiKeyB9,\r
   EfiKeyB10,\r
-  EfiKeyRshift,\r
+  EfiKeyRShift,\r
   EfiKeyUpArrow,\r
   EfiKeyOne,\r
   EfiKeyTwo,\r
@@ -1396,16 +1402,16 @@ typedef struct {
   // EFI_HII_KEYBOARD_LAYOUT Layout[];\r
 } EFI_HII_KEYBOARD_PACKAGE_HDR;\r
 \r
-typedef struct {\r
-  CHAR16                  Language[3];\r
-  CHAR16                  Space;\r
-  CHAR16                  DescriptionString[1];\r
-} EFI_DESCRIPTION_STRING;\r
+//typedef struct {\r
+//  CHAR16                  Language[];           // RFC4646 Language Code\r
+//  CHAR16                  Space;\r
+//  CHAR16                  DescriptionString[];\r
+//} EFI_DESCRIPTION_STRING;\r
 \r
-typedef struct {\r
-  UINT16                  DescriptionCount;\r
-  EFI_DESCRIPTION_STRING  DescriptionString[1];\r
-} EFI_DESCRIPTION_STRING_BUNDLE;\r
+//typedef struct {\r
+//  UINT16                  DescriptionCount;\r
+//  EFI_DESCRIPTION_STRING  DescriptionString[];\r
+//} EFI_DESCRIPTION_STRING_BUNDLE;\r
 \r
 //\r
 // Modifier values\r
@@ -1425,7 +1431,7 @@ typedef struct {
 #define EFI_LEFT_SHIFT_MODIFIER          0x000C\r
 #define EFI_RIGHT_SHIFT_MODIFIER         0x000D\r
 #define EFI_CAPS_LOCK_MODIFIER           0x000E\r
-#define EFI_NUM_LOCK _MODIFIER           0x000F\r
+#define EFI_NUM_LOCK_MODIFIER            0x000F\r
 #define EFI_LEFT_ARROW_MODIFIER          0x0010\r
 #define EFI_RIGHT_ARROW_MODIFIER         0x0011\r
 #define EFI_DOWN_ARROW_MODIFIER          0x0012\r
@@ -1458,6 +1464,10 @@ typedef struct {
 #define EFI_PAUSE_MODIFIER               0x0025\r
 #define EFI_BREAK_MODIFIER               0x0026\r
 \r
+#define EFI_LEFT_LOGO_MODIFIER           0x0027\r
+#define EFI_RIGHT_LOGO_MODIFIER          0x0028\r
+#define EFI_MENU_MODIFIER                0x0029\r
+\r
 #pragma pack()\r
 \r
 #endif\r
index fa6dc424c3b482e1729a12b723a774d27f5fc8a2..90f7b75b478c5e41c1fef641fed289f01d3c211f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -622,6 +622,48 @@ typedef struct {
   //\r
 } EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;\r
 \r
+//\r
+// Resource Format\r
+//\r
+typedef struct {\r
+  UINT32  Characteristics;\r
+  UINT32  TimeDateStamp;\r
+  UINT16  MajorVersion;\r
+  UINT16  MinorVersion;\r
+  UINT16  NumberOfNamedEntries;\r
+  UINT16  NumberOfIdEntries;\r
+//  EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[];\r
+} EFI_IMAGE_RESOURCE_DIRECTORY;\r
+\r
+typedef struct {\r
+  union {\r
+    struct {\r
+      UINT32  NameOffset:31;\r
+      UINT32  NameIsString:1;\r
+    } s;\r
+    UINT32  Id;\r
+  } u1;\r
+  union {\r
+    UINT32  OffsetToData;\r
+    struct {\r
+      UINT32  OffsetToDirectory:31;\r
+      UINT32  DataIsDirectory:1;\r
+    } s;\r
+  } u2;\r
+} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;\r
+\r
+typedef struct {\r
+  UINT16  Length;\r
+  CHAR16  String[1];\r
+} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;\r
+\r
+typedef struct {\r
+  UINT32  OffsetToData;\r
+  UINT32  Size;\r
+  UINT32  CodePage;\r
+  UINT32  Reserved;\r
+} EFI_IMAGE_RESOURCE_DATA_ENTRY;\r
+\r
 //\r
 // Header format for TE images\r
 //\r
index 3fba60ff5d156607d589b2e4ed11c7d29be6c531..5de817e09168f2e2f402bb41c607a88d9b2ce860 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -90,11 +90,11 @@ typedef UINT64 EFI_LBA;
 // EFI Constants. They may exist in other build structures, so #ifndef them.\r
 //\r
 #ifndef TRUE\r
-#define TRUE  ((BOOLEAN) 1 == 1)\r
+#define TRUE  ((BOOLEAN) (1 == 1))\r
 #endif\r
 \r
 #ifndef FALSE\r
-#define FALSE ((BOOLEAN) 0 == 1)\r
+#define FALSE ((BOOLEAN) (0 == 1))\r
 #endif\r
 \r
 #ifndef NULL\r
index ac914f7508c5cde44143e1caf0a2f99f236a6181..0767b8a4a1c1e7b3f9b8d2e3f748361c62512396 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -185,9 +185,16 @@ typedef struct {
   UINT32  IoAlign;\r
 \r
   EFI_LBA LastBlock;\r
+\r
+  EFI_LBA LowestAlignedLba;\r
+  UINT32  LogicalBlocksPerPhysicalBlock;\r
 } EFI_BLOCK_IO_MEDIA;\r
 \r
-#define EFI_BLOCK_IO_PROTOCOL_REVISION  0x00010000\r
+#define EFI_BLOCK_IO_PROTOCOL_REVISION     0x00010000\r
+#define EFI_BLOCK_IO_PROTOCOL_REVISION2    0x00020001\r
+\r
+#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV1  ((UINTN)&((EFI_BLOCK_IO_MEDIA *)0)->LastBlock + sizeof(EFI_LBA))\r
+#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV2  sizeof(EFI_BLOCK_IO_MEDIA)\r
 \r
 struct _EFI_BLOCK_IO_PROTOCOL {\r
   UINT64              Revision;\r
index 6a3a42bd9df8d2fc2de57ffa984760429c6f0c57..19c6d5a09d2f2ae97acdef18064bceb2026b2d9e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -50,12 +50,13 @@ EFI_STATUS
     Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
 \r
   Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
+    This       - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.\r
+    Language   - A pointer to a Null-terminated ASCII string array indicating the \r
+                 language.  This is the language of the driver name that the caller \r
+                 is requesting, and it must match one of the languages specified in \r
+                 SupportedLanguages. The number of languages supported by a \r
+                 driver is up to the driver writer.  Language is specified in RFC \r
+                 4646 language code format.\r
     DriverName - A pointer to the Unicode string to return.  This Unicode string\r
                  is the name of the driver specified by This in the language \r
                  specified by Language.\r
@@ -86,7 +87,7 @@ EFI_STATUS
     that is being managed by an EFI Driver.\r
 \r
   Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+    This             - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.\r
     ControllerHandle - The handle of a controller that the driver specified by \r
                        This is managing.  This handle specifies the controller \r
                        whose name is to be returned.\r
@@ -96,12 +97,12 @@ EFI_STATUS
                        for a bus drivers that wish to retrieve the name of the \r
                        bus controller.  It will not be NULL for a bus driver \r
                        that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 languag\r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
+    Language         - A pointer to a Null-terminated ASCII string array indicating th\r
+                       language.  This is the language of the driver name that the caller \r
+                       is requesting, and it must match one of the languages specified in \r
+                       SupportedLanguages. The number of languages supported by a \r
+                       driver is up to the driver writer.  Language is specified in RFC \r
+                       4646 language code format.\r
     ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
                        string is the name of the controller specified by \r
                        ControllerHandle and ChildHandle in the language specified\r
index 854efb354e956230770017b3415d4de9219a79b2..e99e26de272450a5af174a949ba6fbc783ae33ed 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials                          \r
 # are licensed and made available under the terms and conditions of the BSD License         \r
 # which accompanies this distribution.  The full text of the license may be found at        \r
@@ -117,6 +117,8 @@ COMPONENT_TYPE=   LIBRARY
   HiiFont/HiiFont.c\r
   HiiImage/HiiImage.h\r
   HiiImage/HiiImage.c\r
+  HiiPackageList/HiiPackageList.h\r
+  HiiPackageList/HiiPackageList.c\r
   HiiString/HiiString.h\r
   HiiString/HiiString.c  \r
   Ip4/Ip4.h\r
index 8cb526613eebb688fd757046ff88ca1e19fc60ff..b319aae973d13795fea8346485bd82be272ae310 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -138,8 +138,7 @@ EFI_STATUS
   Returns:\r
     EFI_SUCCESS            - The data associated with the Handle was removed from \r
                              the HII database.\r
-    EFI_NOT_FOUND          - The specified PackageList could not be found in database.\r
-    EFI_INVALID_PARAMETER  - The Handle was not valid.\r
+    EFI_NOT_FOUND          - The specified Handle is not in database.\r
      \r
 --*/\r
 ;\r
@@ -166,8 +165,8 @@ EFI_STATUS
   Returns:\r
     EFI_SUCCESS            - The HII database was successfully updated.\r
     EFI_OUT_OF_RESOURCES   - Unable to allocate enough memory for the updated database.\r
-    EFI_INVALID_PARAMETER  - Handle or PackageList was NULL.\r
-    EFI_NOT_FOUND          - The Handle was not valid or could not be found in database.\r
+    EFI_INVALID_PARAMETER  - PackageList was NULL.\r
+    EFI_NOT_FOUND          - The specified Handle is not in database.\r
      \r
 --*/\r
 ;\r
@@ -203,12 +202,16 @@ EFI_STATUS
         \r
   Returns:\r
     EFI_SUCCESS            - The matching handles are outputed successfully.\r
+                             HandleBufferLength is updated with the actual length.\r
     EFI_BUFFER_TO_SMALL    - The HandleBufferLength parameter indicates that\r
                              Handle is too small to support the number of handles.\r
                              HandleBufferLength is updated with a value that will \r
                              enable the data to fit.\r
     EFI_NOT_FOUND          - No matching handle could not be found in database.\r
     EFI_INVALID_PARAMETER  - Handle or HandleBufferLength was NULL.\r
+    EFI_INVALID_PARAMETER  - PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but\r
+                             PackageGuid is not NULL, PackageType is a EFI_HII_\r
+                             PACKAGE_TYPE_GUID but PackageGuid is NULL.\r
      \r
 --*/  \r
 ;\r
@@ -312,7 +315,8 @@ EFI_STATUS
                          \r
   Returns:\r
     EFI_SUCCESS            - Notification is unregistered successfully.    \r
-    EFI_INVALID_PARAMETER  - The Handle is invalid.\r
+    EFI_NOT_FOUND          - The incoming notification handle does not exist \r
+                             in current hii database.\r
      \r
 --*/  \r
 ;  \r
index 36f5a872eb6f83f7424b3795aae5b48a0d9413a3..46c922cf123b6c2a8ac0525654724e01624e30a5 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -53,9 +53,9 @@ typedef struct _EFI_HII_ROW_INFO {
 } EFI_HII_ROW_INFO;\r
 \r
 typedef struct {\r
-  UINT32 FontStyle;\r
-  UINT16 FontSize; // character cell size in pixels\r
-  CHAR16 FontName[1];\r
+  EFI_HII_FONT_STYLE FontStyle;\r
+  UINT16             FontSize; // character cell height in pixels\r
+  CHAR16             FontName[1];\r
 } EFI_FONT_INFO;\r
 \r
 typedef struct _EFI_FONT_DISPLAY_INFO {\r
@@ -65,25 +65,25 @@ typedef struct _EFI_FONT_DISPLAY_INFO {
   EFI_FONT_INFO                 FontInfo;  \r
 } EFI_FONT_DISPLAY_INFO;\r
 \r
-#define EFI_HII_OUT_FLAG_CLIP        0x00000001\r
-#define EFI_HII_OUT_FLAG_WRAP        0x00000002\r
-#define EFI_HII_OUT_FLAG_CLEAN_Y     0x00000004\r
-#define EFI_HII_OUT_FLAG_CLEAN_X     0x00000008\r
-#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010\r
-#define EFI_HII_IGNORE_IF_NO_GLYPH   0x00000020\r
-#define EFI_HII_IGNORE_LINE_BREAK    0x00000040\r
-#define EFI_HII_DIRECT_TO_SCREEN     0x00000080\r
-\r
-#define EFI_FONT_INFO_SYS_FONT       0x00000001\r
-#define EFI_FONT_INFO_SYS_SIZE       0x00000002\r
-#define EFI_FONT_INFO_SYS_STYLE      0x00000004\r
-#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010\r
-#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020\r
-#define EFI_FONT_INFO_RESIZE         0x00001000\r
-#define EFI_FONT_INFO_RESTYLE        0x00002000\r
-#define EFI_FONT_INFO_ANY_FONT       0x00010000\r
-#define EFI_FONT_INFO_ANY_SIZE       0x00020000\r
-#define EFI_FONT_INFO_ANY_STYLE      0x00040000\r
+#define EFI_HII_OUT_FLAG_CLIP         0x00000001\r
+#define EFI_HII_OUT_FLAG_WRAP         0x00000002\r
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004\r
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008\r
+#define EFI_HII_OUT_FLAG_TRANSPARENT  0x00000010\r
+#define EFI_HII_IGNORE_IF_NO_GLYPH    0x00000020\r
+#define EFI_HII_IGNORE_LINE_BREAK     0x00000040\r
+#define EFI_HII_DIRECT_TO_SCREEN      0x00000080\r
+\r
+#define EFI_FONT_INFO_SYS_FONT        0x00000001\r
+#define EFI_FONT_INFO_SYS_SIZE        0x00000002\r
+#define EFI_FONT_INFO_SYS_STYLE       0x00000004\r
+#define EFI_FONT_INFO_SYS_FORE_COLOR  0x00000010\r
+#define EFI_FONT_INFO_SYS_BACK_COLOR  0x00000020\r
+#define EFI_FONT_INFO_RESIZE          0x00001000\r
+#define EFI_FONT_INFO_RESTYLE         0x00002000\r
+#define EFI_FONT_INFO_ANY_FONT        0x00010000\r
+#define EFI_FONT_INFO_ANY_SIZE        0x00020000\r
+#define EFI_FONT_INFO_ANY_STYLE       0x00040000\r
 \r
 typedef\r
 EFI_STATUS\r
@@ -109,7 +109,7 @@ EFI_STATUS
     Flags             - Describes how the string is to be drawn.                 \r
     String            - Points to the null-terminated string to be displayed.\r
     StringInfo        - Points to the string output information, including the color and font. \r
-                        If NULL, then the string will be output in the default system font and color.                             \r
+                        If NULL, then the string will be output in the default system font and color.\r
     Blt               - If this points to a non-NULL on entry, this points to the image, which is Width pixels  \r
                         wide and Height pixels high. The string will be drawn onto this image and               \r
                         EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a             \r
@@ -132,7 +132,8 @@ EFI_STATUS
   Returns:\r
     EFI_SUCCESS           - The string was successfully rendered.                           \r
     EFI_OUT_OF_RESOURCES  - Unable to allocate an output buffer for RowInfoArray or Blt.\r
-    EFI_INVALID_PARAMETER - The String was NULL.    \r
+    EFI_INVALID_PARAMETER - The String or Blt was NULL.\r
+    EFI_INVALID_PARAMETER - Flags were invalid combination.\r
         \r
 --*/\r
 ;\r
@@ -166,7 +167,7 @@ EFI_STATUS
     Language          - Points to the language for the retrieved string. If NULL, then the current system\r
                         language is used.                                                                \r
     StringInfo        - Points to the string output information, including the color and font. \r
-                        If NULL, then the string will be output in the default system font and color.                             \r
+                        If NULL, then the string will be output in the default system font and color.\r
     Blt               - If this points to a non-NULL on entry, this points to the image, which is Width pixels  \r
                         wide and Height pixels high. The string will be drawn onto this image and               \r
                         EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a             \r
@@ -187,9 +188,12 @@ EFI_STATUS
                         is possible when character display is normalized that some character cells overlap.           \r
                      \r
   Returns:\r
-    EFI_SUCCESS           - The string was successfully rendered.                           \r
+    EFI_SUCCESS           - The string was successfully rendered.\r
     EFI_OUT_OF_RESOURCES  - Unable to allocate an output buffer for RowInfoArray or Blt.\r
-    EFI_INVALID_PARAMETER - The String was NULL.    \r
+    EFI_INVALID_PARAMETER - The Blt or PackageList was NULL.\r
+    EFI_INVALID_PARAMETER - Flags were invalid combination.\r
+    EFI_NOT_FOUND         - The specified PackageList is not in the Database or the stringid is not \r
+                            in the specified PackageList. \r
         \r
 --*/\r
 ;\r
@@ -233,7 +237,7 @@ EFI_STATUS
 (EFIAPI *EFI_HII_GET_FONT_INFO) (\r
   IN  CONST EFI_HII_FONT_PROTOCOL    *This,\r
   IN  OUT   EFI_FONT_HANDLE          *FontHandle,\r
-  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfoIn,\r
+  IN  CONST EFI_FONT_DISPLAY_INFO    *StringInfoIn, OPTIONAL\r
   OUT       EFI_FONT_DISPLAY_INFO    **StringInfoOut,\r
   IN  CONST EFI_STRING               String OPTIONAL\r
   )\r
@@ -246,11 +250,13 @@ EFI_STATUS
     \r
   Arguments:          \r
     This              - A pointer to the EFI_HII_FONT_PROTOCOL instance.\r
-    FontHandle        - On entry, points to the font handle returned by a \r
-                        previous call to GetFontInfo() or NULL to start with the \r
+    FontHandle        - On entry, points to the font handle returned by a previous \r
+                        call to GetFontInfo() or points to NULL to start with the \r
                         first font. On return, points to the returned font handle or\r
-                        points to NULL if there are no more matching fonts.                                               \r
-    StringInfoIn      - Upon entry, points to the font to return information about.                        \r
+                        points to NULL if there are no more matching fonts.\r
+    StringInfoIn      - Upon entry, points to the font to return information about.\r
+                        If NULL, then the information about the system default \r
+                        font will be returned.\r
     StringInfoOut     - Upon return, contains the matching font's information. \r
                         If NULL, then no information is returned.\r
                         It's caller's responsibility to free this buffer.\r
@@ -261,10 +267,10 @@ EFI_STATUS
   Returns:\r
     EFI_SUCCESS            - Matching font returned successfully.\r
     EFI_NOT_FOUND          - No matching font was found.\r
-    EFI_INVALID_PARAMETER  - StringInfoIn is NULL.\r
+    EFI_INVALID_PARAMETER  - StringInfoIn->FontInfoMask is an invalid combination.\r
     EFI_OUT_OF_RESOURCES   - There were insufficient resources to complete the request.\r
             \r
---*/     \r
+--*/\r
 ;\r
 \r
 \r
index 1eb4e6fab0626fabe1f3c9507f0fbe408d378024..0a27599e8a39d75629d5366be1f3cb02fb8d5572 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -45,7 +45,7 @@ typedef struct _EFI_IMAGE_INPUT {
   UINT32                             Flags;  \r
   UINT16                             Width;\r
   UINT16                             Height;\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      Bitmap[1];\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL      *Bitmap;\r
 } EFI_IMAGE_INPUT;\r
 \r
 #define EFI_IMAGE_TRANSPARENT          0x00000001\r
@@ -101,8 +101,7 @@ EFI_STATUS
   IN  CONST EFI_HII_IMAGE_PROTOCOL   *This,\r
   IN  EFI_HII_HANDLE                 PackageList,\r
   IN  EFI_IMAGE_ID                   ImageId,\r
-  OUT EFI_IMAGE_INPUT                *Image,\r
-  OUT UINTN                          *ImageSize\r
+  OUT EFI_IMAGE_INPUT                *Image\r
   )\r
 /*++\r
 \r
@@ -115,14 +114,14 @@ EFI_STATUS
     PackageList       - Handle of the package list where this image will be searched.    \r
     ImageId           - The image's id,, which is unique within PackageList.\r
     Image             - Points to the image.\r
-    ImageSize         - On entry, points to the size of the buffer pointed to by Image, in bytes. On return,\r
-                        points to the length of the image, in bytes.                                        \r
                         \r
   Returns:\r
     EFI_SUCCESS            - The new image was returned successfully.\r
     EFI_NOT_FOUND          - The image specified by ImageId is not available.\r
-    EFI_BUFFER_TOO_SMALL   - The buffer specified by ImageSize is too small to hold the image.                                                      \r
+                             The specified PackageList is not in the database.\r
     EFI_INVALID_PARAMETER  - The Image or ImageSize was NULL.\r
+    EFI_OUT_OF_RESOURCES   - The bitmap could not be retrieved because there was not\r
+                             enough memory.\r
     \r
 --*/  \r
 ;\r
@@ -149,7 +148,8 @@ EFI_STATUS
                         \r
   Returns:\r
     EFI_SUCCESS            - The new image was updated successfully.\r
-    EFI_NOT_FOUND          - The image specified by ImageId is not in the database.    \r
+    EFI_NOT_FOUND          - The image specified by ImageId is not in the database.\r
+                             The specified PackageList is not in the database.    \r
     EFI_INVALID_PARAMETER  - The Image was NULL.\r
     \r
 --*/  \r
@@ -233,7 +233,9 @@ EFI_STATUS
   Returns:\r
     EFI_SUCCESS            - The image was successfully drawn.\r
     EFI_OUT_OF_RESOURCES   - Unable to allocate an output buffer for Blt.\r
-    EFI_INVALID_PARAMETER  - The Image was NULL.\r
+    EFI_NOT_FOUND          - The image specified by ImageId is not in the database. \r
+                             The specified PackageList is not in the database.                            \r
+    EFI_INVALID_PARAMETER  - The Blt was NULL.    \r
 \r
 --*/\r
 ;\r
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.c
new file mode 100644 (file)
index 0000000..aa424ab
--- /dev/null
@@ -0,0 +1,27 @@
+/*++\r
+\r
+Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+  HiiPackageList.c\r
+\r
+Abstract:\r
+\r
+  EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.\r
+\r
+--*/\r
+\r
+#include "EfiSpec.h"\r
+#include EFI_PROTOCOL_DEFINITION (HiiPackageList)\r
+\r
+EFI_GUID  gEfiHiiPackageListProtocolGuid = EFI_HII_PACKAGE_LIST_PROTOCOL_GUID;\r
+\r
+EFI_GUID_STRING(&gEfiHiiPackageListProtocolGuid, "HII Package List Protocol", "HII Package List 2.1 protocol");\r
diff --git a/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h b/EdkCompatibilityPkg/Foundation/Efi/Protocol/HiiPackageList/HiiPackageList.h
new file mode 100644 (file)
index 0000000..a3d057a
--- /dev/null
@@ -0,0 +1,36 @@
+/*++\r
+\r
+Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+  HiiPackageList.h\r
+\r
+Abstract:\r
+\r
+  EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.\r
+\r
+--*/\r
+\r
+#ifndef _HII_PACKAGE_LIST_H_\r
+#define _HII_PACKAGE_LIST_H_\r
+\r
+#include "EfiHii.h"\r
+\r
+#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \\r
+  { \\r
+    0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc} \\r
+  }\r
+\r
+typedef EFI_HII_PACKAGE_LIST_HEADER *    EFI_HII_PACKAGE_LIST_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiHiiPackageListProtocolGuid;\r
+\r
+#endif\r
index c243d9e6802fc93d052f7f8988a9e350dc0dcc76..0c27218b38db14481eba65ad5486678eb71eadcb 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -54,6 +54,8 @@ EFI_STATUS
   Routine Description:\r
     This function adds the string String to the group of strings owned by PackageList, with the\r
     specified font information StringFontInfo and returns a new string id.                         \r
+    The new string identifier is guaranteed to be unique within the package list. \r
+    That new string identifier is reserved for all languages in the package list. \r
     \r
   Arguments:          \r
     This              - A pointer to the EFI_HII_STRING_PROTOCOL instance.\r
@@ -104,13 +106,19 @@ EFI_STATUS
     String            - Points to the new null-terminated string.            \r
     StringSize        - On entry, points to the size of the buffer pointed to by \r
                         String, in bytes. On return,\r
-                        points to the length of the string, in bytes.                                                                                             \r
-    StringFontInfo    - If not NULL, points to the string's font information. \r
-                        It's caller's responsibility to free this buffer.\r
+                        points to the length of the string, in bytes.\r
+    StringFontInfo    - Points to a buffer that will be callee allocated and will \r
+                        have the string's font information into this buffer.  \r
+                        The caller is responsible for freeing this buffer.  \r
+                        If the parameter is NULL a buffer will not be allocated \r
+                        and the string font information will not be returned.\r
 \r
   Returns:\r
     EFI_SUCCESS            - The string was returned successfully.\r
     EFI_NOT_FOUND          - The string specified by StringId is not available.\r
+                             The specified PackageList is not in the database.\r
+    EFI_INVALID_LANGUAGE   - The string specified by StringId is available but\r
+                             not in the specified language.                             \r
     EFI_BUFFER_TOO_SMALL   - The buffer specified by StringSize is too small to \r
                              hold the string.                                                      \r
     EFI_INVALID_PARAMETER  - The String or Language or StringSize was NULL.\r
@@ -147,7 +155,8 @@ EFI_STATUS
 \r
   Returns:\r
     EFI_SUCCESS            - The string was updated successfully.\r
-    EFI_NOT_FOUND          - The string specified by StringId is not in the database.    \r
+    EFI_NOT_FOUND          - The string specified by StringId is not in the database.\r
+                             The specified PackageList is not in the database.\r
     EFI_INVALID_PARAMETER  - The String or Language was NULL.\r
     EFI_OUT_OF_RESOURCES   - The system is out of resources to accomplish the task.\r
     \r
@@ -182,6 +191,7 @@ EFI_STATUS
     EFI_BUFFER_TOO_SMALL   - The LanguagesSize is too small to hold the list of \r
                              supported languages. LanguageSize is updated to\r
                              contain the required size.\r
+    EFI_NOT_FOUND          - The specified PackageList is not in the database.\r
     \r
 --*/\r
 ;\r
@@ -220,9 +230,12 @@ EFI_STATUS
     EFI_BUFFER_TOO_SMALL   - The buffer specified by SecondLanguagesSize is   \r
                              too small to hold the returned information.      \r
                              SecondLanguageSize is updated to hold the size of\r
-                             the buffer required.                             \r
-                             \r
---*/                         \r
+                             the buffer required.\r
+    EFI_INVALID_LANGUAGE   - The language specified by FirstLanguage is not\r
+                             present in the specified package list.\r
+    EFI_NOT_FOUND          - The specified PackageList is not in the Database.    \r
+    \r
+--*/\r
 ;\r
 //\r
 // Interface structure for the EFI_HII_STRING_PROTOCOL\r
index 0263bf04f4695993daec8d388d5d09bb410f9736..3e315c0bb23fcfedf5b6a03df58b8b49ba3e9740 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -15,7 +15,7 @@ Module Name:
 \r
 Abstract:\r
 \r
-  UEFI IPv4 protocol.\r
+  EFI_IP4_PROTOCOL definition in UEFI 2.2 specification.\r
 \r
 --*/\r
 \r
@@ -80,7 +80,7 @@ typedef struct _EFI_IP4_ICMP_TYPE {
 typedef struct {\r
   BOOLEAN                 IsStarted;\r
   UINT32                  MaxPacketSize;\r
-\r
+  \r
   EFI_IP4_CONFIG_DATA     ConfigData;\r
   BOOLEAN                 IsConfigured;\r
 \r
index d9f003255960478927230d3468ad8d14cd2a8242..6abd11d5bf86d4aebb3e74509d806e4d28a641ee 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -35,6 +35,8 @@ Abstract:
 \r
 EFI_FORWARD_DECLARATION (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);\r
 EFI_FORWARD_DECLARATION (EFI_FILE);\r
+typedef struct _EFI_FILE *EFI_FILE_HANDLE;\r
+typedef struct _EFI_FILE EFI_FILE_PROTOCOL;\r
 \r
 typedef\r
 EFI_STATUS\r
@@ -356,7 +358,7 @@ EFI_STATUS
 ;\r
 \r
 #define EFI_FILE_HANDLE_REVISION  0x00010000\r
-typedef struct _EFI_FILE {\r
+struct _EFI_FILE {\r
   UINT64                Revision;\r
   EFI_FILE_OPEN         Open;\r
   EFI_FILE_CLOSE        Close;\r
@@ -368,7 +370,7 @@ typedef struct _EFI_FILE {
   EFI_FILE_GET_INFO     GetInfo;\r
   EFI_FILE_SET_INFO     SetInfo;\r
   EFI_FILE_FLUSH        Flush;\r
-} *EFI_FILE_HANDLE;\r
+};\r
 \r
 extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;\r
 \r
index a4b83c33d9670f6afee6d15f36b590ed0e485810..482e69e114f6e8605da50b49644e85c74a562f50 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -140,7 +140,9 @@ typedef enum _EFI_MEMORY_ARRAY_TYPE {
   EfiMemoryTypeRdram                          = 0x11,\r
   EfiMemoryTypeDdr                            = 0x12,\r
   EfiMemoryTypeDdr2                           = 0x13,\r
-  EfiMemoryTypeDdr2FbDimm                     = 0x14\r
+  EfiMemoryTypeDdr2FbDimm                     = 0x14,\r
+  EfiMemoryTypeDdr3                           = 0x18,\r
+  EfiMemoryTypeFbd2                           = 0x19\r
 } EFI_MEMORY_ARRAY_TYPE;\r
 \r
 typedef struct {\r
@@ -189,6 +191,8 @@ typedef struct {
   UINT16                      MemorySpeed;\r
   EFI_MEMORY_STATE            MemoryState;\r
   UINT8                       MemoryAttributes;\r
+  UINT8                       MemoryBankConnections;\r
+  UINT8                       MemoryErrorStatus;\r
 } EFI_MEMORY_ARRAY_LINK;\r
 \r
 \r
@@ -304,11 +308,15 @@ typedef struct {
 \r
 typedef struct {\r
   UINT8  Five                  :1;\r
-  UINT8  There                 :1;\r
+  UINT8  Three                 :1;\r
   UINT8  Two                   :1;\r
   UINT8  Reserved              :5;\r
 } EFI_MEMORY_MODULE_VOLTAGE_TYPE;\r
 \r
+//\r
+//  EFI_MEMORY_CONTROLLER_INFORMATION is obsolete\r
+//  Use EFI_MEMORY_CONTROLLER_INFORMATION_DATA instead\r
+//\r
 typedef struct {\r
   EFI_MEMORY_ERROR_DETECT_METHOD_TYPE   ErrorDetectingMethod;\r
   EFI_MEMORY_ERROR_CORRECT_CAPABILITY   ErrorCorrectingCapability;\r
@@ -323,6 +331,20 @@ typedef struct {
   UINT16                                *MemoryModuleConfigHandles;\r
 } EFI_MEMORY_CONTROLLER_INFORMATION;\r
 \r
+typedef struct {\r
+  EFI_MEMORY_ERROR_DETECT_METHOD_TYPE   ErrorDetectingMethod;\r
+  EFI_MEMORY_ERROR_CORRECT_CAPABILITY   ErrorCorrectingCapability;\r
+  EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemorySupportedInterleave;\r
+  EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE    MemoryCurrentInterleave;\r
+  UINT8                                 MaxMemoryModuleSize;\r
+  EFI_MEMORY_SPEED_TYPE                 MemorySpeedType;\r
+  EFI_MEMORY_SUPPORTED_TYPE             MemorySupportedType;\r
+  EFI_MEMORY_MODULE_VOLTAGE_TYPE        MemoryModuleVoltage;\r
+  UINT8                                 NumberofMemorySlot;\r
+  EFI_MEMORY_ERROR_CORRECT_CAPABILITY   EnabledCorrectingCapability;\r
+  EFI_INTER_LINK_DATA                   MemoryModuleConfig[1];\r
+} EFI_MEMORY_CONTROLLER_INFORMATION_DATA;\r
+\r
 //\r
 //  Memory. Error Information - SMBIOS Type 18\r
 //\r
index 56124059a67df3319c94edc0db97dcd9f00d975e..d7545afc8bbcb3857fd77c0057a5f20bee2adb5f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
  \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -261,6 +261,7 @@ typedef enum {
 \r
 typedef struct {\r
   UINT32  RecordType  :1;\r
+  UINT32  Type        :7;\r
   UINT32  Reserved    :24;\r
 } EFI_MISC_ELEMENT_TYPE;\r
 \r
@@ -417,7 +418,7 @@ typedef enum {
   EfiSlotTypeApg2X = 0x10,\r
   EfiSlotTypeAgp4X = 0x11,\r
   EfiSlotTypePciX = 0x12,\r
-  EfiSlotTypeAgp4x = 0x13,\r
+  EfiSlotTypeAgp8X = 0x13,\r
   EfiSlotTypePC98C20 = 0xA0,\r
   EfiSlotTypePC98C24 = 0xA1,\r
   EfiSlotTypePC98E = 0xA2,\r
@@ -428,7 +429,13 @@ typedef enum {
   EfiSlotTypePciExpressX2 = 0xA7,\r
   EfiSlotTypePciExpressX4 = 0xA8,\r
   EfiSlotTypePciExpressX8 = 0xA9,\r
-  EfiSlotTypePciExpressX16 = 0xAA\r
+  EfiSlotTypePciExpressX16 = 0xAA,\r
+  EfiSlotTypePciExpressGen2    = 0xAB,\r
+  EfiSlotTypePciExpressGen2X1  = 0xAC,\r
+  EfiSlotTypePciExpressGen2X2  = 0xAD,\r
+  EfiSlotTypePciExpressGen2X4  = 0xAE,\r
+  EfiSlotTypePciExpressGen2X8  = 0xAF,\r
+  EfiSlotTypePciExpressGen2X16 = 0xB0\r
 } EFI_MISC_SLOT_TYPE;\r
 \r
 typedef enum {  \r
@@ -595,6 +602,7 @@ typedef struct {
   EFI_INTER_LINK_DATA GroupLink;\r
   UINT16              GroupId;\r
   UINT16              GroupElementId;\r
+  UINT8               ItemType;\r
 } EFI_MISC_GROUP_ITEM_SET_DATA;\r
 \r
 //\r
@@ -711,7 +719,12 @@ typedef struct {
 //\r
 // Misc. Hardware Security - SMBIOS Type 24\r
 //\r
-#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER 0x00000012\r
+#define EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER 0x00000012\r
+\r
+//\r
+// Backward Compatibility\r
+//\r
+#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER  EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER\r
 \r
 typedef enum {\r
   EfiHardwareSecurityStatusDisabled = 0,\r
@@ -966,6 +979,7 @@ typedef struct {
   EFI_INTER_LINK_DATA   ManagementDeviceLink;\r
   EFI_INTER_LINK_DATA   ManagementDeviceComponentLink;\r
   EFI_INTER_LINK_DATA   ManagementDeviceThresholdLink;\r
+  UINT8                 ComponentType;\r
 } EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION;\r
 \r
 //\r
@@ -1013,7 +1027,7 @@ typedef struct {
 } POWER_SUPPLY_CHARACTERISTICS;\r
 \r
 typedef struct {\r
-  UINT                          PowerUnitGroup;\r
+  UINT16                          PowerUnitGroup;\r
   STRING_REF                      PowerSupplyLocation;\r
   STRING_REF                      PowerSupplyDeviceName;\r
   STRING_REF                      PowerSupplyManufacturer;\r
@@ -1098,18 +1112,62 @@ typedef struct {
 //  Misc. System Event Log  - SMBIOS Type 15\r
 //\r
 #define EFI_MISC_SYSTEM_EVENT_LOG_RECORD_NUMBER 0x00000020\r
+\r
+typedef enum {  \r
+  EfiEventLogTypeReserved1                          = 0,\r
+  EfiEventLogTypeSingleBitEccMemoryError            = 1,\r
+  EfiEventLogTypeMultiBitEccMemoryError             = 2,\r
+  EfiEventLogTypeParityMemoryError                  = 3,\r
+  EfiEventLogTypeBusTimeOut                         = 4,\r
+  EfiEventLogTypeIoChannelCheck                     = 5,\r
+  EfiEventLogTypeSoftwareNmi                        = 6,\r
+  EfiEventLogTypePostMemoryResize                   = 7,\r
+  EfiEventLogTypePostError                          = 8,\r
+  EfiEventLogTypePciParityError                     = 9,\r
+  EfiEventLogTypePciSystemError                     = 0xA,\r
+  EfiEventLogTypeCpuFailure                         = 0xB,\r
+  EfiEventLogTypeEisaFailSafeTimerTimeOut           = 0xC,\r
+  EfiEventLogTypeCorrectableMemoryLogDisabled       = 0xD,\r
+  EfiEventLogTypeLoggingDisabled                    = 0xE,\r
+  EfiEventLogTypeReserved2                          = 0xF,\r
+  EfiEventLogTypeSystemLimitExceeded                = 0x10,\r
+  EfiEventLogTypeAsynchronousHardwareTimerExpired   = 0x11,\r
+  EfiEventLogTypeSystemConfigurationInformation     = 0x12,\r
+  EfiEventLogTypeHardDiskInformation                = 0x13,\r
+  EfiEventLogTypeSystemReconfigured                 = 0x14,\r
+  EfiEventLogTypeUncorrectableCpuComplexError       = 0x15,\r
+  EfiEventLogTypeLogAreaResetCleared                = 0x16,\r
+  EfiEventLogTypeSystemBoot                         = 0x17,\r
+  EfiEventLogTypeEndOfLog                           = 0xFF\r
+} EFI_MISC_LOG_TYPE;\r
+\r
+typedef enum {  \r
+  EfiEventLogDataFormatTypeNone = 0,\r
+  EfiEventLogDataFormatTypeHandle = 1,\r
+  EfiEventLogDataFormatTypeMultipleEvent = 2,\r
+  EfiEventLogDataFormatTypeMultipleEventHandle = 3,\r
+  EfiEventLogDataFormatTypePostResultsBitmap = 4,\r
+  EfiEventLogDataFormatTypeSystemManagement = 5,\r
+  EfiEventLogDataFormatTypeMultipleEventSystemManagement = 6\r
+} EFI_MISC_VARIABLE_DATA_FORMAT_TYPE;\r
+\r
+typedef struct {\r
+  UINT8                 LogType;\r
+  UINT8                 DataFormatType;\r
+} EFI_MISC_EVENT_LOG_TYPE;\r
+\r
 typedef struct {\r
-  //SMBIOS_STRUCTURE_HDR  Header;\r
-  UINT16                LogAreaLength;\r
-  UINT16                LogHeaderStartOffset;\r
-  UINT16                LogDataStartOffset;\r
-  UINT8                 AccessMethod;\r
-  UINT8                 LogStatus;\r
-  UINT32                LogChangeToken;\r
-  UINT32                AccessMethodAddress;\r
-  UINT8                 LogHeaderFormat;\r
-  UINT8                 NumberOfSupportedLogType;\r
-  UINT8                 LengthOfLogDescriptor;\r
+  UINT16                    LogAreaLength;\r
+  UINT16                    LogHeaderStartOffset;\r
+  UINT16                    LogDataStartOffset;\r
+  UINT8                     AccessMethod;\r
+  UINT8                     LogStatus;\r
+  UINT32                    LogChangeToken;\r
+  UINT32                    AccessMethodAddress;\r
+  UINT8                     LogHeaderFormat;\r
+  UINT8                     NumberOfSupportedLogType;\r
+  UINT8                     LengthOfLogDescriptor;\r
+  EFI_PHYSICAL_ADDRESS      EventLogTypeDescriptors; // Pointer to EFI_MISC_EVENT_LOG_TYPE\r
 } EFI_MISC_SYSTEM_EVENT_LOG;\r
 \r
 //\r
index fc094b7b9cbcec66c79a10aab4a542272a6ab863..f55bd30830ff250bb9a501985680d5ff2aebf816 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -49,6 +49,7 @@ typedef STRING_REF            EFI_PROCESSOR_MANUFACTURER_DATA;
 typedef STRING_REF            EFI_PROCESSOR_SERIAL_NUMBER_DATA;\r
 \r
 typedef STRING_REF            EFI_PROCESSOR_ASSET_TAG_DATA;\r
+\r
 typedef STRING_REF            EFI_PROCESSOR_PART_NUMBER_DATA;\r
 \r
 typedef struct {\r
@@ -159,6 +160,10 @@ typedef enum {
   EfiProcessorFamilyPowerPC620   = 0x25,\r
   EfiProcessorFamilyPowerPC704   = 0x26,\r
   EfiProcessorFamilyPowerPC750   = 0x27,\r
+  EfiProcessorFamilyIntelCoreDuo = 0x28,\r
+  EfiProcessorFamilyIntelCoreDuoMobile = 0x29,\r
+  EfiProcessorFamilyIntelCoreSoloMobile = 0x2A,\r
+  EfiProcessorFamilyIntelAtom    = 0x2B,\r
   EfiProcessorFamilyAlpha2       = 0x30,\r
   EfiProcessorFamilyAlpha21064   = 0x31,\r
   EfiProcessorFamilyAlpha21066   = 0x32,\r
@@ -201,6 +206,12 @@ typedef enum {
   EfiProcessorFamilyDualCoreAmdOpteron = 0x87,\r
   EfiProcessorFamilyAmdAthlon64X2DualCore = 0x88,\r
   EfiProcessorFamilyAmdTurion64X2Mobile   = 0x89,\r
+  EfiProcessorFamilyQuadCoreAmdOpteron = 0x8A,\r
+  EfiProcessorFamilyThirdGenerationAmdOpteron = 0x8B,\r
+  EfiProcessorFamilyAmdPhenomFxQuadCore = 0x8C,\r
+  EfiProcessorFamilyAmdPhenomX4QuadCore = 0x8D,\r
+  EfiProcessorFamilyAmdPhenomX2DualCore = 0x8E,\r
+  EfiProcessorFamilyAmdAthlonX2DualCore = 0x8F,\r
   EfiProcessorFamilyPARISC       = 0x90,\r
   EfiProcessorFamilyPaRisc8500   = 0x91,\r
   EfiProcessorFamilyPaRisc8000   = 0x92,\r
@@ -209,6 +220,21 @@ typedef enum {
   EfiProcessorFamilyPaRisc7100LC = 0x95,\r
   EfiProcessorFamilyPaRisc7100   = 0x96,\r
   EfiProcessorFamilyV30          = 0xA0,\r
+  EfiProcessorFamilyQuadCoreIntelXeon3200Series  = 0xA1,\r
+  EfiProcessorFamilyDualCoreIntelXeon3000Series  = 0xA2,\r
+  EfiProcessorFamilyQuadCoreIntelXeon5300Series  = 0xA3,\r
+  EfiProcessorFamilyDualCoreIntelXeon5100Series  = 0xA4,\r
+  EfiProcessorFamilyDualCoreIntelXeon5000Series  = 0xA5,\r
+  EfiProcessorFamilyDualCoreIntelXeonLV          = 0xA6,\r
+  EfiProcessorFamilyDualCoreIntelXeonULV         = 0xA7,\r
+  EfiProcessorFamilyDualCoreIntelXeon7100Series  = 0xA8,\r
+  EfiProcessorFamilyQuadCoreIntelXeon5400Series  = 0xA9,\r
+  EfiProcessorFamilyQuadCoreIntelXeon            = 0xAA,\r
+  EfiProcessorFamilyDualCoreIntelXeon5200Series  = 0xAB,\r
+  EfiProcessorFamilyDualCoreIntelXeon7200Series  = 0xAC,\r
+  EfiProcessorFamilyQuadCoreIntelXeon7300Series  = 0xAD,\r
+  EfiProcessorFamilyQuadCoreIntelXeon7400Series  = 0xAE,\r
+  EfiProcessorFamilyMultiCoreIntelXeon7400Series = 0xAF,\r
   EfiProcessorFamilyPentiumIIIXeon = 0xB0,\r
   EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,\r
   EfiProcessorFamilyPentium4     = 0xB2,\r
@@ -222,9 +248,17 @@ typedef enum {
   EfiProcessorFamilyIntelCeleronD = 0xBA,\r
   EfiProcessorFamilyIntelPentiumD = 0xBB,\r
   EfiProcessorFamilyIntelPentiumEx = 0xBC,\r
-  EfiProcessorFamilyIntelCoreBrand = 0xBD,\r
+  EfiProcessorFamilyIntelCoreSolo  = 0xBD,  // SMBIOS spec 2.6 correct this value\r
   EfiProcessorFamilyReserved       = 0xBE,\r
   EfiProcessorFamilyIntelCore2     = 0xBF,\r
+  EfiProcessorFamilyIntelCore2Solo          = 0xC0,\r
+  EfiProcessorFamilyIntelCore2Extreme       = 0xC1,\r
+  EfiProcessorFamilyIntelCore2Quad          = 0xC2,\r
+  EfiProcessorFamilyIntelCore2ExtremeMobile = 0xC3,\r
+  EfiProcessorFamilyIntelCore2DuoMobile     = 0xC4,\r
+  EfiProcessorFamilyIntelCore2SoloMobile    = 0xC5,\r
+  EfiProcessorFamilyIntelCoreI7             = 0xC6,\r
+  EfiProcessorFamilyDualCoreIntelCeleron    = 0xC7,\r
   EfiProcessorFamilyIBM390       = 0xC8,\r
   EfiProcessorFamilyG4           = 0xC9,\r
   EfiProcessorFamilyG5           = 0xCA,\r
@@ -234,6 +268,20 @@ typedef enum {
   EfiProcessorFamilyViaC7D      = 0xD3,\r
   EfiProcessorFamilyViaC7       = 0xD4,\r
   EfiProcessorFamilyViaEden     = 0xD5,\r
+  EfiProcessorFamilyMultiCoreIntelXeon           = 0xD6,\r
+  EfiProcessorFamilyDualCoreIntelXeon3Series     = 0xD7,\r
+  EfiProcessorFamilyQuadCoreIntelXeon3Series     = 0xD8,\r
+  EfiProcessorFamilyDualCoreIntelXeon5Series     = 0xDA,\r
+  EfiProcessorFamilyQuadCoreIntelXeon5Series     = 0xDB,\r
+  EfiProcessorFamilyDualCoreIntelXeon7Series     = 0xDD,\r
+  EfiProcessorFamilyQuadCoreIntelXeon7Series     = 0xDE,\r
+  EfiProcessorFamilyMultiCoreIntelXeon7Series    = 0xDF,\r
+  EfiProcessorFamilyEmbeddedAmdOpteronQuadCore   = 0xE6,\r
+  EfiProcessorFamilyAmdPhenomTripleCore          = 0xE7,\r
+  EfiProcessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,\r
+  EfiProcessorFamilyAmdTurionDualCoreMobile      = 0xE9,\r
+  EfiProcessorFamilyAmdAthlonDualCore            = 0xEA,\r
+  EfiProcessorFamilyAmdSempronSI                 = 0xEB,\r
   EfiProcessorFamilyi860         = 0xFA,\r
   EfiProcessorFamilyi960         = 0xFB,\r
   EfiProcessorFamilyIndicatorFamily2    = 0xFE\r
@@ -314,7 +362,8 @@ typedef enum {
   EfiProcessorSocketLGA775 = 0x15,\r
   EfiProcessorSocketS1 = 0x16,\r
   EfiProcessorSocketAm2 = 0x17,\r
-  EfiProcessorSocketF   = 0x18\r
+  EfiProcessorSocketF   = 0x18,\r
+  EfiProcessorSocketLGA1366 = 0x19\r
 } EFI_PROCESSOR_SOCKET_TYPE_DATA;\r
 \r
 typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;\r
index f2e996a794d37e59f98305c8b7675c2ae8d3aa25..cae8aec1619e771cc7349e57fe935f041df096ee 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -59,6 +59,11 @@ typedef struct {
   VOID*    CapsulePtr[1];\r
 } EFI_CAPSULE_TABLE;\r
 \r
+//\r
+// This struct is deprecated because VendorTable entries physical address will not be fixed up when \r
+// transitioning from preboot to runtime phase. So we don't need CapsuleInfoTable to record capsule\r
+// GUIDs any more for runtime convert.\r
+//\r
 typedef struct {\r
   UINT32      CapsuleGuidNumber;\r
   EFI_GUID    CapsuleGuidPtr[1];\r
@@ -66,6 +71,7 @@ typedef struct {
 \r
 //\r
 // This GUID is used for collecting all capsules' Guids who install in ConfigTable.\r
+// This GUID is deprecated as well.\r
 //\r
 #define EFI_CAPSULE_INFO_GUID \\r
   { \\r
index c5c180d3376a50598699712dacc3651031771234..1db788670f548c622bc34049b1c6532e1342be28 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -50,11 +50,10 @@ typedef enum {
 } EFI_PEI_PCI_CFG_PPI_WIDTH;\r
 \r
 #define EFI_PEI_PCI_CFG_ADDRESS(bus, dev, func, reg)   \\r
-            (   ((bus) << 24)  | \\r
-                ((dev) << 16)  | \\r
-                ((func) << 8)  | \\r
-                ((reg) < 256 ? (reg): ((UINT64)(reg) << 32))) \r
-\r
+      (UINT64) ((((UINTN) (bus)) << 24) | \\r
+                (((UINTN) (dev)) << 16) | \\r
+                (((UINTN) (func)) << 8) | \\r
+                ((reg) < 256 ? ((UINTN) (reg)): ((UINT64) (reg) << 32)))\r
 \r
 #if (PI_SPECIFICATION_VERSION < 0x00010000)\r
 \r
index 5d1ce1f63fb4e788cec367d8131bc28b85591506..e37baeb10c2c0be93095b7abd8908b4cf9dfd427 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -361,8 +361,8 @@ EFI_STATUS
 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (\r
   IN CONST  EFI_PEI_SERVICES        **PeiServices,\r
   IN EFI_FV_FILETYPE                SearchType,\r
-  IN CONST EFI_PEI_FV_HANDLE        *FwVolHeader,\r
-  IN OUT EFI_PEI_FILE_HANDLE        **FileHandle  \r
+  IN CONST EFI_PEI_FV_HANDLE        FvHandle,\r
+  IN OUT EFI_PEI_FILE_HANDLE        *FileHandle  \r
   );\r
 \r
 typedef\r
@@ -370,7 +370,7 @@ EFI_STATUS
 (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (\r
   IN CONST  EFI_PEI_SERVICES    **PeiServices,\r
   IN EFI_SECTION_TYPE           SectionType,\r
-  IN EFI_PEI_FILE_HANDLE        *FileHandle,\r
+  IN EFI_PEI_FILE_HANDLE        FileHandle,\r
   OUT VOID                      **SectionData\r
   );\r
 \r
@@ -443,7 +443,7 @@ EFI_STATUS
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (\r
-  IN  EFI_PEI_FV_HANDLE     *VolumeHandle,\r
+  IN  EFI_PEI_FV_HANDLE     VolumeHandle,\r
   OUT EFI_FV_INFO           *VolumeInfo\r
   );\r
 \r
index c8eec3d946b8b2517b1efde725cdf636c476e33c..4f6cb395d68f439540ae021d40b591b37cebc52c 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
  \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -22,28 +22,11 @@ Abstract:
 #ifndef _TIANO_SPEC_DEVICE_PATH_H\r
 #define _TIANO_SPEC_DEVICE_PATH_H\r
 \r
-#pragma pack(1)\r
+#include "EfiDevicePath.h"\r
 \r
-#if (EFI_SPECIFICATION_VERSION <= 0x00020000)\r
 //\r
-// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10. \r
-// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with\r
-// EFI 1.10 and UEFI 2.10.\r
+// MEDIA_FW_VOL_FILEPATH_DEVICE_PATH and MEDIA_FW_VOL_DEVICE_PATH are defined in \r
+// EfiDevicePath.h\r
 //\r
-#define MEDIA_FV_FILEPATH_DP  0x06\r
-typedef struct {\r
-  EFI_DEVICE_PATH_PROTOCOL  Header;\r
-  EFI_GUID                  NameGuid;\r
-} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
-#endif\r
-\r
-\r
-#if (EFI_SPECIFICATION_VERSION > 0x00020000)\r
-//\r
-// EFI Specification extension on Media Device Path was added to UEFI 2.1 specification,\r
-// so the definition is moved to EfiDevicePath.h\r
-//\r
-#endif\r
 \r
-#pragma pack()\r
 #endif\r
index b39121583980ade0186ba7f4c36ede0f897145c7..cba842faa145ee7122c0f3751bc574059fc42ff8 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials                          \r
 # are licensed and made available under the terms and conditions of the BSD License         \r
 # which accompanies this distribution.  The full text of the license may be found at        \r
@@ -102,4 +102,7 @@ COMPONENT_TYPE=   LIBRARY
     GuidedSectionExtraction/GuidedSectionExtraction.c\r
     EcpPciCfg/EcpPciCfg.h\r
     EcpPciCfg/EcpPciCfg.c\r
-    \r
+    TemporaryRamSupport/TemporaryRamSupport.h\r
+    TemporaryRamSupport/TemporaryRamSupport.c\r
+    LoadedImage/LoadedImage.h\r
+    LoadedImage/LoadedImage.c    \r
index 006a4fb23a9b14a54c438699699006e17d5f89d3..e3740169ae3da8420c2ae1ec8b3acda19049c811 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -77,7 +77,7 @@ EFI_STATUS
 (EFIAPI *EFI_PEI_FV_FIND_FILE_NAME) (\r
   IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI     *This,\r
   IN CONST EFI_GUID                        *FileName,\r
-  IN EFI_PEI_FV_HANDLE                     FvHandle,\r
+  IN OUT EFI_PEI_FV_HANDLE                 *FvHandle,\r
   OUT EFI_PEI_FILE_HANDLE                  *FileHandle\r
   );\r
 \r
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.c
new file mode 100644 (file)
index 0000000..09d4a8b
--- /dev/null
@@ -0,0 +1,30 @@
+/*++\r
+\r
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+ LoadedImage.c\r
+\r
+Abstract:\r
+\r
+  The file describes the PPI which notifies other drivers \r
+  of the PEIM being initialized by the PEI Dispatcher.\r
+\r
+--*/\r
+\r
+#include "Tiano.h"\r
+#include "PeiBind.h"\r
+#include "PeiApi.h"\r
+#include EFI_PPI_DEFINITION (LoadedImage)\r
+\r
+EFI_GUID  gEfiPeiLoadedImagePpiGuid = EFI_PEI_LOADED_IMAGE_PPI_GUID;\r
+\r
+EFI_GUID_STRING(&gEfiPeiLoadedImagePpiGuid, "LoadedImagePpi", "LoadedImage PPI");\r
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h b/EdkCompatibilityPkg/Foundation/Framework/Ppi/LoadedImage/LoadedImage.h
new file mode 100644 (file)
index 0000000..909b109
--- /dev/null
@@ -0,0 +1,56 @@
+/*++\r
+\r
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+ LoadedImage.h\r
+\r
+Abstract:\r
+\r
+  The file describes the PPI which notifies other drivers \r
+  of the PEIM being initialized by the PEI Dispatcher.\r
+\r
+--*/\r
+\r
+#ifndef __LOADED_IMAGE_PPI_H__\r
+#define __LOADED_IMAGE_PPI_H__\r
+\r
+#include "Tiano.h"\r
+\r
+#define EFI_PEI_LOADED_IMAGE_PPI_GUID \\r
+  { 0xc1fcd448, 0x6300, 0x4458, {0xb8, 0x64, 0x28, 0xdf, 0x01, 0x53, 0x64, 0xbc} }\r
+  \r
+typedef struct _EFI_PEI_LOADED_IMAGE_PPI  EFI_PEI_LOADED_IMAGE_PPI;\r
+\r
+///\r
+/// This interface is installed by the PEI Dispatcher after the image has been\r
+/// loaded and after all security checks have been performed, \r
+/// to notify other PEIMs of the files which are being loaded.\r
+///\r
+struct _EFI_PEI_LOADED_IMAGE_PPI {\r
+  ///\r
+  /// Address of the image at the address where it will be executed.\r
+  ///\r
+  EFI_PHYSICAL_ADDRESS  ImageAddress;\r
+  ///\r
+  /// Size of the image as it will be executed.\r
+  ///\r
+  UINT64                ImageSize;\r
+  ///\r
+  /// File handle from which the image was loaded.\r
+  /// Can be NULL, indicating the image was not loaded from a handle.\r
+  ///\r
+  EFI_PEI_FILE_HANDLE   FileHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiLoadedImagePpiGuid;\r
+\r
+#endif \r
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.c
new file mode 100644 (file)
index 0000000..b4a2b86
--- /dev/null
@@ -0,0 +1,30 @@
+/*++\r
+\r
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+ TemporaryRamSupport.c\r
+\r
+Abstract:\r
+\r
+  This file declares Temporary RAM Support PPI.                                   \r
+  This Ppi provides the service that migrates temporary RAM into permanent memory.\r
+\r
+--*/\r
+\r
+#include "Tiano.h"\r
+#include "PeiBind.h"\r
+#include "PeiApi.h"\r
+#include EFI_PPI_DEFINITION (TemporaryRamSupport)\r
+\r
+EFI_GUID  gEfiTemporaryRamSupportPpiGuid = TEMPORARY_RAM_SUPPORT_PPI_GUID;\r
+\r
+EFI_GUID_STRING(&gEfiTemporaryRamSupportPpiGuid, "TemporaryRamSupportPpi", "TemporaryRamSupport PPI");\r
diff --git a/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h b/EdkCompatibilityPkg/Foundation/Framework/Ppi/TemporaryRamSupport/TemporaryRamSupport.h
new file mode 100644 (file)
index 0000000..635c3f8
--- /dev/null
@@ -0,0 +1,66 @@
+/*++\r
+\r
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+ TemporaryRamSupport.h\r
+\r
+Abstract:\r
+\r
+  This file declares Temporary RAM Support PPI.                                   \r
+  This Ppi provides the service that migrates temporary RAM into permanent memory.\r
+\r
+--*/\r
+\r
+#ifndef __TEMPORARY_RAM_SUPPORT_H__\r
+#define __TEMPORARY_RAM_SUPPORT_H__\r
+\r
+#include "Tiano.h"\r
+\r
+#define TEMPORARY_RAM_SUPPORT_PPI_GUID \\r
+  { \\r
+     0xdbe23aa9, 0xa345, 0x4b97, {0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} \\r
+  }\r
+\r
+/**                                                                                                             \r
+  This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into                                \r
+  permanent memory.                                                                                             \r
+\r
+  @param PeiServices            Pointer to the PEI Services Table.                                              \r
+  @param TemporaryMemoryBase    Source Address in temporary memory from which the SEC or PEIM will copy the     \r
+                                Temporary RAM contents.                                                         \r
+  @param PermanentMemoryBase    Destination Address in permanent memory into which the SEC or PEIM will copy the\r
+                                Temporary RAM contents.                                                         \r
+  @param CopySize               Amount of memory to migrate from temporary to permanent memory.                 \r
+\r
+  @retval EFI_SUCCESS           The data was successfully returned.                                             \r
+  @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when TemporaryMemoryBase > PermanentMemoryBase.                                      \r
+\r
+  **/                                                                                                             \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI * TEMPORARY_RAM_MIGRATION)(\r
+  IN CONST EFI_PEI_SERVICES   **PeiServices,\r
+  IN EFI_PHYSICAL_ADDRESS     TemporaryMemoryBase,\r
+  IN EFI_PHYSICAL_ADDRESS     PermanentMemoryBase,\r
+  IN UINTN                    CopySize\r
+);                                                                          \r
+\r
+///                                                                                                             \r
+/// This service abstracts the ability to migrate contents of the platform early memory store.                  \r
+///                                                                                                             \r
+typedef struct {                                                                                                \r
+  TEMPORARY_RAM_MIGRATION   TemporaryRamMigration;                                                              \r
+} TEMPORARY_RAM_SUPPORT_PPI;  \r
+\r
+extern EFI_GUID  gEfiTemporaryRamSupportPpiGuid;\r
+\r
+#endif \r
index ffa2f5b3623e0fe2f97f634b802e4c54346ab6bd..30cff849dbabc8229147582cb594e29a00e290e5 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -27,5 +27,7 @@ Abstract:
 #include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)\r
 \r
 EFI_GUID  gEfiFirmwareVolumeBlockProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;\r
+EFI_GUID  gEfiFirmwareVolumeBlock2ProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;\r
 \r
 EFI_GUID_STRING(&gEfiFirmwareVolumeBlockProtocolGuid, "FirmwareVolumeBlock Protocol", "Firmware Volume Block protocol");\r
+EFI_GUID_STRING(&gEfiFirmwareVolumeBlock2ProtocolGuid, "FirmwareVolumeBlock2 Protocol", "Firmware Volume Block2 protocol");\r
index d431aedc5d1a4414bf0525ce03b96696b5e8e148..a2fd4e9d7a0b7644308e391c9861c03128b5d11d 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -40,6 +40,8 @@ Abstract:
 \r
 EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL);\r
 \r
+typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL;\r
+\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_FVB_GET_ATTRIBUTES) (\r
index c28852c64b14cda63e2ddeb010ba9e85ff41c99b..6e3691cb3b1760e56242ac5c8be84644eae62bbf 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -174,10 +174,17 @@ typedef struct {
   UINT16  command_set_feature_enb_86; // word 86\r
   UINT16  command_set_feature_default; // word 87\r
   UINT16  ultra_dma_mode; // word 88\r
-  UINT16  reserved_89_127[39];\r
+  UINT16  reserved_89_105[17];\r
+  UINT16  phy_logic_sector_support; // word 106\r
+  UINT16  reserved_107_116[10];\r
+  UINT16  logic_sector_size_lo; // word 117\r
+  UINT16  logic_sector_size_hi; // word 118\r
+  UINT16  reserved_119_127[9];\r
   UINT16  security_status;\r
   UINT16  vendor_data_129_159[31];\r
-  UINT16  reserved_160_255[96];\r
+  UINT16  reserved_160_208[49];\r
+  UINT16  alignment_logic_in_phy_blocks; // word 209\r
+  UINT16  reserved_210_255[46];\r
 } EFI_ATA_IDENTIFY_DATA;\r
 \r
 #pragma pack()\r
index 4c1462712cc20a62b89001c49c630ee0cb3ad124..a2e6fd4f5be3c5256676de222157eb41690663ec 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -28,6 +28,7 @@ Abstract:
     0x3c699197, 0x93c, 0x4c69, {0xb0, 0x6b, 0x12, 0x8a, 0xe3, 0x48, 0x1d, 0xc9} \\r
   }\r
 \r
+#pragma pack(1)\r
 typedef struct {\r
   UINT8   AddressSpaceId;\r
   UINT8   RegisterBitWidth;\r
@@ -52,7 +53,6 @@ typedef struct {
 // Following structure defines ACPI Description information.\r
 // This information is platform specific, may be consumed by DXE generic driver.\r
 //\r
-#pragma pack(1)\r
 typedef struct _EFI_ACPI_DESCRIPTION {\r
   //\r
   // For Timer\r
index 8e5025161fc5b559214be5dd36ce6dc40119b553..396d89cbd4b8276c9adbcce1b1fdf8ae88b23d5e 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -20,6 +20,7 @@ Abstract:
 --*/\r
 \r
 #ifndef _PCI_OPTION_ROM_TABLE_GUID_H_\r
+#define _PCI_OPTION_ROM_TABLE_GUID_H_\r
 \r
 #define EFI_PCI_OPTION_ROM_TABLE_GUID \\r
   { 0x7462660f, 0x1cbd, 0x48da, {0xad, 0x11, 0x91, 0x71, 0x79, 0x13, 0x83, 0x1c} }\r
index 7fc640de96d74859ebd080057955a3bcd5625d57..57f91b7ff34a98275abe4b8500c4ae88613a2359 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -75,6 +75,9 @@ typedef struct {
 #ifdef EFI_NT_EMULATOR\r
   VOID                              **ModHandle;\r
 #endif\r
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)\r
+  EFI_PHYSICAL_ADDRESS              HiiResourceData;\r
+#endif\r
 } EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT;\r
 \r
 typedef \r
index d64c2b2b561d99cda3500414b4b69b8e29661570..31b50deb8bfdabb0d421bbb5d275d50275cb84d4 100644 (file)
@@ -33,19 +33,5 @@ Abstract:
 #include "EfiApi.h"\r
 #include "EfiDevicePath.h"\r
 \r
-//\r
-// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.\r
-//\r
-#if !defined(EFI_SPECIFICATION_VERSION)\r
-  #error EFI_SPECIFICATION_VERSION not defined\r
-#elif !defined(TIANO_RELEASE_VERSION)\r
-  #error TIANO_RELEASE_VERSION not defined\r
-#elif (TIANO_RELEASE_VERSION == 0)\r
-//\r
-// UEFI mode with no Tiano extensions is legal\r
-//\r
-#elif ((TIANO_RELEASE_VERSION < 0x00080005) && (EFI_SPECIFICATION_VERSION >= 0x00020000))\r
-  #error Illegal combination of EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION versions\r
-#endif\r
 \r
 #endif\r
index 6d03ec48960f160b8afd4b8b4ffa4a3ac8c3b89b..07a7fec735bf1eba5ec30c31b09c9d8f4958d0dd 100644 (file)
@@ -25,7 +25,12 @@ Abstract:
 #define _EFI_TPM_H_\r
 \r
 #include "Tiano.h"\r
-#include "IndustryStandard/Tpm12.h"\r
+\r
+//\r
+// The start of TPM return codes\r
+//\r
+#define TPM_BASE                    (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))\r
+#include "Tpm12.h"\r
 \r
 //\r
 // Standard event types\r
index 89b30157138dafd574d63d08e21c88a54274d95a..901bd52ea7179cca9b31202b41706deb8bd0a8da 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -22,6 +22,32 @@ Abstract:
 \r
 #include "Tiano.h"\r
 \r
+//\r
+// Reference SMBIOS 2.6, chapter 3.1.2.\r
+// For v2.1 and later, handle values in the range 0FF00h to 0FFFFh are reserved for\r
+// use by this specification.\r
+//\r
+#define SMBIOS_HANDLE_RESERVED_BEGIN 0xFF00\r
+\r
+//\r
+// Reference SMBIOS 2.6, chapter 3.1.3\r
+// Each text string is limited to 64 significant characters due to system MIF limitations\r
+//\r
+#define SMBIOS_STRING_MAX_LENGTH     64\r
+\r
+//\r
+// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.43.\r
+// Upper-level software that interprets the SMBIOS structure-table should bypass an \r
+// Inactive structure just like a structure type that the software does not recognize.\r
+//\r
+#define SMBIOS_TYPE_INACTIVE         0x007E    \r
+\r
+//\r
+// End-of-table type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.44.\r
+// The end-of-table indicator is used in the last physical structure in a table\r
+//\r
+#define SMBIOS_TYPE_END_OF_TABLE     0x007F\r
+\r
 #pragma pack(1)\r
 \r
 typedef UINT8 SMBIOS_TABLE_STRING;\r
index 0ba14cecfb2631c5ea10bbac838c497283572b82..aa54b384ee8052dca5c95ada1072ca53661fe46e 100644 (file)
@@ -15,7 +15,7 @@ Module Name:
 \r
 Abstract:\r
 \r
-  TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)\r
+  TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103)\r
 \r
   See http://trustedcomputinggroup.org for latest specification updates\r
 \r
@@ -39,6 +39,7 @@ Abstract:
 typedef UINT8                       TPM_AUTH_DATA_USAGE;\r
 typedef UINT8                       TPM_PAYLOAD_TYPE;\r
 typedef UINT8                       TPM_VERSION_BYTE;\r
+typedef UINT8                       TPM_DA_STATE;\r
 typedef UINT16                      TPM_TAG;\r
 typedef UINT16                      TPM_PROTOCOL_ID;\r
 typedef UINT16                      TPM_STARTUP_TYPE;\r
@@ -144,6 +145,9 @@ typedef UINT32                      TPM_FAMILY_OPERATION;
 #define TPM_TAG_CMK_SIGTICKET       ((TPM_STRUCTURE_TAG) 0x0034)\r
 #define TPM_TAG_CMK_MA_APPROVAL     ((TPM_STRUCTURE_TAG) 0x0035)\r
 #define TPM_TAG_QUOTE_INFO2         ((TPM_STRUCTURE_TAG) 0x0036)\r
+#define TPM_TAG_DA_INFO             ((TPM_STRUCTURE_TAG) 0x0037)\r
+#define TPM_TAG_DA_LIMITED          ((TPM_STRUCTURE_TAG) 0x0038)\r
+#define TPM_TAG_DA_ACTION_TYPE      ((TPM_STRUCTURE_TAG) 0x0039)\r
 \r
 //\r
 // Part 2, section 4: TPM Types\r
@@ -190,6 +194,7 @@ typedef UINT32                      TPM_FAMILY_OPERATION;
 #define TPM_ET_DEL_KEY_BLOB         ((UINT16) 0x0009) // The entity is a delegate key blob\r
 #define TPM_ET_COUNTER              ((UINT16) 0x000A) // The entity is a counter\r
 #define TPM_ET_NV                   ((UINT16) 0x000B) // The entity is a NV index\r
+#define TPM_ET_OPERATOR             ((UINT16) 0x000C) // The entity is the operator\r
 #define TPM_ET_RESERVED_HANDLE      ((UINT16) 0x0040) // Reserved. This value avoids collisions with the handle MSB setting.\r
 //\r
 // TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable\r
@@ -323,8 +328,6 @@ typedef TPM_DIGEST                  TPM_DIRVALUE; // This SHALL be the value of
 typedef TPM_DIGEST                  TPM_HMAC;\r
 typedef TPM_DIGEST                  TPM_PCRVALUE; // The value inside of the PCR\r
 typedef TPM_DIGEST                  TPM_AUDITDIGEST; // This SHALL be the value of the current internal audit state\r
-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\r
-typedef TPM_DIGEST                  TPM_DAA_CONTEXT_SEED; // This SHALL be a random value\r
 \r
 //\r
 // Part 2, section 5.5: TPM_NONCE\r
@@ -333,6 +336,9 @@ typedef struct tdTPM_NONCE{
   UINT8                             nonce[20];\r
 } TPM_NONCE;\r
 \r
+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\r
+typedef TPM_NONCE                  TPM_DAA_CONTEXT_SEED; // This SHALL be a random value\r
+\r
 //\r
 // Part 2, section 5.6: TPM_AUTHDATA\r
 //\r
@@ -393,7 +399,8 @@ typedef struct tdTPM_KEY_HANDLE_LIST {
 #define TPM_ES_NONE                 ((TPM_ENC_SCHEME) 0x0001)\r
 #define TPM_ES_RSAESPKCSv15         ((TPM_ENC_SCHEME) 0x0002)\r
 #define TPM_ES_RSAESOAEP_SHA1_MGF1  ((TPM_ENC_SCHEME) 0x0003)\r
-#define TPM_ES_SYM_CNT              ((TPM_ENC_SCHEME) 0x0004)\r
+#define TPM_ES_SYM_CNT              ((TPM_ENC_SCHEME) 0x0004)  // rev94 defined\r
+#define TPM_ES_SYM_CTR              ((TPM_ENC_SCHEME) 0x0004)\r
 #define TPM_ES_SYM_OFB              ((TPM_ENC_SCHEME) 0x0005)\r
 \r
 #define TPM_SS_NONE                 ((TPM_SIG_SCHEME) 0x0001)\r
@@ -584,6 +591,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
   BOOLEAN                           readSRKPub;\r
   BOOLEAN                           tpmEstablished;\r
   BOOLEAN                           maintenanceDone;\r
+  BOOLEAN                           disableFullDALogicInfo;\r
 } TPM_PERMANENT_FLAGS;\r
 \r
 //\r
@@ -608,6 +616,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
 #define TPM_PF_READSRKPUB                   ((TPM_CAPABILITY_AREA) 17)\r
 #define TPM_PF_TPMESTABLISHED               ((TPM_CAPABILITY_AREA) 18)\r
 #define TPM_PF_MAINTENANCEDONE              ((TPM_CAPABILITY_AREA) 19)\r
+#define TPM_PF_DISABLEFULLDALOGICINFO       ((TPM_CAPABILITY_AREA) 20)\r
 \r
 //\r
 // Part 2, section 7.2: TPM_STCLEAR_FLAGS\r
@@ -655,10 +664,11 @@ typedef struct tdTPM_STANY_FLAGS{
 //\r
 // Part 2, section 7.4: TPM_PERMANENT_DATA\r
 //\r
-//#define TPM_MIN_COUNTERS            4   // the minimum number of counters is 4\r
-//#define TPM_DELEGATE_KEY            TPM_KEY\r
-//#define TPM_NUM_PCR                 16\r
-//#define TPM_MAX_NV_WRITE_NOOWNER    64\r
+#define TPM_MIN_COUNTERS            4   // the minimum number of counters is 4\r
+#define TPM_DELEGATE_KEY            TPM_KEY\r
+#define TPM_NUM_PCR                 16\r
+#define TPM_MAX_NV_WRITE_NOOWNER    64\r
+\r
 //typedef struct tdTPM_PERMANENT_DATA\r
 //{\r
 //    TPM_STRUCTURE_TAG               tag;\r
@@ -686,20 +696,62 @@ typedef struct tdTPM_STANY_FLAGS{
 //    UINT32                          noOwnerNVWrite;\r
 //    TPM_CMK_DELEGATE                restrictDelegate;\r
 //    TPM_DAA_TPM_SEED                tpmDAASeed;\r
+//    TPM_NONCE                       daaProff;\r
+//    TPM_KEY                         daaBlobKey;\r
 //} TPM_PERMANENT_DATA;\r
 \r
+//\r
+// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability\r
+//\r
+#define TPM_PD_REVMAJOR               ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_PD_REVMINOR               ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_PD_TPMPROOF               ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_PD_OWNERAUTH              ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_PD_OPERATORAUTH           ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_PD_MANUMAINTPUB           ((TPM_CAPABILITY_AREA) 6)\r
+#define TPM_PD_ENDORSEMENTKEY         ((TPM_CAPABILITY_AREA) 7)\r
+#define TPM_PD_SRK                    ((TPM_CAPABILITY_AREA) 8)\r
+#define TPM_PD_DELEGATEKEY            ((TPM_CAPABILITY_AREA) 9)\r
+#define TPM_PD_CONTEXTKEY             ((TPM_CAPABILITY_AREA) 10)\r
+#define TPM_PD_AUDITMONOTONICCOUNTER  ((TPM_CAPABILITY_AREA) 11)\r
+#define TPM_PD_MONOTONICCOUNTER       ((TPM_CAPABILITY_AREA) 12)\r
+#define TPM_PD_PCRATTRIB              ((TPM_CAPABILITY_AREA) 13)\r
+#define TPM_PD_ORDINALAUDITSTATUS     ((TPM_CAPABILITY_AREA) 14)\r
+#define TPM_PD_AUTHDIR                ((TPM_CAPABILITY_AREA) 15)\r
+#define TPM_PD_RNGSTATE               ((TPM_CAPABILITY_AREA) 16)\r
+#define TPM_PD_FAMILYTABLE            ((TPM_CAPABILITY_AREA) 17)\r
+#define TPM_DELEGATETABLE             ((TPM_CAPABILITY_AREA) 18)\r
+#define TPM_PD_EKRESET                ((TPM_CAPABILITY_AREA) 19)\r
+#define TPM_PD_MAXNVBUFSIZE           ((TPM_CAPABILITY_AREA) 20)\r
+#define TPM_PD_LASTFAMILYID           ((TPM_CAPABILITY_AREA) 21)\r
+#define TPM_PD_NOOWNERNVWRITE         ((TPM_CAPABILITY_AREA) 22)\r
+#define TPM_PD_RESTRICTDELEGATE       ((TPM_CAPABILITY_AREA) 23)\r
+#define TPM_PD_TPMDAASEED             ((TPM_CAPABILITY_AREA) 24)\r
+#define TPM_PD_DAAPROOF               ((TPM_CAPABILITY_AREA) 25)\r
+\r
 //\r
 // Part 2, section 7.5: TPM_STCLEAR_DATA\r
 //   available inside TPM only\r
 //\r
-//typedef struct tdTPM_STCLEAR_DATA\r
-//{\r
-//    TPM_STRUCTURE_TAG               tag;\r
-//    TPM_NONCE                       contextNonceKey;\r
-//    TPM_COUNT_ID                    countID;\r
-//    UINT32                          ownerReference;\r
-//    BOOLEAN                         disableResetLock;\r
-//} TPM_STCLEAR_DATA;\r
+ typedef struct tdTPM_STCLEAR_DATA{\r
+   TPM_STRUCTURE_TAG                  tag;\r
+   TPM_NONCE                          contextNonceKey;\r
+   TPM_COUNT_ID                       countID;\r
+   UINT32                             ownerReference;\r
+   BOOLEAN                            disableResetLock;\r
+   TPM_PCRVALUE                       PCR[TPM_NUM_PCR];\r
+   UINT32                             deferredPhysicalPresence;\r
+ }TPM_STCLEAR_DATA;\r
+\r
+//\r
+// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability\r
+//\r
+#define TPM_SD_CONTEXTNONCEKEY            ((TPM_CAPABILITY_AREA)0x00000001)\r
+#define TPM_SD_COUNTID                    ((TPM_CAPABILITY_AREA)0x00000002)\r
+#define TPM_SD_OWNERREFERENCE             ((TPM_CAPABILITY_AREA)0x00000003)\r
+#define TPM_SD_DISABLERESETLOCK           ((TPM_CAPABILITY_AREA)0x00000004)\r
+#define TPM_SD_PCR                        ((TPM_CAPABILITY_AREA)0x00000005)\r
+#define TPM_SD_DEFERREDPHYSICALPRESENCE   ((TPM_CAPABILITY_AREA)0x00000006)\r
 \r
 //\r
 // Part 2, section 7.6: TPM_STANY_DATA\r
@@ -716,6 +768,16 @@ typedef struct tdTPM_STANY_FLAGS{
 //    TPM_SESSION_DATA                sessions[TPM_MIN_SESSIONS];\r
 //} TPM_STANY_DATA;\r
 \r
+//\r
+// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability\r
+//\r
+#define TPM_AD_CONTEXTNONCESESSION        ((TPM_CAPABILITY_AREA) 1)\r
+#define TPM_AD_AUDITDIGEST                ((TPM_CAPABILITY_AREA) 2)\r
+#define TPM_AD_CURRENTTICKS               ((TPM_CAPABILITY_AREA) 3)\r
+#define TPM_AD_CONTEXTCOUNT               ((TPM_CAPABILITY_AREA) 4)\r
+#define TPM_AD_CONTEXTLIST                ((TPM_CAPABILITY_AREA) 5)\r
+#define TPM_AD_SESSIONS                   ((TPM_CAPABILITY_AREA) 6)\r
+\r
 //\r
 // Part 2, section 8: PCR Structures\r
 // \r
@@ -1137,7 +1199,9 @@ typedef struct tdTPM_AUDIT_EVENT_OUT
 //\r
 // Part 2, section 16: Return Codes\r
 //\r
-#define TPM_BASE                    0\r
+#ifndef TPM_BASE\r
+#error "TPM Error Codes require definition of TPM_BASE"\r
+#endif\r
 \r
 #define TPM_VENDOR_ERROR            TPM_Vendor_Specific32\r
 #define TPM_NON_FATAL               0x00000800\r
@@ -1498,12 +1562,14 @@ typedef struct tdTPM_NV_DATA_PUBLIC
 //\r
 \r
 //\r
-// Part 2, section 20.3: Owner Permissions Settings for per1 bits\r
+// Part 2, section 20.2.1: Owner Permissions Settings for per1 bits\r
 //\r
 #define TPM_DELEGATE_SetOrdinalAuditStatus          (((UINT32)1)<<30)\r
 #define TPM_DELEGATE_DirWriteAuth                   (((UINT32)1)<<29)\r
 #define TPM_DELEGATE_CMK_ApproveMA                  (((UINT32)1)<<28)\r
+#define TPM_DELEGATE_NV_WriteValue                  (((UINT32)1)<<27)\r
 #define TPM_DELEGATE_CMK_CreateTicket               (((UINT32)1)<<26)\r
+#define TPM_DELEGATE_NV_ReadValue                   (((UINT32)1)<<25)\r
 #define TPM_DELEGATE_Delegate_LoadOwnerDelegation   (((UINT32)1)<<24)\r
 #define TPM_DELEGATE_DAA_Join                       (((UINT32)1)<<23)\r
 #define TPM_DELEGATE_AuthorizeMigrationKey          (((UINT32)1)<<22)\r
@@ -1514,6 +1580,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
 #define TPM_DELEGATE_ResetLockValue                 (((UINT32)1)<<17)\r
 #define TPM_DELEGATE_OwnerClear                     (((UINT32)1)<<16)\r
 #define TPM_DELEGATE_DisableOwnerClear              (((UINT32)1)<<15)\r
+#define TPM_DELEGATE_NV_DefineSpace                 (((UINT32)1)<<14)\r
 #define TPM_DELEGATE_OwnerSetDisable                (((UINT32)1)<<13)\r
 #define TPM_DELEGATE_SetCapability                  (((UINT32)1)<<12)\r
 #define TPM_DELEGATE_MakeIdentity                   (((UINT32)1)<<11)\r
@@ -1530,7 +1597,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
 #define TPM_DELEGATE_DAA_Sign                       (((UINT32)1)<<0)\r
 \r
 //\r
-// Part 2, section 20.3: Key Permissions Settings for per1 bits\r
+// Part 2, section 20.2.3: Key Permissions Settings for per1 bits\r
 //\r
 #define TPM_KEY_DELEGATE_CMK_ConvertMigration       (((UINT32)1)<<28)\r
 #define TPM_KEY_DELEGATE_TickStampBlob              (((UINT32)1)<<27)\r
@@ -1723,6 +1790,15 @@ typedef struct tdTPM_DELEGATE_KEY_BLOB
 #define TPM_CAP_PROP_INPUT_BUFFER       ((TPM_CAPABILITY_AREA) 0x00000124)\r
 \r
 //\r
+// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability\r
+//\r
+#define TPM_SET_PERM_FLAGS              ((TPM_CAPABILITY_AREA) 0x00000001)\r
+#define TPM_SET_PERM_DATA               ((TPM_CAPABILITY_AREA) 0x00000002)\r
+#define TPM_SET_STCLEAR_FLAGS           ((TPM_CAPABILITY_AREA) 0x00000003)\r
+#define TPM_SET_STCLEAR_DATA            ((TPM_CAPABILITY_AREA) 0x00000004)\r
+#define TPM_SET_STANY_FLAGS             ((TPM_CAPABILITY_AREA) 0x00000005)\r
+#define TPM_SET_STANY_DATA              ((TPM_CAPABILITY_AREA) 0x00000006)\r
+\r
 // Part 2, section 21.6: TPM_CAP_VERSION_INFO\r
 //   [size_is(vendorSpecificSize)] BYTE* vendorSpecific;\r
 //\r
@@ -1736,6 +1812,50 @@ typedef struct tdTPM_CAP_VERSION_INFO {
   UINT8                             *vendorSpecific;\r
 } TPM_CAP_VERSION_INFO;\r
 \r
+//\r
+// Part 2, section 21.10: TPM_DA_ACTION_TYPE\r
+//\r
+typedef struct tdTPM_DA_ACTION_TYPE {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  UINT32                            actions;\r
+} TPM_DA_ACTION_TYPE;\r
+\r
+#define TPM_DA_ACTION_FAILURE_MODE     (((UINT32)1)<<3)\r
+#define TPM_DA_ACTION_DEACTIVATE       (((UINT32)1)<<2)\r
+#define TPM_DA_ACTION_DISABLE          (((UINT32)1)<<1)\r
+#define TPM_DA_ACTION_TIMEOUT          (((UINT32)1)<<0)\r
+\r
+//\r
+// Part 2, section 21.7: TPM_DA_INFO\r
+//\r
+typedef struct tdTPM_DA_INFO {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  TPM_DA_STATE                      state;\r
+  UINT16                            currentCount;\r
+  UINT16                            thresholdCount;\r
+  TPM_DA_ACTION_TYPE                actionAtThreshold;\r
+  UINT32                            actionDependValue;\r
+  UINT32                            vendorDataSize;\r
+  UINT8                             *vendorData;\r
+} TPM_DA_INFO;\r
+\r
+//\r
+// Part 2, section 21.8: TPM_DA_INFO_LIMITED\r
+//\r
+typedef struct tdTPM_DA_INFO_LIMITED {\r
+  TPM_STRUCTURE_TAG                 tag;\r
+  TPM_DA_STATE                      state;\r
+  TPM_DA_ACTION_TYPE                actionAtThreshold;\r
+  UINT32                            vendorDataSize;\r
+  UINT8                             *vendorData;\r
+} TPM_DA_INFO_LIMITED;\r
+\r
+//\r
+// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability\r
+//\r
+#define TPM_DA_STATE_INACTIVE          ((UINT8)0x00)\r
+#define TPM_DA_STATE_ACTIVE            ((UINT8)0x01)\r
+\r
 //\r
 // Part 2, section 22: DAA Structures\r
 //\r
index 0957c86d2500ebc8c1a5b350be948b22284e1e9b..e1be8f5a87632734f698d477c2de19aa0831bbf4 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -25,6 +25,16 @@ Revision History
 \r
 #include "pci22.h"\r
 \r
+//\r
+// PCI_CLASS_MASS_STORAGE\r
+//\r
+#define PCI_CLASS_MASS_STORAGE_ATA    0x05\r
+\r
+//\r
+// PCI_CLASS_SERIAL\r
+//\r
+#define PCI_CLASS_SERIAL_IB           0x06\r
+\r
 #define PCI_EXP_MAX_CONFIG_OFFSET     0x1000\r
 #define EFI_PCI_CAPABILITY_ID_PCIEXP  0x10\r
 \r
index 2c2025583bd7ee462f579dd4f80d7adad7776873..0ae3bfd33687ccb61c4088ca898bf39a8568f914 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -56,6 +56,7 @@ Revision History
 #define EFI_SCSI_OP_READ6           0x08\r
 #define EFI_SCSI_OP_READ10          0x28\r
 #define EFI_SCSI_OP_READ_CAPACITY   0x25\r
+#define EFI_SCSI_OP_READ_CAPACITY16 0x9e\r
 #define EFI_SCSI_OP_READ_DEFECT     0x37\r
 #define EFI_SCSI_OP_READ_LONG       0x3e\r
 #define EFI_SCSI_OP_REASSIGN_BLK    0x07\r
@@ -238,6 +239,27 @@ typedef struct {
   UINT8 BlockSize0;\r
 } EFI_SCSI_DISK_CAPACITY_DATA;\r
 \r
+typedef struct {\r
+  UINT8 LastLba7;\r
+  UINT8 LastLba6;\r
+  UINT8 LastLba5;\r
+  UINT8 LastLba4;\r
+  UINT8 LastLba3;\r
+  UINT8 LastLba2;\r
+  UINT8 LastLba1;\r
+  UINT8 LastLba0;\r
+  UINT8 BlockSize3;\r
+  UINT8 BlockSize2;\r
+  UINT8 BlockSize1;\r
+  UINT8 BlockSize0;\r
+  UINT8 Protection;\r
+  UINT8 LogicPerPhysical;\r
+  UINT8 LowestAlignLogic2;  \r
+  UINT8 LowestAlignLogic1;    \r
+  UINT8 Reserved[16];  \r
+} EFI_SCSI_DISK_CAPACITY_DATA16;\r
+\r
+\r
 #pragma pack()\r
 //\r
 // Sense Key\r
index f26515251c0015c7b9d7af43aa0025b6df805afe..159936fa75d7bf8a09e38827a3249d2c9f400c51 100644 (file)
@@ -27,18 +27,6 @@ Abstract:
 #ifndef _TIANO_H_\r
 #define _TIANO_H_\r
 \r
-//\r
-// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.\r
-//\r
-#if !defined(EFI_SPECIFICATION_VERSION)\r
-  #error EFI_SPECIFICATION_VERSION not defined\r
-#elif !defined(TIANO_RELEASE_VERSION)\r
-  #error TIANO_RELEASE_VERSION not defined\r
-#elif (TIANO_RELEASE_VERSION == 0)\r
-  #error TIANO_RELEASE_VERSION can not be zero\r
-#elif (EFI_SPECIFICATION_VERSION <= 0x00020000)\r
-  #define TIANO_EXTENSION_FLAG\r
-#endif\r
 \r
 #include "TianoCommon.h"\r
 #include "TianoApi.h"\r
index fd97e4215a76217d553f7645498e835bc43b9c24..ba17702d150e12538ca3bb123de199c00d87a042 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -50,6 +50,11 @@ Revision History
 //\r
 #define EFI_IFR_TIANO_GUID \\r
   { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }\r
+//\r
+// ClassGuid for Front Page\r
+//\r
+#define EFI_HII_FRONT_PAGE_CLASS_GUID \\r
+  { 0x94d411b7, 0x7669, 0x45c3, {0xba, 0x3b, 0xf3, 0xa5, 0x8a, 0x71, 0x56, 0x81} }\r
 \r
 #pragma pack(1)\r
 \r
index d0aef2f1b6d43a98287e7095358c37ae53a6239c..72f19fbca74c42f972708dc06fc1615ea8b40e61 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-#  Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials                          \r
 #  are licensed and made available under the terms and conditions of the BSD License         \r
 #  which accompanies this distribution.  The full text of the license may be found at        \r
@@ -34,8 +34,8 @@ COMPONENT_TYPE  = LIBRARY
   memset.c            | GCC\r
   \r
 [sources.x64]  \r
-  x64/memcpyRep1.asm | MSFT\r
-  x64/memcpyRep1.asm | INTEL \r
+  x64/memcpyRep4.asm | MSFT\r
+  x64/memcpyRep4.asm | INTEL \r
   x64/memsetRep4.asm | MSFT\r
   x64/memsetRep4.asm | INTEL\r
   memcpy.c           | GCC\r
index 909ee60936f14955d44e5ae30855eb2dec6ab629..bbe3f33d5db4171d39af6e754729b792d8a54b90 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-#  Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials                          \r
 #  are licensed and made available under the terms and conditions of the BSD License         \r
 #  which accompanies this distribution.  The full text of the license may be found at        \r
@@ -34,7 +34,7 @@ COMPONENT_TYPE  = LIBRARY
 [sources.x64]  \r
   memcpy.c | GCC\r
   \r
-  x64/memcpyRep1.asm\r
+  x64/memcpyRep4.asm\r
   x64/memsetRep4.asm\r
 #  x64/memcpy.asm\r
 #  x64/memset.asm\r
index 568ac126135b33db75744cce561296348df7e302..daa01a29a7c91fa58aa5d24fab0970a1edbcb518 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -502,13 +502,6 @@ Routine Description:
 \r
   Initialize a Firmware Volume (FV) Media Device Path node.\r
   \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability.\r
-\r
 Arguments:\r
 \r
   FvDevicePathNode  - Pointer to a FV device path node to initialize\r
@@ -520,12 +513,6 @@ Returns:
 \r
 --*/\r
 {\r
-  //\r
-  // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10. \r
-  // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with\r
-  // EFI 1.10 and UEFI 2.10.\r
-  //\r
-\r
   FvDevicePathNode->Header.Type     = MEDIA_DEVICE_PATH;\r
   FvDevicePathNode->Header.SubType  = MEDIA_FV_FILEPATH_DP;\r
   SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
@@ -544,15 +531,6 @@ Routine Description:
 \r
   Check to see if the Firmware Volume (FV) Media Device Path is valid.\r
   \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability. The return value to this\r
-  function points to a location in FvDevicePathNode and it does not allocate\r
-  new memory for the GUID pointer that is returned.\r
-\r
 Arguments:\r
 \r
   FvDevicePathNode  - Pointer to FV device path to check\r
@@ -564,11 +542,6 @@ Returns:
 \r
 --*/\r
 {\r
-  //\r
-  // EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10. \r
-  // In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with\r
-  // EFI 1.10 and UEFI 2.10.\r
-  //\r
   if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&\r
       DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {\r
     return &FvDevicePathNode->NameGuid;\r
index 3de6c59dc28810c8bea1f9e04dc60b67b420cf17..ef10d41702d02c56c86b2c8f735c330e14c55232 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -21,6 +21,18 @@ Abstract:
 \r
 #include "Tiano.h"\r
 #include "EfiDriverLib.h"\r
+#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)\r
+\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+\r
+VOID\r
+EFIAPI\r
+OnStatusCodeInstall (\r
+  IN EFI_EVENT        Event,\r
+  IN VOID             *Context\r
+  );\r
+\r
+#endif\r
 \r
 //\r
 // Global Interface for Debug Mask Protocol\r
@@ -50,6 +62,10 @@ Returns:
 \r
 --*/\r
 {\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  VOID *Registration;\r
+#endif\r
+  \r
   gST = SystemTable;\r
 \r
   ASSERT (gST != NULL);\r
@@ -70,6 +86,21 @@ Returns:
         (VOID *) &gDebugMaskInterface\r
         );\r
 #endif\r
+\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  //\r
+  // Register EFI_STATUS_CODE_PROTOCOL notify function\r
+  //\r
+  EfiLibCreateProtocolNotifyEvent (\r
+    &gEfiStatusCodeRuntimeProtocolGuid,\r
+    EFI_TPL_CALLBACK,\r
+    OnStatusCodeInstall,\r
+    NULL,\r
+    &Registration\r
+    );\r
+\r
+#endif\r
+\r
   //\r
   // Should be at EFI_D_INFO, but lets us know things are running\r
   //\r
@@ -78,55 +109,107 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+STATIC\r
+BOOLEAN\r
+IsIso639LanguageCode (\r
+  IN CHAR8                *Languages\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Tests whether a language code has format of ISO639-2.\r
+\r
+Arguments:\r
+\r
+  Languages - The language code to be tested.\r
+\r
+Returns:\r
+\r
+  TRUE      - Language code format is ISO 639-2.\r
+  FALSE     - Language code format is not ISO 639-2.\r
+\r
+--*/\r
+{\r
+  UINTN  Index;\r
+\r
+  //\r
+  // Find out format of Languages\r
+  //\r
+  for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';' && Languages[Index] != '-'; Index++);\r
+  if (Languages[Index] != 0) {\r
+    //\r
+    // RFC4646 language code\r
+    //\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // No ';' and '-', it's either ISO639-2 code (list) or single RFC4646 code\r
+  //\r
+  if (Index == 2) {\r
+    //\r
+    // Single RFC4646 language code without country code, e.g. "en"\r
+    //\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // Languages in format of ISO639-2\r
+  //\r
+  return TRUE;\r
+}\r
+\r
 BOOLEAN\r
 EfiLibCompareLanguage (\r
-  IN  CHAR8  *Language1,\r
-  IN  CHAR8  *Language2\r
+  IN  CHAR8               *Language1,\r
+  IN  CHAR8               *Language2\r
   )\r
 /*++\r
 \r
 Routine Description:\r
 \r
-  Compare whether two names of languages are identical.\r
+  Compare the first language instance of two language codes, either could be a\r
+  single language code or a language code list. This function assume Language1\r
+  and Language2 has the same language code format, i.e. either ISO639-2 or RFC4646.\r
 \r
 Arguments:\r
 \r
-  Language1 - Name of language 1\r
-  Language2 - Name of language 2\r
+  Language1 - The first language code to be tested.\r
+  Language2 - The second language code to be tested.\r
 \r
 Returns:\r
 \r
-  TRUE      - same\r
-  FALSE     - not same\r
+  TRUE      - Language code match.\r
+  FALSE     - Language code mismatch.\r
 \r
 --*/\r
 {\r
   UINTN Index;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-  for (Index = 0; (Language1[Index] != 0) && (Language2[Index] != 0); Index++) {\r
-    if (Language1[Index] != Language2[Index]) {\r
-      return FALSE;\r
-    }\r
+  //\r
+  // Compare first two bytes of language tag\r
+  //\r
+  if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {\r
+    return FALSE;\r
   }\r
 \r
-  if (((Language1[Index] == 0) && (Language2[Index] == 0))   || \r
-         ((Language1[Index] == 0) && (Language2[Index] != ';')) ||\r
-         ((Language1[Index] == ';') && (Language2[Index] != 0)) ||\r
-         ((Language1[Index] == ';') && (Language2[Index] != ';'))) {\r
-    return TRUE;\r
+  if (IsIso639LanguageCode (Language1)) {\r
+    //\r
+    // ISO639-2 language code, compare the third byte of language tag\r
+    //\r
+    return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);\r
   }\r
 \r
-  return FALSE;\r
-#else\r
-  for (Index = 0; Index < 3; Index++) {\r
-    if (Language1[Index] != Language2[Index]) {\r
-      return FALSE;\r
-    }\r
+  //\r
+  // RFC4646 language code\r
+  //\r
+  for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++);\r
+  if ((EfiAsciiStrnCmp (Language1, Language2, Index) == 0) && (Language2[Index] == 0 || Language2[Index] == ';')) {\r
+    return TRUE;\r
   }\r
 \r
-  return TRUE;\r
-#endif\r
+  return FALSE;\r
 }\r
 \r
 STATIC\r
@@ -134,19 +217,39 @@ CHAR8 *
 NextSupportedLanguage (\r
   IN CHAR8                *Languages\r
   )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Step to next language code of a language code list.\r
+\r
+Arguments:\r
+\r
+  Languages - The language code list to traverse.\r
+\r
+Returns:\r
+\r
+  Pointer to next language code or NULL terminator if it's the last one.\r
+\r
+--*/\r
 {\r
-#ifdef LANGUAGE_RFC_3066   // LANGUAGE_RFC_3066\r
-  for (; (*Languages != 0) && (*Languages != ';'); Languages++)\r
-    ;\r
+  UINTN    Index;\r
 \r
-  if (*Languages == ';') {\r
-    Languages++;\r
+  if (IsIso639LanguageCode (Languages)) {\r
+    //\r
+    // ISO639-2 language code\r
+    //\r
+    return (Languages + 3);\r
   }\r
 \r
-  return Languages;\r
-#else                      // LANGUAGE_ISO_639_2\r
-  return (Languages + 3);\r
-#endif\r
+  //\r
+  // Search in RFC4646 language code list\r
+  //\r
+  for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);\r
+  if (Languages[Index] == ';') {\r
+    Index++;\r
+  }\r
+  return (Languages + Index);\r
 }\r
 \r
 EFI_STATUS\r
@@ -217,7 +320,7 @@ Returns:
       return EFI_UNSUPPORTED;\r
     }\r
 \r
-    SupportedLanguages = NextSupportedLanguage(SupportedLanguages);\r
+    SupportedLanguages = NextSupportedLanguage (SupportedLanguages);\r
   }\r
 \r
   return EFI_UNSUPPORTED;\r
@@ -326,7 +429,7 @@ Returns:
       //\r
       // Allocate space for a copy of the Language specifier\r
       //\r
-      NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrLen(Language) + 1, Language);\r
+      NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrSize (Language), Language);\r
       if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {\r
         gBS->FreePool (NewUnicodeStringTable);\r
         return EFI_OUT_OF_RESOURCES;\r
@@ -372,7 +475,7 @@ Returns:
       return EFI_SUCCESS;\r
     }\r
 \r
-    SupportedLanguages = NextSupportedLanguage(SupportedLanguages);\r
+    SupportedLanguages = NextSupportedLanguage (SupportedLanguages);\r
   }\r
 \r
   return EFI_UNSUPPORTED;\r
index 547c203a832ad9f907deefdfd5f616f860a25bba..e5b84d205a49ca333ad74644fe23ab745079f99c 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -19,12 +19,85 @@ Abstract:
 \r
 #include "Tiano.h"\r
 #include "EfiDriverLib.h"\r
+#include "PeiHob.h"\r
 #include EFI_PROTOCOL_DEFINITION (DevicePath)\r
+#include EFI_GUID_DEFINITION (Hob)\r
 #include EFI_GUID_DEFINITION (StatusCodeDataTypeId)\r
 #include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)\r
 \r
 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-STATIC EFI_STATUS_CODE_PROTOCOL  *gStatusCode = NULL;\r
+\r
+EFI_REPORT_STATUS_CODE gReportStatusCode = NULL;\r
+\r
+VOID\r
+EFIAPI\r
+OnStatusCodeInstall (\r
+  IN EFI_EVENT        Event,\r
+  IN VOID             *Context\r
+  )\r
+{\r
+  EFI_STATUS                Status;\r
+  EFI_STATUS_CODE_PROTOCOL  *StatusCode;\r
+\r
+  Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **) &StatusCode);\r
+  if (!EFI_ERROR (Status)) {\r
+    gReportStatusCode = StatusCode->ReportStatusCode;\r
+  }\r
+}\r
+\r
+EFI_STATUS\r
+GetPeiProtocol (\r
+  IN EFI_GUID  *ProtocolGuid,\r
+  IN VOID      **Interface\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Searches for a Protocol Interface passed from PEI through a HOB\r
+\r
+Arguments:\r
+\r
+  ProtocolGuid - The Protocol GUID to search for in the HOB List\r
+  Interface    - A pointer to the interface for the Protocol GUID\r
+\r
+Returns:\r
+\r
+  EFI_SUCCESS   - The Protocol GUID was found and its interface is returned in Interface\r
+  EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List\r
+\r
+--*/\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_PEI_HOB_POINTERS  GuidHob;\r
+\r
+  //\r
+  // Get Hob list\r
+  //\r
+  Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **)  &GuidHob.Raw);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {\r
+    if (END_OF_HOB_LIST (GuidHob)) {\r
+      Status = EFI_NOT_FOUND;\r
+      break;\r
+    }\r
+\r
+    if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {\r
+      if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {\r
+        Status     = EFI_SUCCESS;\r
+        *Interface = (VOID *) *(UINTN *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));\r
+      }\r
+    }\r
+\r
+    GuidHob.Raw = GET_NEXT_HOB (GuidHob);\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
 #endif\r
 \r
 EFI_STATUS\r
@@ -59,18 +132,28 @@ Returns:
 {\r
   EFI_STATUS  Status;\r
 \r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000) \r
-  if (gStatusCode == NULL) {\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  if (gReportStatusCode == NULL) {\r
+    //\r
+    // Because we've installed the protocol notification on EfiStatusCodeRuntimeProtocol,\r
+    //   running here indicates that the StatusCode driver has not started yet.\r
+    //\r
     if (gBS == NULL) {\r
+      //\r
+      // Running here only when StatusCode driver never starts.\r
+      //\r
       return EFI_UNSUPPORTED;\r
     }\r
-    Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);\r
-    if (EFI_ERROR (Status) || gStatusCode == NULL) {\r
+\r
+    //\r
+    // Try to get the PEI version of ReportStatusCode.\r
+    //      \r
+    Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);\r
+    if (EFI_ERROR (Status)) {\r
       return EFI_UNSUPPORTED;\r
     }\r
   }\r
-  Status = gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);\r
-  return Status;\r
+  Status = gReportStatusCode (Type, Value, Instance, CallerId, Data);\r
 #else\r
   if (gRT == NULL) {\r
     return EFI_UNSUPPORTED;\r
@@ -84,8 +167,8 @@ Returns:
       gRT->ReportStatusCode != NULL) {\r
     Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);\r
   }\r
-  return Status;\r
 #endif\r
+  return Status;\r
 }\r
 \r
 EFI_STATUS\r
index 63e09d0087f3921c2a8d0adb4d59a37a21c5c1e7..5cbbe02104864cf5cb671915c0455ec5df708a47 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-# Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials                          \r
 # are licensed and made available under the terms and conditions of the BSD License         \r
 # which accompanies this distribution.  The full text of the license may be found at        \r
@@ -41,7 +41,6 @@ COMPONENT_TYPE      = LIBRARY
   $(EDK_SOURCE)/Foundation/Include/IndustryStandard\r
   $(EDK_SOURCE)/Foundation/Core/Dxe\r
   $(EDK_SOURCE)/Foundation/Library/Dxe/Include\r
-  $(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib\r
 \r
 [libraries.common]\r
   EfiGuidLib\r
index 47b084e09b1e9cc26c53edec74ad944541a65aab..a6b7f06a508d1bd9c2d1bded86a2974baa3fd8ec 100644 (file)
@@ -30,7 +30,6 @@ COMPONENT_TYPE      = LIBRARY
 [includes.common]\r
   $(EDK_SOURCE)/Foundation/Framework\r
   $(EDK_SOURCE)/Foundation/Efi\r
-#  $(EFI_SOURCE)/Framework\r
   .\r
   $(EDK_SOURCE)/Foundation/Include\r
   $(EDK_SOURCE)/Foundation/Efi/Include\r
index b913d3fac2a83a1b7954fb56a98eb80eb811d96b..9d4260768c3f10569c94a25c641d9ff86e494457 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -23,7 +23,6 @@ Revision History:
 \r
 #define IS_DIGIT(Ch)  (((Ch) >= L'0') && ((Ch) <= L'9'))\r
 \r
-STATIC\r
 EFI_STATUS\r
 EfiStringToValue (\r
   OUT UINT64        *Val,\r
@@ -37,8 +36,6 @@ Routine Description:
   The returned value is 64-bit.\r
   The string is expected in decimal format,\r
   the string is parsed and format verified.\r
-  This function is missing from the libs. One day it maybe\r
-  replaced with a lib function when it'll become available.\r
 \r
 Arguments:\r
   Val    - pointer to the variable to store the value to\r
index bd8de3a1cfb9465dea1e7b75584208627df035c6..c417242552662a9a451d3b9abbac96ab3f467256 100644 (file)
@@ -106,10 +106,8 @@ typedef struct {
   CHAR16  *UnicodeString;\r
 } EFI_UNICODE_STRING_TABLE;\r
 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-#define LANGUAGE_RFC_3066\r
 #define LANGUAGE_CODE_ENGLISH    "en-US"\r
 #else\r
-#define LANGUAGE_ISO_639_2\r
 #define LANGUAGE_CODE_ENGLISH    "eng"\r
 #endif\r
 \r
@@ -1179,13 +1177,6 @@ EfiInitializeFwVolDevicepathNode (
 Routine Description:\r
   Initialize a Firmware Volume (FV) Media Device Path node.\r
   \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability.\r
-\r
 Arguments:\r
   FvDevicePathNode   - Pointer to a FV device path node to initialize\r
   NameGuid           - FV file name to use in FvDevicePathNode\r
@@ -1202,15 +1193,6 @@ EfiGetNameGuidFromFwVolDevicePathNode (
 Routine Description:\r
   Check to see if the Firmware Volume (FV) Media Device Path is valid.\r
   \r
-  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
-  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
-  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed \r
-  device path is defined for PIWG extensions of device path. If the code \r
-  is compiled to conform with the UEFI 2.0 specification use the new device path\r
-  else use the old form for backwards compatability. The return value to this\r
-  function points to a location in FvDevicePathNode and it does not allocate\r
-  new memory for the GUID pointer that is returned.\r
-\r
 Arguments:\r
   FvDevicePathNode   - Pointer to FV device path to check\r
 \r
index 7cfeffe5fb66d80e03030ef16bcb6ea6855b81b5..946742cb17d19adbc163de8580e302b21a1c8a1f 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -202,4 +202,33 @@ Returns:
 --*/\r
 ;\r
 \r
+EFI_STATUS\r
+EfiStringToValue (\r
+  OUT UINT64        *Val,\r
+  IN  CHAR16        *String,\r
+  OUT UINT8         *EndIdx OPTIONAL\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Parses and converts Unicode string to decimal value.\r
+  The returned value is 64-bit.\r
+  The string is expected in decimal format,\r
+  the string is parsed and format verified.\r
+\r
+Arguments:\r
+  Val    - pointer to the variable to store the value to\r
+  String - string that contains the value to parse and convert\r
+  EndIdx - index on which the parsing stopped. It points to the\r
+           first character that was not part of the returned Val.\r
+           It's valid only if the function returns success.\r
+           It's optional and it could be NULL.\r
+\r
+Returns:\r
+  EFI_SUCCESS           - if successful\r
+  EFI_INVALID_PARAMETER - if String is in unexpected format\r
+\r
+--*/\r
+;\r
+\r
 #endif\r
index c70fb87e7942303b90b314eefe339680e6a37b1f..ae771b13a5710e2915a92990795bc6c57416a84a 100644 (file)
@@ -1,6 +1,6 @@
 #/*++\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -41,7 +41,6 @@ COMPONENT_TYPE      = LIBRARY
   $(EDK_SOURCE)/Foundation/Include/IndustryStandard\r
   $(EDK_SOURCE)/Foundation/Core/Dxe\r
   $(EDK_SOURCE)/Foundation/Library/Dxe/Include\r
-  $(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib\r
 \r
 [libraries.common]\r
   EfiGuidLib\r
index 90afafe83721df7d5243e31d9264e77d458ffb21..c41a85c38da223264d0ef7621fbdfe05b86c0f80 100644 (file)
@@ -37,6 +37,7 @@ HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathTemplate = {
       },\r
       EFI_IFR_TIANO_GUID,\r
     },\r
+    0,\r
     0\r
   },\r
   {\r
@@ -181,22 +182,23 @@ Returns:
 {\r
   EFI_STATUS                   Status;\r
   HII_VENDOR_DEVICE_PATH_NODE  *VendorDevicePath;\r
-  UINT64                       MonotonicCount;\r
 \r
   VendorDevicePath = EfiLibAllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);\r
   if (VendorDevicePath == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
-  gBS->GetNextMonotonicCount (&MonotonicCount);\r
-  VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;\r
+  //\r
+  // Use memory address as unique ID to distinguish from different device paths\r
+  //\r
+  VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);\r
 \r
   *DriverHandle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
                   DriverHandle,\r
                   &gEfiDevicePathProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  VendorDevicePath\r
+                  VendorDevicePath,\r
+                  NULL\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r
@@ -240,7 +242,7 @@ Returns:
                   &gEfiDevicePathProtocolGuid,\r
                   DevicePath\r
                   );\r
-\r
+  gBS->FreePool (DevicePath);\r
   return Status;\r
 }\r
 \r
@@ -511,6 +513,7 @@ Arguments:
 \r
 Returns:\r
   EFI_SUCCESS     - Successfully extract Class for specified Hii handle.\r
+  EFI_NOT_FOUND   - Class not found.\r
 \r
 --*/\r
 {\r
@@ -525,10 +528,12 @@ Returns:
   UINT32                       Offset2;\r
   UINT32                       PackageListLength;\r
   EFI_HII_PACKAGE_HEADER       PackageHeader;\r
+  BOOLEAN                      ClassFound;\r
 \r
   *Class = EFI_NON_DEVICE_CLASS;\r
   *FormSetTitle = 0;\r
   *FormSetHelp = 0;\r
+  ClassFound = FALSE;\r
 \r
   //\r
   // Locate HII Database protocol\r
@@ -574,7 +579,7 @@ Returns:
     Package = ((UINT8 *) HiiPackageList) + Offset;\r
     EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));\r
 \r
-    if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) {\r
+    if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {\r
       //\r
       // Search Class Opcode in this Form Package\r
       //\r
@@ -602,6 +607,139 @@ Returns:
           //\r
           // Till now, we ought to have found the formset Opcode\r
           //\r
+          ClassFound = TRUE;\r
+          break;\r
+        }\r
+\r
+        Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;\r
+      }\r
+\r
+      if (Offset2 < PackageHeader.Length) {\r
+        //\r
+        // Target formset found\r
+        //\r
+        break;\r
+      }\r
+    }\r
+\r
+    Offset += PackageHeader.Length;\r
+  }\r
+\r
+  gBS->FreePool (HiiPackageList);\r
+\r
+  return ClassFound ? EFI_SUCCESS : EFI_NOT_FOUND;\r
+}\r
+\r
+EFI_STATUS\r
+ExtractClassGuidFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  OUT     UINT8               *NumberOfClassGuid,\r
+  OUT     EFI_GUID            **ClassGuid,\r
+  OUT     EFI_STRING_ID       *FormSetTitle,\r
+  OUT     EFI_STRING_ID       *FormSetHelp\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Extract formset ClassGuid for given HII handle.\r
+\r
+Arguments:\r
+  HiiHandle         - Hii handle\r
+  NumberOfClassGuid - Number of ClassGuid\r
+  ClassGuid         - Pointer to callee allocated buffer, an array of ClassGuid\r
+  FormSetTitle      - Formset title string\r
+  FormSetHelp       - Formset help string\r
+\r
+Returns:\r
+  EFI_SUCCESS     - Successfully extract Class for specified Hii handle.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                   Status;\r
+  UINTN                        BufferSize;\r
+  EFI_HII_DATABASE_PROTOCOL    *HiiDatabase;\r
+  EFI_HII_PACKAGE_LIST_HEADER  *HiiPackageList;\r
+  UINT8                        *Package;\r
+  UINT8                        *FormSet;\r
+  UINT8                        *OpCodeData;\r
+  UINT32                       Offset;\r
+  UINT32                       Offset2;\r
+  UINT32                       PackageListLength;\r
+  EFI_HII_PACKAGE_HEADER       PackageHeader;\r
+\r
+  if (NumberOfClassGuid == NULL || ClassGuid == NULL || FormSetTitle == NULL || FormSetHelp == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  *NumberOfClassGuid = 0;\r
+  *ClassGuid = NULL;\r
+  *FormSetTitle = 0;\r
+  *FormSetHelp = 0;\r
+\r
+  //\r
+  // Locate HII Database protocol\r
+  //\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiHiiDatabaseProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &HiiDatabase\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Get HII PackageList\r
+  //\r
+  BufferSize = 0;\r
+  HiiPackageList = NULL;\r
+  Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);\r
+  if (Status == EFI_BUFFER_TOO_SMALL) {\r
+    HiiPackageList = EfiLibAllocatePool (BufferSize);\r
+    ASSERT (HiiPackageList != NULL);\r
+\r
+    Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);\r
+  }\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Get Form package from this HII package List\r
+  //\r
+  Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
+  Offset2 = 0;\r
+  FormSet = NULL;\r
+  EfiCopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));\r
+\r
+  while (Offset < PackageListLength) {\r
+    Package = ((UINT8 *) HiiPackageList) + Offset;\r
+    EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));\r
+\r
+    if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {\r
+      //\r
+      // Search Class Opcode in this Form Package\r
+      //\r
+      Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);\r
+      while (Offset2 < PackageHeader.Length) {\r
+        OpCodeData = Package + Offset2;\r
+\r
+        if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {\r
+          //\r
+          // Find FormSet OpCode\r
+          //\r
+          EfiCopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));\r
+          EfiCopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));\r
+          if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > ((UINTN) &((EFI_IFR_FORM_SET *) 0)->Flags)) {\r
+            //\r
+            // New version of formset OpCode\r
+            //\r
+            *NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);\r
+            *ClassGuid = EfiLibAllocateCopyPool (\r
+                           *NumberOfClassGuid * sizeof (EFI_GUID),\r
+                           ((EFI_IFR_FORM_SET *) OpCodeData)->ClassGuid\r
+                           );\r
+          }\r
           break;\r
         }\r
 \r
index fbb46075c482ea03ed5af73d83ce30786e425518..355935322c5c0cc87d7d657e3024f27448c2ae43 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -26,7 +26,6 @@ Abstract:
 //\r
 UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";\r
 \r
-STATIC\r
 EFI_STATUS\r
 GetPackageDataFromPackageList (\r
   IN  EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList,\r
@@ -72,7 +71,6 @@ GetPackageDataFromPackageList (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 UpdateFormPackageData (\r
   IN  EFI_GUID               *FormSetGuid,\r
@@ -86,17 +84,15 @@ UpdateFormPackageData (
   OUT UINT32                 *TempBufferSize\r
   )\r
 {\r
-  UINTN                     AddSize;\r
   UINT8                     *BufferPos;\r
   EFI_HII_PACKAGE_HEADER    PackageHeader;\r
-  UINT                    Offset;\r
+  UINT32                    Offset;\r
   EFI_IFR_OP_HEADER         *IfrOpHdr;\r
   BOOLEAN                   GetFormSet;\r
   BOOLEAN                   GetForm;\r
   UINT8                     ExtendOpCode;\r
   UINT16                    LabelNumber;\r
   BOOLEAN                   Updated;\r
-  EFI_IFR_OP_HEADER         *AddOpCode;\r
 \r
   if ((TempBuffer == NULL) || (TempBufferSize == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -122,7 +118,7 @@ UpdateFormPackageData (
   GetForm    = FALSE;\r
   Updated    = FALSE;\r
 \r
-  while (Offset < PackageHeader.Length) {\r
+  while (!Updated && Offset < PackageHeader.Length) {\r
     EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);\r
     BufferPos += IfrOpHdr->Length;\r
     *TempBufferSize += IfrOpHdr->Length;\r
@@ -132,6 +128,8 @@ UpdateFormPackageData (
       if (FormSetGuid != NULL) {\r
         if (EfiCompareMem (&((EFI_IFR_FORM_SET *) IfrOpHdr)->Guid, FormSetGuid, sizeof (EFI_GUID)) == 0) {\r
           GetFormSet = TRUE;\r
+        } else {\r
+          GetFormSet = FALSE;\r
         }\r
       }\r
       break;\r
@@ -139,17 +137,24 @@ UpdateFormPackageData (
     case EFI_IFR_FORM_OP:\r
       if (EfiCompareMem (&((EFI_IFR_FORM *) IfrOpHdr)->FormId, &FormId, sizeof (EFI_FORM_ID)) == 0) {\r
         GetForm = TRUE;\r
+      } else {\r
+        GetForm = FALSE;\r
       }\r
       break;\r
 \r
     case EFI_IFR_GUID_OP :\r
-      if (!GetFormSet || !GetForm || Updated) {\r
+      if (!GetFormSet || !GetForm) {\r
         //\r
         // Go to the next Op-Code\r
         //\r
-        Offset   += IfrOpHdr->Length;\r
-        IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);\r
-        continue;\r
+        break;\r
+      }\r
+\r
+      if (!EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid)) {\r
+        //\r
+        // GUID mismatch, skip this op-code\r
+        //\r
+        break;\r
       }\r
 \r
       ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;\r
@@ -158,29 +163,18 @@ UpdateFormPackageData (
         //\r
         // Go to the next Op-Code\r
         //\r
-        Offset   += IfrOpHdr->Length;\r
-        IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);\r
-        continue;\r
+        break;\r
       }\r
 \r
-      if (Insert && (Data != NULL)) {\r
+      if (Insert) {\r
         //\r
-        // insert the DataCount amount of opcodes to TempBuffer if Data is NULL remove\r
-        // DataCount amount of opcodes unless runing into a label.\r
+        // Insert data after current Label, skip myself\r
         //\r
-        AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;\r
-        AddSize   = 0;\r
-        while (AddSize < Data->Offset) {\r
-          EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);\r
-          BufferPos += AddOpCode->Length;\r
-          *TempBufferSize += AddOpCode->Length;\r
-\r
-          AddSize += AddOpCode->Length;\r
-          AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);\r
-        }\r
+        Offset   += IfrOpHdr->Length;\r
+        IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);\r
       } else {\r
         //\r
-        // Search the next Label.\r
+        // Replace data between two paired Label, try to find the next Label.\r
         //\r
         while (TRUE) {\r
           Offset   += IfrOpHdr->Length;\r
@@ -193,33 +187,28 @@ UpdateFormPackageData (
           IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);\r
           if (IfrOpHdr->OpCode == EFI_IFR_GUID_OP) {\r
             ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;\r
-            if (ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {\r
+            if (EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid) && ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {\r
               break;\r
             }\r
           }\r
         }\r
+      }\r
 \r
-        if (Data != NULL) {\r
-          AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;\r
-          AddSize   = 0;\r
-          while (AddSize < Data->Offset) {\r
-            EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);\r
-            BufferPos += AddOpCode->Length;\r
-            *TempBufferSize += AddOpCode->Length;\r
-\r
-            AddSize   += AddOpCode->Length;\r
-            AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);\r
-          }\r
-        }\r
-\r
-        //\r
-        // copy the next label\r
-        //\r
-        EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);\r
-        BufferPos += IfrOpHdr->Length;\r
-        *TempBufferSize += IfrOpHdr->Length;\r
+      //\r
+      // Fill in the update data\r
+      //\r
+      if (Data != NULL) {\r
+        EfiCopyMem (BufferPos, Data->Data, Data->Offset);\r
+        BufferPos += Data->Offset;\r
+        *TempBufferSize += Data->Offset;\r
       }\r
 \r
+      //\r
+      // Copy the reset data\r
+      //\r
+      EfiCopyMem (BufferPos, IfrOpHdr, PackageHeader.Length - Offset);\r
+      *TempBufferSize += PackageHeader.Length - Offset;\r
+\r
       Updated = TRUE;\r
       break;\r
     default :\r
@@ -249,6 +238,68 @@ Fail:
   return EFI_SUCCESS;\r
 }\r
 \r
+EFI_STATUS\r
+IfrLibInitUpdateData (\r
+  IN OUT EFI_HII_UPDATE_DATA   *UpdateData,\r
+  IN UINT32                    BufferSize\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function initialize the data structure for dynamic opcode.\r
+\r
+Arguments:\r
+  UpdateData     - The adding data;\r
+  BufferSize     - Length of the buffer to fill dynamic opcodes.\r
+\r
+Returns:\r
+  EFI_SUCCESS           - Update data is initialized.\r
+  EFI_INVALID_PARAMETER - UpdateData is NULL.\r
+  EFI_OUT_OF_RESOURCES  - No enough memory to allocate.\r
+\r
+--*/\r
+{\r
+  if (UpdateData == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  UpdateData->BufferSize = BufferSize;\r
+  UpdateData->Offset = 0;\r
+  UpdateData->Data = EfiLibAllocatePool (BufferSize);\r
+\r
+  return (UpdateData->Data != NULL) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;\r
+}\r
+\r
+EFI_STATUS\r
+IfrLibFreeUpdateData (\r
+  IN EFI_HII_UPDATE_DATA       *UpdateData\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function free the resource of update data.\r
+\r
+Arguments:\r
+  UpdateData     - The adding data;\r
+\r
+Returns:\r
+  EFI_SUCCESS           - Resource in UpdateData is released.\r
+  EFI_INVALID_PARAMETER - UpdateData is NULL.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  if (UpdateData == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  Status = gBS->FreePool (UpdateData->Data);\r
+  UpdateData->Data = NULL;\r
+\r
+  return Status;\r
+}\r
+\r
 EFI_STATUS\r
 IfrLibUpdateForm (\r
   IN EFI_HII_HANDLE            Handle,\r
@@ -339,7 +390,7 @@ Returns:
     Status = GetPackageDataFromPackageList (HiiPackageList, Index, &PackageLength, &Package);\r
     if (Status == EFI_SUCCESS) {\r
       EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));\r
-      if ((PackageHeader.Type == EFI_HII_PACKAGE_FORM) && !Updated) {\r
+      if ((PackageHeader.Type == EFI_HII_PACKAGE_FORMS) && !Updated) {\r
         Status = UpdateFormPackageData (FormSetGuid, FormId, Package, PackageLength, Label, Insert, Data, (UINT8 **)&TempBuffer, &TempBufferSize);\r
         if (!EFI_ERROR(Status)) {\r
           if (FormSetGuid == NULL) {\r
@@ -644,7 +695,376 @@ ExtractDefault(
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
+EFI_STATUS\r
+ExtractBlockName (\r
+  IN UINT8                        *Buffer,\r
+  OUT CHAR16                      **BlockName\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Extract block name from the array generated by VFR compiler. The name of\r
+  this array is "Vfr + <StorageName> + BlockName", e.g. "VfrMyIfrNVDataBlockName".\r
+  Format of this array is:\r
+     Array length | 4-bytes\r
+       Offset     | 2-bytes\r
+       Width      | 2-bytes\r
+       Offset     | 2-bytes\r
+       Width      | 2-bytes\r
+       ... ...\r
+\r
+  Arguments:\r
+    Buffer                - Array generated by VFR compiler.\r
+    BlockName             - The returned <BlockName>\r
+\r
+  Returns:\r
+    EFI_OUT_OF_RESOURCES  - Run out of memory resource.\r
+    EFI_INVALID_PARAMETER - Buffer is NULL or BlockName is NULL.\r
+    EFI_SUCCESS           - Operation successful.\r
+\r
+--*/\r
+{\r
+  UINTN       Index;\r
+  UINT32      Length;\r
+  UINT32      BlockNameNumber;\r
+  UINTN       HexStringBufferLen;\r
+  CHAR16      *StringPtr;\r
+\r
+  if ((Buffer == NULL) || (BlockName == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Calculate number of Offset/Width pair\r
+  //\r
+  EfiCopyMem (&Length, Buffer, sizeof (UINT32));\r
+  BlockNameNumber = (Length - sizeof (UINT32)) / (sizeof (UINT16) * 2);\r
+\r
+  //\r
+  // <BlockName> ::= &OFFSET=1234&WIDTH=1234\r
+  //                 |   8  | 4 |  7   | 4 |\r
+  //\r
+  StringPtr = EfiLibAllocateZeroPool ((BlockNameNumber * (8 + 4 + 7 + 4) + 1) * sizeof (CHAR16));\r
+  *BlockName = StringPtr;\r
+  if (StringPtr == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  Buffer += sizeof (UINT32);\r
+  for (Index = 0; Index < BlockNameNumber; Index++) {\r
+    EfiStrCpy (StringPtr, L"&OFFSET=");\r
+    StringPtr += 8;\r
+\r
+    HexStringBufferLen = 5;\r
+    BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));\r
+    Buffer += sizeof (UINT16);\r
+    StringPtr += 4;\r
+\r
+    EfiStrCpy (StringPtr, L"&WIDTH=");\r
+    StringPtr += 7;\r
+\r
+    HexStringBufferLen = 5;\r
+    BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));\r
+    Buffer += sizeof (UINT16);\r
+    StringPtr += 4;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+ExtractBlockConfig (\r
+  IN UINT8                        *Buffer,\r
+  OUT CHAR16                      **BlockConfig\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+    Extract block config from the array generated by VFR compiler. The name of\r
+  this array is "Vfr + <StorageName> + Default<HexCh>4", e.g. "VfrMyIfrNVDataDefault0000".\r
+\r
+  Arguments:\r
+    Buffer                - Array generated by VFR compiler.\r
+    BlockConfig           - The returned <BlockConfig>\r
+\r
+  Returns:\r
+    EFI_OUT_OF_RESOURCES  - Run out of memory resource.\r
+    EFI_INVALID_PARAMETER - Buffer is NULL or BlockConfig is NULL.\r
+    EFI_SUCCESS           - Operation successful.\r
+\r
+--*/\r
+{\r
+  UINT32      Length;\r
+  UINT16      Width;\r
+  UINTN       HexStringBufferLen;\r
+  CHAR16      *StringPtr;\r
+  UINT8       *BufferEnd;\r
+  CHAR16      *StringEnd;\r
+  EFI_STATUS  Status;\r
+\r
+  if ((Buffer == NULL) || (BlockConfig == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Calculate length of AltResp string\r
+  // Format of Default value array is:\r
+  //  Array length | 4-bytes\r
+  //        Offset | 2-bytes\r
+  //        Width  | 2-bytes\r
+  //        Value  | Variable length\r
+  //        Offset | 2-bytes\r
+  //        Width  | 2-bytes\r
+  //        Value  | Variable length\r
+  //        ... ...\r
+  // When value is 1 byte in length, overhead of AltResp string will be maximum,\r
+  //  BlockConfig ::= <&OFFSET=1234&WIDTH=1234&VALUE=12>+\r
+  //                   |   8   | 4  |  7   | 4 |  7  |2|\r
+  // so the maximum length of BlockConfig could be calculated as:\r
+  // (ArrayLength / 5) * (8 + 4 + 7 + 4 + 7 + 2) = ArrayLength * 6.4 < ArrayLength * 7\r
+  //\r
+  EfiCopyMem (&Length, Buffer, sizeof (UINT32));\r
+  BufferEnd = Buffer + Length;\r
+  StringPtr = EfiLibAllocatePool (Length * 7 * sizeof (CHAR16));\r
+  *BlockConfig = StringPtr;\r
+  if (StringPtr == NULL) {\r
+      return EFI_OUT_OF_RESOURCES;\r
+  }\r
+  StringEnd = StringPtr + (Length * 7);\r
+\r
+  Buffer += sizeof (UINT32);\r
+  while (Buffer < BufferEnd) {\r
+    EfiStrCpy (StringPtr, L"&OFFSET=");\r
+    StringPtr += 8;\r
+\r
+    HexStringBufferLen = 5;\r
+    BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));\r
+    Buffer += sizeof (UINT16);\r
+    StringPtr += 4;\r
+\r
+    EfiStrCpy (StringPtr, L"&WIDTH=");\r
+    StringPtr += 7;\r
+\r
+    HexStringBufferLen = 5;\r
+    BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));\r
+    EfiCopyMem (&Width, Buffer, sizeof (UINT16));\r
+    Buffer += sizeof (UINT16);\r
+    StringPtr += 4;\r
+\r
+    EfiStrCpy (StringPtr, L"&VALUE=");\r
+    StringPtr += 7;\r
+\r
+    HexStringBufferLen = StringEnd - StringPtr;\r
+    Status = BufToHexString (StringPtr, &HexStringBufferLen, Buffer, Width);\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+    Buffer += Width;\r
+    StringPtr += (Width * 2);\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+ConstructConfigAltResp (\r
+  IN  EFI_STRING                  ConfigRequest,  OPTIONAL\r
+  OUT EFI_STRING                  *Progress,\r
+  OUT EFI_STRING                  *ConfigAltResp,\r
+  IN  EFI_GUID                    *Guid,\r
+  IN  CHAR16                      *Name,\r
+  IN  EFI_HANDLE                  *DriverHandle,\r
+  IN  VOID                        *BufferStorage,\r
+  IN  UINTN                       BufferStorageSize,\r
+  IN  VOID                        *BlockNameArray, OPTIONAL\r
+  IN  UINTN                       NumberAltCfg,\r
+  ...\r
+//IN  UINT16                      AltCfgId,\r
+//IN  VOID                        *DefaultValueArray,\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+  Construct <ConfigAltResp> for a buffer storage.\r
+\r
+  Arguments:\r
+    ConfigRequest         - The Config request string. If set to NULL, all the\r
+                            configurable elements will be extracted from BlockNameArray.\r
+    ConfigAltResp         - The returned <ConfigAltResp>.\r
+    Progress              - On return, points to a character in the Request.\r
+    Guid                  - GUID of the buffer storage.\r
+    Name                  - Name of the buffer storage.\r
+    DriverHandle          - The DriverHandle which is used to invoke HiiDatabase\r
+                            protocol interface NewPackageList().\r
+    BufferStorage         - Content of the buffer storage.\r
+    BufferStorageSize     - Length in bytes of the buffer storage.\r
+    BlockNameArray        - Array generated by VFR compiler.\r
+    NumberAltCfg          - Number of Default value array generated by VFR compiler.\r
+                            The sequential input parameters will be number of\r
+                            AltCfgId and DefaultValueArray pairs. When set to 0,\r
+                            there will be no <AltResp>.\r
+\r
+  Returns:\r
+    EFI_OUT_OF_RESOURCES  - Run out of memory resource.\r
+    EFI_INVALID_PARAMETER - ConfigAltResp is NULL.\r
+    EFI_SUCCESS           - Operation successful.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS                      Status;\r
+  CHAR16                          *ConfigHdr;\r
+  CHAR16                          *BlockName;\r
+  CHAR16                          *DescHdr;\r
+  CHAR16                          *StringPtr;\r
+  CHAR16                          **AltCfg;\r
+  UINT16                          AltCfgId;\r
+  VOID                            *DefaultValueArray;\r
+  UINTN                           StrBufferLen;\r
+  EFI_STRING                      ConfigResp;\r
+  EFI_STRING                      TempStr;\r
+  VA_LIST                         Args;\r
+  UINTN                           AltRespLen;\r
+  UINTN                           Index;\r
+  BOOLEAN                         NeedFreeConfigRequest;\r
+  EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;\r
+\r
+  if (ConfigAltResp == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Construct <ConfigHdr> : "GUID=...&NAME=...&PATH=..."\r
+  //\r
+  ConfigHdr = NULL;\r
+  StrBufferLen = 0;\r
+  Status = ConstructConfigHdr (\r
+             ConfigHdr,\r
+             &StrBufferLen,\r
+             Guid,\r
+             Name,\r
+             DriverHandle\r
+             );\r
+  if (Status == EFI_BUFFER_TOO_SMALL) {\r
+    ConfigHdr = EfiLibAllocateZeroPool (StrBufferLen);\r
+    Status = ConstructConfigHdr (\r
+               ConfigHdr,\r
+               &StrBufferLen,\r
+               Guid,\r
+               Name,\r
+               DriverHandle\r
+               );\r
+  }\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Construct <ConfigResp>\r
+  //\r
+  NeedFreeConfigRequest = FALSE;\r
+  if (ConfigRequest == NULL) {\r
+    //\r
+    // If ConfigRequest is set to NULL, export all configurable elements in BlockNameArray\r
+    //\r
+    Status = ExtractBlockName (BlockNameArray, &BlockName);\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+\r
+    StrBufferLen = EfiStrSize (ConfigHdr);\r
+    StrBufferLen = StrBufferLen + EfiStrSize (BlockName) - sizeof (CHAR16);\r
+    ConfigRequest = EfiLibAllocateZeroPool (StrBufferLen);\r
+    EfiStrCpy (ConfigRequest, ConfigHdr);\r
+    EfiStrCat (ConfigRequest, BlockName);\r
+    NeedFreeConfigRequest = TRUE;\r
+  }\r
+\r
+  Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting);\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  Status = HiiConfigRouting->BlockToConfig (\r
+                               HiiConfigRouting,\r
+                               ConfigRequest,\r
+                               BufferStorage,\r
+                               BufferStorageSize,\r
+                               &ConfigResp,\r
+                               (Progress == NULL) ? &TempStr : Progress\r
+                               );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Construct <AltResp>\r
+  //\r
+  DescHdr = EfiLibAllocateZeroPool (NumberAltCfg * 16 * sizeof (CHAR16));\r
+  StringPtr = DescHdr;\r
+  AltCfg = EfiLibAllocateZeroPool (NumberAltCfg * sizeof (CHAR16 *));\r
+  AltRespLen = 0;\r
+  VA_START (Args, NumberAltCfg);\r
+  for (Index = 0; Index < NumberAltCfg; Index++) {\r
+    AltCfgId = (UINT16) VA_ARG (Args, UINT16);\r
+    DefaultValueArray = (UINT8 *) VA_ARG (Args, VOID *);\r
+\r
+    //\r
+    // '&' <ConfigHdr>\r
+    //\r
+    AltRespLen += (EfiStrLen (ConfigHdr) + 1);\r
+\r
+    StringPtr = DescHdr + Index * 16;\r
+    EfiStrCpy (StringPtr, L"&ALTCFG=");\r
+    AltRespLen += (8 + sizeof (UINT16) * 2);\r
+\r
+    StrBufferLen = 5;\r
+    BufToHexString (StringPtr + 8, &StrBufferLen, (UINT8 *) &AltCfgId, sizeof (UINT16));\r
+    Status = ExtractBlockConfig (DefaultValueArray, &AltCfg[Index]);\r
+    if (EFI_ERROR (Status)) {\r
+      return Status;\r
+    }\r
+    AltRespLen += EfiStrLen (AltCfg[Index]);\r
+  }\r
+  VA_END (Args);\r
+\r
+  //\r
+  // Generate the final <ConfigAltResp>\r
+  //\r
+  StrBufferLen = (EfiStrLen ((CHAR16 *) ConfigResp) + AltRespLen + 1) * sizeof (CHAR16);\r
+  TempStr = EfiLibAllocateZeroPool (StrBufferLen);\r
+  *ConfigAltResp = TempStr;\r
+  if (TempStr == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // <ConfigAltResp> ::= <ConfigResp> ['&' <AltResp>]*\r
+  //\r
+  EfiStrCpy (TempStr, ConfigResp);\r
+  for (Index = 0; Index < NumberAltCfg; Index++) {\r
+    EfiStrCat (TempStr, L"&");\r
+    EfiStrCat (TempStr, ConfigHdr);\r
+    EfiStrCat (TempStr, DescHdr + Index * 16);\r
+    EfiStrCat (TempStr, AltCfg[Index]);\r
+\r
+    gBS->FreePool (AltCfg[Index]);\r
+  }\r
+\r
+  if (NeedFreeConfigRequest) {\r
+    gBS->FreePool (ConfigRequest);\r
+  }\r
+  gBS->FreePool (ConfigHdr);\r
+  gBS->FreePool (ConfigResp);\r
+  gBS->FreePool (DescHdr);\r
+  gBS->FreePool (AltCfg);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
 VOID\r
 SwapBuffer (\r
   IN OUT UINT8     *Buffer,\r
@@ -668,7 +1088,7 @@ Returns:
   UINT8  Temp;\r
   UINTN  SwapCount;\r
 \r
-  SwapCount = (BufferSize - 1) / 2;\r
+  SwapCount = BufferSize / 2;\r
   for (Index = 0; Index < SwapCount; Index++) {\r
     Temp = Buffer[Index];\r
     Buffer[Index] = Buffer[BufferSize - 1 - Index];\r
@@ -676,6 +1096,31 @@ Returns:
   }\r
 }\r
 \r
+VOID\r
+ToLower (\r
+  IN OUT CHAR16    *Str\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Converts the unicode character of the string from uppercase to lowercase.\r
+\r
+Arguments:\r
+  Str        -  String to be converted\r
+\r
+Returns:\r
+\r
+--*/\r
+{\r
+  CHAR16      *Ptr;\r
+\r
+  for (Ptr = Str; *Ptr != L'\0'; Ptr++) {\r
+    if (*Ptr >= L'A' && *Ptr <= L'Z') {\r
+      *Ptr = (CHAR16) (*Ptr - L'A' + L'a');\r
+    }\r
+  }\r
+}\r
+\r
 EFI_STATUS\r
 BufferToHexString (\r
   IN OUT CHAR16    *Str,\r
@@ -704,10 +1149,14 @@ Returns:
   NewBuffer = EfiLibAllocateCopyPool (BufferSize, Buffer);\r
   SwapBuffer (NewBuffer, BufferSize);\r
 \r
-  StrBufferLen = (BufferSize + 1) * sizeof (CHAR16);\r
+  StrBufferLen = BufferSize * 2 + 1;\r
   Status = BufToHexString (Str, &StrBufferLen, NewBuffer, BufferSize);\r
 \r
   gBS->FreePool (NewBuffer);\r
+  //\r
+  // Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.\r
+  //\r
+  ToLower (Str);\r
 \r
   return Status;\r
 }\r
@@ -741,12 +1190,138 @@ Returns:
   ConvertedStrLen = 0;\r
   Status = HexStringToBuf (Buffer, BufferSize, Str, &ConvertedStrLen);\r
   if (!EFI_ERROR (Status)) {\r
-    SwapBuffer (Buffer, ConvertedStrLen);\r
+    SwapBuffer (Buffer, (ConvertedStrLen + 1) / 2);\r
   }\r
 \r
   return Status;\r
 }\r
 \r
+EFI_STATUS\r
+ConfigStringToUnicode (\r
+  IN OUT CHAR16                *UnicodeString,\r
+  IN OUT UINTN                 *StrBufferLen,\r
+  IN CHAR16                    *ConfigString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Convert binary representation Config string (e.g. "0041004200430044") to the\r
+  original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.\r
+  "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
+\r
+Arguments:\r
+  UnicodeString - Original Unicode string.\r
+  StrBufferLen  - On input: Length in bytes of buffer to hold the Unicode string.\r
+                  Includes tailing '\0' character.\r
+                  On output:\r
+                    If return EFI_SUCCESS, containing length of Unicode string buffer.\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
+  ConfigString  - Binary representation of Unicode String, <string> := (<HexCh>4)+\r
+\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r
+\r
+--*/\r
+{\r
+  UINTN       Index;\r
+  UINTN       Len;\r
+  UINTN       BufferSize;\r
+  CHAR16      BackupChar;\r
+\r
+  Len = EfiStrLen (ConfigString) / 4;\r
+  BufferSize = (Len + 1) * sizeof (CHAR16);\r
+\r
+  if (*StrBufferLen < BufferSize) {\r
+    *StrBufferLen = BufferSize;\r
+    return EFI_BUFFER_TOO_SMALL;\r
+  }\r
+\r
+  *StrBufferLen = BufferSize;\r
+\r
+  for (Index = 0; Index < Len; Index++) {\r
+    BackupChar = ConfigString[4];\r
+    ConfigString[4] = L'\0';\r
+\r
+    HexStringToBuf ((UINT8 *) UnicodeString, &BufferSize, ConfigString, NULL);\r
+\r
+    ConfigString[4] = BackupChar;\r
+\r
+    ConfigString += 4;\r
+    UnicodeString += 1;\r
+  }\r
+\r
+  //\r
+  // Add tailing '\0' character\r
+  //\r
+  *UnicodeString = L'\0';\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+EFI_STATUS\r
+UnicodeToConfigString (\r
+  IN OUT CHAR16                *ConfigString,\r
+  IN OUT UINTN                 *StrBufferLen,\r
+  IN CHAR16                    *UnicodeString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Convert Unicode string to binary representation Config string, e.g.\r
+  "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.\r
+  "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
+\r
+Arguments:\r
+  ConfigString  - Binary representation of Unicode String, <string> := (<HexCh>4)+\r
+  StrBufferLen  - On input: Length in bytes of buffer to hold the Unicode string.\r
+                  Includes tailing '\0' character.\r
+                  On output:\r
+                    If return EFI_SUCCESS, containing length of Unicode string buffer.\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
+  UnicodeString - Original Unicode string.\r
+\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r
+\r
+--*/\r
+{\r
+  UINTN       Index;\r
+  UINTN       Len;\r
+  UINTN       BufferSize;\r
+  CHAR16      *String;\r
+\r
+  Len = EfiStrLen (UnicodeString);\r
+  BufferSize = (Len * 4 + 1) * sizeof (CHAR16);\r
+\r
+  if (*StrBufferLen < BufferSize) {\r
+    *StrBufferLen = BufferSize;\r
+    return EFI_BUFFER_TOO_SMALL;\r
+  }\r
+\r
+  *StrBufferLen = BufferSize;\r
+  String        = ConfigString;\r
+\r
+  for (Index = 0; Index < Len; Index++) {\r
+    BufToHexString (ConfigString, &BufferSize, (UINT8 *) UnicodeString, 2);\r
+\r
+    ConfigString += 4;\r
+    UnicodeString += 1;\r
+  }\r
+\r
+  //\r
+  // Add tailing '\0' character\r
+  //\r
+  *ConfigString = L'\0';\r
+\r
+  //\r
+  // Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.\r
+  //\r
+  ToLower (String);\r
+  return EFI_SUCCESS;\r
+}\r
+\r
 EFI_STATUS\r
 ConstructConfigHdr (\r
   IN OUT CHAR16                *ConfigHdr,\r
@@ -811,10 +1386,10 @@ Returns:
   DevicePathSize = EfiDevicePathSize (DevicePath);\r
 \r
   //\r
-  // GUID=<HexCh>32&NAME=<Alpha>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>\r
-  // | 5  |   32   |  6  |   NameStrLen   |  6  |    DevicePathStrLen   |\r
+  // GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>\r
+  // | 5  |   32   |  6  |  NameStrLen*4 |  6  |    DevicePathStrLen    | 1 |\r
   //\r
-  BufferSize = (5 + 32 + 6 + NameStrLen + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);\r
+  BufferSize = (5 + 32 + 6 + NameStrLen * 4 + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);\r
   if (*StrBufferLen < BufferSize) {\r
     *StrBufferLen = BufferSize;\r
     return EFI_BUFFER_TOO_SMALL;\r
@@ -829,11 +1404,15 @@ Returns:
   BufferToHexString (StrPtr, (UINT8 *) Guid, sizeof (EFI_GUID));\r
   StrPtr += 32;\r
 \r
+  //\r
+  // Convert name string, e.g. name "ABCD" => "&NAME=0041004200430044"\r
+  //\r
   EfiStrCpy (StrPtr, L"&NAME=");\r
   StrPtr += 6;\r
   if (Name != NULL) {\r
-    EfiStrCpy (StrPtr, Name);\r
-    StrPtr += NameStrLen;\r
+    BufferSize = (NameStrLen * 4 + 1) * sizeof (CHAR16);\r
+    UnicodeToConfigString (StrPtr, &BufferSize, Name);\r
+    StrPtr += (NameStrLen * 4);\r
   }\r
 \r
   EfiStrCpy (StrPtr, L"&PATH=");\r
@@ -843,6 +1422,105 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+BOOLEAN\r
+IsConfigHdrMatch (\r
+  IN EFI_STRING                ConfigString,\r
+  IN EFI_GUID                  *StorageGuid, OPTIONAL\r
+  IN CHAR16                    *StorageName  OPTIONAL\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.\r
+\r
+Arguments:\r
+  ConfigString - Either <ConfigRequest> or <ConfigResp>.\r
+  StorageGuid  - GUID of the storage.\r
+  StorageName  - Name of the stoarge.\r
+\r
+Returns:\r
+  TRUE         - Routing information is correct in ConfigString.\r
+  FALSE        - Routing information is incorrect in ConfigString.\r
+\r
+--*/\r
+{\r
+  EFI_STATUS  Status;\r
+  BOOLEAN     Match;\r
+  EFI_GUID    Guid;\r
+  CHAR16      *Name;\r
+  CHAR16      *StrPtr;\r
+  UINTN       BufferSize;\r
+\r
+  //\r
+  // <ConfigHdr> ::=\r
+  // GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>\r
+  // | 5  |   32   |  6  |  NameStrLen*4 |  6  |    DevicePathStrLen    | 1 |\r
+  //\r
+  if (EfiStrLen (ConfigString) <= (5 + 32 + 6)) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // Compare GUID\r
+  //\r
+  if (StorageGuid != NULL) {\r
+\r
+    StrPtr = ConfigString + 5 + 32;\r
+    if (*StrPtr != L'&') {\r
+      return FALSE;\r
+    }\r
+    *StrPtr = L'\0';\r
+\r
+    BufferSize = sizeof (EFI_GUID);\r
+    Status = HexStringToBuffer (\r
+               (UINT8 *) &Guid,\r
+               &BufferSize,\r
+               ConfigString + 5\r
+               );\r
+    *StrPtr = L'&';\r
+\r
+    if (EFI_ERROR (Status)) {\r
+      return FALSE;\r
+    }\r
+\r
+    if (!EfiCompareGuid (&Guid, StorageGuid)) {\r
+      return FALSE;\r
+    }\r
+  }\r
+\r
+  //\r
+  // Compare Name\r
+  //\r
+  Match = TRUE;\r
+  if (StorageName != NULL) {\r
+    StrPtr = ConfigString + 5 + 32 + 6;\r
+    while (*StrPtr != L'\0' && *StrPtr != L'&') {\r
+      StrPtr++;\r
+    }\r
+    if (*StrPtr != L'&') {\r
+      return FALSE;\r
+    }\r
+\r
+    *StrPtr = L'\0';\r
+    BufferSize = (EfiStrLen (ConfigString + 5 + 32 + 6) + 1) * sizeof (CHAR16);\r
+    Name = EfiLibAllocatePool (BufferSize);\r
+    ASSERT (Name != NULL);\r
+    Status = ConfigStringToUnicode (\r
+               Name,\r
+               &BufferSize,\r
+               ConfigString + 5 + 32 + 6\r
+               );\r
+    *StrPtr = L'&';\r
+\r
+    if (EFI_ERROR (Status) || (EfiStrCmp (Name, StorageName) != 0)) {\r
+      Match = FALSE;\r
+    }\r
+    gBS->FreePool (Name);\r
+  }\r
+\r
+  return Match;\r
+}\r
+\r
 BOOLEAN\r
 FindBlockName (\r
   IN OUT CHAR16                *String,\r
@@ -965,7 +1643,7 @@ Returns:
   HeaderLen = EfiStrLen (ConfigHdr);\r
 \r
   BufferLen = 0x4000;\r
-  ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);\r
+  ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));\r
 \r
   StringPtr = ConfigResp + HeaderLen;\r
   *StringPtr = L'&';\r
@@ -981,7 +1659,7 @@ Returns:
                            );\r
   if (Status == EFI_BUFFER_TOO_SMALL) {\r
     gBS->FreePool (ConfigResp);\r
-    ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);\r
+    ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));\r
 \r
     StringPtr = ConfigResp + HeaderLen;\r
     *StringPtr = L'&';\r
@@ -1116,7 +1794,7 @@ Returns:
                                 &Progress\r
                                 );\r
   if (EFI_ERROR (Status)) {\r
-    gBS->FreePool (ConfigResp);\r
+    gBS->FreePool (ConfigRequest);\r
     return Status;\r
   }\r
 \r
@@ -1133,9 +1811,10 @@ Returns:
                            &BufferSize,\r
                            StringPtr,\r
                            FALSE,\r
-                           NULL,\r
-                           NULL\r
+                           VariableGuid,\r
+                           VariableName\r
                            );\r
   gBS->FreePool (ConfigResp);\r
+  gBS->FreePool (ConfigRequest);\r
   return Status;\r
 }\r
index bd85764d4a2c327a633ea6b0e6c48b587c56389b..3de0efb65186c2c09185144d059e77956d01260b 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -78,10 +78,13 @@ typedef struct {
 } IFR_OPTION;\r
 #pragma pack()\r
 \r
+#pragma pack(1)\r
 typedef struct {\r
   VENDOR_DEVICE_PATH             VendorDevicePath;\r
-  UINT32                         MonotonicCount;\r
+  UINT32                         Reserved;\r
+  UINT64                         UniqueId;\r
 } HII_VENDOR_DEVICE_PATH_NODE;\r
+#pragma pack()\r
 \r
 typedef struct {\r
   HII_VENDOR_DEVICE_PATH_NODE    Node;\r
@@ -280,7 +283,8 @@ CreateOneOfOptionOpCode (
   IN     IFR_OPTION           *OptionsList,\r
   IN     UINT8                Type,\r
   IN OUT EFI_HII_UPDATE_DATA  *Data\r
-  );\r
+  )\r
+;\r
 \r
 EFI_STATUS\r
 CreateOneOfOpCode (\r
@@ -599,6 +603,53 @@ ExtractDefault(
 --*/\r
 ;\r
 \r
+EFI_STATUS\r
+ConstructConfigAltResp (\r
+  IN  EFI_STRING                  ConfigRequest,  OPTIONAL\r
+  OUT EFI_STRING                  *Progress,\r
+  OUT EFI_STRING                  *ConfigAltResp,\r
+  IN  EFI_GUID                    *Guid,\r
+  IN  CHAR16                      *Name,\r
+  IN  EFI_HANDLE                  *DriverHandle,\r
+  IN  VOID                        *BufferStorage,\r
+  IN  UINTN                       BufferStorageSize,\r
+  IN  VOID                        *BlockNameArray, OPTIONAL\r
+  IN  UINTN                       NumberAltCfg,\r
+  ...\r
+//IN  UINT16                      AltCfgId,\r
+//IN  VOID                        *DefaultValueArray,\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+\r
+  Construct <ConfigAltResp> for a buffer storage.\r
+\r
+  Arguments:\r
+    ConfigRequest         - The Config request string. If set to NULL, all the\r
+                            configurable elements will be extracted from BlockNameArray.\r
+    ConfigAltResp         - The returned <ConfigAltResp>.\r
+    Progress              - On return, points to a character in the Request.\r
+    Guid                  - GUID of the buffer storage.\r
+    Name                  - Name of the buffer storage.\r
+    DriverHandle          - The DriverHandle which is used to invoke HiiDatabase\r
+                            protocol interface NewPackageList().\r
+    BufferStorage         - Content of the buffer storage.\r
+    BufferStorageSize     - Length in bytes of the buffer storage.\r
+    BlockNameArray        - Array generated by VFR compiler.\r
+    NumberAltCfg          - Number of Default value array generated by VFR compiler.\r
+                            The sequential input parameters will be number of\r
+                            AltCfgId and DefaultValueArray pairs. When set to 0,\r
+                            there will be no <AltResp>.\r
+\r
+  Returns:\r
+    EFI_OUT_OF_RESOURCES  - Run out of memory resource.\r
+    EFI_INVALID_PARAMETER - ConfigAltResp is NULL.\r
+    EFI_SUCCESS           - Operation successful.\r
+\r
+--*/\r
+;\r
+\r
 EFI_STATUS\r
 ExtractGuidFromHiiHandle (\r
   IN      EFI_HII_HANDLE      Handle,\r
@@ -643,6 +694,49 @@ Returns:
 --*/\r
 ;\r
 \r
+EFI_STATUS\r
+ExtractClassGuidFromHiiHandle (\r
+  IN      EFI_HII_HANDLE      Handle,\r
+  OUT     UINT8               *NumberOfClassGuid,\r
+  OUT     EFI_GUID            **ClassGuid,\r
+  OUT     EFI_STRING_ID       *FormSetTitle,\r
+  OUT     EFI_STRING_ID       *FormSetHelp\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Extract formset ClassGuid for given HII handle.\r
+\r
+Arguments:\r
+  HiiHandle         - Hii handle\r
+  NumberOfClassGuid - Number of ClassGuid\r
+  ClassGuid         - Pointer to callee allocated buffer, an array of ClassGuid\r
+  FormSetTitle      - Formset title string\r
+  FormSetHelp       - Formset help string\r
+\r
+Returns:\r
+  EFI_SUCCESS     - Successfully extract Class for specified Hii handle.\r
+\r
+--*/\r
+;\r
+\r
+VOID\r
+ToLower (\r
+  IN OUT CHAR16    *Str\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Converts the unicode character from uppercase to lowercase.\r
+\r
+Arguments:\r
+  Str        -  String to be converted\r
+\r
+Returns:\r
+\r
+--*/\r
+;\r
+\r
 EFI_STATUS\r
 BufferToHexString (\r
   IN OUT CHAR16    *Str,\r
@@ -689,6 +783,64 @@ Returns:
 --*/\r
 ;\r
 \r
+EFI_STATUS\r
+ConfigStringToUnicode (\r
+  IN OUT CHAR16                *UnicodeString,\r
+  IN OUT UINTN                 *StrBufferLen,\r
+  IN CHAR16                    *ConfigString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Convert binary representation Config string (e.g. "0041004200430044") to the\r
+  original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.\r
+  "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
+\r
+Arguments:\r
+  UnicodeString - Original Unicode string.\r
+  StrBufferLen  - On input: Length in bytes of buffer to hold the Unicode string.\r
+                  Includes tailing '\0' character.\r
+                  On output:\r
+                    If return EFI_SUCCESS, containing length of Unicode string buffer.\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
+  ConfigString  - Binary representation of Unicode String, <string> := (<HexCh>4)+\r
+\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+UnicodeToConfigString (\r
+  IN OUT CHAR16                *ConfigString,\r
+  IN OUT UINTN                 *StrBufferLen,\r
+  IN CHAR16                    *UnicodeString\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Convert Unicode string to binary representation Config string, e.g.\r
+  "ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.\r
+  "&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").\r
+\r
+Arguments:\r
+  ConfigString  - Binary representation of Unicode String, <string> := (<HexCh>4)+\r
+  StrBufferLen  - On input: Length in bytes of buffer to hold the Unicode string.\r
+                  Includes tailing '\0' character.\r
+                  On output:\r
+                    If return EFI_SUCCESS, containing length of Unicode string buffer.\r
+                    If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.\r
+  UnicodeString - Original Unicode string.\r
+\r
+Returns:\r
+  EFI_SUCCESS          - Routine success.\r
+  EFI_BUFFER_TOO_SMALL - The string buffer is too small.\r
+\r
+--*/\r
+;\r
+\r
 EFI_STATUS\r
 ConstructConfigHdr (\r
   IN OUT CHAR16                *ConfigHdr,\r
@@ -719,6 +871,29 @@ Returns:
 --*/\r
 ;\r
 \r
+BOOLEAN\r
+IsConfigHdrMatch (\r
+  IN EFI_STRING                ConfigString,\r
+  IN EFI_GUID                  *StorageGuid, OPTIONAL\r
+  IN CHAR16                    *StorageName  OPTIONAL\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.\r
+\r
+Arguments:\r
+  ConfigString - Either <ConfigRequest> or <ConfigResp>.\r
+  StorageGuid  - GUID of the storage.\r
+  StorageName  - Name of the stoarge.\r
+\r
+Returns:\r
+  TRUE         - Routing information is correct in ConfigString.\r
+  FALSE        - Routing information is incorrect in ConfigString.\r
+\r
+--*/\r
+;\r
+\r
 BOOLEAN\r
 FindBlockName (\r
   IN OUT CHAR16                *String,\r
@@ -1093,6 +1268,47 @@ Returns:
 --*/\r
 ;\r
 \r
+EFI_STATUS\r
+IfrLibInitUpdateData (\r
+  IN OUT EFI_HII_UPDATE_DATA   *UpdateData,\r
+  IN UINT32                    BufferSize\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function initialize the data structure for dynamic opcode.\r
+\r
+Arguments:\r
+  UpdateData     - The adding data;\r
+  BufferSize     - Length of the buffer to fill dynamic opcodes.\r
+\r
+Returns:\r
+  EFI_SUCCESS           - Update data is initialized.\r
+  EFI_INVALID_PARAMETER - UpdateData is NULL.\r
+  EFI_OUT_OF_RESOURCES  - No enough memory to allocate.\r
+\r
+--*/\r
+;\r
+\r
+EFI_STATUS\r
+IfrLibFreeUpdateData (\r
+  IN EFI_HII_UPDATE_DATA       *UpdateData\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+  This function free the resource of update data.\r
+\r
+Arguments:\r
+  UpdateData     - The adding data;\r
+\r
+Returns:\r
+  EFI_SUCCESS           - Resource in UpdateData is released.\r
+  EFI_INVALID_PARAMETER - UpdateData is NULL.\r
+\r
+--*/\r
+;\r
+\r
 EFI_STATUS\r
 IfrLibUpdateForm (\r
   IN EFI_HII_HANDLE            Handle,\r
index c46bc7d73ec21ecb1bece88632fb2ab5b0b003cd..2c454de95178478d97886695450cd4760d7f2067 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -394,9 +394,7 @@ CreateOrderedListOpCode (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if ((OrderedListFlags != 0) &&\r
-      (OrderedListFlags != EFI_IFR_UNIQUE_SET) &&\r
-      (OrderedListFlags != EFI_IFR_NO_EMPTY_SET)) {\r
+  if ((OrderedListFlags & (~(EFI_IFR_UNIQUE_SET | EFI_IFR_NO_EMPTY_SET))) != 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 0a5739965aa84009a0ea7207f2c801b57ac93742..ece78bfb441624a6b0bc83adb7d1bbb384975767 100644 (file)
@@ -555,20 +555,37 @@ IfrLibNewString (
   if (Languages == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
+  \r
+  if (StringId == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+  *StringId = 0;\r
 \r
   LangStrings = Languages;\r
   while (*LangStrings != 0) {\r
     GetNextLanguage (&LangStrings, Lang);\r
 \r
-    Status = gIfrLibHiiString->NewString (\r
-                                 gIfrLibHiiString,\r
-                                 PackageList,\r
-                                 StringId,\r
-                                 Lang,\r
-                                 NULL,\r
-                                 String,\r
-                                 NULL\r
-                                 );\r
+    if (*StringId == 0) {\r
+      Status = gIfrLibHiiString->NewString (\r
+                                   gIfrLibHiiString,\r
+                                   PackageList,\r
+                                   StringId,\r
+                                   Lang,\r
+                                   NULL,\r
+                                   String,\r
+                                   NULL\r
+                                   );\r
+    } else {\r
+      Status = gIfrLibHiiString->SetString (\r
+                                   gIfrLibHiiString,\r
+                                   PackageList,\r
+                                   *StringId,\r
+                                   Lang,\r
+                                   String,\r
+                                   NULL\r
+                                   );\r
+    }\r
+\r
     if (EFI_ERROR (Status)) {\r
       break;\r
     }\r
index 7968995794fd7a83085655bc1c08ff7efbb1083a..be5bf00f7c8eee4d8caa861fd509f3da2c97caed 100644 (file)
@@ -23,6 +23,81 @@ Abstract:
 #include "EdkIIGlueDxe.h"\r
 #include "Common/EdkIIGlueDependencies.h"\r
 \r
+//\r
+// Check definitions in .inf file to determine __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
+//\r
+// __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
+//    1: only install ComponentName, DriverConfiguration and DriverDiagnostics\r
+//    2: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
+//    3: install all including ComponentName, DriverConfiguration, DriverDiagnostics AND\r
+//                             ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
+//    4: install automatically according to EFI_SPECIFICATION_VERSION:\r
+//        if EFI_SPECIFICATION_VERSION <  0x00020000: only install ComponentName, DriverConfiguration and DriverDiagnostics\r
+//        if EFI_SPECIFICATION_VERSION >= 0x00020000: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2\r
+//\r
+#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
+#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
+#endif\r
+\r
+#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
+#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
+#endif\r
+\r
+#ifdef  __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
+#undef  __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)\r
+#define __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)\r
+#define __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__\r
+#endif\r
+\r
+#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__)\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1\r
+#endif\r
+\r
+#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__)\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2\r
+#endif\r
+\r
+#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__)\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 3\r
+#endif\r
+\r
+//\r
+//  To use Auto-Select, it must be:\r
+//    1. both Protocol and Protocol2 are defined\r
+//    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__\r
+//\r
+#if defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)\r
+#if !(defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__))\r
+#error "To use Auto-Select please define both Protocol and Protocol2 instances"\r
+#endif\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 4\r
+#endif\r
+\r
+#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 4)\r
+#undef  __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__  2\r
+#else\r
+#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__  1\r
+#endif\r
+#endif\r
+\r
+#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
+UINT8 _gEdkIIGlueDriverModelProtocolSelection = 1;\r
+#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
+UINT8 _gEdkIIGlueDriverModelProtocolSelection = 2;\r
+#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
+UINT8 _gEdkIIGlueDriverModelProtocolSelection = 3;\r
+#else\r
+UINT8 _gEdkIIGlueDriverModelProtocolSelection = 0;\r
+#endif\r
+\r
 STATIC EFI_EVENT  _mDriverExitBootServicesNotifyEvent;\r
 \r
 //\r
@@ -31,27 +106,38 @@ STATIC EFI_EVENT  _mDriverExitBootServicesNotifyEvent;
 // In case where multiple Driver Model protocols need to be installed in a single driver,\r
 // manually edit this file and compile/link the modified file with the driver.\r
 //\r
-\r
-#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__)\r
 extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;\r
-#else\r
+#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__)\r
 extern EFI_COMPONENT_NAME_PROTOCOL   __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;\r
 #endif\r
-#endif\r
 \r
-#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__)\r
 extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;\r
 #endif\r
+#endif\r
 \r
-#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)\r
 extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__;\r
 #endif\r
 \r
+#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__)\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__;\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__)\r
+extern EFI_DRIVER_CONFIGURATION2_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__;\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)\r
+extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__;\r
+#endif\r
+#endif\r
+\r
 GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST  _gDriverModelProtocolList[] = {\r
  {\r
 #ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__\r
@@ -60,23 +146,41 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST  _gDriverMode
   NULL,\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
   &__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,\r
 #else\r
   NULL,\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
   &__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,\r
 #else\r
   NULL,\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__\r
+#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)\r
  &__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__,\r
 #else\r
   NULL,\r
 #endif\r
+\r
+#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
+  &__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__,\r
+#else\r
+  NULL,\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
+  &__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__,\r
+#else\r
+  NULL,\r
+#endif\r
+\r
+#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)\r
+ &__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__,\r
+#else\r
+  NULL,\r
+#endif\r
   }\r
 };\r
 \r
@@ -249,15 +353,15 @@ ProcessLibraryConstructorList (
 // NOTE: the constructors must be called according to dependency order\r
 //\r
 // UefiBootServicesTableLib     UefiBootServicesTableLibConstructor()\r
+// UefiRuntimeServicesTableLib  UefiRuntimeServicesTableLibConstructor() \r
+// DxeServicesTableLib          DxeServicesTableLibConstructor()\r
 // DxeIoLibCpuIo                IoLibConstructor()\r
 // DxeSalLib                    DxeSalLibConstructor(), IPF only\r
 // EdkDxeRuntimeDriverLib       RuntimeDriverLibConstruct()\r
-// DxeHobLib                    HobLibConstructor()\r
+// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()\r
 // UefiDriverModelLib           UefiDriverModelLibConstructor()\r
+// DxeHobLib                    HobLibConstructor()\r
 // DxeSmbusLib                  SmbusLibConstructor()    \r
-// DxeServicesTableLib          DxeServicesTableLibConstructor()\r
-// UefiRuntimeServicesTableLib  UefiRuntimeServicesTableLibConstructor() \r
-// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()\r
 // \r
 \r
 #ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__\r
@@ -265,6 +369,16 @@ ProcessLibraryConstructorList (
   ASSERT_EFI_ERROR (Status);\r
 #endif\r
 \r
+#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__\r
+  Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);\r
+  ASSERT_EFI_ERROR (Status);\r
+#endif\r
+\r
+#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__\r
+  Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);\r
+  ASSERT_EFI_ERROR (Status); \r
+#endif\r
+\r
 #ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__\r
   Status = IoLibConstructor (ImageHandle, SystemTable);\r
   ASSERT_EFI_ERROR (Status);\r
@@ -280,8 +394,8 @@ ProcessLibraryConstructorList (
   ASSERT_EFI_ERROR (Status);\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__\r
-  Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);\r
+#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__\r
+  Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);\r
   ASSERT_EFI_ERROR (Status);\r
 #endif\r
 \r
@@ -290,16 +404,6 @@ ProcessLibraryConstructorList (
   ASSERT_EFI_ERROR (Status);\r
 #endif\r
 \r
-#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__\r
-  Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);\r
-  ASSERT_EFI_ERROR (Status); \r
-#endif\r
-\r
-#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__\r
-  Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);\r
-  ASSERT_EFI_ERROR (Status);\r
-#endif\r
-\r
 #ifdef __EDKII_GLUE_DXE_HOB_LIB__\r
   Status = HobLibConstructor (ImageHandle, SystemTable);\r
   ASSERT_EFI_ERROR (Status);\r