public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: "Marvin Häuser" <Marvin.Haeuser@outlook.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "eric.dong@intel.com" <eric.dong@intel.com>
Subject: Re: [PATCH] UefiCpuPkg/SecMain: Add NORETURN decorator to SecStartup().
Date: Tue, 27 Feb 2018 18:40:40 +0100	[thread overview]
Message-ID: <d95c39f6-7443-0235-58b4-5559bed55c11@redhat.com> (raw)
In-Reply-To: <AM4PR06MB14910D57C5206336421710C480C00@AM4PR06MB1491.eurprd06.prod.outlook.com>

On 02/27/18 17:50, Marvin Häuser wrote:
> The function SecStartup() is not supposed to return. Hence, add the
> NORETURN decorator.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
>  UefiCpuPkg/SecCore/SecMain.c | 6 ++++++
>  UefiCpuPkg/SecCore/SecMain.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c
> index c241d3704af7..6f9db0584ce1 100644
> --- a/UefiCpuPkg/SecCore/SecMain.c
> +++ b/UefiCpuPkg/SecCore/SecMain.c
> @@ -113,6 +113,7 @@ SecPerformancePpiCallBack (
>    @param BootFirmwareVolume  Base address of the Boot Firmware Volume.
>  **/
>  VOID
> +NORETURN
>  EFIAPI
>  SecStartup (
>    IN UINT32                   SizeOfRam,
> @@ -201,6 +202,11 @@ SecStartup (
>    // Initialize Debug Agent to support source level debug in SEC/PEI phases before memory ready.
>    //
>    InitializeDebugAgent (DEBUG_AGENT_INIT_PREMEM_SEC, &SecCoreData, SecStartupPhase2);
> +
> +  //
> +  // Should not come here.
> +  //
> +  UNREACHABLE ();
>  }
>  
>  /**
> diff --git a/UefiCpuPkg/SecCore/SecMain.h b/UefiCpuPkg/SecCore/SecMain.h
> index 46c7d41c6e3e..42a5718cfdd5 100644
> --- a/UefiCpuPkg/SecCore/SecMain.h
> +++ b/UefiCpuPkg/SecCore/SecMain.h
> @@ -76,6 +76,7 @@ SecTemporaryRamDone (
>    @param BootFirmwareVolume  Base address of the Boot Firmware Volume.
>  **/
>  VOID
> +NORETURN
>  EFIAPI
>  SecStartup (
>    IN UINT32                   SizeOfRam,
> 

I checked the NORETURN and UNREACHABLE() macros in
"MdePkg/Include/Base.h", and also the InitializeDebugAgent() API. I
think the patch is correct.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo


  reply	other threads:[~2018-02-27 17:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 16:50 [PATCH] UefiCpuPkg/SecMain: Add NORETURN decorator to SecStartup() Marvin Häuser
2018-02-27 17:40 ` Laszlo Ersek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-05 13:17 FW: " Marvin Häuser
2018-05-07  8:13 ` Dong, Eric

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=d95c39f6-7443-0235-58b4-5559bed55c11@redhat.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