From 7cd8a57599b519c4ead0c0eadbb52469eaf2dda5 Mon Sep 17 00:00:00 2001 From: Marvin H?user Date: Wed, 28 Feb 2018 00:50:59 +0800 Subject: [PATCH] UefiCpuPkg/SecMain: Add NORETURN decorator to SecStartup(). 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 Reviewed-by: Eric Dong Reviewed-by: Laszlo Ersek --- UefiCpuPkg/SecCore/SecMain.c | 8 +++++++- UefiCpuPkg/SecCore/SecMain.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/SecCore/SecMain.c b/UefiCpuPkg/SecCore/SecMain.c index c241d3704a..b24e190617 100644 --- a/UefiCpuPkg/SecCore/SecMain.c +++ b/UefiCpuPkg/SecCore/SecMain.c @@ -1,7 +1,7 @@ /** @file C functions in SEC - Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -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 46c7d41c6e..4bc6606044 100644 --- a/UefiCpuPkg/SecCore/SecMain.h +++ b/UefiCpuPkg/SecCore/SecMain.h @@ -1,7 +1,7 @@ /** @file Master header file for SecCore. - Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -76,6 +76,7 @@ SecTemporaryRamDone ( @param BootFirmwareVolume Base address of the Boot Firmware Volume. **/ VOID +NORETURN EFIAPI SecStartup ( IN UINT32 SizeOfRam, -- 2.39.2