]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Pei/Service.h
MdeModulePkg: Update PCD driver to support the optimized PcdDataBase
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Pei / Service.h
index 006681c49407e91fff4a7130241b616416c3d757..3a7910a900c8261ccbc2bf428b953e516acf8865 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
-Private functions used by PCD PEIM.\r
+  The internal header file declares the private functions used by PeiPcd driver.\r
 \r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -10,9 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-\r
-Module Name: Service.h\r
-\r
 **/\r
 \r
 #ifndef _PEI_PCD_SERVICE_H_\r
@@ -21,29 +18,88 @@ Module Name: Service.h
 #include <PiPei.h>\r
 #include <Ppi/ReadOnlyVariable2.h>\r
 #include <Ppi/Pcd.h>\r
+#include <Ppi/PiPcd.h>\r
+#include <Ppi/PcdInfo.h>\r
+#include <Ppi/PiPcdInfo.h>\r
+#include <Guid/PcdDataBaseHobGuid.h>\r
+#include <Guid/PcdDataBaseSignatureGuid.h>\r
+#include <Guid/VariableFormat.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/PeiServicesLib.h>\r
 #include <Library/PcdLib.h>\r
-#include <Library/PeiServicesTablePointerLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
-\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 //\r
 // Please make sure the PCD Serivce PEIM Version is consistent with\r
-// the version of PCD Database generation tool\r
+// the version of the generated PEIM PCD Database by build tool.\r
 //\r
-#define PCD_SERVICE_PEIM_VERSION      2\r
+#define PCD_SERVICE_PEIM_VERSION      7\r
 \r
 //\r
-// PCD_PEI_DATABASE_GENTOOL_VERSION is defined in Autogen.h\r
-// and generated by PCD Database generation tool.\r
+// PCD_PEI_SERVICE_DRIVER_VERSION is defined in Autogen.h.\r
 //\r
-//#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_AUTOGEN_VERSION )\r
-//  #error "Please make sure the version of PCD Service PEIM and PCD PEI Database Generation Tool matches"\r
-//#endif\r
+#if (PCD_SERVICE_PEIM_VERSION != PCD_PEI_SERVICE_DRIVER_VERSION)\r
+  #error "Please make sure the version of PCD PEIM Service and the generated PCD PEI Database match."\r
+#endif\r
+\r
+/**\r
+  Retrieve additional information associated with a PCD token in the default token space.\r
+\r
+  This includes information such as the type of value the TokenNumber is associated with as well as possible\r
+  human readable name that is associated with the token.\r
+\r
+  @param[in]    TokenNumber The PCD token number.\r
+  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.\r
+                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
+\r
+  @retval  EFI_SUCCESS      The PCD information was returned successfully.\r
+  @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiGetPcdInfoGetInfo (\r
+  IN        UINTN           TokenNumber,\r
+  OUT       EFI_PCD_INFO    *PcdInfo\r
+  );\r
+\r
+/**\r
+  Retrieve additional information associated with a PCD token.\r
+\r
+  This includes information such as the type of value the TokenNumber is associated with as well as possible\r
+  human readable name that is associated with the token.\r
+\r
+  @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
+  @param[in]    TokenNumber The PCD token number.\r
+  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.\r
+                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName.\r
+\r
+  @retval  EFI_SUCCESS      The PCD information was returned successfully.\r
+  @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+PeiGetPcdInfoGetInfoEx (\r
+  IN CONST  EFI_GUID        *Guid,\r
+  IN        UINTN           TokenNumber,\r
+  OUT       EFI_PCD_INFO    *PcdInfo\r
+  );\r
+\r
+/**\r
+  Retrieve the currently set SKU Id.\r
+\r
+  @return   The currently set SKU Id. If the platform has not set at a SKU Id, then the\r
+            default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU\r
+            Id is returned.\r
+**/\r
+UINTN\r
+EFIAPI\r
+PeiGetPcdInfoGetSku (\r
+  VOID\r
+  );\r
 \r
 //\r
 // PPI Interface Implementation Declaration.\r
@@ -69,15 +125,12 @@ Module Name: Service.h
   @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and \r
               set values associated with a PCD token.\r
 \r
-  @retval VOID\r
-\r
 **/\r
 VOID\r
 EFIAPI\r
 PeiPcdSetSku (\r
   IN  UINTN                  SkuId\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 8-bit value for a given PCD token.\r
@@ -94,8 +147,7 @@ UINT8
 EFIAPI\r
 PeiPcdGet8 (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 16-bit value for a given PCD token.\r
@@ -112,8 +164,7 @@ UINT16
 EFIAPI\r
 PeiPcdGet16 (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 32-bit value for a given PCD token.\r
@@ -130,8 +181,7 @@ UINT32
 EFIAPI\r
 PeiPcdGet32 (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 64-bit value for a given PCD token.\r
@@ -148,8 +198,7 @@ UINT64
 EFIAPI\r
 PeiPcdGet64 (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves a pointer to a value for a given PCD token.\r
@@ -168,8 +217,7 @@ VOID *
 EFIAPI\r
 PeiPcdGetPtr (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves a Boolean value for a given PCD token.\r
@@ -188,8 +236,7 @@ BOOLEAN
 EFIAPI\r
 PeiPcdGetBool (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves the size of the value for a given PCD token.\r
@@ -206,8 +253,7 @@ UINTN
 EFIAPI\r
 PeiPcdGetSize (\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 8-bit value for a given PCD token.\r
@@ -228,8 +274,7 @@ EFIAPI
 PeiPcdGet8Ex (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 16-bit value for a given PCD token.\r
@@ -250,8 +295,7 @@ EFIAPI
 PeiPcdGet16Ex (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 32-bit value for a given PCD token.\r
@@ -272,8 +316,7 @@ EFIAPI
 PeiPcdGet32Ex (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an 64-bit value for a given PCD token.\r
@@ -294,8 +337,7 @@ EFIAPI
 PeiPcdGet64Ex (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves a pointer to a value for a given PCD token.\r
@@ -316,8 +358,7 @@ EFIAPI
 PeiPcdGetPtrEx (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves an Boolean value for a given PCD token.\r
@@ -338,8 +379,7 @@ EFIAPI
 PeiPcdGetBoolEx (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves the size of the value for a given PCD token.\r
@@ -358,8 +398,7 @@ EFIAPI
 PeiPcdGetSizeEx (\r
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 8-bit value for a given PCD token.\r
@@ -383,8 +422,7 @@ EFIAPI
 PeiPcdSet8 (\r
   IN UINTN             TokenNumber,\r
   IN UINT8             Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 16-bit value for a given PCD token.\r
@@ -408,8 +446,7 @@ EFIAPI
 PeiPcdSet16 (\r
   IN UINTN             TokenNumber,\r
   IN UINT16            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 32-bit value for a given PCD token.\r
@@ -433,8 +470,7 @@ EFIAPI
 PeiPcdSet32 (\r
   IN UINTN             TokenNumber,\r
   IN UINT32            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 64-bit value for a given PCD token.\r
@@ -458,8 +494,7 @@ EFIAPI
 PeiPcdSet64 (\r
   IN UINTN             TokenNumber,\r
   IN UINT64            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets a value of a specified size for a given PCD token.\r
@@ -488,8 +523,7 @@ PeiPcdSetPtr (
   IN        UINTN             TokenNumber,\r
   IN OUT    UINTN             *SizeOfBuffer,\r
   IN        VOID              *Buffer\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an Boolean value for a given PCD token.\r
@@ -513,8 +547,7 @@ EFIAPI
 PeiPcdSetBool (\r
   IN UINTN             TokenNumber,\r
   IN BOOLEAN           Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 8-bit value for a given PCD token.\r
@@ -540,8 +573,7 @@ PeiPcdSet8Ex (
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber,\r
   IN UINT8             Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 16-bit value for a given PCD token.\r
@@ -567,8 +599,7 @@ PeiPcdSet16Ex (
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber,\r
   IN UINT16            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 32-bit value for a given PCD token.\r
@@ -594,8 +625,7 @@ PeiPcdSet32Ex (
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber,\r
   IN UINT32            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an 64-bit value for a given PCD token.\r
@@ -621,8 +651,7 @@ PeiPcdSet64Ex (
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber,\r
   IN UINT64            Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets a value of a specified size for a given PCD token.\r
@@ -653,8 +682,7 @@ PeiPcdSetPtrEx (
   IN        UINTN             TokenNumber,\r
   IN OUT    UINTN             *SizeOfBuffer,\r
   IN        VOID              *Buffer\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Sets an Boolean value for a given PCD token.\r
@@ -680,8 +708,7 @@ PeiPcdSetBoolEx (
   IN CONST EFI_GUID    *Guid,\r
   IN UINTN             TokenNumber,\r
   IN BOOLEAN           Value\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Specifies a function to be called anytime the value of a designated token is changed.\r
@@ -701,8 +728,7 @@ PeiRegisterCallBackOnSet (
   IN  CONST EFI_GUID          *Guid, OPTIONAL\r
   IN  UINTN                   TokenNumber,\r
   IN  PCD_PPI_CALLBACK        CallBackFunction\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Cancels a previously set callback function for a particular PCD token number.\r
@@ -722,23 +748,31 @@ PcdUnRegisterCallBackOnSet (
   IN  CONST EFI_GUID          *Guid, OPTIONAL\r
   IN  UINTN                   TokenNumber,\r
   IN  PCD_PPI_CALLBACK        CallBackFunction\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
-  Retrieves the next valid PCD token for a given namespace.\r
-\r
-  @param[in]  Guid The 128-bit unique value that designates the namespace from which to extract the value.\r
-  @param[in, out]  TokenNumber A pointer to the PCD token number to use to find the subsequent token number.  \r
-                  If the input token namespace or token number does not exist on the platform, \r
-                  an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, \r
-                  have the pointer reference a TokenNumber value of 0. If the input token number is 0 and \r
-                  there is no valid token number for this token namespace,  *TokenNumber will be assigned to \r
-                  0 and the function return EFI_SUCCESS. If the token number is the last valid token number, \r
-                  *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS.\r
-\r
-  @retval EFI_SUCCESS  The PCD service retrieved the next valid token number. Or the input token number \r
-                        is already the last valid token number in the PCD database. \r
+  Retrieves the next valid token number in a given namespace.  \r
+  \r
+  This is useful since the PCD infrastructure contains a sparse list of token numbers, \r
+  and one cannot a priori know what token numbers are valid in the database. \r
+  \r
+  If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned.  \r
+  If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned.  \r
+  If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned.  \r
+  If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned.  \r
+  The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid.  \r
+  If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned.  \r
+  If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned.  \r
+  If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned.\r
+\r
+\r
+  @param[in]       Guid        The 128-bit unique value that designates the namespace from which to extract the value.  \r
+                               This is an optional parameter that may be NULL.  If this parameter is NULL, then a request \r
+                               is being made to retrieve tokens from the default token space.\r
+  @param[in, out]  TokenNumber A pointer to the PCD token number to use to find the subsequent token number.\r
+                   \r
+  @retval EFI_SUCCESS   The PCD service has retrieved the next valid token number. \r
+                        Or the input token number is already the last valid token number in the PCD database. \r
                         In the later case, *TokenNumber is updated with the value of 0.\r
   @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform.\r
 \r
@@ -748,8 +782,7 @@ EFIAPI
 PeiPcdGetNextToken (\r
   IN CONST EFI_GUID           *Guid, OPTIONAL\r
   IN OUT  UINTN               *TokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Retrieves the next valid PCD token namespace for a given namespace.\r
@@ -776,9 +809,28 @@ EFI_STATUS
 EFIAPI\r
 PeiPcdGetNextTokenSpace (\r
   IN OUT CONST EFI_GUID           **Guid\r
-  )\r
-;\r
+  );\r
+\r
+/**\r
+  Retrieve additional information associated with a PCD token.\r
+\r
+  This includes information such as the type of value the TokenNumber is associated with as well as possible\r
+  human readable name that is associated with the token.\r
 \r
+  @param[in]    Guid        The 128-bit unique value that designates the namespace from which to extract the value.\r
+  @param[in]    TokenNumber The PCD token number.\r
+  @param[out]   PcdInfo     The returned information associated with the requested TokenNumber.\r
+                            The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. \r
+\r
+  @retval  EFI_SUCCESS      The PCD information was returned successfully\r
+  @retval  EFI_NOT_FOUND    The PCD service could not find the requested token number.\r
+**/\r
+EFI_STATUS\r
+PeiGetPcdInfo (\r
+  IN CONST  EFI_GUID        *Guid,\r
+  IN        UINTN           TokenNumber,\r
+  OUT       EFI_PCD_INFO    *PcdInfo\r
+  );\r
 \r
 /* Internal Function definitions */\r
 /**\r
@@ -790,8 +842,7 @@ PeiPcdGetNextTokenSpace (
 PEI_PCD_DATABASE *\r
 GetPcdDatabase (\r
   VOID\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Wrapper function for setting non-pointer type value for a PCD entry.\r
@@ -808,8 +859,7 @@ SetValueWorker (
   IN          UINTN              TokenNumber,\r
   IN          VOID               *Data,\r
   IN          UINTN              Size\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Set value for an PCD entry\r
@@ -822,6 +872,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.\r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r
@@ -832,8 +883,7 @@ SetWorker (
   IN          VOID               *Data,\r
   IN OUT      UINTN              *Size,\r
   IN          BOOLEAN            PtrType\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Wrapper function for set PCD value for non-Pointer type dynamic-ex PCD.\r
@@ -852,8 +902,7 @@ ExSetValueWorker (
   IN          CONST EFI_GUID       *Guid,\r
   IN          VOID                 *Data,\r
   IN          UINTN                Size\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Set value for a dynamic PCD entry.\r
@@ -880,8 +929,7 @@ ExSetWorker (
   IN      VOID                 *Data,\r
   IN OUT  UINTN                *Size,\r
   IN      BOOLEAN              PtrType\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Get the PCD entry pointer in PCD database.\r
@@ -901,8 +949,7 @@ VOID *
 GetWorker (\r
   IN UINTN                TokenNumber,\r
   IN UINTN                GetSize\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Wrapper function for get PCD value for dynamic-ex PCD.\r
@@ -919,8 +966,7 @@ ExGetWorker (
   IN CONST EFI_GUID   *Guid,\r
   IN UINTN            ExTokenNumber,\r
   IN UINTN            GetSize\r
-  )\r
-;\r
+  );\r
 \r
 typedef struct {\r
   UINTN   TokenNumber;\r
@@ -929,24 +975,23 @@ typedef struct {
 } EX_PCD_ENTRY_ATTRIBUTE;\r
 \r
 /**\r
-  Get local token number according to dynamic-ex PCD's {token space guid:token number}\r
+  Get Token Number according to dynamic-ex PCD's {token space guid:token number}\r
 \r
   A dynamic-ex type PCD, developer must provide pair of token space guid: token number\r
   in DEC file. PCD database maintain a mapping table that translate pair of {token\r
-  space guid: token number} to local token number.\r
+  space guid: token number} to Token Number.\r
   \r
   @param Guid            Token space guid for dynamic-ex PCD entry.\r
-  @param ExTokenNumber   EDES_TODO: Add parameter description\r
+  @param ExTokenNumber   Token number for dynamic-ex PCD.\r
 \r
-  @return local token number for dynamic-ex PCD.\r
+  @return Token Number for dynamic-ex PCD.\r
 \r
 **/\r
 UINTN\r
 GetExPcdTokenNumber (\r
   IN CONST EFI_GUID             *Guid,\r
   IN UINTN                      ExTokenNumber\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   The function registers the CallBackOnSet fucntion\r
@@ -968,32 +1013,20 @@ PeiRegisterCallBackWorker (
   IN  CONST EFI_GUID         *Guid, OPTIONAL\r
   IN  PCD_PPI_CALLBACK   CallBackFunction,\r
   IN  BOOLEAN            Register\r
-);\r
+  );\r
 \r
 /**\r
   The function builds the PCD database.\r
-**/\r
-VOID\r
-BuildPcdDatabase (\r
-  VOID\r
-  )\r
-;\r
-\r
-/**\r
-  Get SKU ID tabble from PCD database.\r
 \r
-  @param LocalTokenNumberTableIdx Index of local token number in token number table.\r
-  @param Database                 PCD Database in PEI phase\r
+  @param  FileHandle  Handle of the file the external PCD database binary located.\r
 \r
-  @return Pointer to SKU ID array table\r
+  @return Pointer to PCD database.\r
 \r
 **/\r
-SKU_ID *\r
-GetSkuIdArray (\r
-  IN    UINTN             LocalTokenNumberTableIdx,\r
-  IN    PEI_PCD_DATABASE  *Database\r
-  )\r
-;\r
+PEI_PCD_DATABASE *\r
+BuildPcdDatabase (\r
+  IN EFI_PEI_FILE_HANDLE    FileHandle\r
+  );\r
 \r
 /**\r
   Get index of PCD entry in size table.\r
@@ -1008,8 +1041,7 @@ UINTN
 GetSizeTableIndex (\r
   IN    UINTN             LocalTokenNumberTableIdx,\r
   IN    PEI_PCD_DATABASE  *Database\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Get PCD value's size for POINTER type PCD.\r
@@ -1029,8 +1061,7 @@ GetPtrTypeSize (
   IN    UINTN             LocalTokenNumberTableIdx,\r
   OUT   UINTN             *MaxSize,\r
   IN    PEI_PCD_DATABASE  *Database\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
   Set PCD value's size for POINTER type PCD.\r
@@ -1051,14 +1082,7 @@ SetPtrTypeSize (
   IN          UINTN             LocalTokenNumberTableIdx,\r
   IN    OUT   UINTN             *CurrentSize,\r
   IN          PEI_PCD_DATABASE  *Database\r
-  )\r
-;\r
-\r
-\r
-extern EFI_GUID gPcdDataBaseHobGuid;\r
-\r
-extern EFI_GUID gPcdPeiCallbackFnTableHobGuid;\r
-\r
-extern PEI_PCD_DATABASE_INIT gPEIPcdDbInit;\r
+  );\r
 \r
 #endif\r
+\r