From 4acf8ce7da7a8125ec83c6ce6d4dd675314e3d59 Mon Sep 17 00:00:00 2001 From: qwang12 Date: Fri, 26 May 2006 11:00:44 +0000 Subject: Add version check in both PCD database generation and service driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@292 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Universal/PCD/Dxe/Service.h | 191 ++----------------------------- 1 file changed, 7 insertions(+), 184 deletions(-) (limited to 'EdkModulePkg/Universal/PCD/Dxe/Service.h') diff --git a/EdkModulePkg/Universal/PCD/Dxe/Service.h b/EdkModulePkg/Universal/PCD/Dxe/Service.h index d5918f2693..54ab1b6551 100644 --- a/EdkModulePkg/Universal/PCD/Dxe/Service.h +++ b/EdkModulePkg/Universal/PCD/Dxe/Service.h @@ -18,197 +18,20 @@ Module Name: Service.h #ifndef _SERVICE_H #define _SERVICE_H -#define USE_AUTOGEN - -#ifndef USE_AUTOGEN -// -// 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_DATABASE_OFFSET_MASK (~(PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED)) - -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) - - - -// -// C Structure generate for PEI PCD Database -// -#define PEI_EXMAPPING_TABLE_SIZE 1 -#define PEI_GUID_TABLE_SIZE 1 -#define PEI_LOCAL_TOKEN_NUMBER 1 -#define PEI_EXTOKEN_NUMBER 1 -#define PEI_STRING_TABLE_SIZE 2 -#define PEI_SKUID_TABLE_SIZE 3 -#define PEI_SIZE_TABLE_SIZE 1 - -#define PEI_DATABASE_EMPTRY FALSE -#define PEI_DYNAMICEX_MAPPING_EMPTY FALSE -#define PEI_GUID_TABLE_EMPTY FALSE -#define PEI_STRINGTABLE_EMPTY FALSE -#define PEI_SIZETABLE_EMPTY FALSE -#define PEI_SKUID_TABLE_EMPTY FALSE - - -typedef struct { - - DYNAMICEX_MAPPING ExMapTable[PEI_EXMAPPING_TABLE_SIZE]; - EFI_GUID GuidTable[PEI_GUID_TABLE_SIZE]; - - UINT32 LocalTokenNumberTable[PEI_LOCAL_TOKEN_NUMBER]; - - - UINT16 StringTable[PEI_STRING_TABLE_SIZE]; - UINT16 SizeTable[PEI_LOCAL_TOKEN_NUMBER]; - - SKU_ID SkuIdTable[PEI_SKUID_TABLE_SIZE]; - - SKU_ID SystemSkuId; - -} PEI_PCD_DATABASE_INIT; - -typedef struct { - UINT8 Dummy; -} PEI_PCD_DATABASE_UNINIT; - // -// Following code should be generated for PCD DXE driver +// Please make sure the PCD Serivce PEIM Version is consistent with +// the version of PCD Database generation tool // - -#define DXE_EXMAPPING_TABLE_SIZE 1 -#define DXE_GUID_TABLE_SIZE 1 -#define DXE_TOKEN_NUMBER 1 -#define DXE_EXTOKEN_NUMBER 1 -#define DXE_STRING_TABLE_SIZE 2 -#define DXE_SKUID_TABLE_SIZE 3 -#define DXE_SIZE_TABLE_SIZE 1 - -#define DXE_DATABASE_EMPTRY FALSE -#define DXE_DYNAMICEX_MAPPING_EMPTY FALSE -#define DXE_GUID_TABLE_EMPTY FALSE -#define DXE_STRINGTABLE_EMPTY FALSE -#define DXE_SIZETABLE_EMPTY FALSE -#define DXE_SKUID_TABLE_EMPTY FALSE - -typedef struct { - DYNAMICEX_MAPPING ExMapTable[DXE_EXMAPPING_TABLE_SIZE]; - EFI_GUID GuidTable[DXE_GUID_TABLE_SIZE]; - - UINT32 LocalTokenNumberTable[DXE_TOKEN_NUMBER]; - - - UINT16 StringTable[DXE_STRING_TABLE_SIZE]; - UINT16 SizeTable[DXE_TOKEN_NUMBER]; - - SKU_ID SkuIdTable[DXE_SKUID_TABLE_SIZE]; - -} DXE_PCD_DATABASE_INIT; - -typedef struct { - UINT8 Dummy; -} DXE_PCD_DATABASE_UNINIT; - - -#define DXE_PCD_DB_INIT_VALUE \ - /* ExMapTable */ \ - { \ - { /* ExTokenNumber */ 0x00000001, /* LocalTokenNumberIndex */ 0, /* ExGuidIndex */ 0} \ - }, \ - \ - /* GuidTable */ \ - { \ - { 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD }} \ - }, \ - \ - /* LocalTokenNumberTable */ \ - { \ - 0 \ - }, \ - \ - /* StringTable */ \ - { \ - L"\0" \ - }, \ - \ - /* SizeTable */ \ - { \ - 4 \ - }, \ - \ - /* SkuIdTable */ \ - { \ - /*MaxSku*/ 2, /*SkuId*/ 100, /*SkuId*/200 \ - },\ - \ +#define PCD_DXE_SERVICE_DRIVER_VERSION 1 // -// End of Autogen Code +// PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h +// and generated by PCD Database generation tool. // +#if (PCD_DXE_SERVICE_PEIM_VERSION != PCD_DXE_DATABASE_GENTOOL_VERSION) + #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches" #endif -/* -typedef struct { - PEI_PCD_DATABASE_INIT Init; - PEI_PCD_DATABASE_UNINIT Uninit; -} PEI_PCD_DATABASE; - - - -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; -*/ - - // // Internal Functions // -- cgit v1.2.3