Back to home page

LXR

 
 

    


0001 /*
0002  * Startup glue code to uncompress the kernel
0003  *
0004  * Copyright IBM Corp. 2010
0005  *
0006  *   Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
0007  */
0008 
0009 #include <linux/init.h>
0010 #include <linux/linkage.h>
0011 #include <asm/asm-offsets.h>
0012 #include <asm/thread_info.h>
0013 #include <asm/page.h>
0014 #include "sizes.h"
0015 
0016 __HEAD
0017 ENTRY(startup_continue)
0018     basr    %r13,0          # get base
0019 .LPG1:
0020     # setup stack
0021     lg  %r15,.Lstack-.LPG1(%r13)
0022     aghi    %r15,-160
0023     brasl   %r14,decompress_kernel
0024     # Set up registers for memory mover. We move the decompressed image to
0025     # 0x11000, starting at offset 0x11000 in the decompressed image so
0026     # that code living at 0x11000 in the image will end up at 0x11000 in
0027     # memory.
0028     lgr %r4,%r2
0029     lg  %r2,.Loffset-.LPG1(%r13)
0030     la  %r4,0(%r2,%r4)
0031     lg  %r3,.Lmvsize-.LPG1(%r13)
0032     lgr %r5,%r3
0033     # Move the memory mover someplace safe so it doesn't overwrite itself.
0034     la  %r1,0x200
0035     mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
0036     # When the memory mover is done we pass control to
0037     # arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in
0038     # the decompressed image.
0039     lgr %r6,%r2
0040     br  %r1
0041 mover:
0042     mvcle   %r2,%r4,0
0043     jo  mover
0044     br  %r6
0045 mover_end:
0046 
0047     .align  8
0048 .Lstack:
0049     .quad   0x8000 + (1<<(PAGE_SHIFT+THREAD_SIZE_ORDER))
0050 .Loffset:
0051     .quad   0x11000
0052 .Lmvsize:
0053     .quad   SZ__bss_start