X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FPCD%2FDxe%2FService.h;h=0257a3487cc4c7d904c9b08dc8bdaecb54866193;hb=b6e89910dd31e38944900ddc5cb4b86cf25241b4;hp=54e38e5599d6e880a2dc7e631487e491c905beb6;hpb=e5eed7d3641d71d7ea539e5379ea9c6a5cd97004;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.h b/MdeModulePkg/Universal/PCD/Dxe/Service.h index 54e38e5599..0257a3487c 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.h +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.h @@ -1,7 +1,7 @@ /** @file Private functions used by PCD DXE driver. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, 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 @@ -17,8 +17,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include #include #include +#include +#include +#include +#include #include #include #include @@ -30,6 +35,74 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +// +// 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_VERSION 6 + +// +// PCD_DXE_SERVICE_DRIVER_VERSION is defined in Autogen.h. +// +#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 + +/** + Retrieve additional information associated with a PCD token in the default token space. + + This includes information such as the type of value the TokenNumber is associated with as well as possible + human readable name that is associated with the token. + + @param[in] TokenNumber The PCD token number. + @param[out] PcdInfo The returned information associated with the requested TokenNumber. + The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. + + @retval EFI_SUCCESS The PCD information was returned successfully. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. +**/ +EFI_STATUS +EFIAPI +DxeGetPcdInfoGetInfo ( + IN UINTN TokenNumber, + OUT EFI_PCD_INFO *PcdInfo + ); + +/** + Retrieve additional information associated with a PCD token. + + This includes information such as the type of value the TokenNumber is associated with as well as possible + human readable name that is associated with the token. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[out] PcdInfo The returned information associated with the requested TokenNumber. + The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. + + @retval EFI_SUCCESS The PCD information was returned successfully. + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. +**/ +EFI_STATUS +EFIAPI +DxeGetPcdInfoGetInfoEx ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + OUT EFI_PCD_INFO *PcdInfo + ); + +/** + Retrieve the currently set SKU Id. + + @return The currently set SKU Id. If the platform has not set at a SKU Id, then the + default SKU Id value of 0 is returned. If the platform has set a SKU Id, then the currently set SKU + Id is returned. +**/ +UINTN +EFIAPI +DxeGetPcdInfoGetSku ( + VOID + ); + // // Protocol Interface function declaration. // @@ -743,6 +816,27 @@ typedef struct { // Internal Functions // +/** + Retrieve additional information associated with a PCD token. + + This includes information such as the type of value the TokenNumber is associated with as well as possible + human readable name that is associated with the token. + + @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. + @param[in] TokenNumber The PCD token number. + @param[out] PcdInfo The returned information associated with the requested TokenNumber. + The caller is responsible for freeing the buffer that is allocated by callee for PcdInfo->PcdName. + + @retval EFI_SUCCESS The PCD information was returned successfully + @retval EFI_NOT_FOUND The PCD service could not find the requested token number. +**/ +EFI_STATUS +DxeGetPcdInfo ( + IN CONST EFI_GUID *Guid, + IN UINTN TokenNumber, + OUT EFI_PCD_INFO *PcdInfo + ); + /** Wrapper function for setting non-pointer type value for a PCD entry. @@ -911,6 +1005,7 @@ GetHiiVariable ( @param VariableGuid Guid of variable which stored value of a HII-type PCD. @param VariableName Unicode name of variable which stored value of a HII-type PCD. + @param SetAttributes Attributes bitmask to set for the variable. @param Data Value want to be set. @param DataSize Size of value @param Offset Value offset of HII-type PCD in variable. @@ -922,6 +1017,7 @@ EFI_STATUS SetHiiVariable ( IN EFI_GUID *VariableGuid, IN UINT16 *VariableName, + IN UINT32 SetAttributes, IN CONST VOID *Data, IN UINTN DataSize, IN UINTN Offset @@ -982,16 +1078,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 Dynamic-ex PCD token number. - @return local token number for dynamic-ex PCD. + @return Token Number for dynamic-ex PCD. **/ UINTN @@ -1066,9 +1162,39 @@ SetPtrTypeSize ( IN OUT UINTN *CurrentSize ); -extern PCD_DATABASE * mPcdDatabase; +/** + VariableLockProtocol callback + to lock the variables referenced by DynamicHii PCDs with RO property set in *.dsc. + + @param[in] Event Event whose notification function is being invoked. + @param[in] Context Pointer to the notification function's context. + +**/ +VOID +EFIAPI +VariableLockCallBack ( + IN EFI_EVENT Event, + IN VOID *Context + ); + +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 BOOLEAN mPeiExMapTableEmpty; +extern BOOLEAN mDxeExMapTableEmpty; +extern BOOLEAN mPeiDatabaseEmpty; -extern DXE_PCD_DATABASE_INIT gDXEPcdDbInit; +extern EFI_GUID **TmpTokenSpaceBuffer; +extern UINTN TmpTokenSpaceBufferCount; extern EFI_LOCK mPcdDatabaseLock;