head.S 1.3 KB

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