zipl/libc.h: declare start as __noreturn function

Declare `start` as __noreturn function since the function doesn't
return. Use the gcc/clang built-in function `__builtin_unreachable` to
make clear that `lpsw` and `diag308(DIAG390_IPL, NULL)` doesn't
return (see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html and
https://clang.llvm.org/docs/LanguageExtensions.html#builtin-unreachable).

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2021-11-25 12:33:01 +01:00
committed by Jan Höppner
parent 7503d88b3b
commit e1f174ae22
3 changed files with 7 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ unsigned long get_zeroed_page(void);
void free_page(unsigned long);
void initialize(void);
void libc_stop(unsigned long) __noreturn;
void start(void);
void __noreturn start(void);
void pgm_check_handler(void);
void pgm_check_handler_fn(void);
void panic_notify(unsigned long reason);

View File

@@ -75,15 +75,16 @@ out_free_page:
}
static void execute(uint64_t psw)
static __noreturn void execute(uint64_t psw)
{
asm volatile(
" lpsw %[psw]\n"
: : [psw] "Q" (psw) : "cc"
);
__builtin_unreachable();
}
void start(void)
void __noreturn start(void)
{
struct stage2_descr stage2_descr;
struct subchannel_id subchannel_id;

View File

@@ -393,7 +393,7 @@ static void store_status(void)
* Block followed by a valid checksum (as defined in lowcore.h and set
* by ipl.c). In case of match use diag308 to IPL.
*/
static void dump_exit(unsigned long code)
static __noreturn void dump_exit(unsigned long code)
{
struct ipib_info *ipib_info = (struct ipib_info *)&S390_lowcore.ipib;
uint32_t ipib_len, csum;
@@ -406,6 +406,7 @@ static void dump_exit(unsigned long code)
libc_stop(code);
diag308(DIAG308_SET, (void *) ipib_info->ipib);
diag308(DIAG308_IPL, NULL);
__builtin_unreachable();
}
/*
@@ -420,7 +421,7 @@ void panic_notify(unsigned long code)
/*
* Create stand-alone dump
*/
void start(void)
void __noreturn start(void)
{
init_early();
dt_device_parm_setup();