summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2013-11-20 00:44:25 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2013-11-20 00:44:25 +0000
commit96d6d004aaf9da42c5fd9cd07035886937d42a69 (patch)
treed37234172371bb439a6f2553e42e4af5e62e4ec1 /MdePkg/Include
parent14b5e3fd787fb1ae0c354ea5169025a724f9cbb1 (diff)
downloadedk2-platforms-96d6d004aaf9da42c5fd9cd07035886937d42a69.tar.xz
MdePkg and MdeModulePkg Pcd: Add the new EFI_GET_PCD_INFO_PROTOCOL and EFI_GET_PCD_INFO_PPI support for PI 1.2.1 compliance.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14866 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/PcdLib.h85
-rw-r--r--MdePkg/Include/Pi/PiMultiPhase.h31
-rw-r--r--MdePkg/Include/Ppi/PcdInfo.h105
-rw-r--r--MdePkg/Include/Ppi/PiPcdInfo.h82
-rw-r--r--MdePkg/Include/Protocol/PcdInfo.h105
-rw-r--r--MdePkg/Include/Protocol/PiPcdInfo.h83
6 files changed, 490 insertions, 1 deletions
diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h
index 1fc584060f..1ea4ac7cec 100644
--- a/MdePkg/Include/Library/PcdLib.h
+++ b/MdePkg/Include/Library/PcdLib.h
@@ -1516,4 +1516,89 @@ LibPatchPcdSetPtr (
IN CONST VOID *Buffer
);
+typedef enum {
+ PCD_TYPE_8,
+ PCD_TYPE_16,
+ PCD_TYPE_32,
+ PCD_TYPE_64,
+ PCD_TYPE_BOOL,
+ PCD_TYPE_PTR
+} PCD_TYPE;
+
+typedef struct {
+ ///
+ /// The returned information associated with the requested TokenNumber. If
+ /// TokenNumber is 0, then PcdType is set to PCD_TYPE_8.
+ ///
+ PCD_TYPE PcdType;
+ ///
+ /// The size of the data in bytes associated with the TokenNumber specified. If
+ /// TokenNumber is 0, then PcdSize is set 0.
+ ///
+ UINTN PcdSize;
+ ///
+ /// The null-terminated ASCII string associated with a given token. If the
+ /// TokenNumber specified was 0, then this field corresponds to the null-terminated
+ /// ASCII string associated with the token's namespace Guid. If NULL, there is no
+ /// name associated with this request.
+ ///
+ CHAR8 *PcdName;
+} PCD_INFO;
+
+
+/**
+ 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.
+
+ If TokenNumber is not in the default token space specified, then ASSERT().
+
+ @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.
+**/
+VOID
+EFIAPI
+LibPcdGetInfo (
+ IN UINTN TokenNumber,
+ OUT 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.
+
+ If TokenNumber is not in the token space specified by Guid, then ASSERT().
+
+ @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.
+**/
+VOID
+EFIAPI
+LibPcdGetInfoEx (
+ IN CONST GUID *Guid,
+ IN UINTN TokenNumber,
+ OUT PCD_INFO *PcdInfo
+ );
+
+/**
+ Retrieve the currently set SKU Id.
+
+ If the sku id got >= PCD_MAX_SKU_ID, then ASSERT().
+
+ @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
+LibPcdGetSku (
+ VOID
+ );
+
#endif
diff --git a/MdePkg/Include/Pi/PiMultiPhase.h b/MdePkg/Include/Pi/PiMultiPhase.h
index 5a06966a97..2aa4c276c4 100644
--- a/MdePkg/Include/Pi/PiMultiPhase.h
+++ b/MdePkg/Include/Pi/PiMultiPhase.h
@@ -1,7 +1,7 @@
/** @file
Include file matches things in PI for multiple module types.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -133,4 +133,33 @@ typedef struct {
UINT64 RegionState;
} EFI_SMRAM_DESCRIPTOR;
+typedef enum {
+ EFI_PCD_TYPE_8,
+ EFI_PCD_TYPE_16,
+ EFI_PCD_TYPE_32,
+ EFI_PCD_TYPE_64,
+ EFI_PCD_TYPE_BOOL,
+ EFI_PCD_TYPE_PTR
+} EFI_PCD_TYPE;
+
+typedef struct {
+ ///
+ /// The returned information associated with the requested TokenNumber. If
+ /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8.
+ ///
+ EFI_PCD_TYPE PcdType;
+ ///
+ /// The size of the data in bytes associated with the TokenNumber specified. If
+ /// TokenNumber is 0, then PcdSize is set 0.
+ ///
+ UINTN PcdSize;
+ ///
+ /// The null-terminated ASCII string associated with a given token. If the
+ /// TokenNumber specified was 0, then this field corresponds to the null-terminated
+ /// ASCII string associated with the token's namespace Guid. If NULL, there is no
+ /// name associated with this request.
+ ///
+ CHAR8 *PcdName;
+} EFI_PCD_INFO;
+
#endif
diff --git a/MdePkg/Include/Ppi/PcdInfo.h b/MdePkg/Include/Ppi/PcdInfo.h
new file mode 100644
index 0000000000..731f873ed1
--- /dev/null
+++ b/MdePkg/Include/Ppi/PcdInfo.h
@@ -0,0 +1,105 @@
+/** @file
+ Native Platform Configuration Database (PCD) INFO PPI
+
+ The PPI that provides additional information about items that reside in the PCD database.
+
+ Different with the EFI_GET_PCD_INFO_PPI defined in PI 1.2.1 specification,
+ the native PCD INFO PPI provide interfaces for dynamic and dynamic-ex type PCD.
+ The interfaces for dynamic type PCD do not require the token space guid as parameter,
+ but interfaces for dynamic-ex type PCD require token space guid as parameter.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCD_INFO_PPI_H__
+#define __PCD_INFO_PPI_H__
+
+extern EFI_GUID gGetPcdInfoPpiGuid;
+
+#define GET_PCD_INFO_PPI_GUID \
+ { 0x4d8b155b, 0xc059, 0x4c8f, { 0x89, 0x26, 0x6, 0xfd, 0x43, 0x31, 0xdb, 0x8a } }
+
+///
+/// The forward declaration for GET_PCD_INFO_PPI.
+///
+typedef struct _GET_PCD_INFO_PPI GET_PCD_INFO_PPI;
+
+/**
+ 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.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PPI_GET_INFO) (
+ 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.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PPI_GET_INFO_EX) (
+ 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.
+**/
+typedef
+UINTN
+(EFIAPI *GET_PCD_INFO_PPI_GET_SKU) (
+ VOID
+);
+
+///
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _GET_PCD_INFO_PPI {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ GET_PCD_INFO_PPI_GET_INFO GetInfo;
+ GET_PCD_INFO_PPI_GET_INFO_EX GetInfoEx;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ GET_PCD_INFO_PPI_GET_SKU GetSku;
+};
+
+#endif
+
diff --git a/MdePkg/Include/Ppi/PiPcdInfo.h b/MdePkg/Include/Ppi/PiPcdInfo.h
new file mode 100644
index 0000000000..586f707567
--- /dev/null
+++ b/MdePkg/Include/Ppi/PiPcdInfo.h
@@ -0,0 +1,82 @@
+/** @file
+ Platform Configuration Database (PCD) Info Ppi defined in PI 1.2.1 Vol3.
+
+ The PPI that provides additional information about items that reside in the PCD database.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ PI Version 1.2.1 Vol 3.
+**/
+
+#ifndef __PI_PCD_INFO_PPI_H__
+#define __PI_PCD_INFO_PPI_H__
+
+extern EFI_GUID gEfiGetPcdInfoPpiGuid;
+
+#define EFI_GET_PCD_INFO_PPI_GUID \
+ { 0xa60c6b59, 0xe459, 0x425d, { 0x9c, 0x69, 0xb, 0xcc, 0x9c, 0xb2, 0x7d, 0x81 } }
+
+///
+/// The forward declaration for EFI_GET_PCD_INFO_PPI.
+///
+typedef struct _EFI_GET_PCD_INFO_PPI EFI_GET_PCD_INFO_PPI;
+
+/**
+ 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.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_PCD_INFO_PPI_GET_INFO) (
+ 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.
+**/
+typedef
+UINTN
+(EFIAPI *EFI_GET_PCD_INFO_PPI_GET_SKU) (
+ VOID
+);
+
+///
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _EFI_GET_PCD_INFO_PPI {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ EFI_GET_PCD_INFO_PPI_GET_INFO GetInfo;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ EFI_GET_PCD_INFO_PPI_GET_SKU GetSku;
+};
+
+#endif
+
diff --git a/MdePkg/Include/Protocol/PcdInfo.h b/MdePkg/Include/Protocol/PcdInfo.h
new file mode 100644
index 0000000000..00edd1b50c
--- /dev/null
+++ b/MdePkg/Include/Protocol/PcdInfo.h
@@ -0,0 +1,105 @@
+/** @file
+ Native Platform Configuration Database (PCD) INFO PROTOCOL.
+
+ The protocol that provides additional information about items that reside in the PCD database.
+
+ Different with the EFI_GET_PCD_INFO_PROTOCOL defined in PI 1.2.1 specification,
+ the native PCD INFO PROTOCOL provide interfaces for dynamic and dynamic-ex type PCD.
+ The interfaces for dynamic type PCD do not require the token space guid as parameter,
+ but interfaces for dynamic-ex type PCD require token space guid as parameter.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PCD_INFO_H__
+#define __PCD_INFO_H__
+
+extern EFI_GUID gGetPcdInfoProtocolGuid;
+
+#define GET_PCD_INFO_PROTOCOL_GUID \
+ { 0x5be40f57, 0xfa68, 0x4610, { 0xbb, 0xbf, 0xe9, 0xc5, 0xfc, 0xda, 0xd3, 0x65 } }
+
+///
+/// The forward declaration for GET_PCD_INFO_PROTOCOL.
+///
+typedef struct _GET_PCD_INFO_PROTOCOL GET_PCD_INFO_PROTOCOL;
+
+/**
+ 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] TokenNumber The PCD token number.
+ @param[out] PcdInfo The returned information associated with the requested TokenNumber.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO) (
+ 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.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_INFO_EX) (
+ 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.
+**/
+typedef
+UINTN
+(EFIAPI *GET_PCD_INFO_PROTOCOL_GET_SKU) (
+ VOID
+);
+
+///
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _GET_PCD_INFO_PROTOCOL {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ GET_PCD_INFO_PROTOCOL_GET_INFO GetInfo;
+ GET_PCD_INFO_PROTOCOL_GET_INFO_EX GetInfoEx;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ GET_PCD_INFO_PROTOCOL_GET_SKU GetSku;
+};
+
+#endif
+
diff --git a/MdePkg/Include/Protocol/PiPcdInfo.h b/MdePkg/Include/Protocol/PiPcdInfo.h
new file mode 100644
index 0000000000..3c4307586a
--- /dev/null
+++ b/MdePkg/Include/Protocol/PiPcdInfo.h
@@ -0,0 +1,83 @@
+/** @file
+ Platform Configuration Database (PCD) Info Protocol defined in PI 1.2.1 Vol3.
+
+ The protocol that provides additional information about items that reside in the PCD database.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ 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
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ PI Version 1.2.1 Vol 3.
+**/
+
+#ifndef __PI_PCD_INFO_H__
+#define __PI_PCD_INFO_H__
+
+extern EFI_GUID gEfiGetPcdInfoProtocolGuid;
+
+#define EFI_GET_PCD_INFO_PROTOCOL_GUID \
+ { 0xfd0f4478, 0xefd, 0x461d, { 0xba, 0x2d, 0xe5, 0x8c, 0x45, 0xfd, 0x5f, 0x5e } }
+
+///
+/// The forward declaration for EFI_GET_PCD_INFO_PROTOCOL.
+///
+typedef struct _EFI_GET_PCD_INFO_PROTOCOL EFI_GET_PCD_INFO_PROTOCOL;
+
+/**
+ 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.
+
+ @retval EFI_SUCCESS The PCD information was returned successfully
+ @retval EFI_NOT_FOUND The PCD service could not find the requested token number.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_GET_PCD_INFO_PROTOCOL_GET_INFO) (
+ 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.
+**/
+typedef
+UINTN
+(EFIAPI *EFI_GET_PCD_INFO_PROTOCOL_GET_SKU) (
+ VOID
+);
+
+///
+/// Callers to this protocol must be at a TPL_APPLICATION task priority level.
+/// This is the PCD service to use when querying for some additional data that can be contained in the
+/// PCD database.
+///
+struct _EFI_GET_PCD_INFO_PROTOCOL {
+ ///
+ /// Retrieve additional information associated with a PCD.
+ ///
+ EFI_GET_PCD_INFO_PROTOCOL_GET_INFO GetInfo;
+ ///
+ /// Retrieve the currently set SKU Id.
+ ///
+ EFI_GET_PCD_INFO_PROTOCOL_GET_SKU GetSku;
+};
+
+#endif
+