head.S 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. # setup registers for memory mover & branch to target
  23. lgr %r4,%r2
  24. lg %r2,.Loffset-.LPG1(%r13)
  25. la %r4,0(%r2,%r4)
  26. lg %r3,.Lmvsize-.LPG1(%r13)
  27. lgr %r5,%r3
  28. # move the memory mover someplace safe
  29. la %r1,0x200
  30. mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
  31. # decompress image is started at 0x11000
  32. lgr %r6,%r2
  33. br %r1
  34. mover:
  35. mvcle %r2,%r4,0
  36. jo mover
  37. br %r6
  38. mover_end:
  39. .align 8
  40. .Lstack:
  41. .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
  42. .Loffset:
  43. .quad 0x11000
  44. .Lmvsize:
  45. .quad SZ__bss_start