mirror of https://github.com/acidanthera/audk.git
Add sample code for PCD Database generation. These 3 files will be read by GenBuild tool and it is generated in the Head and Source file of PCD Service PEIM/Dxe Driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@251 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
99d2c3c41e
commit
8b29c893b1
|
@ -0,0 +1,53 @@
|
|||
//
|
||||
// The following definition will be generated by build tool
|
||||
//
|
||||
|
||||
//
|
||||
// Common definitions
|
||||
//
|
||||
#define PCD_TYPE_SHIFT 24
|
||||
|
||||
|
||||
#define PCD_TYPE_DATA (0x00 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_HII (0x80 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_VPD (0x40 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_SKU_ENABLED (0x20 << PCD_TYPE_SHIFT)
|
||||
#define PCD_TYPE_STRING (0x10 << PCD_TYPE_SHIFT)
|
||||
|
||||
|
||||
#define PCD_DATABASE_OFFSET_MASK (~(PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING))
|
||||
|
||||
typedef struct {
|
||||
UINT32 ExTokenNumber;
|
||||
UINT32 LocalTokenNumber; // PCD Number of this particular platform build
|
||||
UINT16 ExGuidIndex; // Index of GuidTable
|
||||
} DYNAMICEX_MAPPING;
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINT32 SkuDataStartOffset; //We have to use offsetof MACRO as we don't know padding done by compiler
|
||||
UINT32 SkuIdTableOffset; //Offset from the PCD_DB
|
||||
} SKU_HEAD;
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
|
||||
UINT16 StringIndex; // Offset in String Table in units of UINT16.
|
||||
UINT16 Offset; // Offset in Variable
|
||||
} VARIABLE_HEAD ;
|
||||
|
||||
|
||||
typedef struct {
|
||||
UINT32 Offset;
|
||||
} VPD_HEAD;
|
||||
|
||||
typedef struct {
|
||||
UINT32 LocalTokenNumber;
|
||||
UINT16 TokenNumber;
|
||||
UINT16 Size;
|
||||
} SIZEINFO;
|
||||
|
||||
#define offsetof(s,m) (UINT32)&(((s *)0)->m)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
typedef struct {
|
||||
DXE_PCD_DATABASE_INIT Init;
|
||||
DXE_PCD_DATABASE_UNINIT Uninit;
|
||||
} DXE_PCD_DATABASE;
|
||||
|
||||
|
||||
typedef struct {
|
||||
PEI_PCD_DATABASE PeiDb;
|
||||
DXE_PCD_DATABASE DxeDb;
|
||||
} PCD_DATABASE;
|
||||
|
||||
#define DXE_NEX_TOKEN_NUMBER (DXE_LOCAL_TOKEN_NUMBER - DXE_EX_TOKEN_NUMBER)
|
||||
|
||||
#define PCD_TOTAL_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
typedef struct {
|
||||
PEI_PCD_DATABASE_INIT Init;
|
||||
PEI_PCD_DATABASE_UNINIT Uninit;
|
||||
} PEI_PCD_DATABASE;
|
||||
|
||||
#define PEI_NEX_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER - PEI_EX_TOKEN_NUMBER)
|
||||
|
Loading…
Reference in New Issue