public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Abner Chang" <abner.chang@hpe.com>
To: "Schaefer, Daniel" <daniel.schaefer@hpe.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Leif Lindholm <leif@nuviainc.com>
Subject: Re: [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib: Error handling for locating firmware context
Date: Sat, 12 Sep 2020 06:29:12 +0000	[thread overview]
Message-ID: <CS1PR8401MB1144494469A850F7A8BBEB16FF250@CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <556055a0-5056-7949-903f-0f17999fa855@hpe.com>

Thanks Daniel.

> -----Original Message-----
> From: Schaefer, Daniel
> Sent: Friday, September 11, 2020 3:59 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Leif Lindholm <leif@nuviainc.com>
> Subject: Re: [edk2-platforms][PATCH 1/2] ProcessorPkg/RiscVEdk2SbiLib:
> Error handling for locating firmware context
> 
> 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.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/RiscVEdk2Sbi
> > +++ Lib.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;
> >   }
> >
> >

      reply	other threads:[~2020-09-12  6:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=CS1PR8401MB1144494469A850F7A8BBEB16FF250@CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.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