From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web08.25739.1639489318669943344 for ; Tue, 14 Dec 2021 05:42:00 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.com header.s=intel header.b=gDvivRP8; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639489320; x=1671025320; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OxIdHlkGG4EtGNm3hHNF/9FgSixmwzu4jJIE7f6YsbY=; b=gDvivRP85vXssn4g4zfKU20cguTFz7qJ/v0rcZ351IHAdoBJt453Ayvc Iz/tU8yaApeaUF20DcG3WzlXlvrpqcAs+jl2eeG0OzrlhzQ9eFCZtx+Ue 4yrgkfTPd80L/VzXeA+N7n9w4Gj5AlTDX4bkKJ7NTQTrHn43XzYT2Af6m cktGXUkNK9ukgip76mlIY+am+3GaJQKRqW5FmVrxBOPkc0WNgA8TCoRti A/jiaKLwh+yH9muuK1B1p/e5evoq+9pUHRF5lSwmYzY8hCXBaMVLErfYj Q/I5fKnIf/no5Ql08LwTA8PCWoFr4qSJN4NPwsN5p3b4rOmohKho83uR4 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="218993603" X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="218993603" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 05:41:57 -0800 X-IronPort-AV: E=Sophos;i="5.88,205,1635231600"; d="scan'208";a="465094113" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.30.115]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 05:41:54 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Michael D Kinney , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [PATCH 04/10] OvmfPkg: Add PrePiHobListPointerLibTdx Date: Tue, 14 Dec 2021 21:41:20 +0800 Message-Id: <20211214134126.869-5-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20211214134126.869-1-min.m.xu@intel.com> References: <20211214134126.869-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 This library is needed by EmbeddedPkg/PrePiHobLib to set / get the Hob list pointer. Cc: Michael D Kinney Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu --- .../PrePiHobListPointer.c | 45 +++++++++++++++++++ .../PrePiHobListPointerLibTdx.inf | 25 +++++++++++ 2 files changed, 70 insertions(+) create mode 100644 OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c create mode 100644 OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf diff --git a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c new file mode 100644 index 000000000000..a64ca5f04fc5 --- /dev/null +++ b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c @@ -0,0 +1,45 @@ +/** @file +* +* Copyright (c) 2021, Intel Corporation. All rights reserved.
+* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#include + +static VOID *mHobList = NULL; + +/** + Returns the pointer to the HOB list. + + This function returns the pointer to first HOB in the list. + + @return The pointer to the HOB list. + +**/ +VOID * +EFIAPI +PrePeiGetHobList ( + VOID + ) +{ + return mHobList; +} + +/** + Updates the pointer to the HOB list. + + @param HobList Hob list pointer to store + +**/ +EFI_STATUS +EFIAPI +PrePeiSetHobList ( + IN VOID *HobList + ) +{ + mHobList = HobList; + return EFI_SUCCESS; +} diff --git a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf new file mode 100644 index 000000000000..4d50d28a1614 --- /dev/null +++ b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf @@ -0,0 +1,25 @@ +#/** @file +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = PrePiHobListPointerLibTdx + FILE_GUID = 28297DB9-4CE7-4679-80E6-0270B215A2F2 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = PrePiHobListPointerLib + +[Sources] + PrePiHobListPointer.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + +[LibraryClasses] + PcdLib -- 2.29.2.windows.2