Subject: [PATCH] [FEAT VS1804] include/boot/s390.h: move panic and panic_notify to libc.h From: Marc Hartmayer Summary: genprotimg: Introduce new tool for the creation of PV images Description: genprotimg takes a kernel, host-key documents, optionally an initrd, optionally a file with the kernel command line, and it generates a single, loadable image file. The image consists of a concatenation of a plain text boot loader, the encrypted components for kernel, initrd, and cmdline, and the integrity-protected PV header, containing metadata necessary for running the guest in PV mode. It's possible to use this image file as a kernel for zIPL or for a direct kernel boot using QEMU. Upstream-ID: 2568863f581cff9bf3b1e27c2d2917b5ae3b5177 Problem-ID: VS1804 Upstream-Description: include/boot/s390.h: move panic and panic_notify to libc.h ... 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 Signed-off-by: Marc Hartmayer --- include/boot/s390.h | 9 --------- zipl/boot/libc.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) --- 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; --- 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) {