diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2018-04-10 14:14:02 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2018-10-09 11:21:06 +0200 |
commit | d1b52a4388ffdcff47fb53de7fffe052fe766a9f (patch) | |
tree | 365847541f8313f4771223357ce68c2c945ea8fd /arch/s390/boot/startup.c | |
parent | 7516fc11e44e73f1fcf8a3808dd88f82142e6585 (diff) |
s390: introduce .boot.data section
Introduce .boot.data section which is "shared" between the decompressor
code and the decompressed kernel. The decompressor will store values in
it, and copy over to the decompressed image before starting it. This
method allows to avoid using pre-defined addresses and other hacks to
pass values between those boot phases.
.boot.data section is a part of init data, and will be freed after kernel
initialization is complete.
For uncompressed kernel image, .boot.data section is basically the same
as .init.data
Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/boot/startup.c')
-rw-r--r-- | arch/s390/boot/startup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index 81199ca4a513..e9eea37894b3 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -5,6 +5,8 @@ #include "compressed/decompressor.h" #include "boot.h" +extern char __boot_data_start[], __boot_data_end[]; + void error(char *x) { sclp_early_printk("\n\n"); @@ -36,6 +38,13 @@ static void rescue_initrd(void) INITRD_START = min_initrd_addr; } +static void copy_bootdata(void) +{ + if (__boot_data_end - __boot_data_start != vmlinux.bootdata_size) + error(".boot.data section size mismatch"); + memcpy((void *)vmlinux.bootdata_off, __boot_data_start, vmlinux.bootdata_size); +} + void startup_kernel(void) { void *img; @@ -45,5 +54,6 @@ void startup_kernel(void) img = decompress_kernel(); memmove((void *)vmlinux.default_lma, img, vmlinux.image_size); } + copy_bootdata(); vmlinux.entry(); } |