From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=hyIJWefc; spf=pass (domain: ventanamicro.com, ip: 209.85.214.179, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pl1-f179.google.com with SMTP id k13so6361893plg.0 for ; Fri, 10 Feb 2023 04:31:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wypcml5xBwrZpJT3RHS+lW0xdymjMmkWf88IcyFtwww=; b=hyIJWefcE91JwzAjuYIcyHfExA7tYbfcXq0VlKQLyCwKWn5txA7F2kFTDKhFyIh5lt Ft97+cisi9NwmhCiWSAS9plNLFwEAGjXbnbjzvIMBHacgvsNHxcNuYxPiCTbHpgYonz5 K2GjyYsQtnbG0JCKBx86q7QJm3jIgyTjQ/diA3ueOjKnHq0O3HmzgoA6CVxVC88lbOob vZQ9dG/vb8IuKL8FwU+015A4kJMNLuOqdzfZys7+gZhF84k7veiQvvceMWxZyLzdSC5t JeilMr30rzLYmnKX7Q+NZAm0bwG60/Q0y1hsbJNy9GEQuM3r/BFPuiJXQuaGXpGLSlHS Zbyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wypcml5xBwrZpJT3RHS+lW0xdymjMmkWf88IcyFtwww=; b=brAqCWKbxHd6KpG0gAwcPOG6z2hkNPdIr02nGJjZTBapgqeOb7dkTXXVO7Ar9JMtvo zRU3hQDn+nkcItg7pZnggSno9Koc9Y58MB2t/v9Tful4Vl+jugr4/UXJm6baGvdzavKA ouqgJqMfj7nlCvYfwl6F5lbf61XqPM742ArkcBln5BBmZm/sTHX8Wla13rMiMkW1Yy6p e9CEL0UqWpRmRqCdNMF/YAWNP3JwrGui3jgUSbFYzhd/csakJ+/AoJlBs+ncrmQE6CiQ exVoVCX3hlKj3rYjNF7TIbgC1Rv/nBq7HVo2++6cT5ohOpGOYDh51qyBzaQxcY+hVvyR BfGQ== X-Gm-Message-State: AO0yUKXm5iPZZbM64n/Ru8m5o4Orwy4JII60vEB2F8tHCTqJI/BbfpKU pLrqep1UeyY+Rl5DRc9JMso0kzN9ZZITn0OZ 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) Return-Path: 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-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> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230210123041.1489506-1-sunilvl@ventanamicro.com> References: <20230210123041.1489506-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.inf | 23 +++++++ OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.c | 65 ++++++++++++++++++++ 2 files changed, 88 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf new file mode 100644 index 000000000000..c539682e8d0b --- /dev/null +++ b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf @@ -0,0 +1,23 @@ +#/** @file +# +# Copyright (c) 2021, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = PrePiHobListPointerLib + FILE_GUID = E3FAFC60-758C-471B-A333-FE704A4C11B4 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = 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/PrePiHobListPointer.c b/OvmfPkg/RiscVVirt/Library/PrePiHobListPointerLib/PrePiHobListPointer.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 = NULL; + GetFirmwareContextPointer (&FirmwareContext); + + if (FirmwareContext == 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 = NULL; + GetFirmwareContextPointer (&FirmwareContext); + + if (FirmwareContext == NULL) { + DEBUG ((DEBUG_ERROR, "%a: Firmware Context is NULL\n", __FUNCTION__)); + return EFI_NOT_READY; + } + + FirmwareContext->PrePiHobList = HobList; + return EFI_SUCCESS; +} -- 2.34.1