MdeModulePkg/Core: Decorate phase-transition functions with NORETURN.

This patch adds the NORETURN attribute to functions that transfer to
other phases, along with an UNREACHABLE() call at the end to avoid
false warnings.
DxeIpl has been excluded as its main function returns a status.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Marvin H?user
2016-06-19 09:31:16 +08:00
committed by Liming Gao
parent 90eda6fc27
commit 3a7daf9eb0
3 changed files with 9 additions and 0 deletions

View File

@ -235,6 +235,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE gLoa
**/ **/
VOID VOID
NORETURN
EFIAPI EFIAPI
DxeMain ( DxeMain (
IN VOID *HobStart IN VOID *HobStart
@ -524,6 +525,8 @@ DxeMain (
// //
ASSERT (FALSE); ASSERT (FALSE);
CpuDeadLoop (); CpuDeadLoop ();
UNREACHABLE ();
} }

View File

@ -315,6 +315,7 @@ typedef struct {
**/ **/
VOID VOID
NORETURN
EFIAPI EFIAPI
PeiCore ( PeiCore (
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,

View File

@ -136,6 +136,7 @@ ShadowPeiCore (
**/ **/
VOID VOID
NORETURN
EFIAPI EFIAPI
PeiCore ( PeiCore (
IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr, IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr,
@ -275,6 +276,8 @@ PeiCore (
// //
ASSERT (FALSE); ASSERT (FALSE);
CpuDeadLoop(); CpuDeadLoop();
UNREACHABLE ();
} }
// //
@ -468,4 +471,6 @@ PeiCore (
// //
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
CpuDeadLoop(); CpuDeadLoop();
UNREACHABLE ();
} }