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_ASYNC
38 0: aghi %r15,-STACK_FRAME_OVERHEAD
39 larl %r1,s390_base_ext_handler_fn
44 1: lmg %r0,%r15,__LC_SAVE_AREA_ASYNC
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_SYNC
58 0: aghi %r15,-STACK_FRAME_OVERHEAD
59 larl %r1,s390_base_pgm_handler_fn
64 lmg %r0,%r15,__LC_SAVE_AREA_SYNC
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,.Lfpctl # Floating point control register
91 larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0
93 lg %r4,0(%r4) # Save PSW
94 sturg %r4,%r3 # Use sturg, because of large pages
98 lhi %r0,0 # Load r0 with zero
99 lhi %r1,2 # Use mode 2 = ESAME (dump)
100 sigp %r1,%r0,0x12 # Switch to ESAME mode
101 sam64 # Switch to 64 bit addressing mode
102 larl %r4,.Lctlregs # Restore control registers
103 lctlg %c0,%c15,0(%r4)
104 larl %r4,.Lfpctl # Restore floating point ctl register
109 .long 0x00080000,0x80000000 + .Lrestart_part2
121 #else /* CONFIG_64BIT */
123 ENTRY(s390_base_mcck_handler)
125 0: l %r15,__LC_PANIC_STACK # load panic stack
126 ahi %r15,-STACK_FRAME_OVERHEAD
132 1: lm %r0,%r15,__LC_GPREGS_SAVE_AREA
133 lpsw __LC_MCK_OLD_PSW
135 2: .long s390_base_mcck_handler_fn
139 .globl s390_base_mcck_handler_fn
140 s390_base_mcck_handler_fn:
144 ENTRY(s390_base_ext_handler)
145 stm %r0,%r15,__LC_SAVE_AREA_ASYNC
147 0: ahi %r15,-STACK_FRAME_OVERHEAD
153 1: lm %r0,%r15,__LC_SAVE_AREA_ASYNC
154 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
155 lpsw __LC_EXT_OLD_PSW
157 2: .long s390_base_ext_handler_fn
161 .globl s390_base_ext_handler_fn
162 s390_base_ext_handler_fn:
166 ENTRY(s390_base_pgm_handler)
167 stm %r0,%r15,__LC_SAVE_AREA_SYNC
169 0: ahi %r15,-STACK_FRAME_OVERHEAD
175 lm %r0,%r15,__LC_SAVE_AREA_SYNC
176 lpsw __LC_PGM_OLD_PSW
178 1: lpsw disabled_wait_psw-0b(%r13)
180 2: .long s390_base_pgm_handler_fn
184 .long 0x000a0000,0x00000000 + s390_base_pgm_handler
188 .globl s390_base_pgm_handler_fn
189 s390_base_pgm_handler_fn:
193 #endif /* CONFIG_64BIT */