+++ /dev/null
-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
# 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
#/*++\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
# VOID\r
# )\r
ASM_PFX(EfiEnableCache):\r
- invd\r
+ wbinvd\r
movl %cr0, %eax\r
andl $0x9fffffff, %eax\r
movl %eax, %cr0\r
;/*++\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
; VOID\r
; )\r
EfiEnableCache PROC C PUBLIC\r
- invd\r
+ wbinvd\r
mov eax, cr0\r
and eax, 09fffffffh \r
mov cr0, eax\r
/*++\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
EfiEnableCache (VOID)\r
{\r
__asm {\r
- invd\r
+ wbinvd\r
mov eax, cr0\r
and eax, 09fffffffh \r
mov cr0, eax\r
#------------------------------------------------------------------------------\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
# );\r
#------------------------------------------------------------------------------\r
ASM_PFX(EfiEnableCache):\r
- invd \r
+ wbinvd \r
mov %cr0,%rax\r
and $0xffffffff9fffffff,%rax\r
mov %rax,%cr0\r
\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
; );\r
;------------------------------------------------------------------------------\r
EfiEnableCache PROC PUBLIC\r
- invd\r
+ wbinvd\r
mov rax, cr0\r
and rax, 09fffffffh \r
mov cr0, rax\r
/*++\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
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
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
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
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
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
UINT64 StartingOffset;\r
UINT64 EndingOffset;\r
} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;\r
-#endif\r
\r
//\r
// BBS Device Path\r
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
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
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
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
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
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
/*++\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
#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
/*++\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
\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
// 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
// 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
\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
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
\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
EfiKeyB8,\r
EfiKeyB9,\r
EfiKeyB10,\r
- EfiKeyRshift,\r
+ EfiKeyRShift,\r
EfiKeyUpArrow,\r
EfiKeyOne,\r
EfiKeyTwo,\r
// 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
#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
#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
/*++\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
//\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
/*++\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
// 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
/*++\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
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
/*++\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
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
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
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 language \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 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
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
#/*++\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
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
/*++\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
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
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
\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
\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
/*++\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
} 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
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
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
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
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
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
(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
\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
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
/*++\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
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
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
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
\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
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
--- /dev/null
+/*++\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
--- /dev/null
+/*++\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
/*++\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
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
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
\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
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
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
/*++\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
\r
Abstract:\r
\r
- UEFI IPv4 protocol.\r
+ EFI_IP4_PROTOCOL definition in UEFI 2.2 specification.\r
\r
--*/\r
\r
typedef struct {\r
BOOLEAN IsStarted;\r
UINT32 MaxPacketSize;\r
-\r
+ \r
EFI_IP4_CONFIG_DATA ConfigData;\r
BOOLEAN IsConfigured;\r
\r
/*++\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
\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
;\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
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
/*++\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
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
UINT16 MemorySpeed;\r
EFI_MEMORY_STATE MemoryState;\r
UINT8 MemoryAttributes;\r
+ UINT8 MemoryBankConnections;\r
+ UINT8 MemoryErrorStatus;\r
} EFI_MEMORY_ARRAY_LINK;\r
\r
\r
\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
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
/*++\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
\r
typedef struct {\r
UINT32 RecordType :1;\r
+ UINT32 Type :7;\r
UINT32 Reserved :24;\r
} EFI_MISC_ELEMENT_TYPE;\r
\r
EfiSlotTypeApg2X = 0x10,\r
EfiSlotTypeAgp4X = 0x11,\r
EfiSlotTypePciX = 0x12,\r
- EfiSlotTypeAgp4x = 0x13,\r
+ EfiSlotTypeAgp8X = 0x13,\r
EfiSlotTypePC98C20 = 0xA0,\r
EfiSlotTypePC98C24 = 0xA1,\r
EfiSlotTypePC98E = 0xA2,\r
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
EFI_INTER_LINK_DATA GroupLink;\r
UINT16 GroupId;\r
UINT16 GroupElementId;\r
+ UINT8 ItemType;\r
} EFI_MISC_GROUP_ITEM_SET_DATA;\r
\r
//\r
//\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
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
} POWER_SUPPLY_CHARACTERISTICS;\r
\r
typedef struct {\r
- UINT8 PowerUnitGroup;\r
+ UINT16 PowerUnitGroup;\r
STRING_REF PowerSupplyLocation;\r
STRING_REF PowerSupplyDeviceName;\r
STRING_REF PowerSupplyManufacturer;\r
// 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
/*++\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
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
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
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
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
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
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
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
/*++\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
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
\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
/*++\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
} 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
/*++\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
(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
(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
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
/*++\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
#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
#/*++\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
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
/*++\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
(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
--- /dev/null
+/*++\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
--- /dev/null
+/*++\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
--- /dev/null
+/*++\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
--- /dev/null
+/*++\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
/*++\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
#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
/*++\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
\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
/*++\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
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
/*++\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
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
// 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
/*++\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
--*/\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
/*++\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
#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
#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
#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
/*++\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
\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
\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
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
#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
#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
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
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
#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
BOOLEAN readSRKPub;\r
BOOLEAN tpmEstablished;\r
BOOLEAN maintenanceDone;\r
+ BOOLEAN disableFullDALogicInfo;\r
} TPM_PERMANENT_FLAGS;\r
\r
//\r
#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
//\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
// 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
// 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
//\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
//\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
#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
#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
#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
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
/*++\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
\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
/*++\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
#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
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
#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
/*++\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
//\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
#/*++\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
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
#/*++\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
[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
/*++\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
\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
\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
\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
\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
/*++\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
\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
\r
--*/\r
{\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+ VOID *Registration;\r
+#endif\r
+ \r
gST = SystemTable;\r
\r
ASSERT (gST != NULL);\r
(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
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
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
return EFI_UNSUPPORTED;\r
}\r
\r
- SupportedLanguages = NextSupportedLanguage(SupportedLanguages);\r
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);\r
}\r
\r
return EFI_UNSUPPORTED;\r
//\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
return EFI_SUCCESS;\r
}\r
\r
- SupportedLanguages = NextSupportedLanguage(SupportedLanguages);\r
+ SupportedLanguages = NextSupportedLanguage (SupportedLanguages);\r
}\r
\r
return EFI_UNSUPPORTED;\r
/*++\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
\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
{\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
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
#/*++\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
$(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
[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
/*++\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
\r
#define IS_DIGIT(Ch) (((Ch) >= L'0') && ((Ch) <= L'9'))\r
\r
-STATIC\r
EFI_STATUS\r
EfiStringToValue (\r
OUT UINT64 *Val,\r
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
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
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
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
/*++\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
--*/\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
#/*++\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
$(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
},\r
EFI_IFR_TIANO_GUID,\r
},\r
+ 0,\r
0\r
},\r
{\r
{\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
&gEfiDevicePathProtocolGuid,\r
DevicePath\r
);\r
-\r
+ gBS->FreePool (DevicePath);\r
return Status;\r
}\r
\r
\r
Returns:\r
EFI_SUCCESS - Successfully extract Class for specified Hii handle.\r
+ EFI_NOT_FOUND - Class not found.\r
\r
--*/\r
{\r
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
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
//\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
/*++\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
//\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
return EFI_SUCCESS;\r
}\r
\r
-STATIC\r
EFI_STATUS\r
UpdateFormPackageData (\r
IN EFI_GUID *FormSetGuid,\r
OUT UINT32 *TempBufferSize\r
)\r
{\r
- UINTN AddSize;\r
UINT8 *BufferPos;\r
EFI_HII_PACKAGE_HEADER PackageHeader;\r
- UINTN 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
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
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
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
//\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
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
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
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
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
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
}\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
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
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
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
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
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
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
);\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
&Progress\r
);\r
if (EFI_ERROR (Status)) {\r
- gBS->FreePool (ConfigResp);\r
+ gBS->FreePool (ConfigRequest);\r
return Status;\r
}\r
\r
&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
/*++\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
} 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
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
--*/\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
--*/\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
--*/\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
--*/\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
--*/\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
/*++\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
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
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
#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
// 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
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
// 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
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
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
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