From 97ab8fb4e98c84a89d421c08b392db665125a3c0 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 2 Dec 2019 14:39:44 +0100 Subject: [PATCH] zipl: move loaders layout definitions into separate header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the loaders (stage2/stage3) layout values to `include/boot/loaders_layout.h` and use the `_AC` macro for the constants. This allows the reuse of the definitions, e.g. in assembler files, and later for the creation of linker scripts. Reviewed-by: Stefan Haberland Reviewed-by: Philipp Rudo Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/boot/loaders_layout.h | 32 ++++++++++++++++++++++++++++++++ zipl/include/zipl.h | 14 +------------- 2 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 include/boot/loaders_layout.h diff --git a/include/boot/loaders_layout.h b/include/boot/loaders_layout.h new file mode 100644 index 00000000..72aff0df --- /dev/null +++ b/include/boot/loaders_layout.h @@ -0,0 +1,32 @@ +/* + * zipl stage2/stage3 layout definitions + * + * Copyright IBM Corp. 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 LOADERS_LAYOUT_H +#define LOADERS_LAYOUT_H + +#include "lib/zt_common.h" +#include "linux_layout.h" + +#define STAGE3_ENTRY _AC(0xa000, UL) + +#define STAGE2_LOAD_ADDRESS _AC(0x2000, UL) +#define STAGE3_LOAD_ADDRESS STAGE3_ENTRY +#define IMAGE_LOAD_ADDRESS IMAGE_ENTRY + +#define STAGE3_HEAP_SIZE _AC(0x4000, UL) +#define STAGE3_HEAP_ADDRESS _AC(0x2000, UL) +#define STAGE3_STACK_SIZE _AC(0x1000, UL) +#define STAGE3_STACK_ADDRESS _AC(0xF000, UL) +#define STAGE3_PARAMS_ADDRESS _AC(0x9000, UL) + + +#ifndef __ASSEMBLER__ +#endif /* __ASSEMBLER__ */ +#endif /* LOADERS_LAYOUT_H */ diff --git a/zipl/include/zipl.h b/zipl/include/zipl.h index d510a9eb..3ae895b1 100644 --- a/zipl/include/zipl.h +++ b/zipl/include/zipl.h @@ -14,30 +14,18 @@ #include #include "lib/zt_common.h" -#include "boot/linux_layout.h" +#include "boot/loaders_layout.h" #define ZIPL_MAGIC "zIPL" #define ZIPL_MAGIC_SIZE 4 #define DISK_LAYOUT_ID 0x00000001 -#define STAGE3_ENTRY 0xa000UL - -#define STAGE2_LOAD_ADDRESS 0x2000UL -#define STAGE3_LOAD_ADDRESS STAGE3_ENTRY -#define IMAGE_LOAD_ADDRESS IMAGE_ENTRY - #define ADDRESS_LIMIT 0x80000000UL #define ADDRESS_LIMIT_KDUMP 0x2000000UL /* HSA size: 32 MiB */ #define UNSPECIFIED_ADDRESS -1UL #define MAXIMUM_PARMLINE_SIZE 0x380UL #define MAXIMUM_PHYSICAL_BLOCKSIZE 0x1000UL -#define STAGE3_HEAP_SIZE 0x4000UL -#define STAGE3_HEAP_ADDRESS 0x2000UL -#define STAGE3_STACK_SIZE 0x1000UL -#define STAGE3_STACK_ADDRESS 0xF000UL -#define STAGE3_PARAMS_ADDRESS 0x9000UL - #define PSW_ADDRESS_MASK 0x000000007fffffffUL #define PSW_LOAD 0x0008000080000000UL #define PSW_DISABLED_WAIT 0x000a000000000000UL