2 * arch/s390/kernel/base.S
4 * Copyright IBM Corp. 2006,2007
5 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
6 * Michael Holzheu <holzheu@de.ibm.com>
9 #include <linux/linkage.h>
10 #include <asm/asm-offsets.h>
11 #include <asm/ptrace.h>
15 ENTRY(s390_base_mcck_handler)
17 0: lg %r15,__LC_PANIC_STACK # load panic stack
18 aghi %r15,-STACK_FRAME_OVERHEAD
19 larl %r1,s390_base_mcck_handler_fn
25 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)
26 lpswe __LC_MCK_OLD_PSW
30 .globl s390_base_mcck_handler_fn
31 s390_base_mcck_handler_fn:
35 ENTRY(s390_base_ext_handler)
36 stmg %r0,%r15,__LC_SAVE_AREA
38 0: aghi %r15,-STACK_FRAME_OVERHEAD
39 larl %r1,s390_base_ext_handler_fn
44 1: lmg %r0,%r15,__LC_SAVE_AREA
45 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
46 lpswe __LC_EXT_OLD_PSW
50 .globl s390_base_ext_handler_fn
51 s390_base_ext_handler_fn:
55 ENTRY(s390_base_pgm_handler)
56 stmg %r0,%r15,__LC_SAVE_AREA
58 0: aghi %r15,-STACK_FRAME_OVERHEAD
59 larl %r1,s390_base_pgm_handler_fn
64 lmg %r0,%r15,__LC_SAVE_AREA
65 lpswe __LC_PGM_OLD_PSW
66 1: lpswe disabled_wait_psw-0b(%r13)
70 .quad 0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler
74 .globl s390_base_pgm_handler_fn
75 s390_base_pgm_handler_fn:
80 # Calls diag 308 subcode 1 and continues execution
82 # The following conditions must be ensured before calling this function:
83 # * Prefix register = 0
84 # * Lowcore protection is disabled
87 larl %r4,.Lctlregs # Save control registers
89 larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0
91 lg %r4,0(%r4) # Save PSW
92 sturg %r4,%r3 # Use sturg, because of large pages
96 lhi %r0,0 # Load r0 with zero
97 lhi %r1,2 # Use mode 2 = ESAME (dump)
98 sigp %r1,%r0,0x12 # Switch to ESAME mode
99 sam64 # Switch to 64 bit addressing mode
100 larl %r4,.Lctlregs # Restore control registers
101 lctlg %c0,%c15,0(%r4)
105 .long 0x00080000,0x80000000 + .Lrestart_part2
115 #else /* CONFIG_64BIT */
117 ENTRY(s390_base_mcck_handler)
119 0: l %r15,__LC_PANIC_STACK # load panic stack
120 ahi %r15,-STACK_FRAME_OVERHEAD
126 1: lm %r0,%r15,__LC_GPREGS_SAVE_AREA
127 lpsw __LC_MCK_OLD_PSW
129 2: .long s390_base_mcck_handler_fn
133 .globl s390_base_mcck_handler_fn
134 s390_base_mcck_handler_fn:
138 ENTRY(s390_base_ext_handler)
139 stm %r0,%r15,__LC_SAVE_AREA
141 0: ahi %r15,-STACK_FRAME_OVERHEAD
147 1: lm %r0,%r15,__LC_SAVE_AREA
148 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
149 lpsw __LC_EXT_OLD_PSW
151 2: .long s390_base_ext_handler_fn
155 .globl s390_base_ext_handler_fn
156 s390_base_ext_handler_fn:
160 ENTRY(s390_base_pgm_handler)
161 stm %r0,%r15,__LC_SAVE_AREA
163 0: ahi %r15,-STACK_FRAME_OVERHEAD
169 lm %r0,%r15,__LC_SAVE_AREA
170 lpsw __LC_PGM_OLD_PSW
172 1: lpsw disabled_wait_psw-0b(%r13)
174 2: .long s390_base_pgm_handler_fn
178 .long 0x000a0000,0x00000000 + s390_base_pgm_handler
182 .globl s390_base_pgm_handler_fn
183 s390_base_pgm_handler_fn:
187 #endif /* CONFIG_64BIT */