2008-07-08 15:29:42 +02:00
|
|
|
/** @file
|
2008-11-27 05:53:43 +01:00
|
|
|
The variable data structure related to EDK II specific UEFI variable implementation.
|
2007-07-24 12:52:02 +02:00
|
|
|
|
2008-07-08 15:29:42 +02:00
|
|
|
Copyright (c) 2006 - 2008 Intel Corporation. <BR>
|
2007-07-24 12:52:02 +02:00
|
|
|
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
|
2008-11-27 05:53:43 +01:00
|
|
|
|
2007-07-24 12:52:02 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __VARIABLE_FORMAT_H__
|
|
|
|
#define __VARIABLE_FORMAT_H__
|
|
|
|
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Maximum buffer for the single variable.
|
|
|
|
///
|
2008-10-15 06:20:44 +02:00
|
|
|
#ifndef MAX_VARIABLE_SIZE
|
2007-11-05 17:11:50 +01:00
|
|
|
#define MAX_VARIABLE_SIZE FixedPcdGet32(PcdMaxVariableSize)
|
2008-10-15 06:20:44 +02:00
|
|
|
#endif
|
2008-11-27 05:53:43 +01:00
|
|
|
|
|
|
|
///
|
2008-12-03 09:55:36 +01:00
|
|
|
/// Maximum buffer for Hardware error record variable
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
2008-10-15 06:20:44 +02:00
|
|
|
#ifndef MAX_HARDWARE_ERROR_VARIABLE_SIZE
|
2007-11-05 17:11:50 +01:00
|
|
|
#define MAX_HARDWARE_ERROR_VARIABLE_SIZE FixedPcdGet32(PcdMaxHardwareErrorVariableSize)
|
2008-10-15 06:20:44 +02:00
|
|
|
#endif
|
2007-07-24 12:52:02 +02:00
|
|
|
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// The alignment of variable's start offset.
|
|
|
|
/// For IA32/X64 architecture, the alignment is set to 1, and
|
|
|
|
/// 8 is for IPF archtecture.
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
#if defined (MDE_CPU_IPF)
|
2008-01-10 05:26:13 +01:00
|
|
|
#define ALIGNMENT 8
|
2007-07-24 12:52:02 +02:00
|
|
|
#else
|
2008-01-10 05:26:13 +01:00
|
|
|
#define ALIGNMENT 1
|
2007-07-24 12:52:02 +02:00
|
|
|
#endif
|
|
|
|
|
2008-01-10 05:26:13 +01:00
|
|
|
#define HEADER_ALIGNMENT 4
|
|
|
|
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Variable Store Status
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
typedef enum {
|
|
|
|
EfiRaw,
|
|
|
|
EfiValid,
|
|
|
|
EfiInvalid,
|
|
|
|
EfiUnknown
|
|
|
|
} VARIABLE_STORE_STATUS;
|
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define VARIABLE_STORE_SIGNATURE SIGNATURE_32 ('$', 'V', 'S', 'S')
|
2008-11-27 05:53:43 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Variable Store Header Format and State
|
|
|
|
///
|
|
|
|
#define VARIABLE_STORE_FORMATTED 0x5a
|
|
|
|
#define VARIABLE_STORE_HEALTHY 0xfe
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Variable Store region header
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
typedef struct {
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Variable store region signature.
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT32 Signature;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Size of variable store region including this header
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT32 Size;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// variable region format state
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT8 Format;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// variable region healthy state
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT8 State;
|
|
|
|
UINT16 Reserved;
|
|
|
|
UINT32 Reserved1;
|
|
|
|
} VARIABLE_STORE_HEADER;
|
|
|
|
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Variable data start flag
|
|
|
|
///
|
|
|
|
#define VARIABLE_DATA 0x55AA
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Variable State flags
|
|
|
|
///
|
2008-12-25 10:13:53 +01:00
|
|
|
#define VAR_IN_DELETED_TRANSITION 0xfe ///< Variable is in obsolete transistion
|
|
|
|
#define VAR_DELETED 0xfd ///< Variable is obsolete
|
|
|
|
#define VAR_HEADER_VALID_ONLY 0x7f ///< Variable header has been valid
|
|
|
|
#define VAR_ADDED 0x3f ///< Variable has been completely added
|
2008-11-27 05:53:43 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Removed
|
|
|
|
///
|
|
|
|
#define IS_VARIABLE_STATE(_c, _Mask) (BOOLEAN) (((~_c) & (~_Mask)) != 0)
|
|
|
|
|
|
|
|
///
|
|
|
|
/// Variable Data Header Structure
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
typedef struct {
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Variable Data Start Flag
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT16 StartId;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Variable State defined above
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT8 State;
|
|
|
|
UINT8 Reserved;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Attributes of variable defined in UEFI spec
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT32 Attributes;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Size of variable Null-terminated Unicode string name
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT32 NameSize;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// Size of the variable data without this header
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
UINT32 DataSize;
|
2008-11-27 05:53:43 +01:00
|
|
|
///
|
|
|
|
/// A unique identifier for the vendor.
|
|
|
|
///
|
2007-07-24 12:52:02 +02:00
|
|
|
EFI_GUID VendorGuid;
|
|
|
|
} VARIABLE_HEADER;
|
|
|
|
|
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
#endif // _EFI_VARIABLE_H_
|