Add sample code for PCD Database generation. These 3 files will be read by GenBuild...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 May 2006 08:11:21 +0000 (08:11 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 May 2006 08:11:21 +0000 (08:11 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@251 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Conf/Pcd/PcdDatabaseCommonDefinitions.sample [new file with mode: 0644]
Tools/Conf/Pcd/PcdDatabaseDxeDefinitions.sample [new file with mode: 0644]
Tools/Conf/Pcd/PcdDatabasePeiDefinitions.sample [new file with mode: 0644]

diff --git a/Tools/Conf/Pcd/PcdDatabaseCommonDefinitions.sample b/Tools/Conf/Pcd/PcdDatabaseCommonDefinitions.sample
new file mode 100644 (file)
index 0000000..9b7d7d3
--- /dev/null
@@ -0,0 +1,53 @@
+//\r
+// The following definition will be generated by build tool \r
+//\r
+\r
+//\r
+// Common definitions\r
+//\r
+#define PCD_TYPE_SHIFT        24\r
+\r
+\r
+#define PCD_TYPE_DATA         (0x00 << PCD_TYPE_SHIFT)\r
+#define PCD_TYPE_HII               (0x80 << PCD_TYPE_SHIFT)\r
+#define PCD_TYPE_VPD               (0x40 << PCD_TYPE_SHIFT)\r
+#define PCD_TYPE_SKU_ENABLED   (0x20 << PCD_TYPE_SHIFT)\r
+#define PCD_TYPE_STRING       (0x10 << PCD_TYPE_SHIFT)\r
+\r
+\r
+#define PCD_DATABASE_OFFSET_MASK (~(PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING))\r
+\r
+typedef struct  {\r
+  UINT32                ExTokenNumber;\r
+  UINT32                LocalTokenNumber;   // PCD Number of this particular platform build\r
+  UINT16                ExGuidIndex;        // Index of GuidTable\r
+} DYNAMICEX_MAPPING;\r
+\r
+\r
+typedef struct {\r
+  UINT32  SkuDataStartOffset; //We have to use offsetof MACRO as we don't know padding done by compiler\r
+  UINT32  SkuIdTableOffset;   //Offset from the PCD_DB\r
+} SKU_HEAD;\r
+\r
+\r
+typedef struct {\r
+  UINT16  GuidTableIndex;   // Offset in Guid Table in units of GUID.\r
+  UINT16  StringIndex;           // Offset in String Table in units of UINT16.\r
+  UINT16  Offset;           // Offset in Variable\r
+} VARIABLE_HEAD  ;\r
+\r
+\r
+typedef  struct {\r
+  UINT32  Offset;\r
+} VPD_HEAD;\r
+\r
+typedef struct {\r
+  UINT32 LocalTokenNumber;\r
+  UINT16 TokenNumber;\r
+  UINT16 Size;\r
+} SIZEINFO;\r
+\r
+#define offsetof(s,m)                 (UINT32)&(((s *)0)->m)\r
+\r
+\r
+\r
diff --git a/Tools/Conf/Pcd/PcdDatabaseDxeDefinitions.sample b/Tools/Conf/Pcd/PcdDatabaseDxeDefinitions.sample
new file mode 100644 (file)
index 0000000..be2bc0e
--- /dev/null
@@ -0,0 +1,16 @@
+\r
+typedef struct {\r
+  DXE_PCD_DATABASE_INIT Init;\r
+  DXE_PCD_DATABASE_UNINIT Uninit;\r
+} DXE_PCD_DATABASE;\r
+\r
+\r
+typedef struct {\r
+  PEI_PCD_DATABASE PeiDb;\r
+  DXE_PCD_DATABASE DxeDb;\r
+} PCD_DATABASE;\r
+\r
+#define DXE_NEX_TOKEN_NUMBER (DXE_LOCAL_TOKEN_NUMBER - DXE_EX_TOKEN_NUMBER)\r
+\r
+#define PCD_TOTAL_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)\r
+\r
diff --git a/Tools/Conf/Pcd/PcdDatabasePeiDefinitions.sample b/Tools/Conf/Pcd/PcdDatabasePeiDefinitions.sample
new file mode 100644 (file)
index 0000000..86ae4fc
--- /dev/null
@@ -0,0 +1,8 @@
+\r
+typedef struct {\r
+  PEI_PCD_DATABASE_INIT Init;\r
+  PEI_PCD_DATABASE_UNINIT Uninit;\r
+} PEI_PCD_DATABASE;\r
+\r
+#define PEI_NEX_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER - PEI_EX_TOKEN_NUMBER)\r
+\r