From b83c8944f195117609a36f383f32377014e34c31 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 9 Dec 2019 16:41:00 +0100 Subject: [PATCH] zipl: move s390.h to include/boot/s390.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we made sure that s390.h can be used with our minimal libc implementation and glibc move s390.h to `include/boot/s390.h`. While at it, make sure that s390.h is assembler compatible as it will be used later in the PV boot loader and include s390.h in ipl.h as PAGE_SIZE is used there. Reviewed-by: Philipp Rudo Reviewed-by: Stefan Haberland Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/boot/ipl.h | 1 + {zipl => include}/boot/s390.h | 19 +++++++++++-------- zipl/boot/cio.c | 2 +- zipl/boot/cio.h | 2 +- zipl/boot/eckd2.c | 2 +- zipl/boot/eckd2dump.c | 2 +- zipl/boot/fba2.c | 2 +- zipl/boot/kdump.c | 2 +- zipl/boot/kdump.h | 2 +- zipl/boot/sclp.c | 2 +- zipl/boot/sclp.h | 2 +- zipl/boot/stage2.c | 2 +- zipl/boot/stage2.h | 3 +-- zipl/boot/stage2dump.h | 2 +- zipl/boot/stage3.c | 2 +- zipl/boot/stage3.h | 2 +- 16 files changed, 26 insertions(+), 23 deletions(-) rename {zipl => include}/boot/s390.h (98%) diff --git a/include/boot/ipl.h b/include/boot/ipl.h index af35afae..ae5be195 100644 --- a/include/boot/ipl.h +++ b/include/boot/ipl.h @@ -11,6 +11,7 @@ #define IPL_H #include "lib/zt_common.h" +#include "s390.h" #define IPL_FLAG_SECURE 0x40 diff --git a/zipl/boot/s390.h b/include/boot/s390.h similarity index 98% rename from zipl/boot/s390.h rename to include/boot/s390.h index 886233b9..53fc4a21 100644 --- a/zipl/boot/s390.h +++ b/include/boot/s390.h @@ -1,19 +1,25 @@ /* - * zipl - zSeries Initial Program Loader tool + * s390 related definitions and functions. * - * System z specific functions - * - * Copyright IBM Corp. 2013, 2017 + * Copyright IBM Corp. 2013, 2020 * * s390-tools is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. */ + #ifndef S390_H #define S390_H #include "lib/zt_common.h" #include "boot/sigp.h" +#define __LC_IPLDEV 0x0c6c +#define __LC_OS_INFO 0x0e18 + +#define PAGE_SIZE _AC(4096, UL) + + +#ifndef __ASSEMBLER__ /* * Helper macro for exception table entries @@ -194,10 +200,6 @@ struct _lowcore { #define S390_lowcore (*((struct _lowcore *) 0)) -#define __LC_IPLDEV 0x0c6c -#define __LC_OS_INFO 0x0e18 - -#define PAGE_SIZE 4096 void panic_notify(unsigned long reason); @@ -446,4 +448,5 @@ static __always_inline void stfle(uint64_t *stfle_fac_list, int size) memset((char *) stfle_fac_list + nr, 0, size * 8 - nr); } +#endif /* __ASSEMBLER__ */ #endif /* S390_H */ diff --git a/zipl/boot/cio.c b/zipl/boot/cio.c index 453feaf8..8a0d1406 100644 --- a/zipl/boot/cio.c +++ b/zipl/boot/cio.c @@ -12,7 +12,7 @@ #include "cio.h" #include "error.h" #include "libc.h" -#include "s390.h" +#include "boot/s390.h" static unsigned long initial_lpm = 0x00; static const char *msg_essch = "Start subchannel failed"; diff --git a/zipl/boot/cio.h b/zipl/boot/cio.h index 0f49e08a..fc396084 100644 --- a/zipl/boot/cio.h +++ b/zipl/boot/cio.h @@ -12,7 +12,7 @@ #define CIO_H #include "libc.h" -#include "s390.h" +#include "boot/s390.h" /* Condition codes */ #define CC_INITIATED 0 diff --git a/zipl/boot/eckd2.c b/zipl/boot/eckd2.c index 3943d455..7ac6da21 100644 --- a/zipl/boot/eckd2.c +++ b/zipl/boot/eckd2.c @@ -10,7 +10,7 @@ */ #include "eckd.h" -#include "s390.h" +#include "boot/s390.h" #include "stage2.h" int extract_length(void *data) diff --git a/zipl/boot/eckd2dump.c b/zipl/boot/eckd2dump.c index 3cfa1580..28598adf 100644 --- a/zipl/boot/eckd2dump.c +++ b/zipl/boot/eckd2dump.c @@ -12,7 +12,7 @@ #include "cio.h" #include "eckd2dump.h" #include "error.h" -#include "s390.h" +#include "boot/s390.h" #include "stage2dump.h" #define ECKD_CCW_LOCATE_RECORD 0x47 diff --git a/zipl/boot/fba2.c b/zipl/boot/fba2.c index 7d3b5ccd..1a570c21 100644 --- a/zipl/boot/fba2.c +++ b/zipl/boot/fba2.c @@ -11,7 +11,7 @@ #include "fba.h" #include "libc.h" -#include "s390.h" +#include "boot/s390.h" int extract_length(void *data) { struct linear_blockptr *blockptr = (struct linear_blockptr *)data; diff --git a/zipl/boot/kdump.c b/zipl/boot/kdump.c index fc0281ee..eb3ae07c 100644 --- a/zipl/boot/kdump.c +++ b/zipl/boot/kdump.c @@ -13,7 +13,7 @@ #include "kdump.h" #include "libc.h" #include "menu.h" -#include "s390.h" +#include "boot/s390.h" void kdump_failed(unsigned long reason) { diff --git a/zipl/boot/kdump.h b/zipl/boot/kdump.h index f6fae1ca..f81d20cf 100644 --- a/zipl/boot/kdump.h +++ b/zipl/boot/kdump.h @@ -14,7 +14,7 @@ #define KDUMP_H #include "libc.h" -#include "s390.h" +#include "boot/s390.h" #define OS_INFO_VERSION_MAJOR_SUPPORTED 1 #define OS_INFO_MAGIC 0x4f53494e464f535aULL /* OSINFOSZ */ diff --git a/zipl/boot/sclp.c b/zipl/boot/sclp.c index 817b87a1..0326a327 100644 --- a/zipl/boot/sclp.c +++ b/zipl/boot/sclp.c @@ -11,7 +11,7 @@ #include "libc.h" #include "error.h" -#include "s390.h" +#include "boot/s390.h" #include "sclp.h" /* Perform service call. Return 0 on success, non-zero otherwise. */ diff --git a/zipl/boot/sclp.h b/zipl/boot/sclp.h index 12e87938..1c8c7139 100644 --- a/zipl/boot/sclp.h +++ b/zipl/boot/sclp.h @@ -13,7 +13,7 @@ #define SCLP_H #include "libc.h" -#include "s390.h" +#include "boot/s390.h" /* vector keys and ids */ #define GDS_ID_MDSMU 0x1310 diff --git a/zipl/boot/stage2.c b/zipl/boot/stage2.c index fb5101ed..c8b28cd0 100644 --- a/zipl/boot/stage2.c +++ b/zipl/boot/stage2.c @@ -14,7 +14,7 @@ #include "error.h" #include "libc.h" #include "menu.h" -#include "s390.h" +#include "boot/s390.h" #include "stage2.h" static int is_null_descriptor(disk_blockptr_t *address) diff --git a/zipl/boot/stage2.h b/zipl/boot/stage2.h index 8fd5bd3c..b9b27d8b 100644 --- a/zipl/boot/stage2.h +++ b/zipl/boot/stage2.h @@ -15,7 +15,7 @@ #include "cio.h" #include "error.h" #include "libc.h" -#include "s390.h" +#include "boot/s390.h" #define DESCR_PER_BLOCK 16 @@ -76,4 +76,3 @@ void kdump_stage2(unsigned long); #endif /* COMMON_H */ - diff --git a/zipl/boot/stage2dump.h b/zipl/boot/stage2dump.h index c973dd72..784b299c 100644 --- a/zipl/boot/stage2dump.h +++ b/zipl/boot/stage2dump.h @@ -13,7 +13,7 @@ #define STAGE2DUMP_H #include "libc.h" -#include "s390.h" +#include "boot/s390.h" #define IPL_SC *((struct subchannel_id *) &S390_lowcore.subchannel_id) #define ROUND_DOWN(x, a) ((x) & ~((typeof(x))(a) - 1)) diff --git a/zipl/boot/stage3.c b/zipl/boot/stage3.c index fe8f358a..0c8967c0 100644 --- a/zipl/boot/stage3.c +++ b/zipl/boot/stage3.c @@ -11,7 +11,7 @@ #include "libc.h" #include "boot/sigp.h" -#include "s390.h" +#include "boot/s390.h" #include "stage3.h" #include "error.h" #include "zipl.h" diff --git a/zipl/boot/stage3.h b/zipl/boot/stage3.h index 924cfd9d..a7f20131 100644 --- a/zipl/boot/stage3.h +++ b/zipl/boot/stage3.h @@ -13,8 +13,8 @@ #define STAGE3_H #include "libc.h" -#include "s390.h" +#include "boot/s390.h" #include "boot/ipl.h" #include "boot/linux_layout.h"