public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Daniel Schaefer" <daniel.schaefer@hpe.com>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@hpe.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Daniel Schaefer <daniel.schaefer@hpe.com>
Subject: [edk2-platforms] [PATCH v3 05/14] Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib
Date: Tue, 19 Oct 2021 11:48:40 +0800	[thread overview]
Message-ID: <20211019034849.16847-6-daniel.schaefer@hpe.com> (raw)
In-Reply-To: <20211019034849.16847-1-daniel.schaefer@hpe.com>

From: Abner Chang <abner.chang@hpe.com>

Use RISC-V FirmwareContext library to set and get the
pointer of PeiService.

Cc: Sunil V L <sunilvl@ventanamicro.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>

Signed-off-by: Abner Chang <abner.chang@hpe.com>
---
 Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf | 4 ++--
 Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf
index f23272016b72..fa9fe7851864 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf
+++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf
@@ -4,7 +4,7 @@
 #  PEI Services Table Pointer Library implementation that retrieves a pointer to the
 #  PEI Services Table from a RISC-V OpenSBI sbi_platform firmware context structure.
 #
-#  Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#  Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,5 +35,5 @@
 [LibraryClasses]
   DebugLib
   RiscVCpuLib
-  RiscVEdk2SbiLib
+  RiscVFirmwareContextLib
 
diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c
index 0c1473e93288..9aa74b4f9fbf 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c
+++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c
@@ -1,7 +1,7 @@
 /** @file
   PEI Services Table Pointer Library.
 
-  Copyright (c) 2019 - 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+  Copyright (c) 2019 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 **/
@@ -9,7 +9,7 @@
 #include <PiPei.h>
 #include <Library/DebugLib.h>
 #include <Library/RiscVCpuLib.h>
-#include <Library/RiscVEdk2SbiLib.h>
+#include <Library/RiscVFirmwareContextLib.h>
 #include <Library/PeiServicesTablePointerLib.h>
 #include <sbi/sbi_scratch.h>
 #include <sbi/sbi_platform.h>
@@ -32,8 +32,8 @@ SetPeiServicesTablePointer (
   )
 {
   EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext;
-  SbiGetFirmwareContext (&FirmwareContext);
 
+  GetFirmwareContextPointer (&FirmwareContext);
   FirmwareContext->PeiServiceTable = (VOID *)(UINTN)PeiServicesTablePointer;
 
   DEBUG ((DEBUG_INFO, "Set PEI Service 0x%x at OpenSBI Firmware Context at 0x%x\n",
@@ -61,8 +61,8 @@ GetPeiServicesTablePointer (
   )
 {
   EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext;
-  SbiGetFirmwareContext (&FirmwareContext);
 
+  GetFirmwareContextPointer (&FirmwareContext);
   return (CONST EFI_PEI_SERVICES **)FirmwareContext->PeiServiceTable;
 }
 
-- 
2.31.1


  parent reply	other threads:[~2021-10-19  3:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  3:48 [edk2-platforms] [PATCH v3 00/14] Use generic OpenSBI platform Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 01/14] U5SeriesPkg: Deduplicate PlatformPei Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 02/14] RISC-V: Split SMBIOS out of PlatformPei Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 03/14] RISC-V: Use U5 SMBIOS library only for those platforms Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 04/14] Silicon/RISC-V: Introduce FirmwareContext library Daniel Schaefer
2021-10-19  3:48 ` Daniel Schaefer [this message]
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 06/14] SiFive/U5SeriesPkg: Use " Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 07/14] U540: Add and build device tree Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 08/14] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 09/14] RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 10/14] RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 11/14] U5SeriesPkg: Switch to generic OpenSBI platform Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 12/14] RISC-V: Switch to latest OpenSBI Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 13/14] RISC-V: Implement ResetSystem RT call Daniel Schaefer
2021-10-19  3:48 ` [edk2-platforms] [PATCH v3 14/14] Move OpenSbiPlatformLib to RISC-V/PlatformPkg Daniel Schaefer
2021-10-19  5:58 ` [edk2-platforms] [PATCH v3 00/14] Use generic OpenSBI platform Abner Chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211019034849.16847-6-daniel.schaefer@hpe.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox