From nobody Mon Feb 9 01:19:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+99994+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99994+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1676032284; cv=none; d=zohomail.com; s=zohoarc; b=NBuxSamfVCw9et+Y3c+y6A6TPYSVtUbFlllIpTH70LpNoEslShH0N1U7Sdn/NBlD3tf7hjvy1Ee2rTPvmGspgU2w/5EGX6U5L2MCAgtUjNh8YFAJSFqVB9L5KUNoUKetKwx/Z/qu2ctmiDhB0a2GpEfd7uwiM6SOEscqs4lC+7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676032284; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9X5XH8vDO9boX7N1E6cUFuTsIkEVXoVLnQNnb37An7M=; b=g6DjUIqaW1URNzraVSPKMb8dFJbjJClITigupoyWmDjL0KtHYJBLNmj4E+GoGCcXbJRJBTQt4TPjVWvWuerIdIxp/ixaQnvxWLteyMkb0Nc2LLI1KAv/FsLMzGS4AaZdEeGHbcTjG+vpTEXojR4dxgs/wuZsuHXVrg0ohX2pfvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+99994+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1676032284395119.6668829215962; Fri, 10 Feb 2023 04:31:24 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6N0eYY1788612xyn6rYtzOIS; Fri, 10 Feb 2023 04:31:24 -0800 X-Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mx.groups.io with SMTP id smtpd.web10.13409.1676032273803173206 for ; Fri, 10 Feb 2023 04:31:23 -0800 X-Received: by mail-pl1-f179.google.com with SMTP id k13so6361893plg.0 for ; Fri, 10 Feb 2023 04:31:23 -0800 (PST) X-Gm-Message-State: U4Nm0PqvgCLaKjnZriOLcyNQx1787277AA= X-Google-Smtp-Source: AK7set+Kb5G7EYiVClmlZErDkvew5AwhqRqE0ulg4Qp0tI3y5tGwZUsNKCkf9AgWS5f7SgRPVR3rmQ== X-Received: by 2002:a17:902:d18b:b0:199:151d:d1b0 with SMTP id m11-20020a170902d18b00b00199151dd1b0mr10920250plb.49.1676032283141; Fri, 10 Feb 2023 04:31:23 -0800 (PST) X-Received: from localhost.localdomain ([49.206.14.226]) by smtp.gmail.com with ESMTPSA id b17-20020a170902ed1100b0019a73faf773sm1172961pld.71.2023.02.10.04.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 04:31:22 -0800 (PST) From: "Sunil V L" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Abner Chang , Andrei Warkentin Subject: [edk2-devel] [edk2-staging/RiscV64QemuVirt PATCH V8 13/19] OvmfPkg/RiscVVirt: Add PrePiHobListPointerLib library Date: Fri, 10 Feb 2023 18:00:35 +0530 Message-Id: <20230210123041.1489506-14-sunilvl@ventanamicro.com> In-Reply-To: <20230210123041.1489506-1-sunilvl@ventanamicro.com> References: <20230210123041.1489506-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sunilvl@ventanamicro.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1676032284; bh=1stH9sZx3tyTF+KTLTOGmwf8FAwAluaZeIV8KCefGig=; h=Cc:Date:From:Reply-To:Subject:To; b=PVA3WZDLiYCNhuTWv341JAt3+qnIXPKn+R/7RsBiSQBAxqp9qqwmOBaFTXEZ7CA7Yqt rakKGSZU1wehptQTv6mf34cSrFVqnB6YiB48nn1qMQQgk0nhXxC2hbzMFvrE7+9aZ+vNw lh4wNoqOf1t40dIRP6BtH6wjY/ayyyJUA88= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1676032285119100013 Content-Type: text/plain; charset="utf-8" Add the PrePiHobListPointerLib required for RISC-V Qemu Virt machine since it follows PEIless design. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Sunil V L Acked-by: Abner Chang Reviewed-by: Andrei Warkentin --- OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.in= f | 23 +++++++ OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c = | 65 ++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListP= ointerLib.inf b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobLi= stPointerLib.inf new file mode 100644 index 000000000000..c539682e8d0b --- /dev/null +++ b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerL= ib.inf @@ -0,0 +1,23 @@ +#/** @file +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D PrePiHobListPointerLib + FILE_GUID =3D E3FAFC60-758C-471B-A333-FE704A4C11B4 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PrePiHobListPointerLib + +[Sources.RISCV64] + PrePiHobListPointer.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + UefiCpuPkg/UefiCpuPkg.dec diff --git a/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListP= ointer.c b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPoi= nter.c new file mode 100644 index 000000000000..a58b7aae6bee --- /dev/null +++ b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c @@ -0,0 +1,65 @@ +/** @file +* +* Copyright (c) 2021, Intel Corporation. All rights reserved.
+* SPDX-License-Identifier: BSD-2-Clause-Patent +* +**/ + +#include +#include +#include +#include +#include + +/** + 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 + ) +{ + EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext; + + FirmwareContext =3D NULL; + GetFirmwareContextPointer (&FirmwareContext); + + if (FirmwareContext =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__)); + return NULL; + } + + return (VOID *)FirmwareContext->PrePiHobList; +} + +/** + Updates the pointer to the HOB list. + + @param HobList Hob list pointer to store + +**/ +EFI_STATUS +EFIAPI +PrePeiSetHobList ( + IN VOID *HobList + ) +{ + EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext; + + FirmwareContext =3D NULL; + GetFirmwareContextPointer (&FirmwareContext); + + if (FirmwareContext =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__)); + return EFI_NOT_READY; + } + + FirmwareContext->PrePiHobList =3D HobList; + return EFI_SUCCESS; +} --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#99994): https://edk2.groups.io/g/devel/message/99994 Mute This Topic: https://groups.io/mt/96874996/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-