-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[S390] add support for compressed kernels
Add the "bzImage" compile target and the necessary code to generate compressed kernel images. The old style uncompressed "image" target is preserved, a simple make will build them both. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
- Loading branch information
Martin Schwidefsky
authored and
Martin Schwidefsky
committed
Feb 26, 2010
1 parent
73bfa5f
commit 1844c9b
Showing
15 changed files
with
488 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# | ||
# linux/arch/s390/boot/compressed/Makefile | ||
# | ||
# create a compressed vmlinux image from the original vmlinux | ||
# | ||
|
||
BITS := $(if $(CONFIG_64BIT),64,31) | ||
|
||
targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ | ||
vmlinux.bin.lzma misc.o piggy.o sizes.h head$(BITS).o | ||
|
||
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 | ||
KBUILD_CFLAGS += $(cflags-y) | ||
KBUILD_CFLAGS += $(call cc-option,-mpacked-stack) | ||
KBUILD_CFLAGS += $(call cc-option,-ffreestanding) | ||
|
||
GCOV_PROFILE := n | ||
|
||
OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o) | ||
OBJECTS += $(obj)/head$(BITS).o $(obj)/misc.o $(obj)/piggy.o | ||
|
||
LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T | ||
$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) | ||
$(call if_changed,ld) | ||
@: | ||
|
||
sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p' | ||
|
||
quiet_cmd_sizes = GEN $@ | ||
cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ | ||
|
||
$(obj)/sizes.h: vmlinux | ||
$(call if_changed,sizes) | ||
|
||
AFLAGS_head$(BITS).o += -I$(obj) | ||
$(obj)/head$(BITS).o: $(obj)/sizes.h | ||
|
||
CFLAGS_misc.o += -I$(obj) | ||
$(obj)/misc.o: $(obj)/sizes.h | ||
|
||
OBJCOPYFLAGS_vmlinux.bin := -R .comment -S | ||
$(obj)/vmlinux.bin: vmlinux | ||
$(call if_changed,objcopy) | ||
|
||
vmlinux.bin.all-y := $(obj)/vmlinux.bin | ||
|
||
suffix-$(CONFIG_KERNEL_GZIP) := gz | ||
suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | ||
suffix-$(CONFIG_KERNEL_LZMA) := lzma | ||
|
||
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) | ||
$(call if_changed,gzip) | ||
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) | ||
$(call if_changed,bzip2) | ||
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) | ||
$(call if_changed,lzma) | ||
|
||
LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T | ||
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) | ||
$(call if_changed,ld) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Startup glue code to uncompress the kernel | ||
* | ||
* Copyright IBM Corp. 2010 | ||
* | ||
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <asm/asm-offsets.h> | ||
#include <asm/thread_info.h> | ||
#include <asm/page.h> | ||
#include "sizes.h" | ||
|
||
__HEAD | ||
.globl startup_continue | ||
startup_continue: | ||
basr %r13,0 # get base | ||
.LPG1: | ||
# setup stack | ||
l %r15,.Lstack-.LPG1(%r13) | ||
ahi %r15,-96 | ||
l %r1,.Ldecompress-.LPG1(%r13) | ||
basr %r14,%r1 | ||
# setup registers for memory mover & branch to target | ||
lr %r4,%r2 | ||
l %r2,.Loffset-.LPG1(%r13) | ||
la %r4,0(%r2,%r4) | ||
l %r3,.Lmvsize-.LPG1(%r13) | ||
lr %r5,%r3 | ||
# move the memory mover someplace safe | ||
la %r1,0x200 | ||
mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13) | ||
# decompress image is started at 0x11000 | ||
lr %r6,%r2 | ||
br %r1 | ||
mover: | ||
mvcle %r2,%r4,0 | ||
jo mover | ||
br %r6 | ||
mover_end: | ||
|
||
.align 8 | ||
.Lstack: | ||
.long 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER)) | ||
.Ldecompress: | ||
.long decompress_kernel | ||
.Loffset: | ||
.long 0x11000 | ||
.Lmvsize: | ||
.long SZ__bss_start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Startup glue code to uncompress the kernel | ||
* | ||
* Copyright IBM Corp. 2010 | ||
* | ||
* Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
*/ | ||
|
||
#include <linux/init.h> | ||
#include <asm/asm-offsets.h> | ||
#include <asm/thread_info.h> | ||
#include <asm/page.h> | ||
#include "sizes.h" | ||
|
||
__HEAD | ||
.globl startup_continue | ||
startup_continue: | ||
basr %r13,0 # get base | ||
.LPG1: | ||
# setup stack | ||
lg %r15,.Lstack-.LPG1(%r13) | ||
aghi %r15,-160 | ||
brasl %r14,decompress_kernel | ||
# setup registers for memory mover & branch to target | ||
lgr %r4,%r2 | ||
lg %r2,.Loffset-.LPG1(%r13) | ||
la %r4,0(%r2,%r4) | ||
lg %r3,.Lmvsize-.LPG1(%r13) | ||
lgr %r5,%r3 | ||
# move the memory mover someplace safe | ||
la %r1,0x200 | ||
mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13) | ||
# decompress image is started at 0x11000 | ||
lgr %r6,%r2 | ||
br %r1 | ||
mover: | ||
mvcle %r2,%r4,0 | ||
jo mover | ||
br %r6 | ||
mover_end: | ||
|
||
.align 8 | ||
.Lstack: | ||
.quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER)) | ||
.Loffset: | ||
.quad 0x11000 | ||
.Lmvsize: | ||
.quad SZ__bss_start |
Oops, something went wrong.