head.S 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Startup glue code to uncompress the kernel
  3. *
  4. * Copyright IBM Corp. 2010
  5. *
  6. * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/linkage.h>
  10. #include <asm/asm-offsets.h>
  11. #include <asm/thread_info.h>
  12. #include <asm/page.h>
  13. #include "sizes.h"
  14. __HEAD
  15. ENTRY(startup_continue)
  16. basr %r13,0 # get base
  17. .LPG1:
  18. # setup stack
  19. lg %r15,.Lstack-.LPG1(%r13)
  20. aghi %r15,-160
  21. brasl %r14,decompress_kernel
  22. # Set up registers for memory mover. We move the decompressed image to
  23. # 0x11000, starting at offset 0x11000 in the decompressed image so
  24. # that code living at 0x11000 in the image will end up at 0x11000 in
  25. # memory.
  26. lgr %r4,%r2
  27. lg %r2,.Loffset-.LPG1(%r13)
  28. la %r4,0(%r2,%r4)
  29. lg %r3,.Lmvsize-.LPG1(%r13)
  30. lgr %r5,%r3
  31. # Move the memory mover someplace safe so it doesn't overwrite itself.
  32. la %r1,0x200
  33. mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
  34. # When the memory mover is done we pass control to
  35. # arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in
  36. # the decompressed image.
  37. lgr %r6,%r2
  38. br %r1
  39. mover:
  40. mvcle %r2,%r4,0
  41. jo mover
  42. br %r6
  43. mover_end:
  44. .align 8
  45. .Lstack:
  46. .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
  47. .Loffset:
  48. .quad 0x11000
  49. .Lmvsize:
  50. .quad SZ__bss_start