mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
Add INF extension Information
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7228 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b3ff502f6d
commit
e561879137
@ -52,5 +52,5 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes ## Valid when gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file defines header data structures for BMP file and default
|
This file defines BMP file header data structures.
|
||||||
FFS GUID Filename for BMP logo file.
|
It also defines the File GUID for default BMP logo file.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@ -34,10 +34,10 @@ typedef struct {
|
|||||||
UINT32 HeaderSize;
|
UINT32 HeaderSize;
|
||||||
UINT32 PixelWidth;
|
UINT32 PixelWidth;
|
||||||
UINT32 PixelHeight;
|
UINT32 PixelHeight;
|
||||||
UINT16 Planes; /// Must be 1
|
UINT16 Planes; ///> Must be 1
|
||||||
UINT16 BitPerPixel; /// 1, 4, 8, or 24
|
UINT16 BitPerPixel; ///> 1, 4, 8, or 24
|
||||||
UINT32 CompressionType;
|
UINT32 CompressionType;
|
||||||
UINT32 ImageSize; /// Compressed image size in bytes
|
UINT32 ImageSize; ///> Compressed image size in bytes
|
||||||
UINT32 XPixelsPerMeter;
|
UINT32 XPixelsPerMeter;
|
||||||
UINT32 YPixelsPerMeter;
|
UINT32 YPixelsPerMeter;
|
||||||
UINT32 NumberOfColors;
|
UINT32 NumberOfColors;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
This file defines capsule vendor guid for capsule variable and hob.
|
||||||
This file defines capsule vendor guid, capsule variable name
|
It also defines capsule varialbe name and capsule guid hob data structure.
|
||||||
and capsule guid hob data structure.
|
|
||||||
They are used by EDKII implementation of capsule update across a system reset.
|
They are used by EDKII implementation of capsule update across a system reset.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file defines the genenic platform guid for EFI variable.
|
This file defines the genenic platform guid for EFI variable.
|
||||||
Common drivers can use this generic guid with its variable name to specify
|
Generic drivers can use this guid with its variable name to specify
|
||||||
its EFI variable without defining another new guid.
|
its EFI variable without defining another new guid.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
EDK II implementation specific HII relative definition.
|
EDKII extented HII IFR guid opcodes.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@ -98,9 +98,9 @@ typedef struct _EFI_IFR_GUID_BANNER {
|
|||||||
/// EFI_IFR_EXTEND_OP_BANNER
|
/// EFI_IFR_EXTEND_OP_BANNER
|
||||||
///
|
///
|
||||||
UINT8 ExtendOpCode;
|
UINT8 ExtendOpCode;
|
||||||
EFI_STRING_ID Title; /// The string token for the banner title
|
EFI_STRING_ID Title; ///< The string token for the banner title
|
||||||
UINT16 LineNumber; /// 1-based line number
|
UINT16 LineNumber; ///< 1-based line number
|
||||||
UINT8 Alignment; /// left, center, or right-aligned
|
UINT8 Alignment; ///< left, center, or right-aligned
|
||||||
} EFI_IFR_GUID_BANNER;
|
} EFI_IFR_GUID_BANNER;
|
||||||
|
|
||||||
///
|
///
|
||||||
@ -116,7 +116,7 @@ typedef struct _EFI_IFR_GUID_TIMEOUT {
|
|||||||
/// EFI_IFR_EXTEND_OP_TIMEOUT
|
/// EFI_IFR_EXTEND_OP_TIMEOUT
|
||||||
///
|
///
|
||||||
UINT8 ExtendOpCode;
|
UINT8 ExtendOpCode;
|
||||||
UINT16 TimeOut; /// TimeOut Value
|
UINT16 TimeOut; ///< TimeOut Value
|
||||||
} EFI_IFR_GUID_TIMEOUT;
|
} EFI_IFR_GUID_TIMEOUT;
|
||||||
|
|
||||||
#define EFI_NON_DEVICE_CLASS 0x00
|
#define EFI_NON_DEVICE_CLASS 0x00
|
||||||
@ -140,7 +140,7 @@ typedef struct _EFI_IFR_GUID_CLASS {
|
|||||||
/// EFI_IFR_EXTEND_OP_CLASS
|
/// EFI_IFR_EXTEND_OP_CLASS
|
||||||
///
|
///
|
||||||
UINT8 ExtendOpCode;
|
UINT8 ExtendOpCode;
|
||||||
UINT16 Class; /// Device Class from the above
|
UINT16 Class; ///< Device Class from the above
|
||||||
} EFI_IFR_GUID_CLASS;
|
} EFI_IFR_GUID_CLASS;
|
||||||
|
|
||||||
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
|
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
|
||||||
@ -161,7 +161,7 @@ typedef struct _EFI_IFR_GUID_SUBCLASS {
|
|||||||
/// EFI_IFR_EXTEND_OP_SUBCLASS
|
/// EFI_IFR_EXTEND_OP_SUBCLASS
|
||||||
///
|
///
|
||||||
UINT8 ExtendOpCode;
|
UINT8 ExtendOpCode;
|
||||||
UINT16 SubClass; ///Sub Class type from the above
|
UINT16 SubClass; ///< Sub Class type from the above
|
||||||
} EFI_IFR_GUID_SUBCLASS;
|
} EFI_IFR_GUID_SUBCLASS;
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The variable data structure related to EDK II specific UEFI variable implementation.
|
The variable data structures are related to EDK II specific UEFI variable implementation.
|
||||||
|
Variable data header and Variable storage region header are defined here.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@ -16,23 +17,8 @@
|
|||||||
#define __VARIABLE_FORMAT_H__
|
#define __VARIABLE_FORMAT_H__
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Maximum buffer for the single variable.
|
/// Alignment of variable name and data.
|
||||||
///
|
/// For IA32/X64 architecture, the alignment is set to 1, and 8 is for IPF archtecture.
|
||||||
#ifndef MAX_VARIABLE_SIZE
|
|
||||||
#define MAX_VARIABLE_SIZE FixedPcdGet32(PcdMaxVariableSize)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
/// Maximum buffer for Hardware error record variable
|
|
||||||
///
|
|
||||||
#ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE
|
|
||||||
#define MAX_HARDWARE_ERROR_VARIABLE_SIZE FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
///
|
|
||||||
/// The alignment of variable's start offset.
|
|
||||||
/// For IA32/X64 architecture, the alignment is set to 1, and
|
|
||||||
/// 8 is for IPF archtecture.
|
|
||||||
///
|
///
|
||||||
#if defined (MDE_CPU_IPF)
|
#if defined (MDE_CPU_IPF)
|
||||||
#define ALIGNMENT 8
|
#define ALIGNMENT 8
|
||||||
@ -40,10 +26,23 @@
|
|||||||
#define ALIGNMENT 1
|
#define ALIGNMENT 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define HEADER_ALIGNMENT 4
|
//
|
||||||
|
// Define GET_PAD_SIZE to optimize compiler
|
||||||
|
//
|
||||||
|
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
|
||||||
|
#define GET_PAD_SIZE(a) (0)
|
||||||
|
#else
|
||||||
|
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
|
||||||
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Variable Store Status
|
/// Alignment of Variable Data Header in Variable Store region
|
||||||
|
///
|
||||||
|
#define HEADER_ALIGNMENT 4
|
||||||
|
#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Status of Variable Store Region
|
||||||
///
|
///
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EfiRaw,
|
EfiRaw,
|
||||||
@ -100,7 +99,7 @@ typedef struct {
|
|||||||
#define VAR_ADDED 0x3f ///< Variable has been completely added
|
#define VAR_ADDED 0x3f ///< Variable has been completely added
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Variable Data Header Structure
|
/// Single Variable Data Header Structure
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
///
|
///
|
||||||
@ -125,7 +124,7 @@ typedef struct {
|
|||||||
///
|
///
|
||||||
UINT32 DataSize;
|
UINT32 DataSize;
|
||||||
///
|
///
|
||||||
/// A unique identifier for the vendor.
|
/// A unique identifier for the vendor that produce and consume this varaible.
|
||||||
///
|
///
|
||||||
EFI_GUID VendorGuid;
|
EFI_GUID VendorGuid;
|
||||||
} VARIABLE_HEADER;
|
} VARIABLE_HEADER;
|
||||||
|
@ -20,8 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#define WORKING_BLOCK_INVALID 0x2
|
#define WORKING_BLOCK_INVALID 0x2
|
||||||
|
|
||||||
///
|
///
|
||||||
/// EFI Fault tolerant working block header
|
/// EDKII Fault tolerant working block header
|
||||||
/// The header is immediately followed by the write queue.
|
/// The header is immediately followed by the write queue data.
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
///
|
///
|
||||||
|
@ -45,6 +45,6 @@
|
|||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiCrc32GuidedSectionExtractionProtocolGuid # ALWAYS CONSUMED used as Guid, not protocol service
|
gEfiCrc32GuidedSectionExtractionProtocolGuid ## PRODUCED
|
||||||
gEfiSecurityPolicyProtocolGuid # ALWAYS CONSUMED
|
gEfiSecurityPolicyProtocolGuid ## SOMETIMES_CONSUMED (Set platform override AUTH status if exist)
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Capsule Runtime Drivers produces two UEFI capsule runtime services.
|
# Capsule Runtime Drivers produces two UEFI capsule runtime services.
|
||||||
# (UpdateCapsule, QueryCapsuleCapabilities)
|
# (UpdateCapsule, QueryCapsuleCapabilities)
|
||||||
# It installs the Capsule Architectural Protocol (EDKII definition) to signify
|
# It installs the Capsule Architectural Protocol (EDKII extension definition) to signify
|
||||||
# the capsule runtime services are ready.
|
# the capsule runtime services are ready.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
@ -47,10 +47,10 @@
|
|||||||
UefiRuntimeLib
|
UefiRuntimeLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiCapsuleVendorGuid # Produce variable L"CapsuleUpdateData" for capsule updated data
|
gEfiCapsuleVendorGuid ## SOMETIMES_PRODUCED (Process across reset capsule image) ## Variable:L"CapsuleUpdateData" for capsule updated data
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiCapsuleArchProtocolGuid ## PRODUCED
|
||||||
|
|
||||||
[FeaturePcd]
|
[FeaturePcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
|
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
|
||||||
@ -60,4 +60,4 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiVariableWriteArchProtocolGuid # Depends on variable write functionality to produce capsule data variable
|
gEfiVariableWriteArchProtocolGuid ## Depends on variable write functionality to produce capsule data variable
|
||||||
|
@ -50,11 +50,11 @@
|
|||||||
DevicePathLib
|
DevicePathLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiSystemNvDataFvGuid # ALWAYS_CONSUMED, Signature of Working Space Header
|
gEfiSystemNvDataFvGuid ## CONSUMED ## FV Signature of Working Space Header
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiFirmwareVolumeBlockProtocolGuid ## CONSUMED
|
||||||
gEfiFaultTolerantWriteLiteProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiFaultTolerantWriteLiteProtocolGuid ## PRODUCED
|
||||||
|
|
||||||
[Pcd.common]
|
[Pcd.common]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
||||||
|
@ -47,13 +47,13 @@
|
|||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gPcdPeiCallbackFnTableHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
|
gPcdPeiCallbackFnTableHobGuid ## RPIVATE ## Hob
|
||||||
gPcdDataBaseHobGuid # ALWAYS_PRODUCED Hob: GUID_EXTENSION
|
gPcdDataBaseHobGuid ## PRODUCED ## Hob
|
||||||
|
gPcdDataBaseHobGuid ## CONSUMED ## Hob
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED
|
gEfiPeiReadOnlyVariable2PpiGuid ## CONSUMED
|
||||||
gPcdPpiGuid # PPI ALWAYS_PRODUCED
|
gPcdPpiGuid ## PRODUCED
|
||||||
|
|
||||||
[FeaturePcd.common]
|
[FeaturePcd.common]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseSetEnabled
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiPcdDatabaseSetEnabled
|
||||||
|
@ -167,9 +167,8 @@ GetHiiVariable (
|
|||||||
&Size,
|
&Size,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||||
|
|
||||||
|
|
||||||
Status = PeiServicesAllocatePool (Size, &Buffer);
|
Status = PeiServicesAllocatePool (Size, &Buffer);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
gEfiPciCfg2PpiGuid # PPI ALWAYS_PRODUCED
|
gEfiPciCfg2PpiGuid ## PRODUCED
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -1,20 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2007 - 2008, Intel Corporation
|
|
||||||
All rights reserved. This program and the accompanying materials
|
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
PlatOverMngr.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
A UI application to offer a UI interface in device manager to let user configue
|
A UI application to offer a UI interface in device manager to let user configue
|
||||||
platform override protocol to override the default algorithm for matching
|
platform override protocol to override the default algorithm for matching
|
||||||
drivers to controllers.
|
drivers to controllers.
|
||||||
@ -27,6 +12,15 @@ Abstract:
|
|||||||
4. The UI application save all the mapping info in NV variables which will be consumed
|
4. The UI application save all the mapping info in NV variables which will be consumed
|
||||||
by platform override protocol driver to publish the platform override protocol.
|
by platform override protocol driver to publish the platform override protocol.
|
||||||
|
|
||||||
|
Copyright (c) 2007 - 2008, Intel Corporation
|
||||||
|
All rights reserved. This program and the accompanying materials
|
||||||
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
@ -119,28 +113,31 @@ ConvertComponentNameSupportLanguage (
|
|||||||
IN CHAR8 *Language
|
IN CHAR8 *Language
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CHAR8 *LangCode;
|
CHAR8 *LangCode;
|
||||||
LangCode = NULL;
|
LangCode = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// check the input language is English
|
// Check the input language is English
|
||||||
//
|
//
|
||||||
if (AsciiStrnCmp (Language, "en-", 3) != 0) {
|
if (AsciiStrnCmp (Language, "en-", 3) != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert Language string from RFC 3066 to ISO 639-2
|
// Check SupportedLanguages format
|
||||||
//
|
//
|
||||||
LangCode = AllocateZeroPool(4);
|
if (AsciiStrStr (SupportedLanguages, "en-") != NULL) {
|
||||||
AsciiStrCpy (LangCode, "eng");
|
//
|
||||||
|
// Create RFC 3066 language
|
||||||
//
|
//
|
||||||
// Check whether the converted language is supported in the SupportedLanguages list.
|
LangCode = AllocateZeroPool(AsciiStrSize (Language));
|
||||||
//
|
AsciiStrCpy (LangCode, Language);
|
||||||
if (AsciiStrStr (SupportedLanguages, LangCode) == NULL) {
|
} else if (AsciiStrStr (SupportedLanguages, "en") != NULL) {
|
||||||
FreePool (LangCode);
|
//
|
||||||
return NULL;
|
// Create ISO 639-2 Language
|
||||||
|
//
|
||||||
|
LangCode = AllocateZeroPool(4);
|
||||||
|
AsciiStrCpy (LangCode, "eng");
|
||||||
}
|
}
|
||||||
|
|
||||||
return LangCode;
|
return LangCode;
|
||||||
@ -193,12 +190,14 @@ GetComponentName (
|
|||||||
if (ComponentName != NULL) {
|
if (ComponentName != NULL) {
|
||||||
if (ComponentName->GetDriverName != NULL) {
|
if (ComponentName->GetDriverName != NULL) {
|
||||||
SupportedLanguage = ConvertComponentNameSupportLanguage (ComponentName->SupportedLanguages, mLanguage);
|
SupportedLanguage = ConvertComponentNameSupportLanguage (ComponentName->SupportedLanguages, mLanguage);
|
||||||
Status = ComponentName->GetDriverName (
|
if (SupportedLanguage != NULL) {
|
||||||
ComponentName,
|
Status = ComponentName->GetDriverName (
|
||||||
SupportedLanguage,
|
ComponentName,
|
||||||
&DriverName
|
SupportedLanguage,
|
||||||
);
|
&DriverName
|
||||||
FreePool (SupportedLanguage);
|
);
|
||||||
|
FreePool (SupportedLanguage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (ComponentName2 != NULL) {
|
} else if (ComponentName2 != NULL) {
|
||||||
if (ComponentName2->GetDriverName != NULL) {
|
if (ComponentName2->GetDriverName != NULL) {
|
||||||
@ -556,6 +555,9 @@ GetDriverBindingHandleFromImageHandle (
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get the first Driver Binding handle which has the specific image handle.
|
||||||
|
//
|
||||||
for (Index = 0; Index < DriverBindingHandleCount; Index++) {
|
for (Index = 0; Index < DriverBindingHandleCount; Index++) {
|
||||||
DriverBindingInterface = NULL;
|
DriverBindingInterface = NULL;
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
@ -576,9 +578,6 @@ GetDriverBindingHandleFromImageHandle (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// If no Driver Binding Protocol instance is found
|
|
||||||
//
|
|
||||||
FreePool (DriverBindingHandleBuffer);
|
FreePool (DriverBindingHandleBuffer);
|
||||||
return DriverBindingHandle;
|
return DriverBindingHandle;
|
||||||
}
|
}
|
||||||
@ -1341,7 +1340,7 @@ PlatOverMngrInit (
|
|||||||
//
|
//
|
||||||
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
|
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Finish;
|
||||||
}
|
}
|
||||||
CallbackInfo->DriverHandle = DriverHandle;
|
CallbackInfo->DriverHandle = DriverHandle;
|
||||||
|
|
||||||
@ -1355,7 +1354,7 @@ PlatOverMngrInit (
|
|||||||
&CallbackInfo->ConfigAccess
|
&CallbackInfo->ConfigAccess
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1377,6 +1376,10 @@ PlatOverMngrInit (
|
|||||||
);
|
);
|
||||||
FreePool (PackageList);
|
FreePool (PackageList);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto Finish;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Locate ConfigRouting protocol
|
// Locate ConfigRouting protocol
|
||||||
//
|
//
|
||||||
@ -1386,7 +1389,7 @@ PlatOverMngrInit (
|
|||||||
(VOID **) &CallbackInfo->HiiConfigRouting
|
(VOID **) &CallbackInfo->HiiConfigRouting
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1411,11 +1414,24 @@ PlatOverMngrInit (
|
|||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
goto Finish;
|
||||||
|
}
|
||||||
|
|
||||||
Status = HiiDatabase->RemovePackageList (HiiDatabase, CallbackInfo->RegisteredHandle);
|
Status = HiiDatabase->RemovePackageList (HiiDatabase, CallbackInfo->RegisteredHandle);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
goto Finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
|
Finish:
|
||||||
|
if (CallbackInfo->DriverHandle != NULL) {
|
||||||
|
HiiLibDestroyHiiDriverHandle (CallbackInfo->DriverHandle);
|
||||||
|
}
|
||||||
|
if (CallbackInfo != NULL) {
|
||||||
|
FreePool (CallbackInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -67,21 +67,22 @@
|
|||||||
GenericBdsLib
|
GenericBdsLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiGlobalVariableGuid # Get value of variable L"PlatformLang".
|
gEfiGlobalVariableGuid ## CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 3066 format)
|
||||||
# this value specifies the platform supported language string (RFC 3066)
|
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiComponentName2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
|
||||||
gEfiComponentNameProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
|
||||||
gEfiFirmwareVolume2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
|
||||||
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
|
||||||
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
|
||||||
gEfiBusSpecificDriverOverrideProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
|
||||||
gEfiDriverBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
|
||||||
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
|
||||||
gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
|
||||||
gEfiHiiDatabaseProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
|
||||||
gEfiFormBrowser2ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
|
||||||
gEfiHiiConfigRoutingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiHiiDatabaseProtocolGuid ## CONSUMED
|
||||||
gEfiHiiConfigAccessProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiFormBrowser2ProtocolGuid ## CONSUMED
|
||||||
|
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
|
||||||
|
gEfiHiiConfigAccessProtocolGuid ## PRODUCED
|
||||||
|
|
@ -45,5 +45,5 @@
|
|||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiPlatformDriverOverrideProtocolGuid # ALWAYS_PRODUCED
|
gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED
|
||||||
|
|
@ -39,7 +39,7 @@
|
|||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSecurityArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiSecurityArchProtocolGuid ## PRODUCED
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -118,7 +118,7 @@ GetNextVariablePtr (
|
|||||||
VarHeader = (VARIABLE_HEADER *) (GetVariableDataPtr (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
|
VarHeader = (VARIABLE_HEADER *) (GetVariableDataPtr (Variable) + Variable->DataSize + GET_PAD_SIZE (Variable->DataSize));
|
||||||
|
|
||||||
if (VarHeader->StartId != VARIABLE_DATA ||
|
if (VarHeader->StartId != VARIABLE_DATA ||
|
||||||
(sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > MAX_VARIABLE_SIZE
|
(sizeof (VARIABLE_HEADER) + VarHeader->DataSize + VarHeader->NameSize) > FixedPcdGet32(PcdMaxVariableSize)
|
||||||
) {
|
) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -485,21 +485,21 @@ SetVariable (
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||||
// the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
|
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
||||||
// bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
|
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
|
||||||
//
|
//
|
||||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||||
if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
|
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
|
||||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
|
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||||
// the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
|
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
|
||||||
//
|
//
|
||||||
if ((DataSize > MAX_VARIABLE_SIZE) ||
|
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
|
||||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
|
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -740,15 +740,15 @@ QueryVariableInfo (
|
|||||||
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
|
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
|
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
|
||||||
//
|
//
|
||||||
*MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
|
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Harware error record variable needs larger size.
|
// Harware error record variable needs larger size.
|
||||||
//
|
//
|
||||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||||
*MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
|
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -808,13 +808,13 @@ InitializeVariableStore (
|
|||||||
// Allocate memory for volatile variable store
|
// Allocate memory for volatile variable store
|
||||||
//
|
//
|
||||||
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (
|
VariableStore = (VARIABLE_STORE_HEADER *) AllocateRuntimePool (
|
||||||
VARIABLE_STORE_SIZE
|
FixedPcdGet32(PcdVariableStoreSize)
|
||||||
);
|
);
|
||||||
if (NULL == VariableStore) {
|
if (NULL == VariableStore) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMem (VariableStore, VARIABLE_STORE_SIZE, 0xff);
|
SetMem (VariableStore, FixedPcdGet32(PcdVariableStoreSize), 0xff);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Variable Specific Data
|
// Variable Specific Data
|
||||||
@ -823,7 +823,7 @@ InitializeVariableStore (
|
|||||||
*LastVariableOffset = sizeof (VARIABLE_STORE_HEADER);
|
*LastVariableOffset = sizeof (VARIABLE_STORE_HEADER);
|
||||||
|
|
||||||
VariableStore->Signature = VARIABLE_STORE_SIGNATURE;
|
VariableStore->Signature = VARIABLE_STORE_SIGNATURE;
|
||||||
VariableStore->Size = VARIABLE_STORE_SIZE;
|
VariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
|
||||||
VariableStore->Format = VARIABLE_STORE_FORMATTED;
|
VariableStore->Format = VARIABLE_STORE_FORMATTED;
|
||||||
VariableStore->State = VARIABLE_STORE_HEALTHY;
|
VariableStore->State = VARIABLE_STORE_HEALTHY;
|
||||||
VariableStore->Reserved = 0;
|
VariableStore->Reserved = 0;
|
||||||
|
@ -33,18 +33,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Library/PcdLib.h>
|
#include <Library/PcdLib.h>
|
||||||
#include <VariableFormat.h>
|
#include <VariableFormat.h>
|
||||||
|
|
||||||
#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
|
|
||||||
#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define GET_PAD_SIZE to optimize compiler
|
|
||||||
//
|
|
||||||
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
|
|
||||||
#define GET_PAD_SIZE(a) (0)
|
|
||||||
#else
|
|
||||||
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
|
#define GET_VARIABLE_NAME_PTR(a) (CHAR16 *) ((UINTN) (a) + sizeof (VARIABLE_HEADER))
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -30,17 +30,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#include <VariableFormat.h>
|
#include <VariableFormat.h>
|
||||||
|
|
||||||
//
|
|
||||||
// Define GET_PAD_SIZE to optimize compiler
|
|
||||||
//
|
|
||||||
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
|
|
||||||
#define GET_PAD_SIZE(a) (0)
|
|
||||||
#else
|
|
||||||
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VARIABLE_HEADER *CurrPtr;
|
VARIABLE_HEADER *CurrPtr;
|
||||||
VARIABLE_HEADER *EndPtr;
|
VARIABLE_HEADER *EndPtr;
|
||||||
|
@ -1225,21 +1225,21 @@ RuntimeServiceSetVariable (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||||
// the DataSize is limited to maximum size of MAX_HARDWARE_ERROR_VARIABLE_SIZE (32K)
|
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
||||||
// bytes for HwErrRec, and MAX_VARIABLE_SIZE (1024) bytes for the others.
|
// bytes for HwErrRec, and FixedPcdGet32(PcdMaxVariableSize) bytes for the others.
|
||||||
//
|
//
|
||||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||||
if ((DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE) ||
|
if ((DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize)) ||
|
||||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_HARDWARE_ERROR_VARIABLE_SIZE)) {
|
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxHardwareErrorVariableSize))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// The size of the VariableName, including the Unicode Null in bytes plus
|
// The size of the VariableName, including the Unicode Null in bytes plus
|
||||||
// the DataSize is limited to maximum size of MAX_VARIABLE_SIZE (1024) bytes.
|
// the DataSize is limited to maximum size of FixedPcdGet32(PcdMaxVariableSize) bytes.
|
||||||
//
|
//
|
||||||
if ((DataSize > MAX_VARIABLE_SIZE) ||
|
if ((DataSize > FixedPcdGet32(PcdMaxVariableSize)) ||
|
||||||
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > MAX_VARIABLE_SIZE)) {
|
(sizeof (VARIABLE_HEADER) + StrSize (VariableName) + DataSize > FixedPcdGet32(PcdMaxVariableSize))) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1391,7 +1391,7 @@ RuntimeServiceSetVariable (
|
|||||||
//
|
//
|
||||||
NextVariable = GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
|
NextVariable = GetEndPointer ((VARIABLE_STORE_HEADER *) ((UINTN) mVariableModuleGlobal->VariableGlobal.VolatileVariableBase));
|
||||||
|
|
||||||
SetMem (NextVariable, SCRATCH_SIZE, 0xff);
|
SetMem (NextVariable, FixedPcdGet32(PcdMaxVariableSize), 0xff);
|
||||||
|
|
||||||
NextVariable->StartId = VARIABLE_DATA;
|
NextVariable->StartId = VARIABLE_DATA;
|
||||||
NextVariable->Attributes = Attributes;
|
NextVariable->Attributes = Attributes;
|
||||||
@ -1690,15 +1690,15 @@ RuntimeServiceQueryVariableInfo (
|
|||||||
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
|
*RemainingVariableStorageSize = VariableStoreHeader->Size - sizeof (VARIABLE_STORE_HEADER);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Let *MaximumVariableSize be MAX_VARIABLE_SIZE with the exception of the variable header size.
|
// Let *MaximumVariableSize be FixedPcdGet32(PcdMaxVariableSize) with the exception of the variable header size.
|
||||||
//
|
//
|
||||||
*MaximumVariableSize = MAX_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
|
*MaximumVariableSize = FixedPcdGet32(PcdMaxVariableSize) - sizeof (VARIABLE_HEADER);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Harware error record variable needs larger size.
|
// Harware error record variable needs larger size.
|
||||||
//
|
//
|
||||||
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
if ((Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD) == EFI_VARIABLE_HARDWARE_ERROR_RECORD) {
|
||||||
*MaximumVariableSize = MAX_HARDWARE_ERROR_VARIABLE_SIZE - sizeof (VARIABLE_HEADER);
|
*MaximumVariableSize = FixedPcdGet32(PcdMaxHardwareErrorVariableSize) - sizeof (VARIABLE_HEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -1835,13 +1835,13 @@ VariableCommonInitialize (
|
|||||||
//
|
//
|
||||||
// Allocate memory for volatile variable store
|
// Allocate memory for volatile variable store
|
||||||
//
|
//
|
||||||
VolatileVariableStore = AllocateRuntimePool (VARIABLE_STORE_SIZE + SCRATCH_SIZE);
|
VolatileVariableStore = AllocateRuntimePool (FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize));
|
||||||
if (VolatileVariableStore == NULL) {
|
if (VolatileVariableStore == NULL) {
|
||||||
FreePool (mVariableModuleGlobal);
|
FreePool (mVariableModuleGlobal);
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMem (VolatileVariableStore, VARIABLE_STORE_SIZE + SCRATCH_SIZE, 0xff);
|
SetMem (VolatileVariableStore, FixedPcdGet32(PcdVariableStoreSize) + FixedPcdGet32(PcdMaxVariableSize), 0xff);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Variable Specific Data
|
// Variable Specific Data
|
||||||
@ -1850,7 +1850,7 @@ VariableCommonInitialize (
|
|||||||
mVariableModuleGlobal->VolatileLastVariableOffset = (UINTN) GetStartPointer (VolatileVariableStore) - (UINTN) VolatileVariableStore;
|
mVariableModuleGlobal->VolatileLastVariableOffset = (UINTN) GetStartPointer (VolatileVariableStore) - (UINTN) VolatileVariableStore;
|
||||||
|
|
||||||
VolatileVariableStore->Signature = VARIABLE_STORE_SIGNATURE;
|
VolatileVariableStore->Signature = VARIABLE_STORE_SIGNATURE;
|
||||||
VolatileVariableStore->Size = VARIABLE_STORE_SIZE;
|
VolatileVariableStore->Size = FixedPcdGet32(PcdVariableStoreSize);
|
||||||
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
|
VolatileVariableStore->Format = VARIABLE_STORE_FORMATTED;
|
||||||
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
|
VolatileVariableStore->State = VARIABLE_STORE_HEALTHY;
|
||||||
VolatileVariableStore->Reserved = 0;
|
VolatileVariableStore->Reserved = 0;
|
||||||
|
@ -37,25 +37,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Guid/GlobalVariable.h>
|
#include <Guid/GlobalVariable.h>
|
||||||
#include <VariableFormat.h>
|
#include <VariableFormat.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define VARIABLE_RECLAIM_THRESHOLD (1024)
|
#define VARIABLE_RECLAIM_THRESHOLD (1024)
|
||||||
|
|
||||||
#define VARIABLE_STORE_SIZE FixedPcdGet32(PcdVariableStoreSize)
|
|
||||||
#define SCRATCH_SIZE FixedPcdGet32(PcdMaxVariableSize)
|
|
||||||
|
|
||||||
//
|
|
||||||
// Define GET_PAD_SIZE to optimize compiler
|
|
||||||
//
|
|
||||||
#if ((ALIGNMENT == 0) || (ALIGNMENT == 1))
|
|
||||||
#define GET_PAD_SIZE(a) (0)
|
|
||||||
#else
|
|
||||||
#define GET_PAD_SIZE(a) (((~a) + 1) & (ALIGNMENT - 1))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HEADER_ALIGN(Header) (((UINTN) (Header) + HEADER_ALIGNMENT - 1) & (~(HEADER_ALIGNMENT - 1)))
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VARIABLE_HEADER *CurrPtr;
|
VARIABLE_HEADER *CurrPtr;
|
||||||
VARIABLE_HEADER *EndPtr;
|
VARIABLE_HEADER *EndPtr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user