Oh no, what did I do here... I don't return proper error codes at all in this
file.
I forgot to revise this after the initial implementation.
So, good change but we should do that for all functions in this file.
I'll do that on Monday.
On 9/8/20 1:48 PM, Abner Chang wrote:
Return EFI_NOT_FOUND if opensbi firmware context can not be
located using SBI call.
Signed-off-by: Abner Chang <abner.ch...@hpe.com>
Cc: Daniel Schaefer <daniel.schae...@hpe.com>
Cc: Leif Lindholm <l...@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;
}
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#65187): https://edk2.groups.io/g/devel/message/65187
Mute This Topic: https://groups.io/mt/76703528/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-