]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Core: Decorate phase-transition functions with NORETURN.
authorMarvin H?user <Marvin.Haeuser@outlook.com>
Sun, 19 Jun 2016 01:31:16 +0000 (09:31 +0800)
committerLiming Gao <liming.gao@intel.com>
Wed, 22 Jun 2016 01:37:18 +0000 (09:37 +0800)
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>
MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
MdeModulePkg/Core/Pei/PeiMain.h
MdeModulePkg/Core/Pei/PeiMain/PeiMain.c

index c34067e11845f4ce0e6b338b180a1ae2952de80d..8380fd78bed81bfd2b586f0536855290a9214e69 100644 (file)
@@ -235,6 +235,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE    gLoa
 \r
 **/\r
 VOID\r
+NORETURN\r
 EFIAPI\r
 DxeMain (\r
   IN  VOID *HobStart\r
@@ -524,6 +525,8 @@ DxeMain (
   //\r
   ASSERT (FALSE);\r
   CpuDeadLoop ();\r
+\r
+  UNREACHABLE ();\r
 }\r
 \r
 \r
index 24983201d0230fa4f89de7938fdd0e4612ee8904..54331dabd84425bebe0684356d81e76255ed7427 100644 (file)
@@ -315,6 +315,7 @@ typedef struct {
 \r
 **/\r
 VOID\r
+NORETURN\r
 EFIAPI\r
 PeiCore (\r
   IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreData,\r
index 10db496140ad0d6f5820f72c08fedb63572d6019..59fdd2614b146c58ec03ca282b3a0f6514034e45 100644 (file)
@@ -136,6 +136,7 @@ ShadowPeiCore (
 \r
 **/\r
 VOID\r
+NORETURN\r
 EFIAPI\r
 PeiCore (\r
   IN CONST EFI_SEC_PEI_HAND_OFF        *SecCoreDataPtr,\r
@@ -275,6 +276,8 @@ PeiCore (
       //\r
       ASSERT (FALSE);\r
       CpuDeadLoop();\r
+\r
+      UNREACHABLE ();\r
     }\r
 \r
     //\r
@@ -468,4 +471,6 @@ PeiCore (
   //\r
   ASSERT_EFI_ERROR (Status);\r
   CpuDeadLoop();\r
+\r
+  UNREACHABLE ();\r
 }\r