X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FPCD%2FDxe%2FService.h;h=292a74cfb5a036dae04d0421c7397a5dfcddcd52;hp=7a9113b138ada355877d20e79a2e8bc5691247e1;hb=419db80bef66edff583a0a5f406e801d70f11344;hpb=50d7ebad9270530b2fb784a82bd093b5dab84036 diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.h b/MdeModulePkg/Universal/PCD/Dxe/Service.h index 7a9113b138..292a74cfb5 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.h +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.h @@ -1,8 +1,8 @@ /** @file Private functions used by PCD DXE driver. -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2006 - 2013, Intel Corporation. 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 @@ -10,16 +10,16 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: Service.h - **/ #ifndef _PCD_DXE_SERVICE_H_ #define _PCD_DXE_SERVICE_H_ #include +#include +#include #include +#include #include #include #include @@ -32,18 +32,17 @@ Module Name: Service.h #include // -// Please make sure the PCD Serivce PEIM Version is consistent with -// the version of PCD Database generation tool +// Please make sure the PCD Serivce DXE Version is consistent with +// the version of the generated DXE PCD Database by build tool. // -#define PCD_SERVICE_DXE_DRIVER_VERSION 2 +#define PCD_SERVICE_DXE_VERSION 4 // -// PCD_DXE_DATABASE_GENTOOL_VERSION is defined in Autogen.h -// and generated by PCD Database generation tool. +// PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h. // -//#if (PCD_SERVICE_DXE_DRIVER_VERSION != PCD_DXE_SERVICE_DRIVER_AUTOGEN_VERSION) -// #error "Please make sure the version of PCD Service DXE Driver and PCD DXE Database Generation Tool matches" -//#endif +#if (PCD_SERVICE_DXE_VERSION != PCD_DXE_SERVICE_DRIVER_VERSION) + #error "Please make sure the version of PCD DXE Service and the generated PCD DXE Database match." +#endif // // Protocol Interface function declaration. @@ -153,7 +152,7 @@ DxePcdGet64 ( @param[in] TokenNumber The PCD token number. - @return The pointer to the buffer to be retrived. + @return The pointer to the buffer to be retrieved. **/ VOID * @@ -293,7 +292,7 @@ DxePcdGet64Ex ( @param[in] Guid The token space for the token number. @param[in] TokenNumber The PCD token number. - @return The pointer to the buffer to be retrived. + @return The pointer to the buffer to be retrieved. **/ VOID * @@ -696,18 +695,28 @@ DxeUnRegisterCallBackOnSet ( ); /** - Retrieves the next valid PCD token for a given namespace. - - @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. - @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. - If the input token namespace or token number does not exist on the platform, - an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, - have the pointer reference a TokenNumber value of 0. If the input token number is 0 and - there is no valid token number for this token namespace, *TokenNumber will be assigned to - 0 and the function return EFI_SUCCESS. If the token number is the last valid token number, - *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS. - - @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number + Retrieves the next valid token number in a given namespace. + + This is useful since the PCD infrastructure contains a sparse list of token numbers, + and one cannot a priori know what token numbers are valid in the database. + + If TokenNumber is 0 and Guid is not NULL, then the first token from the token space specified by Guid is returned. + If TokenNumber is not 0 and Guid is not NULL, then the next token in the token space specified by Guid is returned. + If TokenNumber is 0 and Guid is NULL, then the first token in the default token space is returned. + If TokenNumber is not 0 and Guid is NULL, then the next token in the default token space is returned. + The token numbers in the default token space may not be related to token numbers in token spaces that are named by Guid. + If the next token number can be retrieved, then it is returned in TokenNumber, and EFI_SUCCESS is returned. + If TokenNumber represents the last token number in the token space specified by Guid, then EFI_NOT_FOUND is returned. + If TokenNumber is not present in the token space specified by Guid, then EFI_NOT_FOUND is returned. + + + @param[in] Guid The 128-bit unique value that designates the namespace from which to retrieve the next token. + This is an optional parameter that may be NULL. If this parameter is NULL, then a request is + being made to retrieve tokens from the default token space. + @param[in, out] TokenNumber + A pointer to the PCD token number to use to find the subsequent token number. + + @retval EFI_SUCCESS The PCD service retrieved the next valid token number. Or the input token number is already the last valid token number in the PCD database. In the later case, *TokenNumber is updated with the value of 0. @retval EFI_NOT_FOUND If this input token number and token namespace does not exist on the platform. @@ -723,14 +732,10 @@ DxePcdGetNextToken ( /** Get next token space in PCD database according to given token space guid. - This routine is enable only when feature flag PCD PcdDxePcdDatabaseTraverseEnabled - is TRUE. - @param Guid Given token space guid. If NULL, then Guid will be set to the first PCD token space in PCD database, If not NULL, then Guid will be set to next PCD token space. - @retval EFI_UNSUPPORTED If feature flag PCD PcdDxePcdDatabaseTraverseEnabled is FALSE. @retval EFI_NOT_FOUND If PCD database has no token space table or can not find given token space in PCD database. @retval EFI_SUCCESS Success to get next token space guid. @@ -780,6 +785,7 @@ SetValueWorker ( @retval EFI_INVALID_PARAMETER If this PCD type is VPD, VPD PCD can not be set. @retval EFI_INVALID_PARAMETER If Size can not be set to size table. + @retval EFI_INVALID_PARAMETER If Size of non-Ptr type PCD does not match the size information in PCD database. @retval EFI_NOT_FOUND If value type of PCD entry is intergrate, but not in range of UINT8, UINT16, UINT32, UINT64 @retval EFI_NOT_FOUND Can not find the PCD type according to token number. @@ -862,7 +868,7 @@ GetWorker ( Wrapper function for get PCD value for dynamic-ex PCD. @param Guid Token space guid for dynamic-ex PCD. - @param ExTokenNumber Token number for dyanmic-ex PCD. + @param ExTokenNumber Token number for dynamic-ex PCD. @param GetSize The size of dynamic-ex PCD value. @return PCD entry in PCD database. @@ -990,16 +996,16 @@ BuildPcdDxeDataBase ( ); /** - Get local token number according to dynamic-ex PCD's {token space guid:token number} + Get Token Number according to dynamic-ex PCD's {token space guid:token number} A dynamic-ex type PCD, developer must provide pair of token space guid: token number in DEC file. PCD database maintain a mapping table that translate pair of {token - space guid: token number} to local token number. + space guid: token number} to Token Number. @param Guid Token space guid for dynamic-ex PCD entry. - @param ExTokenNumber EDES_TODO: Add parameter description + @param ExTokenNumber Dynamic-ex PCD token number. - @return local token number for dynamic-ex PCD. + @return Token Number for dynamic-ex PCD. **/ UINTN @@ -1047,7 +1053,7 @@ ExGetNextTokeNumber ( Get size of POINTER type PCD value. @param LocalTokenNumberTableIdx Index of local token number in local token number table. - @param MaxSize Maxmium size of POINTER type PCD value. + @param MaxSize Maximum size of POINTER type PCD value. @return size of POINTER type PCD value. @@ -1059,7 +1065,7 @@ GetPtrTypeSize ( ); /** - Set size of POINTER type PCD value. The size should not exceed the maxmium size + Set size of POINTER type PCD value. The size should not exceed the maximum size of this PCD value. @param LocalTokenNumberTableIdx Index of local token number in local token number table. @@ -1074,12 +1080,26 @@ SetPtrTypeSize ( IN OUT UINTN *CurrentSize ); -extern EFI_GUID gPcdDataBaseHobGuid; +extern PCD_DATABASE mPcdDatabase; -extern PCD_DATABASE * mPcdDatabase; +extern UINT32 mPcdTotalTokenCount; +extern UINT32 mPeiLocalTokenCount; +extern UINT32 mDxeLocalTokenCount; +extern UINT32 mPeiNexTokenCount; +extern UINT32 mDxeNexTokenCount; +extern UINT32 mPeiExMapppingTableSize; +extern UINT32 mDxeExMapppingTableSize; +extern UINT32 mPeiGuidTableSize; +extern UINT32 mDxeGuidTableSize; -extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit; +extern BOOLEAN mPeiExMapTableEmpty; +extern BOOLEAN mDxeExMapTableEmpty; +extern BOOLEAN mPeiDatabaseEmpty; + +extern EFI_GUID **TmpTokenSpaceBuffer; +extern UINTN TmpTokenSpaceBufferCount; extern EFI_LOCK mPcdDatabaseLock; #endif +