From 2568863f581cff9bf3b1e27c2d2917b5ae3b5177 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 18 Feb 2020 16:18:33 +0100 Subject: [PATCH] include/boot/s390.h: move panic and panic_notify to libc.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as this code is not s390 specific and not every user of s390.h wants to implement `panic_notify`. Reviewed-by: Philipp Rudo Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/boot/s390.h | 9 --------- zipl/boot/libc.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/boot/s390.h b/include/boot/s390.h index 53fc4a21..ea1493e5 100644 --- a/include/boot/s390.h +++ b/include/boot/s390.h @@ -201,15 +201,6 @@ struct _lowcore { #define S390_lowcore (*((struct _lowcore *) 0)) -void panic_notify(unsigned long reason); - -#define panic(reason, x...) \ -do { \ - printf(x); \ - panic_notify(reason); \ - libc_stop(reason); \ -} while (0) - static __always_inline int page_is_valid(unsigned long addr) { unsigned long tmp; diff --git a/zipl/boot/libc.h b/zipl/boot/libc.h index 83ff82bc..f5112d60 100644 --- a/zipl/boot/libc.h +++ b/zipl/boot/libc.h @@ -61,6 +61,14 @@ void libc_stop(unsigned long); void start(void); void pgm_check_handler(void); void pgm_check_handler_fn(void); +void panic_notify(unsigned long reason); + +#define panic(reason, ...) \ + do { \ + printf(__VA_ARGS__); \ + panic_notify(reason); \ + libc_stop(reason); \ + } while (0) static inline int isdigit(int c) {