summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
diff options
context:
space:
mode:
authorMin Xu <min.m.xu@intel.com>2022-04-19 08:26:24 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-19 01:26:08 +0000
commit74a3eb975da7059b825c84bed759d2845de8de68 (patch)
tree42095c4fcaaa3a8debd230f8566a25a8befae362 /MdePkg/Library
parentd020ac55b6968d3bcaf631307152b51738286583 (diff)
downloadedk2-74a3eb975da7059b825c84bed759d2845de8de68.tar.gz
edk2-74a3eb975da7059b825c84bed759d2845de8de68.tar.bz2
edk2-74a3eb975da7059b825c84bed759d2845de8de68.zip
MdePkg: Add CcProbeLibNull
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3902 CcProbeLib is used to probe the Confidential Computing guest type. This library is designed to run on SEC / PEI / DXE phases. A null instance of the library always returns CCGuestTypeNonEncrypted. A platform specific CcProbeLib will be implemented, for example, in OvmfPkg. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c26
-rw-r--r--MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf21
2 files changed, 47 insertions, 0 deletions
diff --git a/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c
new file mode 100644
index 0000000000..ca4111dc30
--- /dev/null
+++ b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c
@@ -0,0 +1,26 @@
+/** @file
+
+ Null stub of CcProbeLib
+
+ Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/CcProbeLib.h>
+
+/**
+ Probe the ConfidentialComputing Guest type. See defition of
+ CC_GUEST_TYPE in <ConfidentialComputingGuestAttr.h>.
+
+ @return The guest type
+
+**/
+UINT8
+EFIAPI
+CcProbe (
+ VOID
+ )
+{
+ return CcGuestTypeNonEncrypted;
+}
diff --git a/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
new file mode 100644
index 0000000000..f37c25f734
--- /dev/null
+++ b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf
@@ -0,0 +1,21 @@
+## @file
+# CcProbeLib null instance.
+#
+# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = CcProbeLibNull
+ FILE_GUID = B15D67FE-0DAC-4316-8E26-8A6b85E43782
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = CcProbeLib
+
+[Sources]
+ CcProbeLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec