mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11094 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
68bb5ce77e
commit
3e99020dbf
@ -1,10 +0,0 @@
|
||||
Notes:
|
||||
This EDK Compatibility Package is based on the EDK 1.03 release found at http://edk.tianocore.org.
|
||||
It is compatibile with EDK 1.01 with the following exception:
|
||||
|
||||
|
||||
13:49 2008-1-24
|
||||
|
||||
This Edk Compatibility Package is updated to the EDK 1.04 release found at http://edk.tianocore.org.
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# in UEFI 2.0 + Framework 0.9x mode. This package also provides Thunk modules that enable Framework 0.9x modules to work with UEFI2.3/PI1.2 EDK II Cores.
|
||||
# EdkCompatibilityPkg is based on the EDK 1.01 release, found at http://edk.tianocore.org. This package only
|
||||
# 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.
|
||||
# This package also incorporates bug fixes released in EDK 1.04.
|
||||
# This package also incorporates bug fixes released in EDK 1.06.
|
||||
#
|
||||
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
#
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
#Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
#Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
#This program and the accompanying materials
|
||||
#are licensed and made available under the terms and conditions of the BSD License
|
||||
#which accompanies this distribution. The full text of the license may be found at
|
||||
@ -157,7 +157,7 @@ L2:
|
||||
# VOID
|
||||
# )
|
||||
ASM_PFX(EfiEnableCache):
|
||||
invd
|
||||
wbinvd
|
||||
movl %cr0, %eax
|
||||
andl $0x9fffffff, %eax
|
||||
movl %eax, %cr0
|
||||
|
@ -1,6 +1,6 @@
|
||||
;/*++
|
||||
;
|
||||
;Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
;Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
;This program and the accompanying materials
|
||||
;are licensed and made available under the terms and conditions of the BSD License
|
||||
;which accompanies this distribution. The full text of the license may be found at
|
||||
@ -140,7 +140,7 @@ EfiDisableCache ENDP
|
||||
; VOID
|
||||
; )
|
||||
EfiEnableCache PROC C PUBLIC
|
||||
invd
|
||||
wbinvd
|
||||
mov eax, cr0
|
||||
and eax, 09fffffffh
|
||||
mov cr0, eax
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -118,7 +118,7 @@ VOID
|
||||
EfiEnableCache (VOID)
|
||||
{
|
||||
__asm {
|
||||
invd
|
||||
wbinvd
|
||||
mov eax, cr0
|
||||
and eax, 09fffffffh
|
||||
mov cr0, eax
|
||||
|
@ -1,6 +1,6 @@
|
||||
#------------------------------------------------------------------------------
|
||||
#*
|
||||
#* Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
||||
#* Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
#* This program and the accompanying materials
|
||||
#* are licensed and made available under the terms and conditions of the BSD License
|
||||
#* which accompanies this distribution. The full text of the license may be found at
|
||||
@ -151,7 +151,7 @@ ASM_PFX(EfiDisableCache):
|
||||
# );
|
||||
#------------------------------------------------------------------------------
|
||||
ASM_PFX(EfiEnableCache):
|
||||
invd
|
||||
wbinvd
|
||||
mov %cr0,%rax
|
||||
and $0xffffffff9fffffff,%rax
|
||||
mov %rax,%cr0
|
||||
|
@ -2,7 +2,7 @@ TITLE Cpu.asm: Assembly code for the x64 resources
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;*
|
||||
;* Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
;* Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
;* This program and the accompanying materials
|
||||
;* are licensed and made available under the terms and conditions of the BSD License
|
||||
;* which accompanies this distribution. The full text of the license may be found at
|
||||
@ -150,7 +150,7 @@ EfiDisableCache ENDP
|
||||
; );
|
||||
;------------------------------------------------------------------------------
|
||||
EfiEnableCache PROC PUBLIC
|
||||
invd
|
||||
wbinvd
|
||||
mov rax, cr0
|
||||
and rax, 09fffffffh
|
||||
mov cr0, rax
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -214,7 +214,6 @@ typedef struct {
|
||||
UINT8 DeviceProtocol;
|
||||
} USB_CLASS_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
#define MSG_USB_WWID_DP 0x10
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
@ -231,7 +230,6 @@ typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 Lun;
|
||||
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
|
||||
#endif
|
||||
|
||||
#define MSG_SATA_DP 0x12
|
||||
typedef struct {
|
||||
@ -330,8 +328,6 @@ typedef struct {
|
||||
UINT32 FlowControlMap;
|
||||
} UART_FLOW_CONTROL_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_SAS \
|
||||
{ 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d} }
|
||||
|
||||
@ -345,8 +341,6 @@ typedef struct {
|
||||
UINT16 RelativeTargetPort;
|
||||
} SAS_DEVICE_PATH;
|
||||
|
||||
#endif
|
||||
|
||||
#define MSG_ISCSI_DP 0x13
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
@ -428,8 +422,6 @@ typedef struct {
|
||||
EFI_GUID Protocol;
|
||||
} MEDIA_PROTOCOL_DEVICE_PATH;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
|
||||
#define MEDIA_FV_DP 0x07
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
@ -449,7 +441,6 @@ typedef struct {
|
||||
UINT64 StartingOffset;
|
||||
UINT64 EndingOffset;
|
||||
} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
|
||||
#endif
|
||||
|
||||
//
|
||||
// BBS Device Path
|
||||
@ -509,10 +500,8 @@ typedef union {
|
||||
F1394_DEVICE_PATH F1394;
|
||||
USB_DEVICE_PATH Usb;
|
||||
USB_CLASS_DEVICE_PATH UsbClass;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
USB_WWID_DEVICE_PATH UsbWwid;
|
||||
DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit;
|
||||
#endif
|
||||
I2O_DEVICE_PATH I2O;
|
||||
MAC_ADDR_DEVICE_PATH MacAddr;
|
||||
IPv4_DEVICE_PATH Ipv4;
|
||||
@ -520,9 +509,7 @@ typedef union {
|
||||
INFINIBAND_DEVICE_PATH InfiniBand;
|
||||
UART_DEVICE_PATH Uart;
|
||||
UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
SAS_DEVICE_PATH Sas;
|
||||
#endif
|
||||
ISCSI_DEVICE_PATH Iscsi;
|
||||
HARDDRIVE_DEVICE_PATH HardDrive;
|
||||
CDROM_DEVICE_PATH CD;
|
||||
@ -530,12 +517,10 @@ typedef union {
|
||||
FILEPATH_DEVICE_PATH FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
MEDIA_FW_VOL_DEVICE_PATH PiwgFirmwareVolume;
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH PiwgFirmwareFile;
|
||||
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
|
||||
Offset;
|
||||
#endif
|
||||
|
||||
BBS_BBS_DEVICE_PATH Bbs;
|
||||
} EFI_DEV_PATH;
|
||||
@ -563,10 +548,8 @@ typedef union {
|
||||
F1394_DEVICE_PATH *F1394;
|
||||
USB_DEVICE_PATH *Usb;
|
||||
USB_CLASS_DEVICE_PATH *UsbClass;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
USB_WWID_DEVICE_PATH *UsbWwid;
|
||||
DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit;
|
||||
#endif
|
||||
I2O_DEVICE_PATH *I2O;
|
||||
MAC_ADDR_DEVICE_PATH *MacAddr;
|
||||
IPv4_DEVICE_PATH *Ipv4;
|
||||
@ -575,9 +558,7 @@ typedef union {
|
||||
UART_DEVICE_PATH *Uart;
|
||||
UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
SAS_DEVICE_PATH *Sas;
|
||||
#endif
|
||||
ISCSI_DEVICE_PATH *Iscsi;
|
||||
|
||||
HARDDRIVE_DEVICE_PATH *HardDrive;
|
||||
@ -586,10 +567,10 @@ typedef union {
|
||||
FILEPATH_DEVICE_PATH *FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
MEDIA_FW_VOL_DEVICE_PATH *PiwgFirmwareVolume;
|
||||
MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *PiwgFirmwareFile;
|
||||
#endif
|
||||
MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH
|
||||
*Offset;
|
||||
|
||||
BBS_BBS_DEVICE_PATH *Bbs;
|
||||
UINT8 *Raw;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -58,6 +58,9 @@ Abstract:
|
||||
#define EFI_INCOMPATIBLE_VERSION EFIERR (25)
|
||||
#define EFI_SECURITY_VIOLATION EFIERR (26)
|
||||
#define EFI_CRC_ERROR EFIERR (27)
|
||||
#define EFI_END_OF_MEDIA EFIERR (28)
|
||||
#define EFI_END_OF_FILE EFIERR (31)
|
||||
#define EFI_INVALID_LANGUAGE EFIERR (32)
|
||||
|
||||
#define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1)
|
||||
#define EFI_WARN_DELETE_FAILURE EFIWARN (2)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -59,13 +59,13 @@ typedef struct {
|
||||
|
||||
#define EFI_HII_PACKAGE_TYPE_ALL 0x00
|
||||
#define EFI_HII_PACKAGE_TYPE_GUID 0x01
|
||||
#define EFI_HII_PACKAGE_FORM 0x02
|
||||
#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03
|
||||
#define EFI_HII_PACKAGE_FORMS 0x02
|
||||
#define EFI_HII_PACKAGE_STRINGS 0x04
|
||||
#define EFI_HII_PACKAGE_FONTS 0x05
|
||||
#define EFI_HII_PACKAGE_IMAGES 0x06
|
||||
#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
|
||||
#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
|
||||
#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09
|
||||
#define EFI_HII_PACKAGE_END 0xDF
|
||||
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
|
||||
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
|
||||
@ -108,6 +108,7 @@ typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
|
||||
// Font Package
|
||||
//
|
||||
|
||||
#define EFI_HII_FONT_STYLE_NORMAL 0x00000000
|
||||
#define EFI_HII_FONT_STYLE_BOLD 0x00000001
|
||||
#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
|
||||
#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000
|
||||
@ -237,8 +238,8 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
|
||||
// String Package
|
||||
//
|
||||
|
||||
#define UEFI_CONFIG_LANG L"x-UEFI"
|
||||
#define UEFI_CONFIG_LANG2 L"x-i-UEFI" // BUGBUG, spec need to be updated.
|
||||
#define UEFI_CONFIG_LANG "x-UEFI"
|
||||
#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
|
||||
|
||||
typedef struct _EFI_HII_STRING_PACKAGE_HDR {
|
||||
EFI_HII_PACKAGE_HEADER Header;
|
||||
@ -697,14 +698,14 @@ typedef struct _EFI_IFR_VARSTORE {
|
||||
|
||||
typedef struct _EFI_IFR_VARSTORE_EFI {
|
||||
EFI_IFR_OP_HEADER Header;
|
||||
UINT16 VarStoreId;
|
||||
EFI_VARSTORE_ID VarStoreId;
|
||||
EFI_GUID Guid;
|
||||
UINT32 Attributes;
|
||||
} EFI_IFR_VARSTORE_EFI;
|
||||
|
||||
typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
|
||||
EFI_IFR_OP_HEADER Header;
|
||||
UINT16 VarStoreId;
|
||||
EFI_VARSTORE_ID VarStoreId;
|
||||
EFI_GUID Guid;
|
||||
} EFI_IFR_VARSTORE_NAME_VALUE;
|
||||
|
||||
@ -713,8 +714,13 @@ typedef struct _EFI_IFR_FORM_SET {
|
||||
EFI_GUID Guid;
|
||||
EFI_STRING_ID FormSetTitle;
|
||||
EFI_STRING_ID Help;
|
||||
UINT8 Flags;
|
||||
EFI_GUID ClassGuid[1];
|
||||
} EFI_IFR_FORM_SET;
|
||||
|
||||
#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
|
||||
{ 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } }
|
||||
|
||||
typedef struct _EFI_IFR_END {
|
||||
EFI_IFR_OP_HEADER Header;
|
||||
} EFI_IFR_END;
|
||||
@ -805,7 +811,7 @@ typedef struct _EFI_IFR_REF4 {
|
||||
|
||||
typedef struct _EFI_IFR_RESET_BUTTON {
|
||||
EFI_IFR_OP_HEADER Header;
|
||||
EFI_IFR_QUESTION_HEADER Question;
|
||||
EFI_IFR_STATEMENT_HEADER Statement;
|
||||
EFI_DEFAULT_ID DefaultId;
|
||||
} EFI_IFR_RESET_BUTTON;
|
||||
|
||||
@ -1273,7 +1279,7 @@ typedef enum {
|
||||
EfiKeyB8,
|
||||
EfiKeyB9,
|
||||
EfiKeyB10,
|
||||
EfiKeyRshift,
|
||||
EfiKeyRShift,
|
||||
EfiKeyUpArrow,
|
||||
EfiKeyOne,
|
||||
EfiKeyTwo,
|
||||
@ -1396,16 +1402,16 @@ typedef struct {
|
||||
// EFI_HII_KEYBOARD_LAYOUT Layout[];
|
||||
} EFI_HII_KEYBOARD_PACKAGE_HDR;
|
||||
|
||||
typedef struct {
|
||||
CHAR16 Language[3];
|
||||
CHAR16 Space;
|
||||
CHAR16 DescriptionString[1];
|
||||
} EFI_DESCRIPTION_STRING;
|
||||
//typedef struct {
|
||||
// CHAR16 Language[]; // RFC4646 Language Code
|
||||
// CHAR16 Space;
|
||||
// CHAR16 DescriptionString[];
|
||||
//} EFI_DESCRIPTION_STRING;
|
||||
|
||||
typedef struct {
|
||||
UINT16 DescriptionCount;
|
||||
EFI_DESCRIPTION_STRING DescriptionString[1];
|
||||
} EFI_DESCRIPTION_STRING_BUNDLE;
|
||||
//typedef struct {
|
||||
// UINT16 DescriptionCount;
|
||||
// EFI_DESCRIPTION_STRING DescriptionString[];
|
||||
//} EFI_DESCRIPTION_STRING_BUNDLE;
|
||||
|
||||
//
|
||||
// Modifier values
|
||||
@ -1425,7 +1431,7 @@ typedef struct {
|
||||
#define EFI_LEFT_SHIFT_MODIFIER 0x000C
|
||||
#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
|
||||
#define EFI_CAPS_LOCK_MODIFIER 0x000E
|
||||
#define EFI_NUM_LOCK _MODIFIER 0x000F
|
||||
#define EFI_NUM_LOCK_MODIFIER 0x000F
|
||||
#define EFI_LEFT_ARROW_MODIFIER 0x0010
|
||||
#define EFI_RIGHT_ARROW_MODIFIER 0x0011
|
||||
#define EFI_DOWN_ARROW_MODIFIER 0x0012
|
||||
@ -1458,6 +1464,10 @@ typedef struct {
|
||||
#define EFI_PAUSE_MODIFIER 0x0025
|
||||
#define EFI_BREAK_MODIFIER 0x0026
|
||||
|
||||
#define EFI_LEFT_LOGO_MODIFIER 0x0027
|
||||
#define EFI_RIGHT_LOGO_MODIFIER 0x0028
|
||||
#define EFI_MENU_MODIFIER 0x0029
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -622,6 +622,48 @@ typedef struct {
|
||||
//
|
||||
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
|
||||
|
||||
//
|
||||
// Resource Format
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Characteristics;
|
||||
UINT32 TimeDateStamp;
|
||||
UINT16 MajorVersion;
|
||||
UINT16 MinorVersion;
|
||||
UINT16 NumberOfNamedEntries;
|
||||
UINT16 NumberOfIdEntries;
|
||||
// EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[];
|
||||
} EFI_IMAGE_RESOURCE_DIRECTORY;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
struct {
|
||||
UINT32 NameOffset:31;
|
||||
UINT32 NameIsString:1;
|
||||
} s;
|
||||
UINT32 Id;
|
||||
} u1;
|
||||
union {
|
||||
UINT32 OffsetToData;
|
||||
struct {
|
||||
UINT32 OffsetToDirectory:31;
|
||||
UINT32 DataIsDirectory:1;
|
||||
} s;
|
||||
} u2;
|
||||
} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Length;
|
||||
CHAR16 String[1];
|
||||
} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
|
||||
|
||||
typedef struct {
|
||||
UINT32 OffsetToData;
|
||||
UINT32 Size;
|
||||
UINT32 CodePage;
|
||||
UINT32 Reserved;
|
||||
} EFI_IMAGE_RESOURCE_DATA_ENTRY;
|
||||
|
||||
//
|
||||
// Header format for TE images
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -90,11 +90,11 @@ typedef UINT64 EFI_LBA;
|
||||
// EFI Constants. They may exist in other build structures, so #ifndef them.
|
||||
//
|
||||
#ifndef TRUE
|
||||
#define TRUE ((BOOLEAN) 1 == 1)
|
||||
#define TRUE ((BOOLEAN) (1 == 1))
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE ((BOOLEAN) 0 == 1)
|
||||
#define FALSE ((BOOLEAN) (0 == 1))
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -185,9 +185,16 @@ typedef struct {
|
||||
UINT32 IoAlign;
|
||||
|
||||
EFI_LBA LastBlock;
|
||||
|
||||
EFI_LBA LowestAlignedLba;
|
||||
UINT32 LogicalBlocksPerPhysicalBlock;
|
||||
} EFI_BLOCK_IO_MEDIA;
|
||||
|
||||
#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
|
||||
#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000
|
||||
#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001
|
||||
|
||||
#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV1 ((UINTN)&((EFI_BLOCK_IO_MEDIA *)0)->LastBlock + sizeof(EFI_LBA))
|
||||
#define SIZE_OF_EFI_BLOCK_IO_MEDIA_REV2 sizeof(EFI_BLOCK_IO_MEDIA)
|
||||
|
||||
struct _EFI_BLOCK_IO_PROTOCOL {
|
||||
UINT64 Revision;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -50,12 +50,13 @@ EFI_STATUS
|
||||
Retrieves a Unicode string that is the user readable name of the EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
Language - A pointer to a three character ISO 639-2 language identifier.
|
||||
This is the language of the driver name that that the caller
|
||||
is requesting, and it must match one of the languages specified
|
||||
in SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer.
|
||||
This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.
|
||||
Language - A pointer to a Null-terminated ASCII string array indicating the
|
||||
language. This is the language of the driver name that the caller
|
||||
is requesting, and it must match one of the languages specified in
|
||||
SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer. Language is specified in RFC
|
||||
4646 language code format.
|
||||
DriverName - A pointer to the Unicode string to return. This Unicode string
|
||||
is the name of the driver specified by This in the language
|
||||
specified by Language.
|
||||
@ -86,7 +87,7 @@ EFI_STATUS
|
||||
that is being managed by an EFI Driver.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||
This - A pointer to the EFI_COMPONENT_NAME2_PROTOCOL instance.
|
||||
ControllerHandle - The handle of a controller that the driver specified by
|
||||
This is managing. This handle specifies the controller
|
||||
whose name is to be returned.
|
||||
@ -96,12 +97,12 @@ EFI_STATUS
|
||||
for a bus drivers that wish to retrieve the name of the
|
||||
bus controller. It will not be NULL for a bus driver
|
||||
that wishes to retrieve the name of a child controller.
|
||||
Language - A pointer to a three character ISO 639-2 language
|
||||
identifier. This is the language of the controller name
|
||||
that that the caller is requesting, and it must match one
|
||||
of the languages specified in SupportedLanguages. The
|
||||
number of languages supported by a driver is up to the
|
||||
driver writer.
|
||||
Language - A pointer to a Null-terminated ASCII string array indicating the
|
||||
language. This is the language of the driver name that the caller
|
||||
is requesting, and it must match one of the languages specified in
|
||||
SupportedLanguages. The number of languages supported by a
|
||||
driver is up to the driver writer. Language is specified in RFC
|
||||
4646 language code format.
|
||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||
string is the name of the controller specified by
|
||||
ControllerHandle and ChildHandle in the language specified
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -117,6 +117,8 @@ COMPONENT_TYPE= LIBRARY
|
||||
HiiFont/HiiFont.c
|
||||
HiiImage/HiiImage.h
|
||||
HiiImage/HiiImage.c
|
||||
HiiPackageList/HiiPackageList.h
|
||||
HiiPackageList/HiiPackageList.c
|
||||
HiiString/HiiString.h
|
||||
HiiString/HiiString.c
|
||||
Ip4/Ip4.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -138,8 +138,7 @@ EFI_STATUS
|
||||
Returns:
|
||||
EFI_SUCCESS - The data associated with the Handle was removed from
|
||||
the HII database.
|
||||
EFI_NOT_FOUND - The specified PackageList could not be found in database.
|
||||
EFI_INVALID_PARAMETER - The Handle was not valid.
|
||||
EFI_NOT_FOUND - The specified Handle is not in database.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -166,8 +165,8 @@ EFI_STATUS
|
||||
Returns:
|
||||
EFI_SUCCESS - The HII database was successfully updated.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate enough memory for the updated database.
|
||||
EFI_INVALID_PARAMETER - Handle or PackageList was NULL.
|
||||
EFI_NOT_FOUND - The Handle was not valid or could not be found in database.
|
||||
EFI_INVALID_PARAMETER - PackageList was NULL.
|
||||
EFI_NOT_FOUND - The specified Handle is not in database.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -203,12 +202,16 @@ EFI_STATUS
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The matching handles are outputed successfully.
|
||||
HandleBufferLength is updated with the actual length.
|
||||
EFI_BUFFER_TO_SMALL - The HandleBufferLength parameter indicates that
|
||||
Handle is too small to support the number of handles.
|
||||
HandleBufferLength is updated with a value that will
|
||||
enable the data to fit.
|
||||
EFI_NOT_FOUND - No matching handle could not be found in database.
|
||||
EFI_INVALID_PARAMETER - Handle or HandleBufferLength was NULL.
|
||||
EFI_INVALID_PARAMETER - PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but
|
||||
PackageGuid is not NULL, PackageType is a EFI_HII_
|
||||
PACKAGE_TYPE_GUID but PackageGuid is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -312,7 +315,8 @@ EFI_STATUS
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Notification is unregistered successfully.
|
||||
EFI_INVALID_PARAMETER - The Handle is invalid.
|
||||
EFI_NOT_FOUND - The incoming notification handle does not exist
|
||||
in current hii database.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -53,9 +53,9 @@ typedef struct _EFI_HII_ROW_INFO {
|
||||
} EFI_HII_ROW_INFO;
|
||||
|
||||
typedef struct {
|
||||
UINT32 FontStyle;
|
||||
UINT16 FontSize; // character cell size in pixels
|
||||
CHAR16 FontName[1];
|
||||
EFI_HII_FONT_STYLE FontStyle;
|
||||
UINT16 FontSize; // character cell height in pixels
|
||||
CHAR16 FontName[1];
|
||||
} EFI_FONT_INFO;
|
||||
|
||||
typedef struct _EFI_FONT_DISPLAY_INFO {
|
||||
@ -65,25 +65,25 @@ typedef struct _EFI_FONT_DISPLAY_INFO {
|
||||
EFI_FONT_INFO FontInfo;
|
||||
} EFI_FONT_DISPLAY_INFO;
|
||||
|
||||
#define EFI_HII_OUT_FLAG_CLIP 0x00000001
|
||||
#define EFI_HII_OUT_FLAG_WRAP 0x00000002
|
||||
#define EFI_HII_OUT_FLAG_CLEAN_Y 0x00000004
|
||||
#define EFI_HII_OUT_FLAG_CLEAN_X 0x00000008
|
||||
#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
|
||||
#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
|
||||
#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
|
||||
#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
|
||||
#define EFI_HII_OUT_FLAG_CLIP 0x00000001
|
||||
#define EFI_HII_OUT_FLAG_WRAP 0x00000002
|
||||
#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004
|
||||
#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008
|
||||
#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
|
||||
#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
|
||||
#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
|
||||
#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
|
||||
|
||||
#define EFI_FONT_INFO_SYS_FONT 0x00000001
|
||||
#define EFI_FONT_INFO_SYS_SIZE 0x00000002
|
||||
#define EFI_FONT_INFO_SYS_STYLE 0x00000004
|
||||
#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
|
||||
#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
|
||||
#define EFI_FONT_INFO_RESIZE 0x00001000
|
||||
#define EFI_FONT_INFO_RESTYLE 0x00002000
|
||||
#define EFI_FONT_INFO_ANY_FONT 0x00010000
|
||||
#define EFI_FONT_INFO_ANY_SIZE 0x00020000
|
||||
#define EFI_FONT_INFO_ANY_STYLE 0x00040000
|
||||
#define EFI_FONT_INFO_SYS_FONT 0x00000001
|
||||
#define EFI_FONT_INFO_SYS_SIZE 0x00000002
|
||||
#define EFI_FONT_INFO_SYS_STYLE 0x00000004
|
||||
#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
|
||||
#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
|
||||
#define EFI_FONT_INFO_RESIZE 0x00001000
|
||||
#define EFI_FONT_INFO_RESTYLE 0x00002000
|
||||
#define EFI_FONT_INFO_ANY_FONT 0x00010000
|
||||
#define EFI_FONT_INFO_ANY_SIZE 0x00020000
|
||||
#define EFI_FONT_INFO_ANY_STYLE 0x00040000
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
@ -109,7 +109,7 @@ EFI_STATUS
|
||||
Flags - Describes how the string is to be drawn.
|
||||
String - Points to the null-terminated string to be displayed.
|
||||
StringInfo - Points to the string output information, including the color and font.
|
||||
If NULL, then the string will be output in the default system font and color.
|
||||
If NULL, then the string will be output in the default system font and color.
|
||||
Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels
|
||||
wide and Height pixels high. The string will be drawn onto this image and
|
||||
EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a
|
||||
@ -132,7 +132,8 @@ EFI_STATUS
|
||||
Returns:
|
||||
EFI_SUCCESS - The string was successfully rendered.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.
|
||||
EFI_INVALID_PARAMETER - The String was NULL.
|
||||
EFI_INVALID_PARAMETER - The String or Blt was NULL.
|
||||
EFI_INVALID_PARAMETER - Flags were invalid combination.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -166,7 +167,7 @@ EFI_STATUS
|
||||
Language - Points to the language for the retrieved string. If NULL, then the current system
|
||||
language is used.
|
||||
StringInfo - Points to the string output information, including the color and font.
|
||||
If NULL, then the string will be output in the default system font and color.
|
||||
If NULL, then the string will be output in the default system font and color.
|
||||
Blt - If this points to a non-NULL on entry, this points to the image, which is Width pixels
|
||||
wide and Height pixels high. The string will be drawn onto this image and
|
||||
EFI_HII_OUT_FLAG_CLIP is implied. If this points to a NULL on entry, then a
|
||||
@ -187,9 +188,12 @@ EFI_STATUS
|
||||
is possible when character display is normalized that some character cells overlap.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The string was successfully rendered.
|
||||
EFI_SUCCESS - The string was successfully rendered.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for RowInfoArray or Blt.
|
||||
EFI_INVALID_PARAMETER - The String was NULL.
|
||||
EFI_INVALID_PARAMETER - The Blt or PackageList was NULL.
|
||||
EFI_INVALID_PARAMETER - Flags were invalid combination.
|
||||
EFI_NOT_FOUND - The specified PackageList is not in the Database or the stringid is not
|
||||
in the specified PackageList.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -233,7 +237,7 @@ EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_FONT_INFO) (
|
||||
IN CONST EFI_HII_FONT_PROTOCOL *This,
|
||||
IN OUT EFI_FONT_HANDLE *FontHandle,
|
||||
IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn,
|
||||
IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL
|
||||
OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,
|
||||
IN CONST EFI_STRING String OPTIONAL
|
||||
)
|
||||
@ -246,11 +250,13 @@ EFI_STATUS
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_HII_FONT_PROTOCOL instance.
|
||||
FontHandle - On entry, points to the font handle returned by a
|
||||
previous call to GetFontInfo() or NULL to start with the
|
||||
FontHandle - On entry, points to the font handle returned by a previous
|
||||
call to GetFontInfo() or points to NULL to start with the
|
||||
first font. On return, points to the returned font handle or
|
||||
points to NULL if there are no more matching fonts.
|
||||
StringInfoIn - Upon entry, points to the font to return information about.
|
||||
points to NULL if there are no more matching fonts.
|
||||
StringInfoIn - Upon entry, points to the font to return information about.
|
||||
If NULL, then the information about the system default
|
||||
font will be returned.
|
||||
StringInfoOut - Upon return, contains the matching font's information.
|
||||
If NULL, then no information is returned.
|
||||
It's caller's responsibility to free this buffer.
|
||||
@ -261,10 +267,10 @@ EFI_STATUS
|
||||
Returns:
|
||||
EFI_SUCCESS - Matching font returned successfully.
|
||||
EFI_NOT_FOUND - No matching font was found.
|
||||
EFI_INVALID_PARAMETER - StringInfoIn is NULL.
|
||||
EFI_INVALID_PARAMETER - StringInfoIn->FontInfoMask is an invalid combination.
|
||||
EFI_OUT_OF_RESOURCES - There were insufficient resources to complete the request.
|
||||
|
||||
--*/
|
||||
--*/
|
||||
;
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -45,7 +45,7 @@ typedef struct _EFI_IMAGE_INPUT {
|
||||
UINT32 Flags;
|
||||
UINT16 Width;
|
||||
UINT16 Height;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Bitmap[1];
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;
|
||||
} EFI_IMAGE_INPUT;
|
||||
|
||||
#define EFI_IMAGE_TRANSPARENT 0x00000001
|
||||
@ -101,8 +101,7 @@ EFI_STATUS
|
||||
IN CONST EFI_HII_IMAGE_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE PackageList,
|
||||
IN EFI_IMAGE_ID ImageId,
|
||||
OUT EFI_IMAGE_INPUT *Image,
|
||||
OUT UINTN *ImageSize
|
||||
OUT EFI_IMAGE_INPUT *Image
|
||||
)
|
||||
/*++
|
||||
|
||||
@ -115,14 +114,14 @@ EFI_STATUS
|
||||
PackageList - Handle of the package list where this image will be searched.
|
||||
ImageId - The image's id,, which is unique within PackageList.
|
||||
Image - Points to the image.
|
||||
ImageSize - On entry, points to the size of the buffer pointed to by Image, in bytes. On return,
|
||||
points to the length of the image, in bytes.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The new image was returned successfully.
|
||||
EFI_NOT_FOUND - The image specified by ImageId is not available.
|
||||
EFI_BUFFER_TOO_SMALL - The buffer specified by ImageSize is too small to hold the image.
|
||||
The specified PackageList is not in the database.
|
||||
EFI_INVALID_PARAMETER - The Image or ImageSize was NULL.
|
||||
EFI_OUT_OF_RESOURCES - The bitmap could not be retrieved because there was not
|
||||
enough memory.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -149,7 +148,8 @@ EFI_STATUS
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The new image was updated successfully.
|
||||
EFI_NOT_FOUND - The image specified by ImageId is not in the database.
|
||||
EFI_NOT_FOUND - The image specified by ImageId is not in the database.
|
||||
The specified PackageList is not in the database.
|
||||
EFI_INVALID_PARAMETER - The Image was NULL.
|
||||
|
||||
--*/
|
||||
@ -233,7 +233,9 @@ EFI_STATUS
|
||||
Returns:
|
||||
EFI_SUCCESS - The image was successfully drawn.
|
||||
EFI_OUT_OF_RESOURCES - Unable to allocate an output buffer for Blt.
|
||||
EFI_INVALID_PARAMETER - The Image was NULL.
|
||||
EFI_NOT_FOUND - The image specified by ImageId is not in the database.
|
||||
The specified PackageList is not in the database.
|
||||
EFI_INVALID_PARAMETER - The Blt was NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
@ -0,0 +1,27 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
HiiPackageList.c
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.
|
||||
|
||||
--*/
|
||||
|
||||
#include "EfiSpec.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (HiiPackageList)
|
||||
|
||||
EFI_GUID gEfiHiiPackageListProtocolGuid = EFI_HII_PACKAGE_LIST_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiHiiPackageListProtocolGuid, "HII Package List Protocol", "HII Package List 2.1 protocol");
|
@ -0,0 +1,36 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
HiiPackageList.h
|
||||
|
||||
Abstract:
|
||||
|
||||
EFI_HII_PACKAGE_LIST_PROTOCOL as defined in UEFI 2.1 spec.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _HII_PACKAGE_LIST_H_
|
||||
#define _HII_PACKAGE_LIST_H_
|
||||
|
||||
#include "EfiHii.h"
|
||||
|
||||
#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc} \
|
||||
}
|
||||
|
||||
typedef EFI_HII_PACKAGE_LIST_HEADER * EFI_HII_PACKAGE_LIST_PROTOCOL;
|
||||
|
||||
extern EFI_GUID gEfiHiiPackageListProtocolGuid;
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -54,6 +54,8 @@ EFI_STATUS
|
||||
Routine Description:
|
||||
This function adds the string String to the group of strings owned by PackageList, with the
|
||||
specified font information StringFontInfo and returns a new string id.
|
||||
The new string identifier is guaranteed to be unique within the package list.
|
||||
That new string identifier is reserved for all languages in the package list.
|
||||
|
||||
Arguments:
|
||||
This - A pointer to the EFI_HII_STRING_PROTOCOL instance.
|
||||
@ -104,13 +106,19 @@ EFI_STATUS
|
||||
String - Points to the new null-terminated string.
|
||||
StringSize - On entry, points to the size of the buffer pointed to by
|
||||
String, in bytes. On return,
|
||||
points to the length of the string, in bytes.
|
||||
StringFontInfo - If not NULL, points to the string's font information.
|
||||
It's caller's responsibility to free this buffer.
|
||||
points to the length of the string, in bytes.
|
||||
StringFontInfo - Points to a buffer that will be callee allocated and will
|
||||
have the string's font information into this buffer.
|
||||
The caller is responsible for freeing this buffer.
|
||||
If the parameter is NULL a buffer will not be allocated
|
||||
and the string font information will not be returned.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The string was returned successfully.
|
||||
EFI_NOT_FOUND - The string specified by StringId is not available.
|
||||
The specified PackageList is not in the database.
|
||||
EFI_INVALID_LANGUAGE - The string specified by StringId is available but
|
||||
not in the specified language.
|
||||
EFI_BUFFER_TOO_SMALL - The buffer specified by StringSize is too small to
|
||||
hold the string.
|
||||
EFI_INVALID_PARAMETER - The String or Language or StringSize was NULL.
|
||||
@ -147,7 +155,8 @@ EFI_STATUS
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - The string was updated successfully.
|
||||
EFI_NOT_FOUND - The string specified by StringId is not in the database.
|
||||
EFI_NOT_FOUND - The string specified by StringId is not in the database.
|
||||
The specified PackageList is not in the database.
|
||||
EFI_INVALID_PARAMETER - The String or Language was NULL.
|
||||
EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task.
|
||||
|
||||
@ -182,6 +191,7 @@ EFI_STATUS
|
||||
EFI_BUFFER_TOO_SMALL - The LanguagesSize is too small to hold the list of
|
||||
supported languages. LanguageSize is updated to
|
||||
contain the required size.
|
||||
EFI_NOT_FOUND - The specified PackageList is not in the database.
|
||||
|
||||
--*/
|
||||
;
|
||||
@ -220,9 +230,12 @@ EFI_STATUS
|
||||
EFI_BUFFER_TOO_SMALL - The buffer specified by SecondLanguagesSize is
|
||||
too small to hold the returned information.
|
||||
SecondLanguageSize is updated to hold the size of
|
||||
the buffer required.
|
||||
|
||||
--*/
|
||||
the buffer required.
|
||||
EFI_INVALID_LANGUAGE - The language specified by FirstLanguage is not
|
||||
present in the specified package list.
|
||||
EFI_NOT_FOUND - The specified PackageList is not in the Database.
|
||||
|
||||
--*/
|
||||
;
|
||||
//
|
||||
// Interface structure for the EFI_HII_STRING_PROTOCOL
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -15,7 +15,7 @@ Module Name:
|
||||
|
||||
Abstract:
|
||||
|
||||
UEFI IPv4 protocol.
|
||||
EFI_IP4_PROTOCOL definition in UEFI 2.2 specification.
|
||||
|
||||
--*/
|
||||
|
||||
@ -80,7 +80,7 @@ typedef struct _EFI_IP4_ICMP_TYPE {
|
||||
typedef struct {
|
||||
BOOLEAN IsStarted;
|
||||
UINT32 MaxPacketSize;
|
||||
|
||||
|
||||
EFI_IP4_CONFIG_DATA ConfigData;
|
||||
BOOLEAN IsConfigured;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -35,6 +35,8 @@ Abstract:
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_SIMPLE_FILE_SYSTEM_PROTOCOL);
|
||||
EFI_FORWARD_DECLARATION (EFI_FILE);
|
||||
typedef struct _EFI_FILE *EFI_FILE_HANDLE;
|
||||
typedef struct _EFI_FILE EFI_FILE_PROTOCOL;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
@ -356,7 +358,7 @@ EFI_STATUS
|
||||
;
|
||||
|
||||
#define EFI_FILE_HANDLE_REVISION 0x00010000
|
||||
typedef struct _EFI_FILE {
|
||||
struct _EFI_FILE {
|
||||
UINT64 Revision;
|
||||
EFI_FILE_OPEN Open;
|
||||
EFI_FILE_CLOSE Close;
|
||||
@ -368,7 +370,7 @@ typedef struct _EFI_FILE {
|
||||
EFI_FILE_GET_INFO GetInfo;
|
||||
EFI_FILE_SET_INFO SetInfo;
|
||||
EFI_FILE_FLUSH Flush;
|
||||
} *EFI_FILE_HANDLE;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -140,7 +140,9 @@ typedef enum _EFI_MEMORY_ARRAY_TYPE {
|
||||
EfiMemoryTypeRdram = 0x11,
|
||||
EfiMemoryTypeDdr = 0x12,
|
||||
EfiMemoryTypeDdr2 = 0x13,
|
||||
EfiMemoryTypeDdr2FbDimm = 0x14
|
||||
EfiMemoryTypeDdr2FbDimm = 0x14,
|
||||
EfiMemoryTypeDdr3 = 0x18,
|
||||
EfiMemoryTypeFbd2 = 0x19
|
||||
} EFI_MEMORY_ARRAY_TYPE;
|
||||
|
||||
typedef struct {
|
||||
@ -189,6 +191,8 @@ typedef struct {
|
||||
UINT16 MemorySpeed;
|
||||
EFI_MEMORY_STATE MemoryState;
|
||||
UINT8 MemoryAttributes;
|
||||
UINT8 MemoryBankConnections;
|
||||
UINT8 MemoryErrorStatus;
|
||||
} EFI_MEMORY_ARRAY_LINK;
|
||||
|
||||
|
||||
@ -304,11 +308,15 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
UINT8 Five :1;
|
||||
UINT8 There :1;
|
||||
UINT8 Three :1;
|
||||
UINT8 Two :1;
|
||||
UINT8 Reserved :5;
|
||||
} EFI_MEMORY_MODULE_VOLTAGE_TYPE;
|
||||
|
||||
//
|
||||
// EFI_MEMORY_CONTROLLER_INFORMATION is obsolete
|
||||
// Use EFI_MEMORY_CONTROLLER_INFORMATION_DATA instead
|
||||
//
|
||||
typedef struct {
|
||||
EFI_MEMORY_ERROR_DETECT_METHOD_TYPE ErrorDetectingMethod;
|
||||
EFI_MEMORY_ERROR_CORRECT_CAPABILITY ErrorCorrectingCapability;
|
||||
@ -323,6 +331,20 @@ typedef struct {
|
||||
UINT16 *MemoryModuleConfigHandles;
|
||||
} EFI_MEMORY_CONTROLLER_INFORMATION;
|
||||
|
||||
typedef struct {
|
||||
EFI_MEMORY_ERROR_DETECT_METHOD_TYPE ErrorDetectingMethod;
|
||||
EFI_MEMORY_ERROR_CORRECT_CAPABILITY ErrorCorrectingCapability;
|
||||
EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE MemorySupportedInterleave;
|
||||
EFI_MEMORY_SUPPORT_INTERLEAVE_TYPE MemoryCurrentInterleave;
|
||||
UINT8 MaxMemoryModuleSize;
|
||||
EFI_MEMORY_SPEED_TYPE MemorySpeedType;
|
||||
EFI_MEMORY_SUPPORTED_TYPE MemorySupportedType;
|
||||
EFI_MEMORY_MODULE_VOLTAGE_TYPE MemoryModuleVoltage;
|
||||
UINT8 NumberofMemorySlot;
|
||||
EFI_MEMORY_ERROR_CORRECT_CAPABILITY EnabledCorrectingCapability;
|
||||
EFI_INTER_LINK_DATA MemoryModuleConfig[1];
|
||||
} EFI_MEMORY_CONTROLLER_INFORMATION_DATA;
|
||||
|
||||
//
|
||||
// Memory. Error Information - SMBIOS Type 18
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -261,6 +261,7 @@ typedef enum {
|
||||
|
||||
typedef struct {
|
||||
UINT32 RecordType :1;
|
||||
UINT32 Type :7;
|
||||
UINT32 Reserved :24;
|
||||
} EFI_MISC_ELEMENT_TYPE;
|
||||
|
||||
@ -417,7 +418,7 @@ typedef enum {
|
||||
EfiSlotTypeApg2X = 0x10,
|
||||
EfiSlotTypeAgp4X = 0x11,
|
||||
EfiSlotTypePciX = 0x12,
|
||||
EfiSlotTypeAgp4x = 0x13,
|
||||
EfiSlotTypeAgp8X = 0x13,
|
||||
EfiSlotTypePC98C20 = 0xA0,
|
||||
EfiSlotTypePC98C24 = 0xA1,
|
||||
EfiSlotTypePC98E = 0xA2,
|
||||
@ -428,7 +429,13 @@ typedef enum {
|
||||
EfiSlotTypePciExpressX2 = 0xA7,
|
||||
EfiSlotTypePciExpressX4 = 0xA8,
|
||||
EfiSlotTypePciExpressX8 = 0xA9,
|
||||
EfiSlotTypePciExpressX16 = 0xAA
|
||||
EfiSlotTypePciExpressX16 = 0xAA,
|
||||
EfiSlotTypePciExpressGen2 = 0xAB,
|
||||
EfiSlotTypePciExpressGen2X1 = 0xAC,
|
||||
EfiSlotTypePciExpressGen2X2 = 0xAD,
|
||||
EfiSlotTypePciExpressGen2X4 = 0xAE,
|
||||
EfiSlotTypePciExpressGen2X8 = 0xAF,
|
||||
EfiSlotTypePciExpressGen2X16 = 0xB0
|
||||
} EFI_MISC_SLOT_TYPE;
|
||||
|
||||
typedef enum {
|
||||
@ -595,6 +602,7 @@ typedef struct {
|
||||
EFI_INTER_LINK_DATA GroupLink;
|
||||
UINT16 GroupId;
|
||||
UINT16 GroupElementId;
|
||||
UINT8 ItemType;
|
||||
} EFI_MISC_GROUP_ITEM_SET_DATA;
|
||||
|
||||
//
|
||||
@ -711,7 +719,12 @@ typedef struct {
|
||||
//
|
||||
// Misc. Hardware Security - SMBIOS Type 24
|
||||
//
|
||||
#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER 0x00000012
|
||||
#define EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER 0x00000012
|
||||
|
||||
//
|
||||
// Backward Compatibility
|
||||
//
|
||||
#define EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA_RECORD_NUMBER EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER
|
||||
|
||||
typedef enum {
|
||||
EfiHardwareSecurityStatusDisabled = 0,
|
||||
@ -966,6 +979,7 @@ typedef struct {
|
||||
EFI_INTER_LINK_DATA ManagementDeviceLink;
|
||||
EFI_INTER_LINK_DATA ManagementDeviceComponentLink;
|
||||
EFI_INTER_LINK_DATA ManagementDeviceThresholdLink;
|
||||
UINT8 ComponentType;
|
||||
} EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION;
|
||||
|
||||
//
|
||||
@ -1013,7 +1027,7 @@ typedef struct {
|
||||
} POWER_SUPPLY_CHARACTERISTICS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 PowerUnitGroup;
|
||||
UINT16 PowerUnitGroup;
|
||||
STRING_REF PowerSupplyLocation;
|
||||
STRING_REF PowerSupplyDeviceName;
|
||||
STRING_REF PowerSupplyManufacturer;
|
||||
@ -1098,18 +1112,62 @@ typedef struct {
|
||||
// Misc. System Event Log - SMBIOS Type 15
|
||||
//
|
||||
#define EFI_MISC_SYSTEM_EVENT_LOG_RECORD_NUMBER 0x00000020
|
||||
|
||||
typedef enum {
|
||||
EfiEventLogTypeReserved1 = 0,
|
||||
EfiEventLogTypeSingleBitEccMemoryError = 1,
|
||||
EfiEventLogTypeMultiBitEccMemoryError = 2,
|
||||
EfiEventLogTypeParityMemoryError = 3,
|
||||
EfiEventLogTypeBusTimeOut = 4,
|
||||
EfiEventLogTypeIoChannelCheck = 5,
|
||||
EfiEventLogTypeSoftwareNmi = 6,
|
||||
EfiEventLogTypePostMemoryResize = 7,
|
||||
EfiEventLogTypePostError = 8,
|
||||
EfiEventLogTypePciParityError = 9,
|
||||
EfiEventLogTypePciSystemError = 0xA,
|
||||
EfiEventLogTypeCpuFailure = 0xB,
|
||||
EfiEventLogTypeEisaFailSafeTimerTimeOut = 0xC,
|
||||
EfiEventLogTypeCorrectableMemoryLogDisabled = 0xD,
|
||||
EfiEventLogTypeLoggingDisabled = 0xE,
|
||||
EfiEventLogTypeReserved2 = 0xF,
|
||||
EfiEventLogTypeSystemLimitExceeded = 0x10,
|
||||
EfiEventLogTypeAsynchronousHardwareTimerExpired = 0x11,
|
||||
EfiEventLogTypeSystemConfigurationInformation = 0x12,
|
||||
EfiEventLogTypeHardDiskInformation = 0x13,
|
||||
EfiEventLogTypeSystemReconfigured = 0x14,
|
||||
EfiEventLogTypeUncorrectableCpuComplexError = 0x15,
|
||||
EfiEventLogTypeLogAreaResetCleared = 0x16,
|
||||
EfiEventLogTypeSystemBoot = 0x17,
|
||||
EfiEventLogTypeEndOfLog = 0xFF
|
||||
} EFI_MISC_LOG_TYPE;
|
||||
|
||||
typedef enum {
|
||||
EfiEventLogDataFormatTypeNone = 0,
|
||||
EfiEventLogDataFormatTypeHandle = 1,
|
||||
EfiEventLogDataFormatTypeMultipleEvent = 2,
|
||||
EfiEventLogDataFormatTypeMultipleEventHandle = 3,
|
||||
EfiEventLogDataFormatTypePostResultsBitmap = 4,
|
||||
EfiEventLogDataFormatTypeSystemManagement = 5,
|
||||
EfiEventLogDataFormatTypeMultipleEventSystemManagement = 6
|
||||
} EFI_MISC_VARIABLE_DATA_FORMAT_TYPE;
|
||||
|
||||
typedef struct {
|
||||
//SMBIOS_STRUCTURE_HDR Header;
|
||||
UINT16 LogAreaLength;
|
||||
UINT16 LogHeaderStartOffset;
|
||||
UINT16 LogDataStartOffset;
|
||||
UINT8 AccessMethod;
|
||||
UINT8 LogStatus;
|
||||
UINT32 LogChangeToken;
|
||||
UINT32 AccessMethodAddress;
|
||||
UINT8 LogHeaderFormat;
|
||||
UINT8 NumberOfSupportedLogType;
|
||||
UINT8 LengthOfLogDescriptor;
|
||||
UINT8 LogType;
|
||||
UINT8 DataFormatType;
|
||||
} EFI_MISC_EVENT_LOG_TYPE;
|
||||
|
||||
typedef struct {
|
||||
UINT16 LogAreaLength;
|
||||
UINT16 LogHeaderStartOffset;
|
||||
UINT16 LogDataStartOffset;
|
||||
UINT8 AccessMethod;
|
||||
UINT8 LogStatus;
|
||||
UINT32 LogChangeToken;
|
||||
UINT32 AccessMethodAddress;
|
||||
UINT8 LogHeaderFormat;
|
||||
UINT8 NumberOfSupportedLogType;
|
||||
UINT8 LengthOfLogDescriptor;
|
||||
EFI_PHYSICAL_ADDRESS EventLogTypeDescriptors; // Pointer to EFI_MISC_EVENT_LOG_TYPE
|
||||
} EFI_MISC_SYSTEM_EVENT_LOG;
|
||||
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -49,6 +49,7 @@ typedef STRING_REF EFI_PROCESSOR_MANUFACTURER_DATA;
|
||||
typedef STRING_REF EFI_PROCESSOR_SERIAL_NUMBER_DATA;
|
||||
|
||||
typedef STRING_REF EFI_PROCESSOR_ASSET_TAG_DATA;
|
||||
|
||||
typedef STRING_REF EFI_PROCESSOR_PART_NUMBER_DATA;
|
||||
|
||||
typedef struct {
|
||||
@ -159,6 +160,10 @@ typedef enum {
|
||||
EfiProcessorFamilyPowerPC620 = 0x25,
|
||||
EfiProcessorFamilyPowerPC704 = 0x26,
|
||||
EfiProcessorFamilyPowerPC750 = 0x27,
|
||||
EfiProcessorFamilyIntelCoreDuo = 0x28,
|
||||
EfiProcessorFamilyIntelCoreDuoMobile = 0x29,
|
||||
EfiProcessorFamilyIntelCoreSoloMobile = 0x2A,
|
||||
EfiProcessorFamilyIntelAtom = 0x2B,
|
||||
EfiProcessorFamilyAlpha2 = 0x30,
|
||||
EfiProcessorFamilyAlpha21064 = 0x31,
|
||||
EfiProcessorFamilyAlpha21066 = 0x32,
|
||||
@ -201,6 +206,12 @@ typedef enum {
|
||||
EfiProcessorFamilyDualCoreAmdOpteron = 0x87,
|
||||
EfiProcessorFamilyAmdAthlon64X2DualCore = 0x88,
|
||||
EfiProcessorFamilyAmdTurion64X2Mobile = 0x89,
|
||||
EfiProcessorFamilyQuadCoreAmdOpteron = 0x8A,
|
||||
EfiProcessorFamilyThirdGenerationAmdOpteron = 0x8B,
|
||||
EfiProcessorFamilyAmdPhenomFxQuadCore = 0x8C,
|
||||
EfiProcessorFamilyAmdPhenomX4QuadCore = 0x8D,
|
||||
EfiProcessorFamilyAmdPhenomX2DualCore = 0x8E,
|
||||
EfiProcessorFamilyAmdAthlonX2DualCore = 0x8F,
|
||||
EfiProcessorFamilyPARISC = 0x90,
|
||||
EfiProcessorFamilyPaRisc8500 = 0x91,
|
||||
EfiProcessorFamilyPaRisc8000 = 0x92,
|
||||
@ -209,6 +220,21 @@ typedef enum {
|
||||
EfiProcessorFamilyPaRisc7100LC = 0x95,
|
||||
EfiProcessorFamilyPaRisc7100 = 0x96,
|
||||
EfiProcessorFamilyV30 = 0xA0,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
|
||||
EfiProcessorFamilyDualCoreIntelXeon3000Series = 0xA2,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
|
||||
EfiProcessorFamilyDualCoreIntelXeon5100Series = 0xA4,
|
||||
EfiProcessorFamilyDualCoreIntelXeon5000Series = 0xA5,
|
||||
EfiProcessorFamilyDualCoreIntelXeonLV = 0xA6,
|
||||
EfiProcessorFamilyDualCoreIntelXeonULV = 0xA7,
|
||||
EfiProcessorFamilyDualCoreIntelXeon7100Series = 0xA8,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon = 0xAA,
|
||||
EfiProcessorFamilyDualCoreIntelXeon5200Series = 0xAB,
|
||||
EfiProcessorFamilyDualCoreIntelXeon7200Series = 0xAC,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
|
||||
EfiProcessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
|
||||
EfiProcessorFamilyPentiumIIIXeon = 0xB0,
|
||||
EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,
|
||||
EfiProcessorFamilyPentium4 = 0xB2,
|
||||
@ -222,9 +248,17 @@ typedef enum {
|
||||
EfiProcessorFamilyIntelCeleronD = 0xBA,
|
||||
EfiProcessorFamilyIntelPentiumD = 0xBB,
|
||||
EfiProcessorFamilyIntelPentiumEx = 0xBC,
|
||||
EfiProcessorFamilyIntelCoreBrand = 0xBD,
|
||||
EfiProcessorFamilyIntelCoreSolo = 0xBD, // SMBIOS spec 2.6 correct this value
|
||||
EfiProcessorFamilyReserved = 0xBE,
|
||||
EfiProcessorFamilyIntelCore2 = 0xBF,
|
||||
EfiProcessorFamilyIntelCore2Solo = 0xC0,
|
||||
EfiProcessorFamilyIntelCore2Extreme = 0xC1,
|
||||
EfiProcessorFamilyIntelCore2Quad = 0xC2,
|
||||
EfiProcessorFamilyIntelCore2ExtremeMobile = 0xC3,
|
||||
EfiProcessorFamilyIntelCore2DuoMobile = 0xC4,
|
||||
EfiProcessorFamilyIntelCore2SoloMobile = 0xC5,
|
||||
EfiProcessorFamilyIntelCoreI7 = 0xC6,
|
||||
EfiProcessorFamilyDualCoreIntelCeleron = 0xC7,
|
||||
EfiProcessorFamilyIBM390 = 0xC8,
|
||||
EfiProcessorFamilyG4 = 0xC9,
|
||||
EfiProcessorFamilyG5 = 0xCA,
|
||||
@ -234,6 +268,20 @@ typedef enum {
|
||||
EfiProcessorFamilyViaC7D = 0xD3,
|
||||
EfiProcessorFamilyViaC7 = 0xD4,
|
||||
EfiProcessorFamilyViaEden = 0xD5,
|
||||
EfiProcessorFamilyMultiCoreIntelXeon = 0xD6,
|
||||
EfiProcessorFamilyDualCoreIntelXeon3Series = 0xD7,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon3Series = 0xD8,
|
||||
EfiProcessorFamilyDualCoreIntelXeon5Series = 0xDA,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon5Series = 0xDB,
|
||||
EfiProcessorFamilyDualCoreIntelXeon7Series = 0xDD,
|
||||
EfiProcessorFamilyQuadCoreIntelXeon7Series = 0xDE,
|
||||
EfiProcessorFamilyMultiCoreIntelXeon7Series = 0xDF,
|
||||
EfiProcessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
|
||||
EfiProcessorFamilyAmdPhenomTripleCore = 0xE7,
|
||||
EfiProcessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
|
||||
EfiProcessorFamilyAmdTurionDualCoreMobile = 0xE9,
|
||||
EfiProcessorFamilyAmdAthlonDualCore = 0xEA,
|
||||
EfiProcessorFamilyAmdSempronSI = 0xEB,
|
||||
EfiProcessorFamilyi860 = 0xFA,
|
||||
EfiProcessorFamilyi960 = 0xFB,
|
||||
EfiProcessorFamilyIndicatorFamily2 = 0xFE
|
||||
@ -314,7 +362,8 @@ typedef enum {
|
||||
EfiProcessorSocketLGA775 = 0x15,
|
||||
EfiProcessorSocketS1 = 0x16,
|
||||
EfiProcessorSocketAm2 = 0x17,
|
||||
EfiProcessorSocketF = 0x18
|
||||
EfiProcessorSocketF = 0x18,
|
||||
EfiProcessorSocketLGA1366 = 0x19
|
||||
} EFI_PROCESSOR_SOCKET_TYPE_DATA;
|
||||
|
||||
typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -59,6 +59,11 @@ typedef struct {
|
||||
VOID* CapsulePtr[1];
|
||||
} EFI_CAPSULE_TABLE;
|
||||
|
||||
//
|
||||
// This struct is deprecated because VendorTable entries physical address will not be fixed up when
|
||||
// transitioning from preboot to runtime phase. So we don't need CapsuleInfoTable to record capsule
|
||||
// GUIDs any more for runtime convert.
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 CapsuleGuidNumber;
|
||||
EFI_GUID CapsuleGuidPtr[1];
|
||||
@ -66,6 +71,7 @@ typedef struct {
|
||||
|
||||
//
|
||||
// This GUID is used for collecting all capsules' Guids who install in ConfigTable.
|
||||
// This GUID is deprecated as well.
|
||||
//
|
||||
#define EFI_CAPSULE_INFO_GUID \
|
||||
{ \
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -50,11 +50,10 @@ typedef enum {
|
||||
} EFI_PEI_PCI_CFG_PPI_WIDTH;
|
||||
|
||||
#define EFI_PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) \
|
||||
( ((bus) << 24) | \
|
||||
((dev) << 16) | \
|
||||
((func) << 8) | \
|
||||
((reg) < 256 ? (reg): ((UINT64)(reg) << 32)))
|
||||
|
||||
(UINT64) ((((UINTN) (bus)) << 24) | \
|
||||
(((UINTN) (dev)) << 16) | \
|
||||
(((UINTN) (func)) << 8) | \
|
||||
((reg) < 256 ? ((UINTN) (reg)): ((UINT64) (reg) << 32)))
|
||||
|
||||
#if (PI_SPECIFICATION_VERSION < 0x00010000)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -361,8 +361,8 @@ EFI_STATUS
|
||||
(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (
|
||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||
IN EFI_FV_FILETYPE SearchType,
|
||||
IN CONST EFI_PEI_FV_HANDLE *FwVolHeader,
|
||||
IN OUT EFI_PEI_FILE_HANDLE **FileHandle
|
||||
IN CONST EFI_PEI_FV_HANDLE FvHandle,
|
||||
IN OUT EFI_PEI_FILE_HANDLE *FileHandle
|
||||
);
|
||||
|
||||
typedef
|
||||
@ -370,7 +370,7 @@ EFI_STATUS
|
||||
(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (
|
||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||
IN EFI_SECTION_TYPE SectionType,
|
||||
IN EFI_PEI_FILE_HANDLE *FileHandle,
|
||||
IN EFI_PEI_FILE_HANDLE FileHandle,
|
||||
OUT VOID **SectionData
|
||||
);
|
||||
|
||||
@ -443,7 +443,7 @@ EFI_STATUS
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (
|
||||
IN EFI_PEI_FV_HANDLE *VolumeHandle,
|
||||
IN EFI_PEI_FV_HANDLE VolumeHandle,
|
||||
OUT EFI_FV_INFO *VolumeInfo
|
||||
);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -22,28 +22,11 @@ Abstract:
|
||||
#ifndef _TIANO_SPEC_DEVICE_PATH_H
|
||||
#define _TIANO_SPEC_DEVICE_PATH_H
|
||||
|
||||
#pragma pack(1)
|
||||
#include "EfiDevicePath.h"
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION <= 0x00020000)
|
||||
//
|
||||
// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
|
||||
// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
|
||||
// EFI 1.10 and UEFI 2.10.
|
||||
// MEDIA_FW_VOL_FILEPATH_DEVICE_PATH and MEDIA_FW_VOL_DEVICE_PATH are defined in
|
||||
// EfiDevicePath.h
|
||||
//
|
||||
#define MEDIA_FV_FILEPATH_DP 0x06
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID NameGuid;
|
||||
} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
|
||||
#endif
|
||||
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION > 0x00020000)
|
||||
//
|
||||
// EFI Specification extension on Media Device Path was added to UEFI 2.1 specification,
|
||||
// so the definition is moved to EfiDevicePath.h
|
||||
//
|
||||
#endif
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -102,4 +102,7 @@ COMPONENT_TYPE= LIBRARY
|
||||
GuidedSectionExtraction/GuidedSectionExtraction.c
|
||||
EcpPciCfg/EcpPciCfg.h
|
||||
EcpPciCfg/EcpPciCfg.c
|
||||
|
||||
TemporaryRamSupport/TemporaryRamSupport.h
|
||||
TemporaryRamSupport/TemporaryRamSupport.c
|
||||
LoadedImage/LoadedImage.h
|
||||
LoadedImage/LoadedImage.c
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -77,7 +77,7 @@ EFI_STATUS
|
||||
(EFIAPI *EFI_PEI_FV_FIND_FILE_NAME) (
|
||||
IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
|
||||
IN CONST EFI_GUID *FileName,
|
||||
IN EFI_PEI_FV_HANDLE FvHandle,
|
||||
IN OUT EFI_PEI_FV_HANDLE *FvHandle,
|
||||
OUT EFI_PEI_FILE_HANDLE *FileHandle
|
||||
);
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
LoadedImage.c
|
||||
|
||||
Abstract:
|
||||
|
||||
The file describes the PPI which notifies other drivers
|
||||
of the PEIM being initialized by the PEI Dispatcher.
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include "PeiBind.h"
|
||||
#include "PeiApi.h"
|
||||
#include EFI_PPI_DEFINITION (LoadedImage)
|
||||
|
||||
EFI_GUID gEfiPeiLoadedImagePpiGuid = EFI_PEI_LOADED_IMAGE_PPI_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiPeiLoadedImagePpiGuid, "LoadedImagePpi", "LoadedImage PPI");
|
@ -0,0 +1,56 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
LoadedImage.h
|
||||
|
||||
Abstract:
|
||||
|
||||
The file describes the PPI which notifies other drivers
|
||||
of the PEIM being initialized by the PEI Dispatcher.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __LOADED_IMAGE_PPI_H__
|
||||
#define __LOADED_IMAGE_PPI_H__
|
||||
|
||||
#include "Tiano.h"
|
||||
|
||||
#define EFI_PEI_LOADED_IMAGE_PPI_GUID \
|
||||
{ 0xc1fcd448, 0x6300, 0x4458, {0xb8, 0x64, 0x28, 0xdf, 0x01, 0x53, 0x64, 0xbc} }
|
||||
|
||||
typedef struct _EFI_PEI_LOADED_IMAGE_PPI EFI_PEI_LOADED_IMAGE_PPI;
|
||||
|
||||
///
|
||||
/// This interface is installed by the PEI Dispatcher after the image has been
|
||||
/// loaded and after all security checks have been performed,
|
||||
/// to notify other PEIMs of the files which are being loaded.
|
||||
///
|
||||
struct _EFI_PEI_LOADED_IMAGE_PPI {
|
||||
///
|
||||
/// Address of the image at the address where it will be executed.
|
||||
///
|
||||
EFI_PHYSICAL_ADDRESS ImageAddress;
|
||||
///
|
||||
/// Size of the image as it will be executed.
|
||||
///
|
||||
UINT64 ImageSize;
|
||||
///
|
||||
/// File handle from which the image was loaded.
|
||||
/// Can be NULL, indicating the image was not loaded from a handle.
|
||||
///
|
||||
EFI_PEI_FILE_HANDLE FileHandle;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiPeiLoadedImagePpiGuid;
|
||||
|
||||
#endif
|
@ -0,0 +1,30 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
TemporaryRamSupport.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This file declares Temporary RAM Support PPI.
|
||||
This Ppi provides the service that migrates temporary RAM into permanent memory.
|
||||
|
||||
--*/
|
||||
|
||||
#include "Tiano.h"
|
||||
#include "PeiBind.h"
|
||||
#include "PeiApi.h"
|
||||
#include EFI_PPI_DEFINITION (TemporaryRamSupport)
|
||||
|
||||
EFI_GUID gEfiTemporaryRamSupportPpiGuid = TEMPORARY_RAM_SUPPORT_PPI_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiTemporaryRamSupportPpiGuid, "TemporaryRamSupportPpi", "TemporaryRamSupport PPI");
|
@ -0,0 +1,66 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
Module Name:
|
||||
|
||||
TemporaryRamSupport.h
|
||||
|
||||
Abstract:
|
||||
|
||||
This file declares Temporary RAM Support PPI.
|
||||
This Ppi provides the service that migrates temporary RAM into permanent memory.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef __TEMPORARY_RAM_SUPPORT_H__
|
||||
#define __TEMPORARY_RAM_SUPPORT_H__
|
||||
|
||||
#include "Tiano.h"
|
||||
|
||||
#define TEMPORARY_RAM_SUPPORT_PPI_GUID \
|
||||
{ \
|
||||
0xdbe23aa9, 0xa345, 0x4b97, {0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} \
|
||||
}
|
||||
|
||||
/**
|
||||
This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
|
||||
permanent memory.
|
||||
|
||||
@param PeiServices Pointer to the PEI Services Table.
|
||||
@param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
|
||||
Temporary RAM contents.
|
||||
@param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
|
||||
Temporary RAM contents.
|
||||
@param CopySize Amount of memory to migrate from temporary to permanent memory.
|
||||
|
||||
@retval EFI_SUCCESS The data was successfully returned.
|
||||
@retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when TemporaryMemoryBase > PermanentMemoryBase.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI * TEMPORARY_RAM_MIGRATION)(
|
||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||
IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
|
||||
IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
|
||||
IN UINTN CopySize
|
||||
);
|
||||
|
||||
///
|
||||
/// This service abstracts the ability to migrate contents of the platform early memory store.
|
||||
///
|
||||
typedef struct {
|
||||
TEMPORARY_RAM_MIGRATION TemporaryRamMigration;
|
||||
} TEMPORARY_RAM_SUPPORT_PPI;
|
||||
|
||||
extern EFI_GUID gEfiTemporaryRamSupportPpiGuid;
|
||||
|
||||
#endif
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -27,5 +27,7 @@ Abstract:
|
||||
#include EFI_PROTOCOL_DEFINITION (FirmwareVolumeBlock)
|
||||
|
||||
EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;
|
||||
EFI_GUID gEfiFirmwareVolumeBlock2ProtocolGuid = EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID;
|
||||
|
||||
EFI_GUID_STRING(&gEfiFirmwareVolumeBlockProtocolGuid, "FirmwareVolumeBlock Protocol", "Firmware Volume Block protocol");
|
||||
EFI_GUID_STRING(&gEfiFirmwareVolumeBlock2ProtocolGuid, "FirmwareVolumeBlock2 Protocol", "Firmware Volume Block2 protocol");
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -40,6 +40,8 @@ Abstract:
|
||||
|
||||
EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL);
|
||||
|
||||
typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -174,10 +174,17 @@ typedef struct {
|
||||
UINT16 command_set_feature_enb_86; // word 86
|
||||
UINT16 command_set_feature_default; // word 87
|
||||
UINT16 ultra_dma_mode; // word 88
|
||||
UINT16 reserved_89_127[39];
|
||||
UINT16 reserved_89_105[17];
|
||||
UINT16 phy_logic_sector_support; // word 106
|
||||
UINT16 reserved_107_116[10];
|
||||
UINT16 logic_sector_size_lo; // word 117
|
||||
UINT16 logic_sector_size_hi; // word 118
|
||||
UINT16 reserved_119_127[9];
|
||||
UINT16 security_status;
|
||||
UINT16 vendor_data_129_159[31];
|
||||
UINT16 reserved_160_255[96];
|
||||
UINT16 reserved_160_208[49];
|
||||
UINT16 alignment_logic_in_phy_blocks; // word 209
|
||||
UINT16 reserved_210_255[46];
|
||||
} EFI_ATA_IDENTIFY_DATA;
|
||||
|
||||
#pragma pack()
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -28,6 +28,7 @@ Abstract:
|
||||
0x3c699197, 0x93c, 0x4c69, {0xb0, 0x6b, 0x12, 0x8a, 0xe3, 0x48, 0x1d, 0xc9} \
|
||||
}
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 AddressSpaceId;
|
||||
UINT8 RegisterBitWidth;
|
||||
@ -52,7 +53,6 @@ typedef struct {
|
||||
// Following structure defines ACPI Description information.
|
||||
// This information is platform specific, may be consumed by DXE generic driver.
|
||||
//
|
||||
#pragma pack(1)
|
||||
typedef struct _EFI_ACPI_DESCRIPTION {
|
||||
//
|
||||
// For Timer
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -20,6 +20,7 @@ Abstract:
|
||||
--*/
|
||||
|
||||
#ifndef _PCI_OPTION_ROM_TABLE_GUID_H_
|
||||
#define _PCI_OPTION_ROM_TABLE_GUID_H_
|
||||
|
||||
#define EFI_PCI_OPTION_ROM_TABLE_GUID \
|
||||
{ 0x7462660f, 0x1cbd, 0x48da, {0xad, 0x11, 0x91, 0x71, 0x79, 0x13, 0x83, 0x1c} }
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2005 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -75,6 +75,9 @@ typedef struct {
|
||||
#ifdef EFI_NT_EMULATOR
|
||||
VOID **ModHandle;
|
||||
#endif
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
EFI_PHYSICAL_ADDRESS HiiResourceData;
|
||||
#endif
|
||||
} EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT;
|
||||
|
||||
typedef
|
||||
|
@ -33,19 +33,5 @@ Abstract:
|
||||
#include "EfiApi.h"
|
||||
#include "EfiDevicePath.h"
|
||||
|
||||
//
|
||||
// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.
|
||||
//
|
||||
#if !defined(EFI_SPECIFICATION_VERSION)
|
||||
#error EFI_SPECIFICATION_VERSION not defined
|
||||
#elif !defined(TIANO_RELEASE_VERSION)
|
||||
#error TIANO_RELEASE_VERSION not defined
|
||||
#elif (TIANO_RELEASE_VERSION == 0)
|
||||
//
|
||||
// UEFI mode with no Tiano extensions is legal
|
||||
//
|
||||
#elif ((TIANO_RELEASE_VERSION < 0x00080005) && (EFI_SPECIFICATION_VERSION >= 0x00020000))
|
||||
#error Illegal combination of EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION versions
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -25,7 +25,12 @@ Abstract:
|
||||
#define _EFI_TPM_H_
|
||||
|
||||
#include "Tiano.h"
|
||||
#include "IndustryStandard/Tpm12.h"
|
||||
|
||||
//
|
||||
// The start of TPM return codes
|
||||
//
|
||||
#define TPM_BASE (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))
|
||||
#include "Tpm12.h"
|
||||
|
||||
//
|
||||
// Standard event types
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -22,6 +22,32 @@ Abstract:
|
||||
|
||||
#include "Tiano.h"
|
||||
|
||||
//
|
||||
// Reference SMBIOS 2.6, chapter 3.1.2.
|
||||
// For v2.1 and later, handle values in the range 0FF00h to 0FFFFh are reserved for
|
||||
// use by this specification.
|
||||
//
|
||||
#define SMBIOS_HANDLE_RESERVED_BEGIN 0xFF00
|
||||
|
||||
//
|
||||
// Reference SMBIOS 2.6, chapter 3.1.3
|
||||
// Each text string is limited to 64 significant characters due to system MIF limitations
|
||||
//
|
||||
#define SMBIOS_STRING_MAX_LENGTH 64
|
||||
|
||||
//
|
||||
// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.43.
|
||||
// Upper-level software that interprets the SMBIOS structure-table should bypass an
|
||||
// Inactive structure just like a structure type that the software does not recognize.
|
||||
//
|
||||
#define SMBIOS_TYPE_INACTIVE 0x007E
|
||||
|
||||
//
|
||||
// End-of-table type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 3.3.44.
|
||||
// The end-of-table indicator is used in the last physical structure in a table
|
||||
//
|
||||
#define SMBIOS_TYPE_END_OF_TABLE 0x007F
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef UINT8 SMBIOS_TABLE_STRING;
|
||||
|
@ -15,7 +15,7 @@ Module Name:
|
||||
|
||||
Abstract:
|
||||
|
||||
TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 94)
|
||||
TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103)
|
||||
|
||||
See http://trustedcomputinggroup.org for latest specification updates
|
||||
|
||||
@ -39,6 +39,7 @@ Abstract:
|
||||
typedef UINT8 TPM_AUTH_DATA_USAGE;
|
||||
typedef UINT8 TPM_PAYLOAD_TYPE;
|
||||
typedef UINT8 TPM_VERSION_BYTE;
|
||||
typedef UINT8 TPM_DA_STATE;
|
||||
typedef UINT16 TPM_TAG;
|
||||
typedef UINT16 TPM_PROTOCOL_ID;
|
||||
typedef UINT16 TPM_STARTUP_TYPE;
|
||||
@ -144,6 +145,9 @@ typedef UINT32 TPM_FAMILY_OPERATION;
|
||||
#define TPM_TAG_CMK_SIGTICKET ((TPM_STRUCTURE_TAG) 0x0034)
|
||||
#define TPM_TAG_CMK_MA_APPROVAL ((TPM_STRUCTURE_TAG) 0x0035)
|
||||
#define TPM_TAG_QUOTE_INFO2 ((TPM_STRUCTURE_TAG) 0x0036)
|
||||
#define TPM_TAG_DA_INFO ((TPM_STRUCTURE_TAG) 0x0037)
|
||||
#define TPM_TAG_DA_LIMITED ((TPM_STRUCTURE_TAG) 0x0038)
|
||||
#define TPM_TAG_DA_ACTION_TYPE ((TPM_STRUCTURE_TAG) 0x0039)
|
||||
|
||||
//
|
||||
// Part 2, section 4: TPM Types
|
||||
@ -190,6 +194,7 @@ typedef UINT32 TPM_FAMILY_OPERATION;
|
||||
#define TPM_ET_DEL_KEY_BLOB ((UINT16) 0x0009) // The entity is a delegate key blob
|
||||
#define TPM_ET_COUNTER ((UINT16) 0x000A) // The entity is a counter
|
||||
#define TPM_ET_NV ((UINT16) 0x000B) // The entity is a NV index
|
||||
#define TPM_ET_OPERATOR ((UINT16) 0x000C) // The entity is the operator
|
||||
#define TPM_ET_RESERVED_HANDLE ((UINT16) 0x0040) // Reserved. This value avoids collisions with the handle MSB setting.
|
||||
//
|
||||
// TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable
|
||||
@ -323,8 +328,6 @@ typedef TPM_DIGEST TPM_DIRVALUE; // This SHALL be the value of
|
||||
typedef TPM_DIGEST TPM_HMAC;
|
||||
typedef TPM_DIGEST TPM_PCRVALUE; // The value inside of the PCR
|
||||
typedef TPM_DIGEST TPM_AUDITDIGEST; // This SHALL be the value of the current internal audit state
|
||||
typedef TPM_DIGEST TPM_DAA_TPM_SEED; // This SHALL be a random value generated by a TPM immediately after the EK is installed in that TPM, whenever an EK is installed in that TPM
|
||||
typedef TPM_DIGEST TPM_DAA_CONTEXT_SEED; // This SHALL be a random value
|
||||
|
||||
//
|
||||
// Part 2, section 5.5: TPM_NONCE
|
||||
@ -333,6 +336,9 @@ typedef struct tdTPM_NONCE{
|
||||
UINT8 nonce[20];
|
||||
} TPM_NONCE;
|
||||
|
||||
typedef TPM_NONCE TPM_DAA_TPM_SEED; // This SHALL be a random value generated by a TPM immediately after the EK is installed in that TPM, whenever an EK is installed in that TPM
|
||||
typedef TPM_NONCE TPM_DAA_CONTEXT_SEED; // This SHALL be a random value
|
||||
|
||||
//
|
||||
// Part 2, section 5.6: TPM_AUTHDATA
|
||||
//
|
||||
@ -393,7 +399,8 @@ typedef struct tdTPM_KEY_HANDLE_LIST {
|
||||
#define TPM_ES_NONE ((TPM_ENC_SCHEME) 0x0001)
|
||||
#define TPM_ES_RSAESPKCSv15 ((TPM_ENC_SCHEME) 0x0002)
|
||||
#define TPM_ES_RSAESOAEP_SHA1_MGF1 ((TPM_ENC_SCHEME) 0x0003)
|
||||
#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004)
|
||||
#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004) // rev94 defined
|
||||
#define TPM_ES_SYM_CTR ((TPM_ENC_SCHEME) 0x0004)
|
||||
#define TPM_ES_SYM_OFB ((TPM_ENC_SCHEME) 0x0005)
|
||||
|
||||
#define TPM_SS_NONE ((TPM_SIG_SCHEME) 0x0001)
|
||||
@ -584,6 +591,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
|
||||
BOOLEAN readSRKPub;
|
||||
BOOLEAN tpmEstablished;
|
||||
BOOLEAN maintenanceDone;
|
||||
BOOLEAN disableFullDALogicInfo;
|
||||
} TPM_PERMANENT_FLAGS;
|
||||
|
||||
//
|
||||
@ -608,6 +616,7 @@ typedef struct tdTPM_PERMANENT_FLAGS{
|
||||
#define TPM_PF_READSRKPUB ((TPM_CAPABILITY_AREA) 17)
|
||||
#define TPM_PF_TPMESTABLISHED ((TPM_CAPABILITY_AREA) 18)
|
||||
#define TPM_PF_MAINTENANCEDONE ((TPM_CAPABILITY_AREA) 19)
|
||||
#define TPM_PF_DISABLEFULLDALOGICINFO ((TPM_CAPABILITY_AREA) 20)
|
||||
|
||||
//
|
||||
// Part 2, section 7.2: TPM_STCLEAR_FLAGS
|
||||
@ -655,10 +664,11 @@ typedef struct tdTPM_STANY_FLAGS{
|
||||
//
|
||||
// Part 2, section 7.4: TPM_PERMANENT_DATA
|
||||
//
|
||||
//#define TPM_MIN_COUNTERS 4 // the minimum number of counters is 4
|
||||
//#define TPM_DELEGATE_KEY TPM_KEY
|
||||
//#define TPM_NUM_PCR 16
|
||||
//#define TPM_MAX_NV_WRITE_NOOWNER 64
|
||||
#define TPM_MIN_COUNTERS 4 // the minimum number of counters is 4
|
||||
#define TPM_DELEGATE_KEY TPM_KEY
|
||||
#define TPM_NUM_PCR 16
|
||||
#define TPM_MAX_NV_WRITE_NOOWNER 64
|
||||
|
||||
//typedef struct tdTPM_PERMANENT_DATA
|
||||
//{
|
||||
// TPM_STRUCTURE_TAG tag;
|
||||
@ -686,20 +696,62 @@ typedef struct tdTPM_STANY_FLAGS{
|
||||
// UINT32 noOwnerNVWrite;
|
||||
// TPM_CMK_DELEGATE restrictDelegate;
|
||||
// TPM_DAA_TPM_SEED tpmDAASeed;
|
||||
// TPM_NONCE daaProff;
|
||||
// TPM_KEY daaBlobKey;
|
||||
//} TPM_PERMANENT_DATA;
|
||||
|
||||
//
|
||||
// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability
|
||||
//
|
||||
#define TPM_PD_REVMAJOR ((TPM_CAPABILITY_AREA) 1)
|
||||
#define TPM_PD_REVMINOR ((TPM_CAPABILITY_AREA) 2)
|
||||
#define TPM_PD_TPMPROOF ((TPM_CAPABILITY_AREA) 3)
|
||||
#define TPM_PD_OWNERAUTH ((TPM_CAPABILITY_AREA) 4)
|
||||
#define TPM_PD_OPERATORAUTH ((TPM_CAPABILITY_AREA) 5)
|
||||
#define TPM_PD_MANUMAINTPUB ((TPM_CAPABILITY_AREA) 6)
|
||||
#define TPM_PD_ENDORSEMENTKEY ((TPM_CAPABILITY_AREA) 7)
|
||||
#define TPM_PD_SRK ((TPM_CAPABILITY_AREA) 8)
|
||||
#define TPM_PD_DELEGATEKEY ((TPM_CAPABILITY_AREA) 9)
|
||||
#define TPM_PD_CONTEXTKEY ((TPM_CAPABILITY_AREA) 10)
|
||||
#define TPM_PD_AUDITMONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 11)
|
||||
#define TPM_PD_MONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 12)
|
||||
#define TPM_PD_PCRATTRIB ((TPM_CAPABILITY_AREA) 13)
|
||||
#define TPM_PD_ORDINALAUDITSTATUS ((TPM_CAPABILITY_AREA) 14)
|
||||
#define TPM_PD_AUTHDIR ((TPM_CAPABILITY_AREA) 15)
|
||||
#define TPM_PD_RNGSTATE ((TPM_CAPABILITY_AREA) 16)
|
||||
#define TPM_PD_FAMILYTABLE ((TPM_CAPABILITY_AREA) 17)
|
||||
#define TPM_DELEGATETABLE ((TPM_CAPABILITY_AREA) 18)
|
||||
#define TPM_PD_EKRESET ((TPM_CAPABILITY_AREA) 19)
|
||||
#define TPM_PD_MAXNVBUFSIZE ((TPM_CAPABILITY_AREA) 20)
|
||||
#define TPM_PD_LASTFAMILYID ((TPM_CAPABILITY_AREA) 21)
|
||||
#define TPM_PD_NOOWNERNVWRITE ((TPM_CAPABILITY_AREA) 22)
|
||||
#define TPM_PD_RESTRICTDELEGATE ((TPM_CAPABILITY_AREA) 23)
|
||||
#define TPM_PD_TPMDAASEED ((TPM_CAPABILITY_AREA) 24)
|
||||
#define TPM_PD_DAAPROOF ((TPM_CAPABILITY_AREA) 25)
|
||||
|
||||
//
|
||||
// Part 2, section 7.5: TPM_STCLEAR_DATA
|
||||
// available inside TPM only
|
||||
//
|
||||
//typedef struct tdTPM_STCLEAR_DATA
|
||||
//{
|
||||
// TPM_STRUCTURE_TAG tag;
|
||||
// TPM_NONCE contextNonceKey;
|
||||
// TPM_COUNT_ID countID;
|
||||
// UINT32 ownerReference;
|
||||
// BOOLEAN disableResetLock;
|
||||
//} TPM_STCLEAR_DATA;
|
||||
typedef struct tdTPM_STCLEAR_DATA{
|
||||
TPM_STRUCTURE_TAG tag;
|
||||
TPM_NONCE contextNonceKey;
|
||||
TPM_COUNT_ID countID;
|
||||
UINT32 ownerReference;
|
||||
BOOLEAN disableResetLock;
|
||||
TPM_PCRVALUE PCR[TPM_NUM_PCR];
|
||||
UINT32 deferredPhysicalPresence;
|
||||
}TPM_STCLEAR_DATA;
|
||||
|
||||
//
|
||||
// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability
|
||||
//
|
||||
#define TPM_SD_CONTEXTNONCEKEY ((TPM_CAPABILITY_AREA)0x00000001)
|
||||
#define TPM_SD_COUNTID ((TPM_CAPABILITY_AREA)0x00000002)
|
||||
#define TPM_SD_OWNERREFERENCE ((TPM_CAPABILITY_AREA)0x00000003)
|
||||
#define TPM_SD_DISABLERESETLOCK ((TPM_CAPABILITY_AREA)0x00000004)
|
||||
#define TPM_SD_PCR ((TPM_CAPABILITY_AREA)0x00000005)
|
||||
#define TPM_SD_DEFERREDPHYSICALPRESENCE ((TPM_CAPABILITY_AREA)0x00000006)
|
||||
|
||||
//
|
||||
// Part 2, section 7.6: TPM_STANY_DATA
|
||||
@ -716,6 +768,16 @@ typedef struct tdTPM_STANY_FLAGS{
|
||||
// TPM_SESSION_DATA sessions[TPM_MIN_SESSIONS];
|
||||
//} TPM_STANY_DATA;
|
||||
|
||||
//
|
||||
// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability
|
||||
//
|
||||
#define TPM_AD_CONTEXTNONCESESSION ((TPM_CAPABILITY_AREA) 1)
|
||||
#define TPM_AD_AUDITDIGEST ((TPM_CAPABILITY_AREA) 2)
|
||||
#define TPM_AD_CURRENTTICKS ((TPM_CAPABILITY_AREA) 3)
|
||||
#define TPM_AD_CONTEXTCOUNT ((TPM_CAPABILITY_AREA) 4)
|
||||
#define TPM_AD_CONTEXTLIST ((TPM_CAPABILITY_AREA) 5)
|
||||
#define TPM_AD_SESSIONS ((TPM_CAPABILITY_AREA) 6)
|
||||
|
||||
//
|
||||
// Part 2, section 8: PCR Structures
|
||||
//
|
||||
@ -1137,7 +1199,9 @@ typedef struct tdTPM_AUDIT_EVENT_OUT
|
||||
//
|
||||
// Part 2, section 16: Return Codes
|
||||
//
|
||||
#define TPM_BASE 0
|
||||
#ifndef TPM_BASE
|
||||
#error "TPM Error Codes require definition of TPM_BASE"
|
||||
#endif
|
||||
|
||||
#define TPM_VENDOR_ERROR TPM_Vendor_Specific32
|
||||
#define TPM_NON_FATAL 0x00000800
|
||||
@ -1498,12 +1562,14 @@ typedef struct tdTPM_NV_DATA_PUBLIC
|
||||
//
|
||||
|
||||
//
|
||||
// Part 2, section 20.3: Owner Permissions Settings for per1 bits
|
||||
// Part 2, section 20.2.1: Owner Permissions Settings for per1 bits
|
||||
//
|
||||
#define TPM_DELEGATE_SetOrdinalAuditStatus (((UINT32)1)<<30)
|
||||
#define TPM_DELEGATE_DirWriteAuth (((UINT32)1)<<29)
|
||||
#define TPM_DELEGATE_CMK_ApproveMA (((UINT32)1)<<28)
|
||||
#define TPM_DELEGATE_NV_WriteValue (((UINT32)1)<<27)
|
||||
#define TPM_DELEGATE_CMK_CreateTicket (((UINT32)1)<<26)
|
||||
#define TPM_DELEGATE_NV_ReadValue (((UINT32)1)<<25)
|
||||
#define TPM_DELEGATE_Delegate_LoadOwnerDelegation (((UINT32)1)<<24)
|
||||
#define TPM_DELEGATE_DAA_Join (((UINT32)1)<<23)
|
||||
#define TPM_DELEGATE_AuthorizeMigrationKey (((UINT32)1)<<22)
|
||||
@ -1514,6 +1580,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
|
||||
#define TPM_DELEGATE_ResetLockValue (((UINT32)1)<<17)
|
||||
#define TPM_DELEGATE_OwnerClear (((UINT32)1)<<16)
|
||||
#define TPM_DELEGATE_DisableOwnerClear (((UINT32)1)<<15)
|
||||
#define TPM_DELEGATE_NV_DefineSpace (((UINT32)1)<<14)
|
||||
#define TPM_DELEGATE_OwnerSetDisable (((UINT32)1)<<13)
|
||||
#define TPM_DELEGATE_SetCapability (((UINT32)1)<<12)
|
||||
#define TPM_DELEGATE_MakeIdentity (((UINT32)1)<<11)
|
||||
@ -1530,7 +1597,7 @@ typedef struct tdTPM_NV_DATA_PUBLIC
|
||||
#define TPM_DELEGATE_DAA_Sign (((UINT32)1)<<0)
|
||||
|
||||
//
|
||||
// Part 2, section 20.3: Key Permissions Settings for per1 bits
|
||||
// Part 2, section 20.2.3: Key Permissions Settings for per1 bits
|
||||
//
|
||||
#define TPM_KEY_DELEGATE_CMK_ConvertMigration (((UINT32)1)<<28)
|
||||
#define TPM_KEY_DELEGATE_TickStampBlob (((UINT32)1)<<27)
|
||||
@ -1723,6 +1790,15 @@ typedef struct tdTPM_DELEGATE_KEY_BLOB
|
||||
#define TPM_CAP_PROP_INPUT_BUFFER ((TPM_CAPABILITY_AREA) 0x00000124)
|
||||
|
||||
//
|
||||
// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability
|
||||
//
|
||||
#define TPM_SET_PERM_FLAGS ((TPM_CAPABILITY_AREA) 0x00000001)
|
||||
#define TPM_SET_PERM_DATA ((TPM_CAPABILITY_AREA) 0x00000002)
|
||||
#define TPM_SET_STCLEAR_FLAGS ((TPM_CAPABILITY_AREA) 0x00000003)
|
||||
#define TPM_SET_STCLEAR_DATA ((TPM_CAPABILITY_AREA) 0x00000004)
|
||||
#define TPM_SET_STANY_FLAGS ((TPM_CAPABILITY_AREA) 0x00000005)
|
||||
#define TPM_SET_STANY_DATA ((TPM_CAPABILITY_AREA) 0x00000006)
|
||||
|
||||
// Part 2, section 21.6: TPM_CAP_VERSION_INFO
|
||||
// [size_is(vendorSpecificSize)] BYTE* vendorSpecific;
|
||||
//
|
||||
@ -1736,6 +1812,50 @@ typedef struct tdTPM_CAP_VERSION_INFO {
|
||||
UINT8 *vendorSpecific;
|
||||
} TPM_CAP_VERSION_INFO;
|
||||
|
||||
//
|
||||
// Part 2, section 21.10: TPM_DA_ACTION_TYPE
|
||||
//
|
||||
typedef struct tdTPM_DA_ACTION_TYPE {
|
||||
TPM_STRUCTURE_TAG tag;
|
||||
UINT32 actions;
|
||||
} TPM_DA_ACTION_TYPE;
|
||||
|
||||
#define TPM_DA_ACTION_FAILURE_MODE (((UINT32)1)<<3)
|
||||
#define TPM_DA_ACTION_DEACTIVATE (((UINT32)1)<<2)
|
||||
#define TPM_DA_ACTION_DISABLE (((UINT32)1)<<1)
|
||||
#define TPM_DA_ACTION_TIMEOUT (((UINT32)1)<<0)
|
||||
|
||||
//
|
||||
// Part 2, section 21.7: TPM_DA_INFO
|
||||
//
|
||||
typedef struct tdTPM_DA_INFO {
|
||||
TPM_STRUCTURE_TAG tag;
|
||||
TPM_DA_STATE state;
|
||||
UINT16 currentCount;
|
||||
UINT16 thresholdCount;
|
||||
TPM_DA_ACTION_TYPE actionAtThreshold;
|
||||
UINT32 actionDependValue;
|
||||
UINT32 vendorDataSize;
|
||||
UINT8 *vendorData;
|
||||
} TPM_DA_INFO;
|
||||
|
||||
//
|
||||
// Part 2, section 21.8: TPM_DA_INFO_LIMITED
|
||||
//
|
||||
typedef struct tdTPM_DA_INFO_LIMITED {
|
||||
TPM_STRUCTURE_TAG tag;
|
||||
TPM_DA_STATE state;
|
||||
TPM_DA_ACTION_TYPE actionAtThreshold;
|
||||
UINT32 vendorDataSize;
|
||||
UINT8 *vendorData;
|
||||
} TPM_DA_INFO_LIMITED;
|
||||
|
||||
//
|
||||
// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability
|
||||
//
|
||||
#define TPM_DA_STATE_INACTIVE ((UINT8)0x00)
|
||||
#define TPM_DA_STATE_ACTIVE ((UINT8)0x01)
|
||||
|
||||
//
|
||||
// Part 2, section 22: DAA Structures
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -25,6 +25,16 @@ Revision History
|
||||
|
||||
#include "pci22.h"
|
||||
|
||||
//
|
||||
// PCI_CLASS_MASS_STORAGE
|
||||
//
|
||||
#define PCI_CLASS_MASS_STORAGE_ATA 0x05
|
||||
|
||||
//
|
||||
// PCI_CLASS_SERIAL
|
||||
//
|
||||
#define PCI_CLASS_SERIAL_IB 0x06
|
||||
|
||||
#define PCI_EXP_MAX_CONFIG_OFFSET 0x1000
|
||||
#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -56,6 +56,7 @@ Revision History
|
||||
#define EFI_SCSI_OP_READ6 0x08
|
||||
#define EFI_SCSI_OP_READ10 0x28
|
||||
#define EFI_SCSI_OP_READ_CAPACITY 0x25
|
||||
#define EFI_SCSI_OP_READ_CAPACITY16 0x9e
|
||||
#define EFI_SCSI_OP_READ_DEFECT 0x37
|
||||
#define EFI_SCSI_OP_READ_LONG 0x3e
|
||||
#define EFI_SCSI_OP_REASSIGN_BLK 0x07
|
||||
@ -238,6 +239,27 @@ typedef struct {
|
||||
UINT8 BlockSize0;
|
||||
} EFI_SCSI_DISK_CAPACITY_DATA;
|
||||
|
||||
typedef struct {
|
||||
UINT8 LastLba7;
|
||||
UINT8 LastLba6;
|
||||
UINT8 LastLba5;
|
||||
UINT8 LastLba4;
|
||||
UINT8 LastLba3;
|
||||
UINT8 LastLba2;
|
||||
UINT8 LastLba1;
|
||||
UINT8 LastLba0;
|
||||
UINT8 BlockSize3;
|
||||
UINT8 BlockSize2;
|
||||
UINT8 BlockSize1;
|
||||
UINT8 BlockSize0;
|
||||
UINT8 Protection;
|
||||
UINT8 LogicPerPhysical;
|
||||
UINT8 LowestAlignLogic2;
|
||||
UINT8 LowestAlignLogic1;
|
||||
UINT8 Reserved[16];
|
||||
} EFI_SCSI_DISK_CAPACITY_DATA16;
|
||||
|
||||
|
||||
#pragma pack()
|
||||
//
|
||||
// Sense Key
|
||||
|
@ -27,18 +27,6 @@ Abstract:
|
||||
#ifndef _TIANO_H_
|
||||
#define _TIANO_H_
|
||||
|
||||
//
|
||||
// Check to make sure EFI_SPECIFICATION_VERSION and TIANO_RELEASE_VERSION are defined.
|
||||
//
|
||||
#if !defined(EFI_SPECIFICATION_VERSION)
|
||||
#error EFI_SPECIFICATION_VERSION not defined
|
||||
#elif !defined(TIANO_RELEASE_VERSION)
|
||||
#error TIANO_RELEASE_VERSION not defined
|
||||
#elif (TIANO_RELEASE_VERSION == 0)
|
||||
#error TIANO_RELEASE_VERSION can not be zero
|
||||
#elif (EFI_SPECIFICATION_VERSION <= 0x00020000)
|
||||
#define TIANO_EXTENSION_FLAG
|
||||
#endif
|
||||
|
||||
#include "TianoCommon.h"
|
||||
#include "TianoApi.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -50,6 +50,11 @@ Revision History
|
||||
//
|
||||
#define EFI_IFR_TIANO_GUID \
|
||||
{ 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} }
|
||||
//
|
||||
// ClassGuid for Front Page
|
||||
//
|
||||
#define EFI_HII_FRONT_PAGE_CLASS_GUID \
|
||||
{ 0x94d411b7, 0x7669, 0x45c3, {0xba, 0x3b, 0xf3, 0xa5, 0x8a, 0x71, 0x56, 0x81} }
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -34,8 +34,8 @@ COMPONENT_TYPE = LIBRARY
|
||||
memset.c | GCC
|
||||
|
||||
[sources.x64]
|
||||
x64/memcpyRep1.asm | MSFT
|
||||
x64/memcpyRep1.asm | INTEL
|
||||
x64/memcpyRep4.asm | MSFT
|
||||
x64/memcpyRep4.asm | INTEL
|
||||
x64/memsetRep4.asm | MSFT
|
||||
x64/memsetRep4.asm | INTEL
|
||||
memcpy.c | GCC
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -34,7 +34,7 @@ COMPONENT_TYPE = LIBRARY
|
||||
[sources.x64]
|
||||
memcpy.c | GCC
|
||||
|
||||
x64/memcpyRep1.asm
|
||||
x64/memcpyRep4.asm
|
||||
x64/memsetRep4.asm
|
||||
# x64/memcpy.asm
|
||||
# x64/memset.asm
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -502,13 +502,6 @@ Routine Description:
|
||||
|
||||
Initialize a Firmware Volume (FV) Media Device Path node.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability.
|
||||
|
||||
Arguments:
|
||||
|
||||
FvDevicePathNode - Pointer to a FV device path node to initialize
|
||||
@ -520,12 +513,6 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
|
||||
// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
|
||||
// EFI 1.10 and UEFI 2.10.
|
||||
//
|
||||
|
||||
FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
|
||||
FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
|
||||
SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
|
||||
@ -544,15 +531,6 @@ Routine Description:
|
||||
|
||||
Check to see if the Firmware Volume (FV) Media Device Path is valid.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability. The return value to this
|
||||
function points to a location in FvDevicePathNode and it does not allocate
|
||||
new memory for the GUID pointer that is returned.
|
||||
|
||||
Arguments:
|
||||
|
||||
FvDevicePathNode - Pointer to FV device path to check
|
||||
@ -564,11 +542,6 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
//
|
||||
// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
|
||||
// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
|
||||
// EFI 1.10 and UEFI 2.10.
|
||||
//
|
||||
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
|
||||
return &FvDevicePathNode->NameGuid;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -21,6 +21,18 @@ Abstract:
|
||||
|
||||
#include "Tiano.h"
|
||||
#include "EfiDriverLib.h"
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
OnStatusCodeInstall (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Global Interface for Debug Mask Protocol
|
||||
@ -50,6 +62,10 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
VOID *Registration;
|
||||
#endif
|
||||
|
||||
gST = SystemTable;
|
||||
|
||||
ASSERT (gST != NULL);
|
||||
@ -70,6 +86,21 @@ Returns:
|
||||
(VOID *) &gDebugMaskInterface
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
//
|
||||
// Register EFI_STATUS_CODE_PROTOCOL notify function
|
||||
//
|
||||
EfiLibCreateProtocolNotifyEvent (
|
||||
&gEfiStatusCodeRuntimeProtocolGuid,
|
||||
EFI_TPL_CALLBACK,
|
||||
OnStatusCodeInstall,
|
||||
NULL,
|
||||
&Registration
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Should be at EFI_D_INFO, but lets us know things are running
|
||||
//
|
||||
@ -78,55 +109,107 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC
|
||||
BOOLEAN
|
||||
EfiLibCompareLanguage (
|
||||
IN CHAR8 *Language1,
|
||||
IN CHAR8 *Language2
|
||||
IsIso639LanguageCode (
|
||||
IN CHAR8 *Languages
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Compare whether two names of languages are identical.
|
||||
Tests whether a language code has format of ISO639-2.
|
||||
|
||||
Arguments:
|
||||
|
||||
Language1 - Name of language 1
|
||||
Language2 - Name of language 2
|
||||
Languages - The language code to be tested.
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - same
|
||||
FALSE - not same
|
||||
TRUE - Language code format is ISO 639-2.
|
||||
FALSE - Language code format is not ISO 639-2.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
//
|
||||
// Find out format of Languages
|
||||
//
|
||||
for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';' && Languages[Index] != '-'; Index++);
|
||||
if (Languages[Index] != 0) {
|
||||
//
|
||||
// RFC4646 language code
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// No ';' and '-', it's either ISO639-2 code (list) or single RFC4646 code
|
||||
//
|
||||
if (Index == 2) {
|
||||
//
|
||||
// Single RFC4646 language code without country code, e.g. "en"
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Languages in format of ISO639-2
|
||||
//
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
EfiLibCompareLanguage (
|
||||
IN CHAR8 *Language1,
|
||||
IN CHAR8 *Language2
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Compare the first language instance of two language codes, either could be a
|
||||
single language code or a language code list. This function assume Language1
|
||||
and Language2 has the same language code format, i.e. either ISO639-2 or RFC4646.
|
||||
|
||||
Arguments:
|
||||
|
||||
Language1 - The first language code to be tested.
|
||||
Language2 - The second language code to be tested.
|
||||
|
||||
Returns:
|
||||
|
||||
TRUE - Language code match.
|
||||
FALSE - Language code mismatch.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
for (Index = 0; (Language1[Index] != 0) && (Language2[Index] != 0); Index++) {
|
||||
if (Language1[Index] != Language2[Index]) {
|
||||
return FALSE;
|
||||
}
|
||||
//
|
||||
// Compare first two bytes of language tag
|
||||
//
|
||||
if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (((Language1[Index] == 0) && (Language2[Index] == 0)) ||
|
||||
((Language1[Index] == 0) && (Language2[Index] != ';')) ||
|
||||
((Language1[Index] == ';') && (Language2[Index] != 0)) ||
|
||||
((Language1[Index] == ';') && (Language2[Index] != ';'))) {
|
||||
if (IsIso639LanguageCode (Language1)) {
|
||||
//
|
||||
// ISO639-2 language code, compare the third byte of language tag
|
||||
//
|
||||
return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
//
|
||||
// RFC4646 language code
|
||||
//
|
||||
for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++);
|
||||
if ((EfiAsciiStrnCmp (Language1, Language2, Index) == 0) && (Language2[Index] == 0 || Language2[Index] == ';')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
#else
|
||||
for (Index = 0; Index < 3; Index++) {
|
||||
if (Language1[Index] != Language2[Index]) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC
|
||||
@ -134,19 +217,39 @@ CHAR8 *
|
||||
NextSupportedLanguage (
|
||||
IN CHAR8 *Languages
|
||||
)
|
||||
{
|
||||
#ifdef LANGUAGE_RFC_3066 // LANGUAGE_RFC_3066
|
||||
for (; (*Languages != 0) && (*Languages != ';'); Languages++)
|
||||
;
|
||||
/*++
|
||||
|
||||
if (*Languages == ';') {
|
||||
Languages++;
|
||||
Routine Description:
|
||||
|
||||
Step to next language code of a language code list.
|
||||
|
||||
Arguments:
|
||||
|
||||
Languages - The language code list to traverse.
|
||||
|
||||
Returns:
|
||||
|
||||
Pointer to next language code or NULL terminator if it's the last one.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
if (IsIso639LanguageCode (Languages)) {
|
||||
//
|
||||
// ISO639-2 language code
|
||||
//
|
||||
return (Languages + 3);
|
||||
}
|
||||
|
||||
return Languages;
|
||||
#else // LANGUAGE_ISO_639_2
|
||||
return (Languages + 3);
|
||||
#endif
|
||||
//
|
||||
// Search in RFC4646 language code list
|
||||
//
|
||||
for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);
|
||||
if (Languages[Index] == ';') {
|
||||
Index++;
|
||||
}
|
||||
return (Languages + Index);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -217,7 +320,7 @@ Returns:
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SupportedLanguages = NextSupportedLanguage(SupportedLanguages);
|
||||
SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
|
||||
}
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
@ -326,7 +429,7 @@ Returns:
|
||||
//
|
||||
// Allocate space for a copy of the Language specifier
|
||||
//
|
||||
NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrLen(Language) + 1, Language);
|
||||
NewUnicodeStringTable[NumberOfEntries].Language = EfiLibAllocateCopyPool (EfiAsciiStrSize (Language), Language);
|
||||
if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
|
||||
gBS->FreePool (NewUnicodeStringTable);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@ -372,7 +475,7 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
SupportedLanguages = NextSupportedLanguage(SupportedLanguages);
|
||||
SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
|
||||
}
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -19,12 +19,85 @@ Abstract:
|
||||
|
||||
#include "Tiano.h"
|
||||
#include "EfiDriverLib.h"
|
||||
#include "PeiHob.h"
|
||||
#include EFI_PROTOCOL_DEFINITION (DevicePath)
|
||||
#include EFI_GUID_DEFINITION (Hob)
|
||||
#include EFI_GUID_DEFINITION (StatusCodeDataTypeId)
|
||||
#include EFI_ARCH_PROTOCOL_DEFINITION (StatusCode)
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
STATIC EFI_STATUS_CODE_PROTOCOL *gStatusCode = NULL;
|
||||
|
||||
EFI_REPORT_STATUS_CODE gReportStatusCode = NULL;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
OnStatusCodeInstall (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS_CODE_PROTOCOL *StatusCode;
|
||||
|
||||
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **) &StatusCode);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
gReportStatusCode = StatusCode->ReportStatusCode;
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
GetPeiProtocol (
|
||||
IN EFI_GUID *ProtocolGuid,
|
||||
IN VOID **Interface
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Searches for a Protocol Interface passed from PEI through a HOB
|
||||
|
||||
Arguments:
|
||||
|
||||
ProtocolGuid - The Protocol GUID to search for in the HOB List
|
||||
Interface - A pointer to the interface for the Protocol GUID
|
||||
|
||||
Returns:
|
||||
|
||||
EFI_SUCCESS - The Protocol GUID was found and its interface is returned in Interface
|
||||
EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PEI_HOB_POINTERS GuidHob;
|
||||
|
||||
//
|
||||
// Get Hob list
|
||||
//
|
||||
Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, (VOID **) &GuidHob.Raw);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
for (Status = EFI_NOT_FOUND; EFI_ERROR (Status);) {
|
||||
if (END_OF_HOB_LIST (GuidHob)) {
|
||||
Status = EFI_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
if (GET_HOB_TYPE (GuidHob) == EFI_HOB_TYPE_GUID_EXTENSION) {
|
||||
if (EfiCompareGuid (ProtocolGuid, &GuidHob.Guid->Name)) {
|
||||
Status = EFI_SUCCESS;
|
||||
*Interface = (VOID *) *(UINTN *) ((UINT8 *) (&GuidHob.Guid->Name) + sizeof (EFI_GUID));
|
||||
}
|
||||
}
|
||||
|
||||
GuidHob.Raw = GET_NEXT_HOB (GuidHob);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
EFI_STATUS
|
||||
@ -59,18 +132,28 @@ Returns:
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
if (gStatusCode == NULL) {
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
if (gReportStatusCode == NULL) {
|
||||
//
|
||||
// Because we've installed the protocol notification on EfiStatusCodeRuntimeProtocol,
|
||||
// running here indicates that the StatusCode driver has not started yet.
|
||||
//
|
||||
if (gBS == NULL) {
|
||||
//
|
||||
// Running here only when StatusCode driver never starts.
|
||||
//
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID **)&gStatusCode);
|
||||
if (EFI_ERROR (Status) || gStatusCode == NULL) {
|
||||
|
||||
//
|
||||
// Try to get the PEI version of ReportStatusCode.
|
||||
//
|
||||
Status = GetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **) &gReportStatusCode);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
Status = gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);
|
||||
return Status;
|
||||
Status = gReportStatusCode (Type, Value, Instance, CallerId, Data);
|
||||
#else
|
||||
if (gRT == NULL) {
|
||||
return EFI_UNSUPPORTED;
|
||||
@ -84,8 +167,8 @@ Returns:
|
||||
gRT->ReportStatusCode != NULL) {
|
||||
Status = gRT->ReportStatusCode (Type, Value, Instance, CallerId, Data);
|
||||
}
|
||||
return Status;
|
||||
#endif
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -41,7 +41,6 @@ COMPONENT_TYPE = LIBRARY
|
||||
$(EDK_SOURCE)/Foundation/Include/IndustryStandard
|
||||
$(EDK_SOURCE)/Foundation/Core/Dxe
|
||||
$(EDK_SOURCE)/Foundation/Library/Dxe/Include
|
||||
$(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib
|
||||
|
||||
[libraries.common]
|
||||
EfiGuidLib
|
||||
|
@ -30,7 +30,6 @@ COMPONENT_TYPE = LIBRARY
|
||||
[includes.common]
|
||||
$(EDK_SOURCE)/Foundation/Framework
|
||||
$(EDK_SOURCE)/Foundation/Efi
|
||||
# $(EFI_SOURCE)/Framework
|
||||
.
|
||||
$(EDK_SOURCE)/Foundation/Include
|
||||
$(EDK_SOURCE)/Foundation/Efi/Include
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -23,7 +23,6 @@ Revision History:
|
||||
|
||||
#define IS_DIGIT(Ch) (((Ch) >= L'0') && ((Ch) <= L'9'))
|
||||
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
EfiStringToValue (
|
||||
OUT UINT64 *Val,
|
||||
@ -37,8 +36,6 @@ Routine Description:
|
||||
The returned value is 64-bit.
|
||||
The string is expected in decimal format,
|
||||
the string is parsed and format verified.
|
||||
This function is missing from the libs. One day it maybe
|
||||
replaced with a lib function when it'll become available.
|
||||
|
||||
Arguments:
|
||||
Val - pointer to the variable to store the value to
|
||||
|
@ -106,10 +106,8 @@ typedef struct {
|
||||
CHAR16 *UnicodeString;
|
||||
} EFI_UNICODE_STRING_TABLE;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
#define LANGUAGE_RFC_3066
|
||||
#define LANGUAGE_CODE_ENGLISH "en-US"
|
||||
#else
|
||||
#define LANGUAGE_ISO_639_2
|
||||
#define LANGUAGE_CODE_ENGLISH "eng"
|
||||
#endif
|
||||
|
||||
@ -1179,13 +1177,6 @@ EfiInitializeFwVolDevicepathNode (
|
||||
Routine Description:
|
||||
Initialize a Firmware Volume (FV) Media Device Path node.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability.
|
||||
|
||||
Arguments:
|
||||
FvDevicePathNode - Pointer to a FV device path node to initialize
|
||||
NameGuid - FV file name to use in FvDevicePathNode
|
||||
@ -1202,15 +1193,6 @@ EfiGetNameGuidFromFwVolDevicePathNode (
|
||||
Routine Description:
|
||||
Check to see if the Firmware Volume (FV) Media Device Path is valid.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability. The return value to this
|
||||
function points to a location in FvDevicePathNode and it does not allocate
|
||||
new memory for the GUID pointer that is returned.
|
||||
|
||||
Arguments:
|
||||
FvDevicePathNode - Pointer to FV device path to check
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -202,4 +202,33 @@ Returns:
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
EfiStringToValue (
|
||||
OUT UINT64 *Val,
|
||||
IN CHAR16 *String,
|
||||
OUT UINT8 *EndIdx OPTIONAL
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Parses and converts Unicode string to decimal value.
|
||||
The returned value is 64-bit.
|
||||
The string is expected in decimal format,
|
||||
the string is parsed and format verified.
|
||||
|
||||
Arguments:
|
||||
Val - pointer to the variable to store the value to
|
||||
String - string that contains the value to parse and convert
|
||||
EndIdx - index on which the parsing stopped. It points to the
|
||||
first character that was not part of the returned Val.
|
||||
It's valid only if the function returns success.
|
||||
It's optional and it could be NULL.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - if successful
|
||||
EFI_INVALID_PARAMETER - if String is in unexpected format
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -41,7 +41,6 @@ COMPONENT_TYPE = LIBRARY
|
||||
$(EDK_SOURCE)/Foundation/Include/IndustryStandard
|
||||
$(EDK_SOURCE)/Foundation/Core/Dxe
|
||||
$(EDK_SOURCE)/Foundation/Library/Dxe/Include
|
||||
$(EDK_SOURCE)/Foundation/Library/Dxe/EfiDriverLib
|
||||
|
||||
[libraries.common]
|
||||
EfiGuidLib
|
||||
|
@ -37,6 +37,7 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = {
|
||||
},
|
||||
EFI_IFR_TIANO_GUID,
|
||||
},
|
||||
0,
|
||||
0
|
||||
},
|
||||
{
|
||||
@ -181,22 +182,23 @@ Returns:
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath;
|
||||
UINT64 MonotonicCount;
|
||||
|
||||
VendorDevicePath = EfiLibAllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);
|
||||
if (VendorDevicePath == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
gBS->GetNextMonotonicCount (&MonotonicCount);
|
||||
VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;
|
||||
//
|
||||
// Use memory address as unique ID to distinguish from different device paths
|
||||
//
|
||||
VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);
|
||||
|
||||
*DriverHandle = NULL;
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
VendorDevicePath
|
||||
VendorDevicePath,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
@ -240,7 +242,7 @@ Returns:
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
DevicePath
|
||||
);
|
||||
|
||||
gBS->FreePool (DevicePath);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -511,6 +513,7 @@ Arguments:
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully extract Class for specified Hii handle.
|
||||
EFI_NOT_FOUND - Class not found.
|
||||
|
||||
--*/
|
||||
{
|
||||
@ -525,10 +528,12 @@ Returns:
|
||||
UINT32 Offset2;
|
||||
UINT32 PackageListLength;
|
||||
EFI_HII_PACKAGE_HEADER PackageHeader;
|
||||
BOOLEAN ClassFound;
|
||||
|
||||
*Class = EFI_NON_DEVICE_CLASS;
|
||||
*FormSetTitle = 0;
|
||||
*FormSetHelp = 0;
|
||||
ClassFound = FALSE;
|
||||
|
||||
//
|
||||
// Locate HII Database protocol
|
||||
@ -574,7 +579,7 @@ Returns:
|
||||
Package = ((UINT8 *) HiiPackageList) + Offset;
|
||||
EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||
|
||||
if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) {
|
||||
if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
|
||||
//
|
||||
// Search Class Opcode in this Form Package
|
||||
//
|
||||
@ -602,6 +607,139 @@ Returns:
|
||||
//
|
||||
// Till now, we ought to have found the formset Opcode
|
||||
//
|
||||
ClassFound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
|
||||
}
|
||||
|
||||
if (Offset2 < PackageHeader.Length) {
|
||||
//
|
||||
// Target formset found
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Offset += PackageHeader.Length;
|
||||
}
|
||||
|
||||
gBS->FreePool (HiiPackageList);
|
||||
|
||||
return ClassFound ? EFI_SUCCESS : EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ExtractClassGuidFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
OUT UINT8 *NumberOfClassGuid,
|
||||
OUT EFI_GUID **ClassGuid,
|
||||
OUT EFI_STRING_ID *FormSetTitle,
|
||||
OUT EFI_STRING_ID *FormSetHelp
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Extract formset ClassGuid for given HII handle.
|
||||
|
||||
Arguments:
|
||||
HiiHandle - Hii handle
|
||||
NumberOfClassGuid - Number of ClassGuid
|
||||
ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid
|
||||
FormSetTitle - Formset title string
|
||||
FormSetHelp - Formset help string
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully extract Class for specified Hii handle.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN BufferSize;
|
||||
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
|
||||
UINT8 *Package;
|
||||
UINT8 *FormSet;
|
||||
UINT8 *OpCodeData;
|
||||
UINT32 Offset;
|
||||
UINT32 Offset2;
|
||||
UINT32 PackageListLength;
|
||||
EFI_HII_PACKAGE_HEADER PackageHeader;
|
||||
|
||||
if (NumberOfClassGuid == NULL || ClassGuid == NULL || FormSetTitle == NULL || FormSetHelp == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*NumberOfClassGuid = 0;
|
||||
*ClassGuid = NULL;
|
||||
*FormSetTitle = 0;
|
||||
*FormSetHelp = 0;
|
||||
|
||||
//
|
||||
// Locate HII Database protocol
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiHiiDatabaseProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &HiiDatabase
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Get HII PackageList
|
||||
//
|
||||
BufferSize = 0;
|
||||
HiiPackageList = NULL;
|
||||
Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
HiiPackageList = EfiLibAllocatePool (BufferSize);
|
||||
ASSERT (HiiPackageList != NULL);
|
||||
|
||||
Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Form package from this HII package List
|
||||
//
|
||||
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
|
||||
Offset2 = 0;
|
||||
FormSet = NULL;
|
||||
EfiCopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32));
|
||||
|
||||
while (Offset < PackageListLength) {
|
||||
Package = ((UINT8 *) HiiPackageList) + Offset;
|
||||
EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||
|
||||
if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
|
||||
//
|
||||
// Search Class Opcode in this Form Package
|
||||
//
|
||||
Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
|
||||
while (Offset2 < PackageHeader.Length) {
|
||||
OpCodeData = Package + Offset2;
|
||||
|
||||
if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
|
||||
//
|
||||
// Find FormSet OpCode
|
||||
//
|
||||
EfiCopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
|
||||
EfiCopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
|
||||
if (((EFI_IFR_OP_HEADER *) OpCodeData)->Length > ((UINTN) &((EFI_IFR_FORM_SET *) 0)->Flags)) {
|
||||
//
|
||||
// New version of formset OpCode
|
||||
//
|
||||
*NumberOfClassGuid = (UINT8) (((EFI_IFR_FORM_SET *) OpCodeData)->Flags & 0x3);
|
||||
*ClassGuid = EfiLibAllocateCopyPool (
|
||||
*NumberOfClassGuid * sizeof (EFI_GUID),
|
||||
((EFI_IFR_FORM_SET *) OpCodeData)->ClassGuid
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -26,7 +26,6 @@ Abstract:
|
||||
//
|
||||
UINT16 mFakeConfigHdr[] = L"GUID=00000000000000000000000000000000&NAME=0000&PATH=0";
|
||||
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
GetPackageDataFromPackageList (
|
||||
IN EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList,
|
||||
@ -72,7 +71,6 @@ GetPackageDataFromPackageList (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
UpdateFormPackageData (
|
||||
IN EFI_GUID *FormSetGuid,
|
||||
@ -86,17 +84,15 @@ UpdateFormPackageData (
|
||||
OUT UINT32 *TempBufferSize
|
||||
)
|
||||
{
|
||||
UINTN AddSize;
|
||||
UINT8 *BufferPos;
|
||||
EFI_HII_PACKAGE_HEADER PackageHeader;
|
||||
UINTN Offset;
|
||||
UINT32 Offset;
|
||||
EFI_IFR_OP_HEADER *IfrOpHdr;
|
||||
BOOLEAN GetFormSet;
|
||||
BOOLEAN GetForm;
|
||||
UINT8 ExtendOpCode;
|
||||
UINT16 LabelNumber;
|
||||
BOOLEAN Updated;
|
||||
EFI_IFR_OP_HEADER *AddOpCode;
|
||||
|
||||
if ((TempBuffer == NULL) || (TempBufferSize == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@ -122,7 +118,7 @@ UpdateFormPackageData (
|
||||
GetForm = FALSE;
|
||||
Updated = FALSE;
|
||||
|
||||
while (Offset < PackageHeader.Length) {
|
||||
while (!Updated && Offset < PackageHeader.Length) {
|
||||
EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);
|
||||
BufferPos += IfrOpHdr->Length;
|
||||
*TempBufferSize += IfrOpHdr->Length;
|
||||
@ -132,6 +128,8 @@ UpdateFormPackageData (
|
||||
if (FormSetGuid != NULL) {
|
||||
if (EfiCompareMem (&((EFI_IFR_FORM_SET *) IfrOpHdr)->Guid, FormSetGuid, sizeof (EFI_GUID)) == 0) {
|
||||
GetFormSet = TRUE;
|
||||
} else {
|
||||
GetFormSet = FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -139,17 +137,24 @@ UpdateFormPackageData (
|
||||
case EFI_IFR_FORM_OP:
|
||||
if (EfiCompareMem (&((EFI_IFR_FORM *) IfrOpHdr)->FormId, &FormId, sizeof (EFI_FORM_ID)) == 0) {
|
||||
GetForm = TRUE;
|
||||
} else {
|
||||
GetForm = FALSE;
|
||||
}
|
||||
break;
|
||||
|
||||
case EFI_IFR_GUID_OP :
|
||||
if (!GetFormSet || !GetForm || Updated) {
|
||||
if (!GetFormSet || !GetForm) {
|
||||
//
|
||||
// Go to the next Op-Code
|
||||
//
|
||||
Offset += IfrOpHdr->Length;
|
||||
IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid)) {
|
||||
//
|
||||
// GUID mismatch, skip this op-code
|
||||
//
|
||||
break;
|
||||
}
|
||||
|
||||
ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
|
||||
@ -158,29 +163,18 @@ UpdateFormPackageData (
|
||||
//
|
||||
// Go to the next Op-Code
|
||||
//
|
||||
Offset += IfrOpHdr->Length;
|
||||
IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if (Insert && (Data != NULL)) {
|
||||
if (Insert) {
|
||||
//
|
||||
// insert the DataCount amount of opcodes to TempBuffer if Data is NULL remove
|
||||
// DataCount amount of opcodes unless runing into a label.
|
||||
// Insert data after current Label, skip myself
|
||||
//
|
||||
AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;
|
||||
AddSize = 0;
|
||||
while (AddSize < Data->Offset) {
|
||||
EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);
|
||||
BufferPos += AddOpCode->Length;
|
||||
*TempBufferSize += AddOpCode->Length;
|
||||
|
||||
AddSize += AddOpCode->Length;
|
||||
AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);
|
||||
}
|
||||
Offset += IfrOpHdr->Length;
|
||||
IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
|
||||
} else {
|
||||
//
|
||||
// Search the next Label.
|
||||
// Replace data between two paired Label, try to find the next Label.
|
||||
//
|
||||
while (TRUE) {
|
||||
Offset += IfrOpHdr->Length;
|
||||
@ -193,33 +187,28 @@ UpdateFormPackageData (
|
||||
IfrOpHdr = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (IfrOpHdr) + IfrOpHdr->Length);
|
||||
if (IfrOpHdr->OpCode == EFI_IFR_GUID_OP) {
|
||||
ExtendOpCode = ((EFI_IFR_GUID_LABEL *) IfrOpHdr)->ExtendOpCode;
|
||||
if (ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {
|
||||
if (EfiCompareGuid (&((EFI_IFR_GUID *) IfrOpHdr)->Guid, &mIfrVendorGuid) && ExtendOpCode == EFI_IFR_EXTEND_OP_LABEL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Data != NULL) {
|
||||
AddOpCode = (EFI_IFR_OP_HEADER *)Data->Data;
|
||||
AddSize = 0;
|
||||
while (AddSize < Data->Offset) {
|
||||
EfiCopyMem (BufferPos, AddOpCode, AddOpCode->Length);
|
||||
BufferPos += AddOpCode->Length;
|
||||
*TempBufferSize += AddOpCode->Length;
|
||||
|
||||
AddSize += AddOpCode->Length;
|
||||
AddOpCode = (EFI_IFR_OP_HEADER *) ((CHAR8 *) (AddOpCode) + AddOpCode->Length);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// copy the next label
|
||||
//
|
||||
EfiCopyMem (BufferPos, IfrOpHdr, IfrOpHdr->Length);
|
||||
BufferPos += IfrOpHdr->Length;
|
||||
*TempBufferSize += IfrOpHdr->Length;
|
||||
}
|
||||
|
||||
//
|
||||
// Fill in the update data
|
||||
//
|
||||
if (Data != NULL) {
|
||||
EfiCopyMem (BufferPos, Data->Data, Data->Offset);
|
||||
BufferPos += Data->Offset;
|
||||
*TempBufferSize += Data->Offset;
|
||||
}
|
||||
|
||||
//
|
||||
// Copy the reset data
|
||||
//
|
||||
EfiCopyMem (BufferPos, IfrOpHdr, PackageHeader.Length - Offset);
|
||||
*TempBufferSize += PackageHeader.Length - Offset;
|
||||
|
||||
Updated = TRUE;
|
||||
break;
|
||||
default :
|
||||
@ -249,6 +238,68 @@ Fail:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibInitUpdateData (
|
||||
IN OUT EFI_HII_UPDATE_DATA *UpdateData,
|
||||
IN UINT32 BufferSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This function initialize the data structure for dynamic opcode.
|
||||
|
||||
Arguments:
|
||||
UpdateData - The adding data;
|
||||
BufferSize - Length of the buffer to fill dynamic opcodes.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Update data is initialized.
|
||||
EFI_INVALID_PARAMETER - UpdateData is NULL.
|
||||
EFI_OUT_OF_RESOURCES - No enough memory to allocate.
|
||||
|
||||
--*/
|
||||
{
|
||||
if (UpdateData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
UpdateData->BufferSize = BufferSize;
|
||||
UpdateData->Offset = 0;
|
||||
UpdateData->Data = EfiLibAllocatePool (BufferSize);
|
||||
|
||||
return (UpdateData->Data != NULL) ? EFI_SUCCESS : EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibFreeUpdateData (
|
||||
IN EFI_HII_UPDATE_DATA *UpdateData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This function free the resource of update data.
|
||||
|
||||
Arguments:
|
||||
UpdateData - The adding data;
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Resource in UpdateData is released.
|
||||
EFI_INVALID_PARAMETER - UpdateData is NULL.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (UpdateData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = gBS->FreePool (UpdateData->Data);
|
||||
UpdateData->Data = NULL;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibUpdateForm (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
@ -339,7 +390,7 @@ Returns:
|
||||
Status = GetPackageDataFromPackageList (HiiPackageList, Index, &PackageLength, &Package);
|
||||
if (Status == EFI_SUCCESS) {
|
||||
EfiCopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||
if ((PackageHeader.Type == EFI_HII_PACKAGE_FORM) && !Updated) {
|
||||
if ((PackageHeader.Type == EFI_HII_PACKAGE_FORMS) && !Updated) {
|
||||
Status = UpdateFormPackageData (FormSetGuid, FormId, Package, PackageLength, Label, Insert, Data, (UINT8 **)&TempBuffer, &TempBufferSize);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (FormSetGuid == NULL) {
|
||||
@ -644,7 +695,376 @@ ExtractDefault(
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
STATIC
|
||||
EFI_STATUS
|
||||
ExtractBlockName (
|
||||
IN UINT8 *Buffer,
|
||||
OUT CHAR16 **BlockName
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Extract block name from the array generated by VFR compiler. The name of
|
||||
this array is "Vfr + <StorageName> + BlockName", e.g. "VfrMyIfrNVDataBlockName".
|
||||
Format of this array is:
|
||||
Array length | 4-bytes
|
||||
Offset | 2-bytes
|
||||
Width | 2-bytes
|
||||
Offset | 2-bytes
|
||||
Width | 2-bytes
|
||||
... ...
|
||||
|
||||
Arguments:
|
||||
Buffer - Array generated by VFR compiler.
|
||||
BlockName - The returned <BlockName>
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - Run out of memory resource.
|
||||
EFI_INVALID_PARAMETER - Buffer is NULL or BlockName is NULL.
|
||||
EFI_SUCCESS - Operation successful.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
UINT32 Length;
|
||||
UINT32 BlockNameNumber;
|
||||
UINTN HexStringBufferLen;
|
||||
CHAR16 *StringPtr;
|
||||
|
||||
if ((Buffer == NULL) || (BlockName == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate number of Offset/Width pair
|
||||
//
|
||||
EfiCopyMem (&Length, Buffer, sizeof (UINT32));
|
||||
BlockNameNumber = (Length - sizeof (UINT32)) / (sizeof (UINT16) * 2);
|
||||
|
||||
//
|
||||
// <BlockName> ::= &OFFSET=1234&WIDTH=1234
|
||||
// | 8 | 4 | 7 | 4 |
|
||||
//
|
||||
StringPtr = EfiLibAllocateZeroPool ((BlockNameNumber * (8 + 4 + 7 + 4) + 1) * sizeof (CHAR16));
|
||||
*BlockName = StringPtr;
|
||||
if (StringPtr == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
Buffer += sizeof (UINT32);
|
||||
for (Index = 0; Index < BlockNameNumber; Index++) {
|
||||
EfiStrCpy (StringPtr, L"&OFFSET=");
|
||||
StringPtr += 8;
|
||||
|
||||
HexStringBufferLen = 5;
|
||||
BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
|
||||
Buffer += sizeof (UINT16);
|
||||
StringPtr += 4;
|
||||
|
||||
EfiStrCpy (StringPtr, L"&WIDTH=");
|
||||
StringPtr += 7;
|
||||
|
||||
HexStringBufferLen = 5;
|
||||
BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
|
||||
Buffer += sizeof (UINT16);
|
||||
StringPtr += 4;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ExtractBlockConfig (
|
||||
IN UINT8 *Buffer,
|
||||
OUT CHAR16 **BlockConfig
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Extract block config from the array generated by VFR compiler. The name of
|
||||
this array is "Vfr + <StorageName> + Default<HexCh>4", e.g. "VfrMyIfrNVDataDefault0000".
|
||||
|
||||
Arguments:
|
||||
Buffer - Array generated by VFR compiler.
|
||||
BlockConfig - The returned <BlockConfig>
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - Run out of memory resource.
|
||||
EFI_INVALID_PARAMETER - Buffer is NULL or BlockConfig is NULL.
|
||||
EFI_SUCCESS - Operation successful.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINT32 Length;
|
||||
UINT16 Width;
|
||||
UINTN HexStringBufferLen;
|
||||
CHAR16 *StringPtr;
|
||||
UINT8 *BufferEnd;
|
||||
CHAR16 *StringEnd;
|
||||
EFI_STATUS Status;
|
||||
|
||||
if ((Buffer == NULL) || (BlockConfig == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate length of AltResp string
|
||||
// Format of Default value array is:
|
||||
// Array length | 4-bytes
|
||||
// Offset | 2-bytes
|
||||
// Width | 2-bytes
|
||||
// Value | Variable length
|
||||
// Offset | 2-bytes
|
||||
// Width | 2-bytes
|
||||
// Value | Variable length
|
||||
// ... ...
|
||||
// When value is 1 byte in length, overhead of AltResp string will be maximum,
|
||||
// BlockConfig ::= <&OFFSET=1234&WIDTH=1234&VALUE=12>+
|
||||
// | 8 | 4 | 7 | 4 | 7 |2|
|
||||
// so the maximum length of BlockConfig could be calculated as:
|
||||
// (ArrayLength / 5) * (8 + 4 + 7 + 4 + 7 + 2) = ArrayLength * 6.4 < ArrayLength * 7
|
||||
//
|
||||
EfiCopyMem (&Length, Buffer, sizeof (UINT32));
|
||||
BufferEnd = Buffer + Length;
|
||||
StringPtr = EfiLibAllocatePool (Length * 7 * sizeof (CHAR16));
|
||||
*BlockConfig = StringPtr;
|
||||
if (StringPtr == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
StringEnd = StringPtr + (Length * 7);
|
||||
|
||||
Buffer += sizeof (UINT32);
|
||||
while (Buffer < BufferEnd) {
|
||||
EfiStrCpy (StringPtr, L"&OFFSET=");
|
||||
StringPtr += 8;
|
||||
|
||||
HexStringBufferLen = 5;
|
||||
BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
|
||||
Buffer += sizeof (UINT16);
|
||||
StringPtr += 4;
|
||||
|
||||
EfiStrCpy (StringPtr, L"&WIDTH=");
|
||||
StringPtr += 7;
|
||||
|
||||
HexStringBufferLen = 5;
|
||||
BufToHexString (StringPtr, &HexStringBufferLen, Buffer, sizeof (UINT16));
|
||||
EfiCopyMem (&Width, Buffer, sizeof (UINT16));
|
||||
Buffer += sizeof (UINT16);
|
||||
StringPtr += 4;
|
||||
|
||||
EfiStrCpy (StringPtr, L"&VALUE=");
|
||||
StringPtr += 7;
|
||||
|
||||
HexStringBufferLen = StringEnd - StringPtr;
|
||||
Status = BufToHexString (StringPtr, &HexStringBufferLen, Buffer, Width);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
Buffer += Width;
|
||||
StringPtr += (Width * 2);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ConstructConfigAltResp (
|
||||
IN EFI_STRING ConfigRequest, OPTIONAL
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *ConfigAltResp,
|
||||
IN EFI_GUID *Guid,
|
||||
IN CHAR16 *Name,
|
||||
IN EFI_HANDLE *DriverHandle,
|
||||
IN VOID *BufferStorage,
|
||||
IN UINTN BufferStorageSize,
|
||||
IN VOID *BlockNameArray, OPTIONAL
|
||||
IN UINTN NumberAltCfg,
|
||||
...
|
||||
//IN UINT16 AltCfgId,
|
||||
//IN VOID *DefaultValueArray,
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Construct <ConfigAltResp> for a buffer storage.
|
||||
|
||||
Arguments:
|
||||
ConfigRequest - The Config request string. If set to NULL, all the
|
||||
configurable elements will be extracted from BlockNameArray.
|
||||
ConfigAltResp - The returned <ConfigAltResp>.
|
||||
Progress - On return, points to a character in the Request.
|
||||
Guid - GUID of the buffer storage.
|
||||
Name - Name of the buffer storage.
|
||||
DriverHandle - The DriverHandle which is used to invoke HiiDatabase
|
||||
protocol interface NewPackageList().
|
||||
BufferStorage - Content of the buffer storage.
|
||||
BufferStorageSize - Length in bytes of the buffer storage.
|
||||
BlockNameArray - Array generated by VFR compiler.
|
||||
NumberAltCfg - Number of Default value array generated by VFR compiler.
|
||||
The sequential input parameters will be number of
|
||||
AltCfgId and DefaultValueArray pairs. When set to 0,
|
||||
there will be no <AltResp>.
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - Run out of memory resource.
|
||||
EFI_INVALID_PARAMETER - ConfigAltResp is NULL.
|
||||
EFI_SUCCESS - Operation successful.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
CHAR16 *ConfigHdr;
|
||||
CHAR16 *BlockName;
|
||||
CHAR16 *DescHdr;
|
||||
CHAR16 *StringPtr;
|
||||
CHAR16 **AltCfg;
|
||||
UINT16 AltCfgId;
|
||||
VOID *DefaultValueArray;
|
||||
UINTN StrBufferLen;
|
||||
EFI_STRING ConfigResp;
|
||||
EFI_STRING TempStr;
|
||||
VA_LIST Args;
|
||||
UINTN AltRespLen;
|
||||
UINTN Index;
|
||||
BOOLEAN NeedFreeConfigRequest;
|
||||
EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
|
||||
|
||||
if (ConfigAltResp == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Construct <ConfigHdr> : "GUID=...&NAME=...&PATH=..."
|
||||
//
|
||||
ConfigHdr = NULL;
|
||||
StrBufferLen = 0;
|
||||
Status = ConstructConfigHdr (
|
||||
ConfigHdr,
|
||||
&StrBufferLen,
|
||||
Guid,
|
||||
Name,
|
||||
DriverHandle
|
||||
);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
ConfigHdr = EfiLibAllocateZeroPool (StrBufferLen);
|
||||
Status = ConstructConfigHdr (
|
||||
ConfigHdr,
|
||||
&StrBufferLen,
|
||||
Guid,
|
||||
Name,
|
||||
DriverHandle
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Construct <ConfigResp>
|
||||
//
|
||||
NeedFreeConfigRequest = FALSE;
|
||||
if (ConfigRequest == NULL) {
|
||||
//
|
||||
// If ConfigRequest is set to NULL, export all configurable elements in BlockNameArray
|
||||
//
|
||||
Status = ExtractBlockName (BlockNameArray, &BlockName);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
StrBufferLen = EfiStrSize (ConfigHdr);
|
||||
StrBufferLen = StrBufferLen + EfiStrSize (BlockName) - sizeof (CHAR16);
|
||||
ConfigRequest = EfiLibAllocateZeroPool (StrBufferLen);
|
||||
EfiStrCpy (ConfigRequest, ConfigHdr);
|
||||
EfiStrCat (ConfigRequest, BlockName);
|
||||
NeedFreeConfigRequest = TRUE;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
Status = HiiConfigRouting->BlockToConfig (
|
||||
HiiConfigRouting,
|
||||
ConfigRequest,
|
||||
BufferStorage,
|
||||
BufferStorageSize,
|
||||
&ConfigResp,
|
||||
(Progress == NULL) ? &TempStr : Progress
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Construct <AltResp>
|
||||
//
|
||||
DescHdr = EfiLibAllocateZeroPool (NumberAltCfg * 16 * sizeof (CHAR16));
|
||||
StringPtr = DescHdr;
|
||||
AltCfg = EfiLibAllocateZeroPool (NumberAltCfg * sizeof (CHAR16 *));
|
||||
AltRespLen = 0;
|
||||
VA_START (Args, NumberAltCfg);
|
||||
for (Index = 0; Index < NumberAltCfg; Index++) {
|
||||
AltCfgId = (UINT16) VA_ARG (Args, UINT16);
|
||||
DefaultValueArray = (UINT8 *) VA_ARG (Args, VOID *);
|
||||
|
||||
//
|
||||
// '&' <ConfigHdr>
|
||||
//
|
||||
AltRespLen += (EfiStrLen (ConfigHdr) + 1);
|
||||
|
||||
StringPtr = DescHdr + Index * 16;
|
||||
EfiStrCpy (StringPtr, L"&ALTCFG=");
|
||||
AltRespLen += (8 + sizeof (UINT16) * 2);
|
||||
|
||||
StrBufferLen = 5;
|
||||
BufToHexString (StringPtr + 8, &StrBufferLen, (UINT8 *) &AltCfgId, sizeof (UINT16));
|
||||
Status = ExtractBlockConfig (DefaultValueArray, &AltCfg[Index]);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
AltRespLen += EfiStrLen (AltCfg[Index]);
|
||||
}
|
||||
VA_END (Args);
|
||||
|
||||
//
|
||||
// Generate the final <ConfigAltResp>
|
||||
//
|
||||
StrBufferLen = (EfiStrLen ((CHAR16 *) ConfigResp) + AltRespLen + 1) * sizeof (CHAR16);
|
||||
TempStr = EfiLibAllocateZeroPool (StrBufferLen);
|
||||
*ConfigAltResp = TempStr;
|
||||
if (TempStr == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// <ConfigAltResp> ::= <ConfigResp> ['&' <AltResp>]*
|
||||
//
|
||||
EfiStrCpy (TempStr, ConfigResp);
|
||||
for (Index = 0; Index < NumberAltCfg; Index++) {
|
||||
EfiStrCat (TempStr, L"&");
|
||||
EfiStrCat (TempStr, ConfigHdr);
|
||||
EfiStrCat (TempStr, DescHdr + Index * 16);
|
||||
EfiStrCat (TempStr, AltCfg[Index]);
|
||||
|
||||
gBS->FreePool (AltCfg[Index]);
|
||||
}
|
||||
|
||||
if (NeedFreeConfigRequest) {
|
||||
gBS->FreePool (ConfigRequest);
|
||||
}
|
||||
gBS->FreePool (ConfigHdr);
|
||||
gBS->FreePool (ConfigResp);
|
||||
gBS->FreePool (DescHdr);
|
||||
gBS->FreePool (AltCfg);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
VOID
|
||||
SwapBuffer (
|
||||
IN OUT UINT8 *Buffer,
|
||||
@ -668,7 +1088,7 @@ Returns:
|
||||
UINT8 Temp;
|
||||
UINTN SwapCount;
|
||||
|
||||
SwapCount = (BufferSize - 1) / 2;
|
||||
SwapCount = BufferSize / 2;
|
||||
for (Index = 0; Index < SwapCount; Index++) {
|
||||
Temp = Buffer[Index];
|
||||
Buffer[Index] = Buffer[BufferSize - 1 - Index];
|
||||
@ -676,6 +1096,31 @@ Returns:
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
ToLower (
|
||||
IN OUT CHAR16 *Str
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Converts the unicode character of the string from uppercase to lowercase.
|
||||
|
||||
Arguments:
|
||||
Str - String to be converted
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
CHAR16 *Ptr;
|
||||
|
||||
for (Ptr = Str; *Ptr != L'\0'; Ptr++) {
|
||||
if (*Ptr >= L'A' && *Ptr <= L'Z') {
|
||||
*Ptr = (CHAR16) (*Ptr - L'A' + L'a');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
BufferToHexString (
|
||||
IN OUT CHAR16 *Str,
|
||||
@ -704,10 +1149,14 @@ Returns:
|
||||
NewBuffer = EfiLibAllocateCopyPool (BufferSize, Buffer);
|
||||
SwapBuffer (NewBuffer, BufferSize);
|
||||
|
||||
StrBufferLen = (BufferSize + 1) * sizeof (CHAR16);
|
||||
StrBufferLen = BufferSize * 2 + 1;
|
||||
Status = BufToHexString (Str, &StrBufferLen, NewBuffer, BufferSize);
|
||||
|
||||
gBS->FreePool (NewBuffer);
|
||||
//
|
||||
// Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.
|
||||
//
|
||||
ToLower (Str);
|
||||
|
||||
return Status;
|
||||
}
|
||||
@ -741,12 +1190,138 @@ Returns:
|
||||
ConvertedStrLen = 0;
|
||||
Status = HexStringToBuf (Buffer, BufferSize, Str, &ConvertedStrLen);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
SwapBuffer (Buffer, ConvertedStrLen);
|
||||
SwapBuffer (Buffer, (ConvertedStrLen + 1) / 2);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ConfigStringToUnicode (
|
||||
IN OUT CHAR16 *UnicodeString,
|
||||
IN OUT UINTN *StrBufferLen,
|
||||
IN CHAR16 *ConfigString
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert binary representation Config string (e.g. "0041004200430044") to the
|
||||
original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
|
||||
"&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
|
||||
|
||||
Arguments:
|
||||
UnicodeString - Original Unicode string.
|
||||
StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
|
||||
Includes tailing '\0' character.
|
||||
On output:
|
||||
If return EFI_SUCCESS, containing length of Unicode string buffer.
|
||||
If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
|
||||
ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Routine success.
|
||||
EFI_BUFFER_TOO_SMALL - The string buffer is too small.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
UINTN Len;
|
||||
UINTN BufferSize;
|
||||
CHAR16 BackupChar;
|
||||
|
||||
Len = EfiStrLen (ConfigString) / 4;
|
||||
BufferSize = (Len + 1) * sizeof (CHAR16);
|
||||
|
||||
if (*StrBufferLen < BufferSize) {
|
||||
*StrBufferLen = BufferSize;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
*StrBufferLen = BufferSize;
|
||||
|
||||
for (Index = 0; Index < Len; Index++) {
|
||||
BackupChar = ConfigString[4];
|
||||
ConfigString[4] = L'\0';
|
||||
|
||||
HexStringToBuf ((UINT8 *) UnicodeString, &BufferSize, ConfigString, NULL);
|
||||
|
||||
ConfigString[4] = BackupChar;
|
||||
|
||||
ConfigString += 4;
|
||||
UnicodeString += 1;
|
||||
}
|
||||
|
||||
//
|
||||
// Add tailing '\0' character
|
||||
//
|
||||
*UnicodeString = L'\0';
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
UnicodeToConfigString (
|
||||
IN OUT CHAR16 *ConfigString,
|
||||
IN OUT UINTN *StrBufferLen,
|
||||
IN CHAR16 *UnicodeString
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert Unicode string to binary representation Config string, e.g.
|
||||
"ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
|
||||
"&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
|
||||
|
||||
Arguments:
|
||||
ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
|
||||
StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
|
||||
Includes tailing '\0' character.
|
||||
On output:
|
||||
If return EFI_SUCCESS, containing length of Unicode string buffer.
|
||||
If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
|
||||
UnicodeString - Original Unicode string.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Routine success.
|
||||
EFI_BUFFER_TOO_SMALL - The string buffer is too small.
|
||||
|
||||
--*/
|
||||
{
|
||||
UINTN Index;
|
||||
UINTN Len;
|
||||
UINTN BufferSize;
|
||||
CHAR16 *String;
|
||||
|
||||
Len = EfiStrLen (UnicodeString);
|
||||
BufferSize = (Len * 4 + 1) * sizeof (CHAR16);
|
||||
|
||||
if (*StrBufferLen < BufferSize) {
|
||||
*StrBufferLen = BufferSize;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
*StrBufferLen = BufferSize;
|
||||
String = ConfigString;
|
||||
|
||||
for (Index = 0; Index < Len; Index++) {
|
||||
BufToHexString (ConfigString, &BufferSize, (UINT8 *) UnicodeString, 2);
|
||||
|
||||
ConfigString += 4;
|
||||
UnicodeString += 1;
|
||||
}
|
||||
|
||||
//
|
||||
// Add tailing '\0' character
|
||||
//
|
||||
*ConfigString = L'\0';
|
||||
|
||||
//
|
||||
// Convert the uppercase to lowercase since <HexAf> is defined in lowercase format.
|
||||
//
|
||||
ToLower (String);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
ConstructConfigHdr (
|
||||
IN OUT CHAR16 *ConfigHdr,
|
||||
@ -811,10 +1386,10 @@ Returns:
|
||||
DevicePathSize = EfiDevicePathSize (DevicePath);
|
||||
|
||||
//
|
||||
// GUID=<HexCh>32&NAME=<Alpha>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
|
||||
// | 5 | 32 | 6 | NameStrLen | 6 | DevicePathStrLen |
|
||||
// GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
|
||||
// | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
|
||||
//
|
||||
BufferSize = (5 + 32 + 6 + NameStrLen + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
|
||||
BufferSize = (5 + 32 + 6 + NameStrLen * 4 + 6 + DevicePathSize * 2 + 1) * sizeof (CHAR16);
|
||||
if (*StrBufferLen < BufferSize) {
|
||||
*StrBufferLen = BufferSize;
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
@ -829,11 +1404,15 @@ Returns:
|
||||
BufferToHexString (StrPtr, (UINT8 *) Guid, sizeof (EFI_GUID));
|
||||
StrPtr += 32;
|
||||
|
||||
//
|
||||
// Convert name string, e.g. name "ABCD" => "&NAME=0041004200430044"
|
||||
//
|
||||
EfiStrCpy (StrPtr, L"&NAME=");
|
||||
StrPtr += 6;
|
||||
if (Name != NULL) {
|
||||
EfiStrCpy (StrPtr, Name);
|
||||
StrPtr += NameStrLen;
|
||||
BufferSize = (NameStrLen * 4 + 1) * sizeof (CHAR16);
|
||||
UnicodeToConfigString (StrPtr, &BufferSize, Name);
|
||||
StrPtr += (NameStrLen * 4);
|
||||
}
|
||||
|
||||
EfiStrCpy (StrPtr, L"&PATH=");
|
||||
@ -843,6 +1422,105 @@ Returns:
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
IsConfigHdrMatch (
|
||||
IN EFI_STRING ConfigString,
|
||||
IN EFI_GUID *StorageGuid, OPTIONAL
|
||||
IN CHAR16 *StorageName OPTIONAL
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
|
||||
|
||||
Arguments:
|
||||
ConfigString - Either <ConfigRequest> or <ConfigResp>.
|
||||
StorageGuid - GUID of the storage.
|
||||
StorageName - Name of the stoarge.
|
||||
|
||||
Returns:
|
||||
TRUE - Routing information is correct in ConfigString.
|
||||
FALSE - Routing information is incorrect in ConfigString.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
BOOLEAN Match;
|
||||
EFI_GUID Guid;
|
||||
CHAR16 *Name;
|
||||
CHAR16 *StrPtr;
|
||||
UINTN BufferSize;
|
||||
|
||||
//
|
||||
// <ConfigHdr> ::=
|
||||
// GUID=<HexCh>32&NAME=<Char>NameStrLen&PATH=<HexChar>DevicePathStrLen <NULL>
|
||||
// | 5 | 32 | 6 | NameStrLen*4 | 6 | DevicePathStrLen | 1 |
|
||||
//
|
||||
if (EfiStrLen (ConfigString) <= (5 + 32 + 6)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Compare GUID
|
||||
//
|
||||
if (StorageGuid != NULL) {
|
||||
|
||||
StrPtr = ConfigString + 5 + 32;
|
||||
if (*StrPtr != L'&') {
|
||||
return FALSE;
|
||||
}
|
||||
*StrPtr = L'\0';
|
||||
|
||||
BufferSize = sizeof (EFI_GUID);
|
||||
Status = HexStringToBuffer (
|
||||
(UINT8 *) &Guid,
|
||||
&BufferSize,
|
||||
ConfigString + 5
|
||||
);
|
||||
*StrPtr = L'&';
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!EfiCompareGuid (&Guid, StorageGuid)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Compare Name
|
||||
//
|
||||
Match = TRUE;
|
||||
if (StorageName != NULL) {
|
||||
StrPtr = ConfigString + 5 + 32 + 6;
|
||||
while (*StrPtr != L'\0' && *StrPtr != L'&') {
|
||||
StrPtr++;
|
||||
}
|
||||
if (*StrPtr != L'&') {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*StrPtr = L'\0';
|
||||
BufferSize = (EfiStrLen (ConfigString + 5 + 32 + 6) + 1) * sizeof (CHAR16);
|
||||
Name = EfiLibAllocatePool (BufferSize);
|
||||
ASSERT (Name != NULL);
|
||||
Status = ConfigStringToUnicode (
|
||||
Name,
|
||||
&BufferSize,
|
||||
ConfigString + 5 + 32 + 6
|
||||
);
|
||||
*StrPtr = L'&';
|
||||
|
||||
if (EFI_ERROR (Status) || (EfiStrCmp (Name, StorageName) != 0)) {
|
||||
Match = FALSE;
|
||||
}
|
||||
gBS->FreePool (Name);
|
||||
}
|
||||
|
||||
return Match;
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
FindBlockName (
|
||||
IN OUT CHAR16 *String,
|
||||
@ -965,7 +1643,7 @@ Returns:
|
||||
HeaderLen = EfiStrLen (ConfigHdr);
|
||||
|
||||
BufferLen = 0x4000;
|
||||
ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);
|
||||
ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
|
||||
|
||||
StringPtr = ConfigResp + HeaderLen;
|
||||
*StringPtr = L'&';
|
||||
@ -981,7 +1659,7 @@ Returns:
|
||||
);
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
gBS->FreePool (ConfigResp);
|
||||
ConfigResp = EfiLibAllocateZeroPool (BufferLen + HeaderLen);
|
||||
ConfigResp = EfiLibAllocateZeroPool (BufferLen + (HeaderLen + 1) * sizeof (CHAR16));
|
||||
|
||||
StringPtr = ConfigResp + HeaderLen;
|
||||
*StringPtr = L'&';
|
||||
@ -1116,7 +1794,7 @@ Returns:
|
||||
&Progress
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
gBS->FreePool (ConfigResp);
|
||||
gBS->FreePool (ConfigRequest);
|
||||
return Status;
|
||||
}
|
||||
|
||||
@ -1133,9 +1811,10 @@ Returns:
|
||||
&BufferSize,
|
||||
StringPtr,
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL
|
||||
VariableGuid,
|
||||
VariableName
|
||||
);
|
||||
gBS->FreePool (ConfigResp);
|
||||
gBS->FreePool (ConfigRequest);
|
||||
return Status;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -78,10 +78,13 @@ typedef struct {
|
||||
} IFR_OPTION;
|
||||
#pragma pack()
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
UINT32 MonotonicCount;
|
||||
UINT32 Reserved;
|
||||
UINT64 UniqueId;
|
||||
} HII_VENDOR_DEVICE_PATH_NODE;
|
||||
#pragma pack()
|
||||
|
||||
typedef struct {
|
||||
HII_VENDOR_DEVICE_PATH_NODE Node;
|
||||
@ -280,7 +283,8 @@ CreateOneOfOptionOpCode (
|
||||
IN IFR_OPTION *OptionsList,
|
||||
IN UINT8 Type,
|
||||
IN OUT EFI_HII_UPDATE_DATA *Data
|
||||
);
|
||||
)
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
CreateOneOfOpCode (
|
||||
@ -599,6 +603,53 @@ ExtractDefault(
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConstructConfigAltResp (
|
||||
IN EFI_STRING ConfigRequest, OPTIONAL
|
||||
OUT EFI_STRING *Progress,
|
||||
OUT EFI_STRING *ConfigAltResp,
|
||||
IN EFI_GUID *Guid,
|
||||
IN CHAR16 *Name,
|
||||
IN EFI_HANDLE *DriverHandle,
|
||||
IN VOID *BufferStorage,
|
||||
IN UINTN BufferStorageSize,
|
||||
IN VOID *BlockNameArray, OPTIONAL
|
||||
IN UINTN NumberAltCfg,
|
||||
...
|
||||
//IN UINT16 AltCfgId,
|
||||
//IN VOID *DefaultValueArray,
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Construct <ConfigAltResp> for a buffer storage.
|
||||
|
||||
Arguments:
|
||||
ConfigRequest - The Config request string. If set to NULL, all the
|
||||
configurable elements will be extracted from BlockNameArray.
|
||||
ConfigAltResp - The returned <ConfigAltResp>.
|
||||
Progress - On return, points to a character in the Request.
|
||||
Guid - GUID of the buffer storage.
|
||||
Name - Name of the buffer storage.
|
||||
DriverHandle - The DriverHandle which is used to invoke HiiDatabase
|
||||
protocol interface NewPackageList().
|
||||
BufferStorage - Content of the buffer storage.
|
||||
BufferStorageSize - Length in bytes of the buffer storage.
|
||||
BlockNameArray - Array generated by VFR compiler.
|
||||
NumberAltCfg - Number of Default value array generated by VFR compiler.
|
||||
The sequential input parameters will be number of
|
||||
AltCfgId and DefaultValueArray pairs. When set to 0,
|
||||
there will be no <AltResp>.
|
||||
|
||||
Returns:
|
||||
EFI_OUT_OF_RESOURCES - Run out of memory resource.
|
||||
EFI_INVALID_PARAMETER - ConfigAltResp is NULL.
|
||||
EFI_SUCCESS - Operation successful.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ExtractGuidFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
@ -643,6 +694,49 @@ Returns:
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ExtractClassGuidFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
OUT UINT8 *NumberOfClassGuid,
|
||||
OUT EFI_GUID **ClassGuid,
|
||||
OUT EFI_STRING_ID *FormSetTitle,
|
||||
OUT EFI_STRING_ID *FormSetHelp
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Extract formset ClassGuid for given HII handle.
|
||||
|
||||
Arguments:
|
||||
HiiHandle - Hii handle
|
||||
NumberOfClassGuid - Number of ClassGuid
|
||||
ClassGuid - Pointer to callee allocated buffer, an array of ClassGuid
|
||||
FormSetTitle - Formset title string
|
||||
FormSetHelp - Formset help string
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Successfully extract Class for specified Hii handle.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
VOID
|
||||
ToLower (
|
||||
IN OUT CHAR16 *Str
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Converts the unicode character from uppercase to lowercase.
|
||||
|
||||
Arguments:
|
||||
Str - String to be converted
|
||||
|
||||
Returns:
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
BufferToHexString (
|
||||
IN OUT CHAR16 *Str,
|
||||
@ -689,6 +783,64 @@ Returns:
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConfigStringToUnicode (
|
||||
IN OUT CHAR16 *UnicodeString,
|
||||
IN OUT UINTN *StrBufferLen,
|
||||
IN CHAR16 *ConfigString
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert binary representation Config string (e.g. "0041004200430044") to the
|
||||
original string (e.g. "ABCD"). Config string appears in <ConfigHdr> (i.e.
|
||||
"&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
|
||||
|
||||
Arguments:
|
||||
UnicodeString - Original Unicode string.
|
||||
StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
|
||||
Includes tailing '\0' character.
|
||||
On output:
|
||||
If return EFI_SUCCESS, containing length of Unicode string buffer.
|
||||
If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
|
||||
ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Routine success.
|
||||
EFI_BUFFER_TOO_SMALL - The string buffer is too small.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
UnicodeToConfigString (
|
||||
IN OUT CHAR16 *ConfigString,
|
||||
IN OUT UINTN *StrBufferLen,
|
||||
IN CHAR16 *UnicodeString
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Convert Unicode string to binary representation Config string, e.g.
|
||||
"ABCD" => "0041004200430044". Config string appears in <ConfigHdr> (i.e.
|
||||
"&NAME=<string>"), or Name/Value pair in <ConfigBody> (i.e. "label=<string>").
|
||||
|
||||
Arguments:
|
||||
ConfigString - Binary representation of Unicode String, <string> := (<HexCh>4)+
|
||||
StrBufferLen - On input: Length in bytes of buffer to hold the Unicode string.
|
||||
Includes tailing '\0' character.
|
||||
On output:
|
||||
If return EFI_SUCCESS, containing length of Unicode string buffer.
|
||||
If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired.
|
||||
UnicodeString - Original Unicode string.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Routine success.
|
||||
EFI_BUFFER_TOO_SMALL - The string buffer is too small.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
ConstructConfigHdr (
|
||||
IN OUT CHAR16 *ConfigHdr,
|
||||
@ -719,6 +871,29 @@ Returns:
|
||||
--*/
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
IsConfigHdrMatch (
|
||||
IN EFI_STRING ConfigString,
|
||||
IN EFI_GUID *StorageGuid, OPTIONAL
|
||||
IN CHAR16 *StorageName OPTIONAL
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
Determines if the Routing data (Guid and Name) is correct in <ConfigHdr>.
|
||||
|
||||
Arguments:
|
||||
ConfigString - Either <ConfigRequest> or <ConfigResp>.
|
||||
StorageGuid - GUID of the storage.
|
||||
StorageName - Name of the stoarge.
|
||||
|
||||
Returns:
|
||||
TRUE - Routing information is correct in ConfigString.
|
||||
FALSE - Routing information is incorrect in ConfigString.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
BOOLEAN
|
||||
FindBlockName (
|
||||
IN OUT CHAR16 *String,
|
||||
@ -1093,6 +1268,47 @@ Returns:
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibInitUpdateData (
|
||||
IN OUT EFI_HII_UPDATE_DATA *UpdateData,
|
||||
IN UINT32 BufferSize
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This function initialize the data structure for dynamic opcode.
|
||||
|
||||
Arguments:
|
||||
UpdateData - The adding data;
|
||||
BufferSize - Length of the buffer to fill dynamic opcodes.
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Update data is initialized.
|
||||
EFI_INVALID_PARAMETER - UpdateData is NULL.
|
||||
EFI_OUT_OF_RESOURCES - No enough memory to allocate.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibFreeUpdateData (
|
||||
IN EFI_HII_UPDATE_DATA *UpdateData
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
This function free the resource of update data.
|
||||
|
||||
Arguments:
|
||||
UpdateData - The adding data;
|
||||
|
||||
Returns:
|
||||
EFI_SUCCESS - Resource in UpdateData is released.
|
||||
EFI_INVALID_PARAMETER - UpdateData is NULL.
|
||||
|
||||
--*/
|
||||
;
|
||||
|
||||
EFI_STATUS
|
||||
IfrLibUpdateForm (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -394,9 +394,7 @@ CreateOrderedListOpCode (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if ((OrderedListFlags != 0) &&
|
||||
(OrderedListFlags != EFI_IFR_UNIQUE_SET) &&
|
||||
(OrderedListFlags != EFI_IFR_NO_EMPTY_SET)) {
|
||||
if ((OrderedListFlags & (~(EFI_IFR_UNIQUE_SET | EFI_IFR_NO_EMPTY_SET))) != 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
@ -555,20 +555,37 @@ IfrLibNewString (
|
||||
if (Languages == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (StringId == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
*StringId = 0;
|
||||
|
||||
LangStrings = Languages;
|
||||
while (*LangStrings != 0) {
|
||||
GetNextLanguage (&LangStrings, Lang);
|
||||
|
||||
Status = gIfrLibHiiString->NewString (
|
||||
gIfrLibHiiString,
|
||||
PackageList,
|
||||
StringId,
|
||||
Lang,
|
||||
NULL,
|
||||
String,
|
||||
NULL
|
||||
);
|
||||
if (*StringId == 0) {
|
||||
Status = gIfrLibHiiString->NewString (
|
||||
gIfrLibHiiString,
|
||||
PackageList,
|
||||
StringId,
|
||||
Lang,
|
||||
NULL,
|
||||
String,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gIfrLibHiiString->SetString (
|
||||
gIfrLibHiiString,
|
||||
PackageList,
|
||||
*StringId,
|
||||
Lang,
|
||||
String,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
break;
|
||||
}
|
||||
|
@ -23,6 +23,81 @@ Abstract:
|
||||
#include "EdkIIGlueDxe.h"
|
||||
#include "Common/EdkIIGlueDependencies.h"
|
||||
|
||||
//
|
||||
// Check definitions in .inf file to determine __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
|
||||
//
|
||||
// __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
|
||||
// 1: only install ComponentName, DriverConfiguration and DriverDiagnostics
|
||||
// 2: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2
|
||||
// 3: install all including ComponentName, DriverConfiguration, DriverDiagnostics AND
|
||||
// ComponentName2, DriverConfiguration2 and DriverDiagnostics2
|
||||
// 4: install automatically according to EFI_SPECIFICATION_VERSION:
|
||||
// if EFI_SPECIFICATION_VERSION < 0x00020000: only install ComponentName, DriverConfiguration and DriverDiagnostics
|
||||
// if EFI_SPECIFICATION_VERSION >= 0x00020000: only install ComponentName2, DriverConfiguration2 and DriverDiagnostics2
|
||||
//
|
||||
#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
|
||||
#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
|
||||
#undef __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
|
||||
#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) || defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1
|
||||
#endif
|
||||
|
||||
#if !defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__) && !defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 3
|
||||
#endif
|
||||
|
||||
//
|
||||
// To use Auto-Select, it must be:
|
||||
// 1. both Protocol and Protocol2 are defined
|
||||
// 2. The Protocol and Protocol2 must use same names, for example, gDriverControllerName as __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__ and __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__
|
||||
//
|
||||
#if defined(__EDKII_GLUE_DRIVER_MODEL_AUTO_SELECT_PROTOCOLS_BY_EFI_VERSION__)
|
||||
#if !(defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_1_DEFINED__) && defined(__EDKII_GLUE_DRIVER_MODEL_VERSION_2_DEFINED__))
|
||||
#error "To use Auto-Select please define both Protocol and Protocol2 instances"
|
||||
#endif
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 4
|
||||
#endif
|
||||
|
||||
#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 4)
|
||||
#undef __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 2
|
||||
#else
|
||||
#define __EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
|
||||
UINT8 _gEdkIIGlueDriverModelProtocolSelection = 1;
|
||||
#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
|
||||
UINT8 _gEdkIIGlueDriverModelProtocolSelection = 2;
|
||||
#elif (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
|
||||
UINT8 _gEdkIIGlueDriverModelProtocolSelection = 3;
|
||||
#else
|
||||
UINT8 _gEdkIIGlueDriverModelProtocolSelection = 0;
|
||||
#endif
|
||||
|
||||
STATIC EFI_EVENT _mDriverExitBootServicesNotifyEvent;
|
||||
|
||||
//
|
||||
@ -31,27 +106,38 @@ STATIC EFI_EVENT _mDriverExitBootServicesNotifyEvent;
|
||||
// In case where multiple Driver Model protocols need to be installed in a single driver,
|
||||
// manually edit this file and compile/link the modified file with the driver.
|
||||
//
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__)
|
||||
extern EFI_DRIVER_BINDING_PROTOCOL __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;
|
||||
#else
|
||||
#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__)
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__)
|
||||
extern EFI_DRIVER_CONFIGURATION_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__)
|
||||
extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
|
||||
#if (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2) || (__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 3)
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__)
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL __EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__)
|
||||
extern EFI_DRIVER_CONFIGURATION2_PROTOCOL __EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__)
|
||||
extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL __EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {
|
||||
{
|
||||
#ifdef __EDKII_GLUE_DRIVER_BINDING_PROTOCOL_INSTANCE__
|
||||
@ -60,23 +146,41 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverMode
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
|
||||
&__EDKII_GLUE_COMPONENT_NAME_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
|
||||
&__EDKII_GLUE_DRIVER_CONFIGURATION_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__
|
||||
#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 2)
|
||||
&__EDKII_GLUE_DRIVER_DIAGNOSTICS_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
|
||||
&__EDKII_GLUE_COMPONENT_NAME2_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
|
||||
&__EDKII_GLUE_DRIVER_CONFIGURATION2_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
|
||||
#if defined(__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__) && !(__EDKII_GLUE_DRIVER_MODEL_PROTOCOL_SELECTION__ == 1)
|
||||
&__EDKII_GLUE_DRIVER_DIAGNOSTICS2_PROTOCOL_INSTANCE__,
|
||||
#else
|
||||
NULL,
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@ -249,15 +353,15 @@ ProcessLibraryConstructorList (
|
||||
// NOTE: the constructors must be called according to dependency order
|
||||
//
|
||||
// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
|
||||
// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
|
||||
// DxeServicesTableLib DxeServicesTableLibConstructor()
|
||||
// DxeIoLibCpuIo IoLibConstructor()
|
||||
// DxeSalLib DxeSalLibConstructor(), IPF only
|
||||
// EdkDxeRuntimeDriverLib RuntimeDriverLibConstruct()
|
||||
// DxeHobLib HobLibConstructor()
|
||||
// UefiDriverModelLib UefiDriverModelLibConstructor()
|
||||
// DxeSmbusLib SmbusLibConstructor()
|
||||
// DxeServicesTableLib DxeServicesTableLibConstructor()
|
||||
// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
|
||||
// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
|
||||
// UefiDriverModelLib UefiDriverModelLibConstructor()
|
||||
// DxeHobLib HobLibConstructor()
|
||||
// DxeSmbusLib SmbusLibConstructor()
|
||||
//
|
||||
|
||||
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
|
||||
@ -265,6 +369,16 @@ ProcessLibraryConstructorList (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
|
||||
Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
|
||||
Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
|
||||
Status = IoLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
@ -280,8 +394,8 @@ ProcessLibraryConstructorList (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
|
||||
Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
|
||||
Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
@ -290,16 +404,6 @@ ProcessLibraryConstructorList (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
|
||||
Status = DxeServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
|
||||
Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_HOB_LIB__
|
||||
Status = HobLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
@ -83,23 +83,18 @@ ProcessLibraryConstructorList (
|
||||
// here
|
||||
//
|
||||
// UefiBootServicesTableLib UefiBootServicesTableLibConstructor()
|
||||
// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
|
||||
// DxeServicesTableLib DxeServicesTableLibConstructor()
|
||||
// DxeIoLibCpuIo IoLibConstructor
|
||||
// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
|
||||
// DxeHobLib HobLibConstructor()
|
||||
// DxeSmbusLib SmbusLibConstructor()
|
||||
// DxeServicesTableLib DxeServicesTableLibConstructor()
|
||||
// UefiRuntimeServicesTableLib UefiRuntimeServicesTableLibConstructor()
|
||||
// SmmRuntimeDxeReportStatusCodeLib ReportStatusCodeLibConstruct()
|
||||
// check here: check lib usage
|
||||
|
||||
#ifdef __EDKII_GLUE_UEFI_BOOT_SERVICES_TABLE_LIB__
|
||||
Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
|
||||
Status = IoLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_UEFI_RUNTIME_SERVICES_TABLE_LIB__
|
||||
Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
@ -110,6 +105,11 @@ ProcessLibraryConstructorList (
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_DXE_IO_LIB_CPU_IO__
|
||||
Status = IoLibConstructor (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
#endif
|
||||
|
||||
#ifdef __EDKII_GLUE_SMM_RUNTIME_DXE_REPORT_STATUS_CODE_LIB__
|
||||
Status = ReportStatusCodeLibConstruct (ImageHandle, SystemTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
@ -320,16 +320,28 @@ _ModuleEntryPoint (
|
||||
EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath;
|
||||
EFI_HANDLE Handle;
|
||||
|
||||
//
|
||||
// Call constructor for all libraries
|
||||
//
|
||||
ProcessLibraryConstructorList (ImageHandle, SystemTable);
|
||||
|
||||
//
|
||||
// Cache a pointer to the Boot Services Table
|
||||
//
|
||||
mBS = SystemTable->BootServices;
|
||||
|
||||
//
|
||||
// Initialize gBS as ASSERT needs it
|
||||
// Both DxeReportStatusCodeLib and SmmRuntimeDxeReportStatusCodeLib implementations
|
||||
// Can handle this cleanly before lib constructors are called.
|
||||
//
|
||||
gBS = mBS;
|
||||
|
||||
//
|
||||
// Retrieve the Loaded Image Protocol
|
||||
//
|
||||
Status = mBS->HandleProtocol (
|
||||
ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID*)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Retrieve SMM Base Protocol
|
||||
//
|
||||
@ -349,27 +361,6 @@ _ModuleEntryPoint (
|
||||
//
|
||||
//
|
||||
if (!InSmm) {
|
||||
//
|
||||
// Retrieve the Loaded Image Protocol
|
||||
//
|
||||
Status = mBS->HandleProtocol (
|
||||
ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID*)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Install the unload handler
|
||||
//
|
||||
Status = mBS->HandleProtocol (
|
||||
ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
LoadedImage->Unload = _DriverUnloadHandler;
|
||||
|
||||
//
|
||||
// Retrieve the Device Path Protocol from the DeviceHandle tha this driver was loaded from
|
||||
//
|
||||
@ -391,18 +382,34 @@ _ModuleEntryPoint (
|
||||
//
|
||||
Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
} else {
|
||||
|
||||
//
|
||||
// Call the list of driver entry points
|
||||
//
|
||||
#ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
|
||||
Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
|
||||
#else
|
||||
Status = EFI_SUCCESS;
|
||||
#endif
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Call constructor for all libraries
|
||||
//
|
||||
ProcessLibraryConstructorList (ImageHandle, SystemTable);
|
||||
|
||||
//
|
||||
// Install the unload handler
|
||||
//
|
||||
Status = mBS->HandleProtocol (
|
||||
ImageHandle,
|
||||
&gEfiLoadedImageProtocolGuid,
|
||||
(VOID **)&LoadedImage
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
LoadedImage->Unload = _DriverUnloadHandler;
|
||||
|
||||
//
|
||||
// Call the list of driver entry points
|
||||
//
|
||||
#ifdef __EDKII_GLUE_MODULE_ENTRY_POINT__
|
||||
Status = (__EDKII_GLUE_MODULE_ENTRY_POINT__ (ImageHandle, SystemTable));
|
||||
#else
|
||||
Status = EFI_SUCCESS;
|
||||
#endif
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
ProcessLibraryDestructorList (ImageHandle, SystemTable);
|
||||
}
|
||||
|
@ -332,6 +332,15 @@ Abstract:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// DxeServicesTableLib
|
||||
//
|
||||
#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
|
||||
#ifndef __EDKII_GLUE_UEFI_LIB__
|
||||
#define __EDKII_GLUE_UEFI_LIB__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// UefiLib
|
||||
//
|
||||
@ -489,15 +498,6 @@ Abstract:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// DxeServicesTableLib
|
||||
//
|
||||
#ifdef __EDKII_GLUE_DXE_SERVICES_TABLE_LIB__
|
||||
#ifndef __EDKII_GLUE_UEFI_LIB__
|
||||
#define __EDKII_GLUE_UEFI_LIB__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// BasePrintLib
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -33,10 +33,15 @@ Abstract:
|
||||
// 0x6000 - support EBC. Feb, 2007
|
||||
// 0x7000 - size reduction, Jun, 2007
|
||||
// 0x7100 - backward compatibility supported, Jun, 2007
|
||||
// 0x8000 - Driver model protocols2 supported, May, 2008
|
||||
// 0x9000 - add SmmRuntimeDxeReportStatusCodeLib and OemHookStatusCodeLibNull, Feb, 2009
|
||||
// 0x9100 - change to use unique member RT variable names in various library instances, June, 2009
|
||||
// 0x9200 - Update LEGACY_BOOT and READY_TO_BOOT event handling in UefiLib, July, 2009
|
||||
// 0x9300 - Remove OemHookStatusCodeLibNull. SmmRuntimeDxeReportStatusCodeLib uses SMM StatusCode Protocol, Oct, 2009
|
||||
//
|
||||
// For reference only, don't change the value
|
||||
//
|
||||
#define EDKII_GLUE_LIBRARY_VERSION 0x7100
|
||||
#define EDKII_GLUE_LIBRARY_VERSION 0x9300
|
||||
|
||||
|
||||
//
|
||||
@ -120,7 +125,9 @@ Abstract:
|
||||
// This value is FSB Clock frequency. Its unit is Hz and its
|
||||
// default value is 200000000, that means FSB frequency is 200Mhz.
|
||||
//
|
||||
#ifndef EDKII_GLUE_FSBClock
|
||||
#define EDKII_GLUE_FSBClock 200000000
|
||||
#endif
|
||||
|
||||
//
|
||||
// post code property mask
|
||||
@ -142,7 +149,9 @@ Abstract:
|
||||
// The base address of IPF IO Block
|
||||
//
|
||||
#ifdef MDE_CPU_IPF
|
||||
#ifndef EDKII_GLUE_IoBlockBaseAddressForIpf
|
||||
#define EDKII_GLUE_IoBlockBaseAddressForIpf 0x0ffffc000000
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -173,4 +173,6 @@ Abstract:
|
||||
#include "Library/EdkIIGlueUefiLib.h"
|
||||
#include "Library/EdkIIGlueUefiRuntimeServicesTableLib.h"
|
||||
|
||||
extern UINT8 _gEdkIIGlueDriverModelProtocolSelection;
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -34,15 +34,14 @@ Abstract:
|
||||
// Data structure that declares pointers to the Driver Model
|
||||
// Protocols.
|
||||
//
|
||||
typedef struct {
|
||||
const EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
const EFI_COMPONENT_NAME2_PROTOCOL *ComponentName;
|
||||
#else
|
||||
const EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
|
||||
#endif
|
||||
const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration;
|
||||
const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics;
|
||||
typedef struct {
|
||||
const EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
|
||||
const EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
|
||||
const EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration;
|
||||
const EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics;
|
||||
const EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
|
||||
const EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2;
|
||||
const EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2;
|
||||
} EFI_DRIVER_MODEL_PROTOCOL_LIST;
|
||||
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -585,13 +585,6 @@ EfiCreateEventReadyToBootEx (
|
||||
/**
|
||||
Initialize a Firmware Volume (FV) Media Device Path node.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for Tiano extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability.
|
||||
|
||||
@param FvDevicePathNode Pointer to a FV device path node to initialize
|
||||
@param NameGuid FV file name to use in FvDevicePathNode
|
||||
|
||||
@ -606,15 +599,6 @@ GlueEfiInitializeFwVolDevicepathNode (
|
||||
/**
|
||||
Check to see if the Firmware Volume (FV) Media Device Path is valid
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for Tiano extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability. The return value to this
|
||||
function points to a location in FvDevicePathNode and it does not allocate
|
||||
new memory for the GUID pointer that is returned.
|
||||
|
||||
@param FvDevicePathNode Pointer to FV device path to check.
|
||||
|
||||
@retval NULL FvDevicePathNode is not valid.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -51,7 +51,7 @@ GlueCompareMem (
|
||||
IN UINTN Length
|
||||
)
|
||||
{
|
||||
if (Length == 0) {
|
||||
if (Length == 0 || DestinationBuffer == SourceBuffer) {
|
||||
return 0;
|
||||
}
|
||||
ASSERT (DestinationBuffer != NULL);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -29,7 +29,7 @@ Abstract:
|
||||
STATIC EFI_EVENT mEfiVirtualNotifyEvent;
|
||||
STATIC BOOLEAN mEfiGoneVirtual = FALSE;
|
||||
STATIC BOOLEAN mEfiAtRuntime = FALSE;
|
||||
EFI_RUNTIME_SERVICES *mRT;
|
||||
EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
|
||||
|
||||
/**
|
||||
Set AtRuntime flag as TRUE after ExitBootServices
|
||||
@ -44,6 +44,11 @@ RuntimeDriverExitBootServices (
|
||||
IN VOID *Context
|
||||
)
|
||||
{
|
||||
//
|
||||
// Clear out BootService globals
|
||||
//
|
||||
gBS = NULL;
|
||||
|
||||
mEfiAtRuntime = TRUE;
|
||||
}
|
||||
|
||||
@ -76,7 +81,7 @@ RuntimeLibVirtualNotifyEvent (
|
||||
//
|
||||
// Update global for Runtime Services Table and IO
|
||||
//
|
||||
EfiConvertPointer (0, (VOID **) &mRT);
|
||||
EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
|
||||
|
||||
mEfiGoneVirtual = TRUE;
|
||||
}
|
||||
@ -99,8 +104,8 @@ RuntimeDriverLibConstruct (
|
||||
EFI_STATUS Status;
|
||||
|
||||
ASSERT (SystemTable != NULL);
|
||||
mRT = SystemTable->RuntimeServices;
|
||||
ASSERT (mRT != NULL);
|
||||
mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
|
||||
ASSERT (mRTEdkDxeRuntimeDriverLib != NULL);
|
||||
|
||||
//
|
||||
// Register SetVirtualAddressMap () notify function
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -50,11 +50,11 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
mRT->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
|
||||
mRTEdkDxeRuntimeDriverLib->ResetSystem (ResetType, ResetStatus, DataSize, ResetData);
|
||||
}
|
||||
|
||||
//
|
||||
// The following functions hide the mRT local global from the call to
|
||||
// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
|
||||
// runtime service in the EFI system table.
|
||||
//
|
||||
EFI_STATUS
|
||||
@ -82,7 +82,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->GetTime (Time, Capabilities);
|
||||
return mRTEdkDxeRuntimeDriverLib->GetTime (Time, Capabilities);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -106,7 +106,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->SetTime (Time);
|
||||
return mRTEdkDxeRuntimeDriverLib->SetTime (Time);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -134,7 +134,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->GetWakeupTime (Enabled, Pending, Time);
|
||||
return mRTEdkDxeRuntimeDriverLib->GetWakeupTime (Enabled, Pending, Time);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -161,7 +161,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->SetWakeupTime (Enable, Time);
|
||||
return mRTEdkDxeRuntimeDriverLib->SetWakeupTime (Enable, Time);
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||
return mRTEdkDxeRuntimeDriverLib->GetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -232,7 +232,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
|
||||
return mRTEdkDxeRuntimeDriverLib->GetNextVariableName (VariableNameSize, VariableName, VendorGuid);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -265,7 +265,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||
return mRTEdkDxeRuntimeDriverLib->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -289,7 +289,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->GetNextHighMonotonicCount (HighCount);
|
||||
return mRTEdkDxeRuntimeDriverLib->GetNextHighMonotonicCount (HighCount);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -316,7 +316,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->ConvertPointer (DebugDisposition, Address);
|
||||
return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -399,7 +399,7 @@ EfiSetVirtualAddressMap (
|
||||
IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
|
||||
)
|
||||
{
|
||||
return mRT->SetVirtualAddressMap (
|
||||
return mRTEdkDxeRuntimeDriverLib->SetVirtualAddressMap (
|
||||
MemoryMapSize,
|
||||
DescriptorSize,
|
||||
DescriptorVersion,
|
||||
@ -417,7 +417,7 @@ EfiUpdateCapsule (
|
||||
)
|
||||
{
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
return mRT->UpdateCapsule (
|
||||
return mRTEdkDxeRuntimeDriverLib->UpdateCapsule (
|
||||
CapsuleHeaderArray,
|
||||
CapsuleCount,
|
||||
ScatterGatherList
|
||||
@ -437,7 +437,7 @@ EfiQueryCapsuleCapabilities (
|
||||
)
|
||||
{
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
return mRT->QueryCapsuleCapabilities (
|
||||
return mRTEdkDxeRuntimeDriverLib->QueryCapsuleCapabilities (
|
||||
CapsuleHeaderArray,
|
||||
CapsuleCount,
|
||||
MaximumCapsuleSize,
|
||||
@ -459,7 +459,7 @@ EfiQueryVariableInfo (
|
||||
)
|
||||
{
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
return mRT->QueryVariableInfo (
|
||||
return mRTEdkDxeRuntimeDriverLib->QueryVariableInfo (
|
||||
Attributes,
|
||||
MaximumVariableStorageSize,
|
||||
RemainingVariableStorageSize,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -26,7 +26,7 @@ Abstract:
|
||||
// Driver Lib Module Globals
|
||||
//
|
||||
static EFI_EVENT mEfiVirtualNotifyEvent;
|
||||
EFI_RUNTIME_SERVICES *mRT;
|
||||
EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
|
||||
|
||||
VOID
|
||||
EFIAPI
|
||||
@ -95,7 +95,7 @@ Returns:
|
||||
//
|
||||
// Update global for Runtime Services Table
|
||||
//
|
||||
EfiConvertPointer (0, (VOID **) &mRT);
|
||||
EfiConvertPointer (0, (VOID **) &mRTEdkDxeRuntimeDriverLib);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
@ -126,7 +126,7 @@ Returns:
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
mRT = SystemTable->RuntimeServices;
|
||||
mRTEdkDxeRuntimeDriverLib = SystemTable->RuntimeServices;
|
||||
|
||||
//
|
||||
// Register SetVirtualAddressMap () notify function
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -70,7 +70,7 @@ Returns:
|
||||
|
||||
|
||||
//
|
||||
// The following functions hide the mRT local global from the call to
|
||||
// The following functions hide the mRTEdkDxeRuntimeDriverLib local global from the call to
|
||||
// runtime service in the EFI system table.
|
||||
//
|
||||
EFI_STATUS
|
||||
@ -415,7 +415,7 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
return mRT->ConvertPointer (DebugDisposition, Address);
|
||||
return mRTEdkDxeRuntimeDriverLib->ConvertPointer (DebugDisposition, Address);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -25,6 +25,6 @@ Abstract:
|
||||
|
||||
#include "EdkIIGlueDxe.h"
|
||||
|
||||
extern EFI_RUNTIME_SERVICES *mRT;
|
||||
extern EFI_RUNTIME_SERVICES *mRTEdkDxeRuntimeDriverLib;
|
||||
|
||||
#endif //__RUNTIMELIBINTERNAL_H__
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -22,13 +22,6 @@ Abstract:
|
||||
|
||||
#include "EdkIIGlueUefi.h"
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
|
||||
#define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID gEfiComponentName2ProtocolGuid
|
||||
#define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL
|
||||
#else
|
||||
#define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID gEfiComponentNameProtocolGuid
|
||||
#define EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
|
||||
#endif
|
||||
|
||||
/**
|
||||
The constructor function installs the standard EFI Driver Model Protocols.
|
||||
@ -46,7 +39,7 @@ UefiDriverModelLibConstructor (
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status = EFI_UNSUPPORTED;
|
||||
EFI_HANDLE DriverBindingHandle;
|
||||
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
|
||||
|
||||
@ -60,16 +53,17 @@ UefiDriverModelLibConstructor (
|
||||
// EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
|
||||
//
|
||||
|
||||
//
|
||||
// The Driver Binding Protocol must never be NULL
|
||||
//
|
||||
ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
|
||||
//
|
||||
// The Driver Binding Protocol must never be NULL
|
||||
//
|
||||
ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
|
||||
|
||||
//
|
||||
// Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
|
||||
// These are all checks against const pointers, so the optimizing compiler will only select one of the
|
||||
// calls to InstallMultipleProtocolInterfaces()
|
||||
//
|
||||
//
|
||||
// Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
|
||||
// These are all checks against const pointers, so the optimizing compiler will only select one of the
|
||||
// calls to InstallMultipleProtocolInterfaces()
|
||||
//
|
||||
if ((_gEdkIIGlueDriverModelProtocolSelection == 1) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
|
||||
if (_gDriverModelProtocolList[0].DriverDiagnostics == NULL) {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName == NULL) {
|
||||
@ -82,7 +76,7 @@ UefiDriverModelLibConstructor (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
@ -98,7 +92,7 @@ UefiDriverModelLibConstructor (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
|
||||
NULL
|
||||
);
|
||||
@ -117,7 +111,7 @@ UefiDriverModelLibConstructor (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
|
||||
NULL
|
||||
);
|
||||
@ -135,7 +129,7 @@ UefiDriverModelLibConstructor (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
|
||||
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
|
||||
NULL
|
||||
@ -143,18 +137,95 @@ UefiDriverModelLibConstructor (
|
||||
}
|
||||
}
|
||||
}
|
||||
} // selection == 1 or 3
|
||||
|
||||
//
|
||||
// ASSERT if the call to InstallMultipleProtocolInterfaces() failed
|
||||
//
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if ((_gEdkIIGlueDriverModelProtocolSelection == 2) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
|
||||
if (_gDriverModelProtocolList[0].DriverDiagnostics2== NULL) {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration2== NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2== NULL) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // selection == 2 or 3
|
||||
|
||||
//
|
||||
// Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
|
||||
//
|
||||
DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding;
|
||||
DriverBinding->ImageHandle = ImageHandle;
|
||||
DriverBinding->DriverBindingHandle = DriverBindingHandle;
|
||||
//
|
||||
// ASSERT if the call to InstallMultipleProtocolInterfaces() failed
|
||||
//
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Update the ImageHandle and DriverBindingHandle fields of the Driver Binding Protocol
|
||||
//
|
||||
DriverBinding = (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding;
|
||||
DriverBinding->ImageHandle = ImageHandle;
|
||||
DriverBinding->DriverBindingHandle = DriverBindingHandle;
|
||||
|
||||
|
||||
return EFI_SUCCESS;
|
||||
@ -176,7 +247,7 @@ UefiDriverModelLibDestructor (
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status = EFI_UNSUPPORTED;
|
||||
EFI_HANDLE DriverBindingHandle;
|
||||
|
||||
//
|
||||
@ -184,21 +255,22 @@ UefiDriverModelLibDestructor (
|
||||
// EdkIIGlueLib: _gDriverModelProtocolListEntries is always 1
|
||||
//
|
||||
|
||||
//
|
||||
// The Driver Binding Protocol must never be NULL
|
||||
//
|
||||
ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
|
||||
//
|
||||
// The Driver Binding Protocol must never be NULL
|
||||
//
|
||||
ASSERT(_gDriverModelProtocolList[0].DriverBinding != NULL);
|
||||
|
||||
//
|
||||
// Retrieve the DriverBindingHandle from the Driver Binding Protocol
|
||||
//
|
||||
DriverBindingHandle = _gDriverModelProtocolList[0].DriverBinding->DriverBindingHandle;
|
||||
//
|
||||
// Retrieve the DriverBindingHandle from the Driver Binding Protocol
|
||||
//
|
||||
DriverBindingHandle = _gDriverModelProtocolList[0].DriverBinding->DriverBindingHandle;
|
||||
|
||||
//
|
||||
// Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
|
||||
// These are all checks against const pointers, so the optimizing compiler will only select one of the
|
||||
// calls to InstallMultipleProtocolInterfaces()
|
||||
//
|
||||
//
|
||||
// Check for all 8 possible combinations of the ComponentName, DriverConfiguration, and DriverDiagnostics Protocol
|
||||
// These are all checks against const pointers, so the optimizing compiler will only select one of the
|
||||
// calls to InstallMultipleProtocolInterfaces()
|
||||
//
|
||||
if ((_gEdkIIGlueDriverModelProtocolSelection == 1) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
|
||||
if (_gDriverModelProtocolList[0].DriverDiagnostics == NULL) {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration == NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName == NULL) {
|
||||
@ -211,7 +283,7 @@ UefiDriverModelLibDestructor (
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
@ -227,7 +299,7 @@ UefiDriverModelLibDestructor (
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
|
||||
NULL
|
||||
);
|
||||
@ -246,7 +318,7 @@ UefiDriverModelLibDestructor (
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
|
||||
NULL
|
||||
);
|
||||
@ -264,7 +336,7 @@ UefiDriverModelLibDestructor (
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL_GUID, (EDKII_GLUE_SELECTED_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiComponentNameProtocolGuid, (EFI_COMPONENT_NAME_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName,
|
||||
&gEfiDriverConfigurationProtocolGuid, (EFI_DRIVER_CONFIGURATION_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration,
|
||||
&gEfiDriverDiagnosticsProtocolGuid, (EFI_DRIVER_DIAGNOSTICS_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics,
|
||||
NULL
|
||||
@ -272,11 +344,88 @@ UefiDriverModelLibDestructor (
|
||||
}
|
||||
}
|
||||
}
|
||||
} // selection == 1 or 3
|
||||
|
||||
//
|
||||
// ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
|
||||
//
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if ((_gEdkIIGlueDriverModelProtocolSelection == 2) || (_gEdkIIGlueDriverModelProtocolSelection == 3)) {
|
||||
if (_gDriverModelProtocolList[0].DriverDiagnostics2 == NULL) {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].DriverConfiguration2 == NULL) {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (_gDriverModelProtocolList[0].ComponentName2 == NULL) {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
} else {
|
||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||
&DriverBindingHandle,
|
||||
&gEfiDriverBindingProtocolGuid, (EFI_DRIVER_BINDING_PROTOCOL *)_gDriverModelProtocolList[0].DriverBinding,
|
||||
&gEfiComponentName2ProtocolGuid, (EFI_COMPONENT_NAME2_PROTOCOL *)_gDriverModelProtocolList[0].ComponentName2,
|
||||
&gEfiDriverConfiguration2ProtocolGuid, (EFI_DRIVER_CONFIGURATION2_PROTOCOL *)_gDriverModelProtocolList[0].DriverConfiguration2,
|
||||
&gEfiDriverDiagnostics2ProtocolGuid, (EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *)_gDriverModelProtocolList[0].DriverDiagnostics2,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // selection == 2 or 3
|
||||
|
||||
//
|
||||
// ASSERT if the call to UninstallMultipleProtocolInterfaces() failed
|
||||
//
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -16,32 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include "Library/EdkIIGlueMemoryAllocationLib.h"
|
||||
|
||||
|
||||
/**
|
||||
Compare whether two names of languages are identical.
|
||||
|
||||
@param Language1 Name of language 1.
|
||||
@param Language2 Name of language 2.
|
||||
|
||||
@retval TRUE Language 1 and language 2 are the same.
|
||||
@retval FALSE Language 1 and language 2 are not the same.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
CompareIso639LanguageCode (
|
||||
IN CONST CHAR8 *Language1,
|
||||
IN CONST CHAR8 *Language2
|
||||
)
|
||||
{
|
||||
UINT32 Name1;
|
||||
UINT32 Name2;
|
||||
|
||||
Name1 = ReadUnaligned24 ((CONST UINT32 *) Language1);
|
||||
Name2 = ReadUnaligned24 ((CONST UINT32 *) Language2);
|
||||
|
||||
return (BOOLEAN) (Name1 == Name2);
|
||||
}
|
||||
|
||||
/**
|
||||
This function searches the list of configuration tables stored in the EFI System
|
||||
Table for a table with a GUID that matches TableGuid. If a match is found,
|
||||
@ -509,6 +483,130 @@ EfiTestChildHandle (
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
Tests whether a language code has format of ISO639-2.
|
||||
|
||||
@param Languages The language code to be tested.
|
||||
|
||||
@retval TRUE Language code format is ISO 639-2.
|
||||
@retval FALSE Language code format is not ISO639-2.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
IsIso639LanguageCode (
|
||||
IN CONST CHAR8 *Languages
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
//
|
||||
// Find out format of Languages
|
||||
//
|
||||
for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';' && Languages[Index] != '-'; Index++);
|
||||
if (Languages[Index] != 0) {
|
||||
//
|
||||
// RFC4646 language code
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// No ';' and '-', it's either ISO639-2 code (list) or single RFC4646 code
|
||||
//
|
||||
if (Index == 2) {
|
||||
//
|
||||
// Single RFC4646 language code without country code, e.g. "en"
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Languages in format of ISO639-2
|
||||
//
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
Compare the first language instance of two language codes, either could be a
|
||||
single language code or a language code list. This function assume Language1
|
||||
and Language2 has the same language code format, i.e. either ISO639-2 or RFC4646.
|
||||
|
||||
@param Language1 The first language code to be tested.
|
||||
@param Language2 The second language code to be tested.
|
||||
|
||||
@retval TRUE Language code match.
|
||||
@retval FALSE Language code mismatch.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
BOOLEAN
|
||||
CompareLanguageCode (
|
||||
IN CONST CHAR8 *Language1,
|
||||
IN CONST CHAR8 *Language2
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
//
|
||||
// Compare first two bytes of language tag
|
||||
//
|
||||
if ((Language1[0] != Language2[0]) || (Language1[1] != Language2[1])) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (IsIso639LanguageCode (Language1)) {
|
||||
//
|
||||
// ISO639-2 language code, compare the third byte of language tag
|
||||
//
|
||||
return (BOOLEAN) ((Language1[2] == Language2[2]) ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
//
|
||||
// RFC4646 language code
|
||||
//
|
||||
for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++);
|
||||
if ((AsciiStrnCmp (Language1, Language2, Index) == 0) && (Language2[Index] == 0 || Language2[Index] == ';')) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
Step to next language code of a language code list.
|
||||
|
||||
@param Languages The language code list to traverse.
|
||||
|
||||
@return Pointer to next language code or NULL terminator if it's the last one.
|
||||
|
||||
**/
|
||||
STATIC
|
||||
CONST
|
||||
CHAR8 *
|
||||
NextSupportedLanguage (
|
||||
IN CONST CHAR8 *Languages
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
|
||||
if (IsIso639LanguageCode (Languages)) {
|
||||
//
|
||||
// ISO639-2 language code
|
||||
//
|
||||
return (Languages + 3);
|
||||
}
|
||||
|
||||
//
|
||||
// Search in RFC4646 language code list
|
||||
//
|
||||
for (Index = 0; Languages[Index] != 0 && Languages[Index] != ';'; Index++);
|
||||
if (Languages[Index] == ';') {
|
||||
Index++;
|
||||
}
|
||||
return (Languages + Index);
|
||||
}
|
||||
|
||||
/**
|
||||
This function looks up a Unicode string in UnicodeStringTable. If Language is
|
||||
a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable
|
||||
@ -566,13 +664,13 @@ LookupUnicodeString (
|
||||
// Make sure Language is in the set of Supported Languages
|
||||
//
|
||||
while (*SupportedLanguages != 0) {
|
||||
if (CompareIso639LanguageCode (Language, SupportedLanguages)) {
|
||||
if (CompareLanguageCode (Language, SupportedLanguages)) {
|
||||
|
||||
//
|
||||
// Search the Unicode String Table for the matching Language specifier
|
||||
//
|
||||
while (UnicodeStringTable->Language != NULL) {
|
||||
if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {
|
||||
if (CompareLanguageCode (Language, UnicodeStringTable->Language)) {
|
||||
|
||||
//
|
||||
// A matching string was found, so return it
|
||||
@ -587,7 +685,7 @@ LookupUnicodeString (
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SupportedLanguages += 3;
|
||||
SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
|
||||
}
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
@ -664,7 +762,7 @@ AddUnicodeString (
|
||||
// Make sure Language is a member of SupportedLanguages
|
||||
//
|
||||
while (*SupportedLanguages != 0) {
|
||||
if (CompareIso639LanguageCode (Language, SupportedLanguages)) {
|
||||
if (CompareLanguageCode (Language, SupportedLanguages)) {
|
||||
|
||||
//
|
||||
// Determine the size of the Unicode String Table by looking for a NULL Language entry
|
||||
@ -673,7 +771,7 @@ AddUnicodeString (
|
||||
if (*UnicodeStringTable != NULL) {
|
||||
OldUnicodeStringTable = *UnicodeStringTable;
|
||||
while (OldUnicodeStringTable->Language != NULL) {
|
||||
if (CompareIso639LanguageCode (Language, OldUnicodeStringTable->Language)) {
|
||||
if (CompareLanguageCode (Language, OldUnicodeStringTable->Language)) {
|
||||
return EFI_ALREADY_STARTED;
|
||||
}
|
||||
|
||||
@ -707,7 +805,7 @@ AddUnicodeString (
|
||||
//
|
||||
// Allocate space for a copy of the Language specifier
|
||||
//
|
||||
NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language);
|
||||
NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (AsciiStrSize (Language), Language);
|
||||
if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {
|
||||
(gBS->FreePool) (NewUnicodeStringTable);
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
@ -753,7 +851,7 @@ AddUnicodeString (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
SupportedLanguages += 3;
|
||||
SupportedLanguages = NextSupportedLanguage (SupportedLanguages);
|
||||
}
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -67,7 +67,7 @@ GlueEfiCreateEventLegacyBoot (
|
||||
{
|
||||
return EfiCreateEventLegacyBootEx (
|
||||
EFI_TPL_CALLBACK,
|
||||
InternalEmptyFuntion,
|
||||
NULL,
|
||||
NULL,
|
||||
LegacyBootEvent
|
||||
);
|
||||
@ -101,29 +101,50 @@ EfiCreateEventLegacyBootEx (
|
||||
OUT EFI_EVENT *LegacyBootEvent
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
UINT32 EventType;
|
||||
EFI_EVENT_NOTIFY WorkerNotifyFunction;
|
||||
|
||||
ASSERT (LegacyBootEvent != NULL);
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION < 0x00020000)
|
||||
|
||||
if (NotifyFunction == NULL) {
|
||||
EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
|
||||
} else {
|
||||
EventType = EFI_EVENT_SIGNAL_LEGACY_BOOT;
|
||||
}
|
||||
WorkerNotifyFunction = NotifyFunction;
|
||||
|
||||
//
|
||||
// prior to UEFI 2.0 use Tiano extension to EFI
|
||||
//
|
||||
Status = gBS->CreateEvent (
|
||||
EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
|
||||
EventType,
|
||||
NotifyTpl,
|
||||
NotifyFunction,
|
||||
WorkerNotifyFunction,
|
||||
NotifyContext,
|
||||
LegacyBootEvent
|
||||
);
|
||||
#else
|
||||
|
||||
EventType = EVENT_NOTIFY_SIGNAL;
|
||||
if (NotifyFunction == NULL) {
|
||||
//
|
||||
// CreatEventEx will check NotifyFunction is NULL or not
|
||||
//
|
||||
WorkerNotifyFunction = InternalEmptyFuntion;
|
||||
} else {
|
||||
WorkerNotifyFunction = NotifyFunction;
|
||||
}
|
||||
|
||||
//
|
||||
// For UEFI 2.0 and the future use an Event Group
|
||||
//
|
||||
Status = gBS->CreateEventEx (
|
||||
EVENT_NOTIFY_SIGNAL,
|
||||
EventType,
|
||||
NotifyTpl,
|
||||
NotifyFunction,
|
||||
WorkerNotifyFunction,
|
||||
NotifyContext,
|
||||
&gEfiEventLegacyBootGuid,
|
||||
LegacyBootEvent
|
||||
@ -157,7 +178,7 @@ GlueEfiCreateEventReadyToBoot (
|
||||
{
|
||||
return EfiCreateEventReadyToBootEx (
|
||||
EFI_TPL_CALLBACK,
|
||||
InternalEmptyFuntion,
|
||||
NULL,
|
||||
NULL,
|
||||
ReadyToBootEvent
|
||||
);
|
||||
@ -191,29 +212,51 @@ EfiCreateEventReadyToBootEx (
|
||||
OUT EFI_EVENT *ReadyToBootEvent
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS Status;
|
||||
UINT32 EventType;
|
||||
EFI_EVENT_NOTIFY WorkerNotifyFunction;
|
||||
|
||||
ASSERT (ReadyToBootEvent != NULL);
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION < 0x00020000)
|
||||
#if (EFI_SPECIFICATION_VERSION < 0x00020000)
|
||||
|
||||
if (NotifyFunction == NULL) {
|
||||
EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL;
|
||||
} else {
|
||||
EventType = EFI_EVENT_SIGNAL_READY_TO_BOOT;
|
||||
}
|
||||
WorkerNotifyFunction = NotifyFunction;
|
||||
|
||||
//
|
||||
// prior to UEFI 2.0 use Tiano extension to EFI
|
||||
//
|
||||
Status = gBS->CreateEvent (
|
||||
EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,
|
||||
EventType,
|
||||
NotifyTpl,
|
||||
NotifyFunction,
|
||||
WorkerNotifyFunction,
|
||||
NotifyContext,
|
||||
ReadyToBootEvent
|
||||
);
|
||||
#else
|
||||
|
||||
EventType = EVENT_NOTIFY_SIGNAL;
|
||||
|
||||
if (NotifyFunction == NULL) {
|
||||
//
|
||||
// CreatEventEx will check NotifyFunction is NULL or not
|
||||
//
|
||||
WorkerNotifyFunction = InternalEmptyFuntion;
|
||||
} else {
|
||||
WorkerNotifyFunction = NotifyFunction;
|
||||
}
|
||||
|
||||
//
|
||||
// For UEFI 2.0 and the future use an Event Group
|
||||
//
|
||||
Status = gBS->CreateEventEx (
|
||||
EVENT_NOTIFY_SIGNAL,
|
||||
EventType,
|
||||
NotifyTpl,
|
||||
NotifyFunction,
|
||||
WorkerNotifyFunction,
|
||||
NotifyContext,
|
||||
&gEfiEventReadyToBootGuid,
|
||||
ReadyToBootEvent
|
||||
@ -274,15 +317,6 @@ EfiSignalEventLegacyBoot (
|
||||
/**
|
||||
Check to see if the Firmware Volume (FV) Media Device Path is valid
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability. The return value to this
|
||||
function points to a location in FvDevicePathNode and it does not allocate
|
||||
new memory for the GUID pointer that is returned.
|
||||
|
||||
@param FvDevicePathNode Pointer to FV device path to check.
|
||||
|
||||
@retval NULL FvDevicePathNode is not valid.
|
||||
@ -297,11 +331,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode (
|
||||
{
|
||||
ASSERT (FvDevicePathNode != NULL);
|
||||
|
||||
//
|
||||
// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
|
||||
// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
|
||||
// EFI 1.10 and UEFI 2.10.
|
||||
//
|
||||
if (DevicePathType (&FvDevicePathNode->Header) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType (&FvDevicePathNode->Header) == MEDIA_FV_FILEPATH_DP) {
|
||||
return (EFI_GUID *) &FvDevicePathNode->NameGuid;
|
||||
@ -314,13 +343,6 @@ GlueEfiGetNameGuidFromFwVolDevicePathNode (
|
||||
/**
|
||||
Initialize a Firmware Volume (FV) Media Device Path node.
|
||||
|
||||
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
|
||||
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
|
||||
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
|
||||
device path is defined for PIWG extensions of device path. If the code
|
||||
is compiled to conform with the UEFI 2.0 specification use the new device path
|
||||
else use the old form for backwards compatability.
|
||||
|
||||
@param FvDevicePathNode Pointer to a FV device path node to initialize
|
||||
@param NameGuid FV file name to use in FvDevicePathNode
|
||||
|
||||
@ -335,16 +357,10 @@ GlueEfiInitializeFwVolDevicepathNode (
|
||||
ASSERT (FvDevicePathNode != NULL);
|
||||
ASSERT (NameGuid != NULL);
|
||||
|
||||
//
|
||||
// EFI Specification extension on Media Device Path. MEDIA_FW_VOL_FILEPATH_DEVICE_PATH is adopted by UEFI later and added in UEFI2.10.
|
||||
// In EdkCompatibility Package, we only support MEDIA_FW_VOL_FILEPATH_DEVICE_PATH that complies with
|
||||
// EFI 1.10 and UEFI 2.10.
|
||||
//
|
||||
FvDevicePathNode->Header.Type = MEDIA_DEVICE_PATH;
|
||||
FvDevicePathNode->Header.SubType = MEDIA_FV_FILEPATH_DP;
|
||||
SetDevicePathNodeLength (&FvDevicePathNode->Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));
|
||||
|
||||
CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);
|
||||
|
||||
CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -60,7 +60,7 @@ COMPONENT_TYPE = LIBRARY
|
||||
Math.c
|
||||
|
||||
[sources.x64]
|
||||
X64/EfiCopyMemRep1.asm
|
||||
X64/EfiCopyMemRep4.asm
|
||||
X64/EfiSetMemRep4.asm
|
||||
X64/EfiZeroMemRep4.asm
|
||||
# X64/EfiCopyMem.asm
|
||||
|
@ -1,6 +1,6 @@
|
||||
#/*++
|
||||
#
|
||||
# Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -85,14 +85,14 @@ COMPONENT_TYPE = LIBRARY
|
||||
Math.c
|
||||
|
||||
[sources.x64]
|
||||
X64/EfiCopyMemRep1.asm | MSFT
|
||||
X64/EfiCopyMemRep4.asm | MSFT
|
||||
X64/EfiSetMemRep4.asm | MSFT
|
||||
X64/EfiZeroMemRep4.asm | MSFT
|
||||
# X64/EfiCopyMem.asm | MSFT
|
||||
# X64/EfiSetMem.asm | MSFT
|
||||
# X64/EfiZeroMem.asm | MSFT
|
||||
|
||||
X64/EfiCopyMemRep1.asm | INTEL
|
||||
X64/EfiCopyMemRep4.asm | INTEL
|
||||
X64/EfiSetMemRep4.asm | INTEL
|
||||
X64/EfiZeroMemRep4.asm | INTEL
|
||||
# X64/EfiCopyMem.asm | INTEL
|
||||
|
@ -75,16 +75,16 @@ ASM_PFX(EfiCommonLibCopyMem):
|
||||
movl %esi, %eax
|
||||
addl %ecx, %eax # Source + Count
|
||||
cmpl %edi, %eax
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
movl %edi, %eax
|
||||
addl %ecx, %eax # Dest + Count
|
||||
cmpl %esi, %eax
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
cmpl %edi, %esi
|
||||
je _CopyMemDone
|
||||
jl _CopyOverlapped # too bad -- overlaps
|
||||
jb _CopyOverlapped # too bad -- overlaps
|
||||
|
||||
# Pick up misaligned start bytes to get destination pointer 4-byte aligned
|
||||
_StartByteCopy:
|
||||
|
@ -73,16 +73,16 @@ EfiCommonLibCopyMem PROC
|
||||
mov eax, esi
|
||||
add eax, ecx ; Source + Count
|
||||
cmp eax, edi
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
mov eax, edi
|
||||
add eax, ecx ; Dest + Count
|
||||
cmp eax, esi
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
cmp esi, edi
|
||||
je _CopyMemDone
|
||||
jl _CopyOverlapped ; too bad -- overlaps
|
||||
jb _CopyOverlapped ; too bad -- overlaps
|
||||
|
||||
; Pick up misaligned start bytes to get destination pointer 4-byte aligned
|
||||
_StartByteCopy:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -58,20 +58,21 @@ Returns:
|
||||
; if (Source == Destination) => do nothing
|
||||
; if (Source + Count <= Destination) => regular copy
|
||||
; if (Destination + Count <= Source) => regular copy
|
||||
; if (Source >= Destination) => regular copy
|
||||
; otherwise, do a reverse copy
|
||||
mov eax, esi
|
||||
add eax, ecx ; Source + Count
|
||||
cmp eax, edi
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
mov eax, edi
|
||||
add eax, ecx ; Dest + Count
|
||||
cmp eax, esi
|
||||
jle _StartByteCopy
|
||||
jbe _StartByteCopy
|
||||
|
||||
cmp esi, edi
|
||||
je _CopyMemDone
|
||||
jl _CopyOverlapped ; too bad -- overlaps
|
||||
jb _CopyOverlapped ; too bad -- overlaps
|
||||
|
||||
; Pick up misaligned start bytes to get destination pointer 4-byte aligned
|
||||
_StartByteCopy:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -104,13 +104,13 @@ _CopyBlocks:
|
||||
copyxmm:
|
||||
|
||||
movdqu xmm0, OWORD PTR ds:[esi]
|
||||
movdqu QWORD PTR ds:[edi], xmm0
|
||||
movdqu OWORD PTR ds:[edi], xmm0
|
||||
movdqu xmm1, OWORD PTR ds:[esi+16]
|
||||
movdqu QWORD PTR ds:[edi+16], xmm1
|
||||
movdqu OWORD PTR ds:[edi+16], xmm1
|
||||
movdqu xmm2, OWORD PTR ds:[esi+32]
|
||||
movdqu QWORD PTR ds:[edi+32], xmm2
|
||||
movdqu OWORD PTR ds:[edi+32], xmm2
|
||||
movdqu xmm3, OWORD PTR ds:[esi+48]
|
||||
movdqu QWORD PTR ds:[edi+48], xmm3
|
||||
movdqu OWORD PTR ds:[edi+48], xmm3
|
||||
|
||||
add edi, 64
|
||||
add esi, 64
|
||||
|
@ -65,11 +65,13 @@ ASM_PFX(Power10U64):
|
||||
jcxz _Power10U64_Done
|
||||
|
||||
_Power10U64_Wend:
|
||||
pushl %ecx
|
||||
pushl $10
|
||||
push 0xC(%ebp)
|
||||
push 0x8(%ebp)
|
||||
call ASM_PFX(MultU64x32)
|
||||
addl $0xc, %esp
|
||||
popl %ecx
|
||||
movl %eax, 8(%ebp) # dword ptr Operand[0]
|
||||
movl %edx, 0xC(%ebp) # dword ptr Operand[4]
|
||||
loopl _Power10U64_Wend
|
||||
|
@ -64,11 +64,13 @@ Power10U64 PROC
|
||||
jcxz _Power10U64_Done
|
||||
|
||||
_Power10U64_Wend:
|
||||
push ecx
|
||||
push 10
|
||||
push [ebp + 0Ch]; dword ptr Operand[4]
|
||||
push [ebp + 8]; dword ptr Operand[0]
|
||||
call MultU64x32
|
||||
add esp, 0cH
|
||||
pop ecx
|
||||
mov [ebp + 8] , eax; dword ptr Operand[0]
|
||||
mov [ebp + 0Ch] , edx; dword ptr Operand[4]
|
||||
loop _Power10U64_Wend
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -56,11 +56,13 @@ Returns:
|
||||
jcxz _Power10U64_Done
|
||||
|
||||
_Power10U64_Wend:
|
||||
push ecx
|
||||
push 10
|
||||
push dword ptr Operand[4]
|
||||
push dword ptr Operand[0]
|
||||
call MultU64x32
|
||||
add esp, 0Ch
|
||||
pop ecx
|
||||
mov dword ptr Operand[0], eax
|
||||
mov dword ptr Operand[4], edx
|
||||
loop _Power10U64_Wend
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -75,6 +75,21 @@ Returns:
|
||||
return Multiplicand * Multiplier;
|
||||
}
|
||||
|
||||
UINT64
|
||||
Power10U64 (
|
||||
IN UINT64 Operand,
|
||||
IN UINTN Power
|
||||
)
|
||||
{
|
||||
UINT64 Result;
|
||||
|
||||
Result = Operand;
|
||||
while (Power-- > 0) {
|
||||
Result *= 10;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
UINT64
|
||||
RShiftU64 (
|
||||
IN UINT64 Operand,
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -20,8 +20,8 @@ Abstract:
|
||||
#include "Tiano.h"
|
||||
#include "pei.h"
|
||||
#include "cpuio.h"
|
||||
#include "pcicfg.h"
|
||||
#include "pcicfg2.h"
|
||||
#include EFI_PPI_CONSUMER (PciCfg)
|
||||
#include EFI_PPI_CONSUMER (PciCfg2)
|
||||
#include EFI_PROTOCOL_CONSUMER (PciRootBridgeIo)
|
||||
|
||||
//
|
||||
@ -68,8 +68,6 @@ Returns:
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
mPeiServices = NULL;
|
||||
CpuIoPpi = NULL;
|
||||
PciCfgPpi = NULL;
|
||||
@ -136,7 +134,7 @@ Returns:
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
|
||||
|
||||
if (mPeiServices == NULL) {
|
||||
if (mPeiServices != NULL) {
|
||||
//
|
||||
// The function is called in PEI phase, use PEI interfaces
|
||||
//
|
||||
@ -197,7 +195,7 @@ Returns:
|
||||
EFI_STATUS Status;
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
|
||||
|
||||
if (mPeiServices == NULL) {
|
||||
if (mPeiServices != NULL) {
|
||||
//
|
||||
// The function is called in PEI phase, use PEI interfaces
|
||||
//
|
||||
@ -260,7 +258,7 @@ Returns:
|
||||
UINT8 *Buffer8;
|
||||
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo;
|
||||
|
||||
if (mPeiServices == NULL) {
|
||||
if (mPeiServices != NULL) {
|
||||
//
|
||||
// The function is called in PEI phase, use PEI interfaces
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -195,8 +195,8 @@ EFI_STATUS
|
||||
EFIAPI
|
||||
PeiLibFfsFindNextFile (
|
||||
IN EFI_FV_FILETYPE SearchType,
|
||||
IN EFI_PEI_FV_HANDLE FwVolHeader,
|
||||
IN OUT EFI_PEI_FILE_HANDLE *FileHeader
|
||||
IN EFI_PEI_FV_HANDLE FvHandle,
|
||||
IN OUT EFI_PEI_FILE_HANDLE *FileHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
@ -207,7 +207,7 @@ Routine Description:
|
||||
Arguments:
|
||||
|
||||
SearchType - Filter to find only file of this type.
|
||||
FwVolHeader - Pointer to the current FV to search.
|
||||
FvHandle - Pointer to the current FV to search.
|
||||
FileHandle - Pointer to the file matching SearchType in FwVolHeader.
|
||||
- NULL if file not found
|
||||
|
||||
@ -271,7 +271,7 @@ Returns:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeiLibFfsGetVolumeInfo (
|
||||
IN EFI_PEI_FV_HANDLE *VolumeHandle,
|
||||
IN EFI_PEI_FV_HANDLE VolumeHandle,
|
||||
OUT EFI_FV_INFO *VolumeInfo
|
||||
)
|
||||
/*++
|
||||
@ -464,7 +464,7 @@ MigrateIdtTable (
|
||||
|
||||
Routine Description:
|
||||
|
||||
Migrate IDT from temporary memory to real memory where preceded with 4 bytes for
|
||||
Migrate IDT from CAR to real memory where preceded with 4 bytes for
|
||||
storing PeiService pointer.
|
||||
|
||||
Arguments:
|
||||
|
@ -70,7 +70,7 @@ PeCoffLoaderLoadImage (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeCoffLoaderUnloadImage (
|
||||
IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
);
|
||||
|
||||
#if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)
|
||||
@ -565,7 +565,10 @@ Returns:
|
||||
// Pe image and in Te image header there is not a field to describe the imagesize,
|
||||
// we use the largest VirtualAddress plus Size in each directory entry to describe the imagesize
|
||||
//
|
||||
ImageContext->ImageSize = (UINT64) (Hdr.Te->DataDirectory[0].VirtualAddress + Hdr.Te->DataDirectory[0].Size);
|
||||
ImageContext->ImageSize = (UINT64) (Hdr.Te->DataDirectory[0].VirtualAddress + Hdr.Te->DataDirectory[0].Size);
|
||||
if(Hdr.Te->DataDirectory[1].VirtualAddress > Hdr.Te->DataDirectory[0].VirtualAddress) {
|
||||
ImageContext->ImageSize = (UINT64) (Hdr.Te->DataDirectory[1].VirtualAddress + Hdr.Te->DataDirectory[1].Size);
|
||||
}
|
||||
ImageContext->SectionAlignment = 4096;
|
||||
ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN) Hdr.Te->BaseOfCode - (UINTN) Hdr.Te->StrippedSize;
|
||||
|
||||
@ -1013,6 +1016,12 @@ Returns:
|
||||
UINT32 TempDebugEntryRva;
|
||||
UINT32 NumberOfRvaAndSizes;
|
||||
UINT16 Magic;
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
EFI_IMAGE_RESOURCE_DIRECTORY *ResourceDirectory;
|
||||
EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *ResourceDirectoryEntry;
|
||||
EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString;
|
||||
EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry;
|
||||
#endif
|
||||
|
||||
if (NULL == ImageContext) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@ -1368,6 +1377,73 @@ Returns:
|
||||
}
|
||||
}
|
||||
|
||||
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
|
||||
//
|
||||
// Get Image's HII resource section
|
||||
//
|
||||
if (!(ImageContext->IsTeImage)) {
|
||||
if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
|
||||
//
|
||||
// Use PE32 offset
|
||||
//
|
||||
DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE];
|
||||
} else {
|
||||
//
|
||||
// Use PE32+ offset
|
||||
//
|
||||
DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *)&Hdr.Pe32Plus->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE];
|
||||
}
|
||||
|
||||
if (DirectoryEntry->Size != 0) {
|
||||
Base = PeCoffLoaderImageAddress (ImageContext, DirectoryEntry->VirtualAddress);
|
||||
|
||||
ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) Base;
|
||||
ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
|
||||
|
||||
for (Index = 0; Index < ResourceDirectory->NumberOfNamedEntries; Index++) {
|
||||
if (ResourceDirectoryEntry->u1.s.NameIsString) {
|
||||
ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (Base + ResourceDirectoryEntry->u1.s.NameOffset);
|
||||
|
||||
if (ResourceDirectoryString->Length == 3 &&
|
||||
ResourceDirectoryString->String[0] == L'H' &&
|
||||
ResourceDirectoryString->String[1] == L'I' &&
|
||||
ResourceDirectoryString->String[2] == L'I') {
|
||||
//
|
||||
// Resource Type "HII" found
|
||||
//
|
||||
if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
|
||||
//
|
||||
// Move to next level - resource Name
|
||||
//
|
||||
ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
|
||||
ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
|
||||
|
||||
if (ResourceDirectoryEntry->u2.s.DataIsDirectory) {
|
||||
//
|
||||
// Move to next level - resource Language
|
||||
//
|
||||
ResourceDirectory = (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + ResourceDirectoryEntry->u2.s.OffsetToDirectory);
|
||||
ResourceDirectoryEntry = (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *) (ResourceDirectory + 1);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Now it ought to be resource Data
|
||||
//
|
||||
if (!ResourceDirectoryEntry->u2.s.DataIsDirectory) {
|
||||
ResourceDataEntry = (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (Base + ResourceDirectoryEntry->u2.OffsetToData);
|
||||
ImageContext->HiiResourceData = (EFI_PHYSICAL_ADDRESS) (UINTN) PeCoffLoaderImageAddress (ImageContext, ResourceDataEntry->OffsetToData);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ResourceDirectoryEntry++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (EFI_DEBUG_ITP_BREAK) && !defined (_CONSOLE)
|
||||
AsmEfiSetBreakSupport ((UINTN)(ImageContext->ImageAddress));
|
||||
#endif
|
||||
@ -1378,7 +1454,7 @@ Returns:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeCoffLoaderUnloadImage (
|
||||
IN OUT EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
IN EFI_PEI_PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
|
||||
)
|
||||
/*++
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -383,8 +383,8 @@ EFI_STATUS
|
||||
EFIAPI
|
||||
PeiLibFfsFindNextFile (
|
||||
IN EFI_FV_FILETYPE SearchType,
|
||||
IN EFI_PEI_FV_HANDLE FwVolHeader,
|
||||
IN OUT EFI_PEI_FILE_HANDLE *FileHeader
|
||||
IN EFI_PEI_FV_HANDLE FvHandle,
|
||||
IN OUT EFI_PEI_FILE_HANDLE *FileHandle
|
||||
)
|
||||
/*++
|
||||
|
||||
@ -395,9 +395,9 @@ Routine Description:
|
||||
Arguments:
|
||||
|
||||
SearchType - Filter to find only file of this type.
|
||||
FwVolHeader - Pointer to the current FV to search.
|
||||
FvHandle - Pointer to the current FV to search.
|
||||
FileHandle - Pointer to the file matching SearchType in FwVolHeader.
|
||||
- NULL if file not found
|
||||
- NULL if file not found
|
||||
|
||||
Returns:
|
||||
EFI_STATUS
|
||||
@ -407,7 +407,7 @@ Returns:
|
||||
EFI_PEI_SERVICES **PeiServices;
|
||||
|
||||
PeiServices = GetPeiServicesTablePointer();
|
||||
return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, &FwVolHeader, &FileHeader);
|
||||
return (*PeiServices)->FfsFindNextFile (PeiServices, SearchType, FvHandle, FileHandle);
|
||||
}
|
||||
|
||||
|
||||
@ -471,13 +471,13 @@ Returns:
|
||||
EFI_PEI_SERVICES **PeiServices;
|
||||
|
||||
PeiServices = GetPeiServicesTablePointer();
|
||||
return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, &FfsFileHeader, SectionData);
|
||||
return (*PeiServices)->FfsFindSectionData (PeiServices, SectionType, (EFI_PEI_FILE_HANDLE)FfsFileHeader, SectionData);
|
||||
}
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PeiLibFfsGetVolumeInfo (
|
||||
IN EFI_PEI_FV_HANDLE *VolumeHandle,
|
||||
IN EFI_PEI_FV_HANDLE VolumeHandle,
|
||||
OUT EFI_FV_INFO *VolumeInfo
|
||||
)
|
||||
/*++
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2005, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -35,6 +35,8 @@ typedef struct {
|
||||
UINT64 R14;
|
||||
UINT64 R15;
|
||||
UINT64 Rip;
|
||||
UINT32 MxCsr;
|
||||
UINT8 XmmBuffer[160]; // XMM6-XMM15
|
||||
} EFI_JUMP_BUFFER;
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2005 - 2008, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
@ -84,8 +84,6 @@ Returns:
|
||||
--*/
|
||||
{
|
||||
*This = &mTransferControl;
|
||||
mTransferControl.SetJump = TransferControlSetJump;
|
||||
mTransferControl.LongJump = TransferControlLongJump;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -112,7 +110,6 @@ Returns:
|
||||
--*/
|
||||
{
|
||||
*This = &mFlushInstructionCache;
|
||||
mFlushInstructionCache.Flush = FlushInstructionCacheFlush;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
; Copyright (c) 2005 - 2007, Intel Corporation. All rights reserved.<BR>
|
||||
; Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
; This program and the accompanying materials
|
||||
; are licensed and made available under the terms and conditions of the BSD License
|
||||
; which accompanies this distribution. The full text of the license may be found at
|
||||
@ -73,6 +73,8 @@ _r13 QWORD ?
|
||||
_r14 QWORD ?
|
||||
_r15 QWORD ?
|
||||
_rip QWORD ?
|
||||
_MxCsr DWORD ?
|
||||
_XmmBuffer DB 160 DUP (?)
|
||||
_EFI_JUMP_BUFFER ENDS
|
||||
|
||||
EFI_JUMP_BUFFER TYPEDEF _EFI_JUMP_BUFFER
|
||||
@ -116,6 +118,19 @@ TransferControlSetJump PROC
|
||||
mov (EFI_JUMP_BUFFER PTR [rdx])._r13, r13
|
||||
mov (EFI_JUMP_BUFFER PTR [rdx])._r14, r14
|
||||
mov (EFI_JUMP_BUFFER PTR [rdx])._r15, r15
|
||||
; save non-volatile fp registers
|
||||
stmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
|
||||
lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
|
||||
movdqu [rax], xmm6
|
||||
movdqu [rax + 10h], xmm7
|
||||
movdqu [rax + 20h], xmm8
|
||||
movdqu [rax + 30h], xmm9
|
||||
movdqu [rax + 40h], xmm10
|
||||
movdqu [rax + 50h], xmm11
|
||||
movdqu [rax + 60h], xmm12
|
||||
movdqu [rax + 70h], xmm13
|
||||
movdqu [rax + 80h], xmm14
|
||||
movdqu [rax + 90h], xmm15
|
||||
mov rax, QWORD PTR [rsp+0]
|
||||
mov (EFI_JUMP_BUFFER PTR [rdx])._rip, rax
|
||||
mov rax, EFI_SUCCESS
|
||||
@ -134,6 +149,19 @@ TransferControlSetJump ENDP
|
||||
;
|
||||
PUBLIC TransferControlLongJump
|
||||
TransferControlLongJump PROC
|
||||
; load non-volatile fp registers
|
||||
ldmxcsr (EFI_JUMP_BUFFER PTR [rdx])._MxCsr
|
||||
lea rax, (EFI_JUMP_BUFFER PTR [rdx])._XmmBuffer
|
||||
movdqu xmm6, [rax]
|
||||
movdqu xmm7, [rax + 10h]
|
||||
movdqu xmm8, [rax + 20h]
|
||||
movdqu xmm9, [rax + 30h]
|
||||
movdqu xmm10, [rax + 40h]
|
||||
movdqu xmm11, [rax + 50h]
|
||||
movdqu xmm12, [rax + 60h]
|
||||
movdqu xmm13, [rax + 70h]
|
||||
movdqu xmm14, [rax + 80h]
|
||||
movdqu xmm15, [rax + 90h]
|
||||
; set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
|
||||
mov rax, EFI_WARN_RETURN_FROM_LONG_JUMP
|
||||
mov rbx, (EFI_JUMP_BUFFER PTR [rdx])._rbx
|
||||
|
@ -1,6 +1,6 @@
|
||||
#------------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
|
||||
# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
|
||||
# This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
@ -99,6 +99,19 @@ ASM_PFX(TransferControlSetJump):
|
||||
mov %r13,0x40(%rdx)
|
||||
mov %r14,0x48(%rdx)
|
||||
mov %r15,0x50(%rdx)
|
||||
#; save non-volatile fp registers
|
||||
stmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu %xmm6, (%rax)
|
||||
movdqu %xmm7, 0x10(%rax)
|
||||
movdqu %xmm8, 0x20(%rax)
|
||||
movdqu %xmm9, 0x30(%rax)
|
||||
movdqu %xmm10, 0x40(%rax)
|
||||
movdqu %xmm11, 0x50(%rax)
|
||||
movdqu %xmm12, 0x60(%rax)
|
||||
movdqu %xmm13, 0x70(%rax)
|
||||
movdqu %xmm14, 0x80(%rax)
|
||||
movdqu %xmm15, 0x90(%rax)
|
||||
mov (%rsp),%rax
|
||||
mov %rax,0x58(%rdx)
|
||||
mov $0x0,%rax
|
||||
@ -115,7 +128,20 @@ ASM_PFX(TransferControlSetJump):
|
||||
#
|
||||
#
|
||||
ASM_PFX(TransferControlLongJump):
|
||||
# set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
|
||||
# set return from SetJump to EFI_WARN_RETURN_FROM_LONG_JUMP
|
||||
#; load non-volatile fp registers
|
||||
ldmxcsr 0x60(%rdx)
|
||||
lea 0x68(%rdx), %rax
|
||||
movdqu (%rax), %xmm6
|
||||
movdqu 0x10(%rax), %xmm7
|
||||
movdqu 0x20(%rax), %xmm8
|
||||
movdqu 0x30(%rax), %xmm9
|
||||
movdqu 0x40(%rax), %xmm10
|
||||
movdqu 0x50(%rax), %xmm11
|
||||
movdqu 0x60(%rax), %xmm12
|
||||
movdqu 0x70(%rax), %xmm13
|
||||
movdqu 0x80(%rax), %xmm14
|
||||
movdqu 0x90(%rax), %xmm15
|
||||
mov $0x5,%rax
|
||||
mov (%rdx),%rbx
|
||||
mov 0x8(%rdx),%rsp
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user