base.S 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * arch/s390/kernel/base.S
  3. *
  4. * Copyright IBM Corp. 2006,2007
  5. * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
  6. * Michael Holzheu <holzheu@de.ibm.com>
  7. */
  8. #include <asm/asm-offsets.h>
  9. #include <asm/ptrace.h>
  10. #ifdef CONFIG_64BIT
  11. .globl s390_base_mcck_handler
  12. s390_base_mcck_handler:
  13. basr %r13,0
  14. 0: lg %r15,__LC_PANIC_STACK # load panic stack
  15. aghi %r15,-STACK_FRAME_OVERHEAD
  16. larl %r1,s390_base_mcck_handler_fn
  17. lg %r1,0(%r1)
  18. ltgr %r1,%r1
  19. jz 1f
  20. basr %r14,%r1
  21. 1: la %r1,4095
  22. lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)
  23. lpswe __LC_MCK_OLD_PSW
  24. .section .bss
  25. .globl s390_base_mcck_handler_fn
  26. s390_base_mcck_handler_fn:
  27. .quad 0
  28. .previous
  29. .globl s390_base_ext_handler
  30. s390_base_ext_handler:
  31. stmg %r0,%r15,__LC_SAVE_AREA
  32. basr %r13,0
  33. 0: aghi %r15,-STACK_FRAME_OVERHEAD
  34. larl %r1,s390_base_ext_handler_fn
  35. lg %r1,0(%r1)
  36. ltgr %r1,%r1
  37. jz 1f
  38. basr %r14,%r1
  39. 1: lmg %r0,%r15,__LC_SAVE_AREA
  40. ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
  41. lpswe __LC_EXT_OLD_PSW
  42. .section .bss
  43. .globl s390_base_ext_handler_fn
  44. s390_base_ext_handler_fn:
  45. .quad 0
  46. .previous
  47. .globl s390_base_pgm_handler
  48. s390_base_pgm_handler:
  49. stmg %r0,%r15,__LC_SAVE_AREA
  50. basr %r13,0
  51. 0: aghi %r15,-STACK_FRAME_OVERHEAD
  52. larl %r1,s390_base_pgm_handler_fn
  53. lg %r1,0(%r1)
  54. ltgr %r1,%r1
  55. jz 1f
  56. basr %r14,%r1
  57. lmg %r0,%r15,__LC_SAVE_AREA
  58. lpswe __LC_PGM_OLD_PSW
  59. 1: lpswe disabled_wait_psw-0b(%r13)
  60. .align 8
  61. disabled_wait_psw:
  62. .quad 0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler
  63. .section .bss
  64. .globl s390_base_pgm_handler_fn
  65. s390_base_pgm_handler_fn:
  66. .quad 0
  67. .previous
  68. #else /* CONFIG_64BIT */
  69. .globl s390_base_mcck_handler
  70. s390_base_mcck_handler:
  71. basr %r13,0
  72. 0: l %r15,__LC_PANIC_STACK # load panic stack
  73. ahi %r15,-STACK_FRAME_OVERHEAD
  74. l %r1,2f-0b(%r13)
  75. l %r1,0(%r1)
  76. ltr %r1,%r1
  77. jz 1f
  78. basr %r14,%r1
  79. 1: lm %r0,%r15,__LC_GPREGS_SAVE_AREA
  80. lpsw __LC_MCK_OLD_PSW
  81. 2: .long s390_base_mcck_handler_fn
  82. .section .bss
  83. .globl s390_base_mcck_handler_fn
  84. s390_base_mcck_handler_fn:
  85. .long 0
  86. .previous
  87. .globl s390_base_ext_handler
  88. s390_base_ext_handler:
  89. stm %r0,%r15,__LC_SAVE_AREA
  90. basr %r13,0
  91. 0: ahi %r15,-STACK_FRAME_OVERHEAD
  92. l %r1,2f-0b(%r13)
  93. l %r1,0(%r1)
  94. ltr %r1,%r1
  95. jz 1f
  96. basr %r14,%r1
  97. 1: lm %r0,%r15,__LC_SAVE_AREA
  98. ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
  99. lpsw __LC_EXT_OLD_PSW
  100. 2: .long s390_base_ext_handler_fn
  101. .section .bss
  102. .globl s390_base_ext_handler_fn
  103. s390_base_ext_handler_fn:
  104. .long 0
  105. .previous
  106. .globl s390_base_pgm_handler
  107. s390_base_pgm_handler:
  108. stm %r0,%r15,__LC_SAVE_AREA
  109. basr %r13,0
  110. 0: ahi %r15,-STACK_FRAME_OVERHEAD
  111. l %r1,2f-0b(%r13)
  112. l %r1,0(%r1)
  113. ltr %r1,%r1
  114. jz 1f
  115. basr %r14,%r1
  116. lm %r0,%r15,__LC_SAVE_AREA
  117. lpsw __LC_PGM_OLD_PSW
  118. 1: lpsw disabled_wait_psw-0b(%r13)
  119. 2: .long s390_base_pgm_handler_fn
  120. disabled_wait_psw:
  121. .align 8
  122. .long 0x000a0000,0x00000000 + s390_base_pgm_handler
  123. .section .bss
  124. .globl s390_base_pgm_handler_fn
  125. s390_base_pgm_handler_fn:
  126. .long 0
  127. .previous
  128. #endif /* CONFIG_64BIT */