public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context
@ 2020-09-08  5:48 Abner Chang
  2020-09-08  5:48 ` [edk2-platforms][PATCH 2/2] Silicon/SiFive: " Abner Chang
  2020-09-11  7:59 ` [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: " Daniel Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Abner Chang @ 2020-09-08  5:48 UTC (permalink / raw)
  To: devel; +Cc: abner.chang, Daniel Schaefer, Leif Lindholm

Return EFI_NOT_FOUND if opensbi firmware context can not be
located using SBI call.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Leif Lindholm <leif@nuviainc.com>
---
 .../ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
index 0df505d267..64c30b950d 100644
--- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
+++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c
@@ -851,6 +851,8 @@ SbiGetMscratchHartid (
 
   @param[out] FirmwareContext      The firmware context pointer.
   @retval EFI_SUCCESS              The operation succeeds.
+  @retval EFI_NOT_FOUND            Failed to get the pointer of EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT.
+
 **/
 EFI_STATUS
 EFIAPI
@@ -866,8 +868,9 @@ SbiGetFirmwareContext (
     ScratchSpace = (SBI_SCRATCH *)Ret.Value;
     SbiPlatform = (SBI_PLATFORM *)sbi_platform_ptr(ScratchSpace);
     *FirmwareContext = (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform->firmware_context;
+  } else {
+    return EFI_NOT_FOUND;
   }
-
   return EFI_SUCCESS;
 }
 
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-12  6:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-08  5:48 [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context Abner Chang
2020-09-08  5:48 ` [edk2-platforms][PATCH 2/2] Silicon/SiFive: " Abner Chang
2020-09-11  8:01   ` Daniel Schaefer
2020-09-12  6:33     ` Abner Chang
2020-09-11  7:59 ` [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: " Daniel Schaefer
2020-09-12  6:29   ` Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox