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>
16 ENTRY(s390_base_mcck_handler)
18 0: lg %r15,__LC_PANIC_STACK # load panic stack
19 aghi %r15,-STACK_FRAME_OVERHEAD
20 larl %r1,s390_base_mcck_handler_fn
26 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)
27 lpswe __LC_MCK_OLD_PSW
31 .globl s390_base_mcck_handler_fn
32 s390_base_mcck_handler_fn:
36 ENTRY(s390_base_ext_handler)
37 stmg %r0,%r15,__LC_SAVE_AREA_ASYNC
39 0: aghi %r15,-STACK_FRAME_OVERHEAD
40 larl %r1,s390_base_ext_handler_fn
45 1: lmg %r0,%r15,__LC_SAVE_AREA_ASYNC
46 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
47 lpswe __LC_EXT_OLD_PSW
51 .globl s390_base_ext_handler_fn
52 s390_base_ext_handler_fn:
56 ENTRY(s390_base_pgm_handler)
57 stmg %r0,%r15,__LC_SAVE_AREA_SYNC
59 0: aghi %r15,-STACK_FRAME_OVERHEAD
60 larl %r1,s390_base_pgm_handler_fn
65 lmg %r0,%r15,__LC_SAVE_AREA_SYNC
66 lpswe __LC_PGM_OLD_PSW
67 1: lpswe disabled_wait_psw-0b(%r13)
71 .quad 0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler
75 .globl s390_base_pgm_handler_fn
76 s390_base_pgm_handler_fn:
81 # Calls diag 308 subcode 1 and continues execution
83 # The following conditions must be ensured before calling this function:
84 # * Prefix register = 0
85 # * Lowcore protection is disabled
88 larl %r4,.Lctlregs # Save control registers
90 larl %r4,.Lfpctl # Floating point control register
92 larl %r4,.Lcontinue_psw # Save PSW flags
95 larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0
97 lg %r4,0(%r4) # Save PSW
98 sturg %r4,%r3 # Use sturg, because of large pages
102 lhi %r0,0 # Load r0 with zero
103 lhi %r1,2 # Use mode 2 = ESAME (dump)
104 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
105 sam64 # Switch to 64 bit addressing mode
106 larl %r4,.Lctlregs # Restore control registers
107 lctlg %c0,%c15,0(%r4)
108 larl %r4,.Lfpctl # Restore floating point ctl register
110 larl %r4,.Lcontinue_psw # Restore PSW flags
116 .long 0x00080000,0x80000000 + .Lrestart_part2
118 .section .data..nosave,"aw",@progbits
134 #else /* CONFIG_64BIT */
136 ENTRY(s390_base_mcck_handler)
138 0: l %r15,__LC_PANIC_STACK # load panic stack
139 ahi %r15,-STACK_FRAME_OVERHEAD
145 1: lm %r0,%r15,__LC_GPREGS_SAVE_AREA
146 lpsw __LC_MCK_OLD_PSW
148 2: .long s390_base_mcck_handler_fn
152 .globl s390_base_mcck_handler_fn
153 s390_base_mcck_handler_fn:
157 ENTRY(s390_base_ext_handler)
158 stm %r0,%r15,__LC_SAVE_AREA_ASYNC
160 0: ahi %r15,-STACK_FRAME_OVERHEAD
166 1: lm %r0,%r15,__LC_SAVE_AREA_ASYNC
167 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
168 lpsw __LC_EXT_OLD_PSW
170 2: .long s390_base_ext_handler_fn
174 .globl s390_base_ext_handler_fn
175 s390_base_ext_handler_fn:
179 ENTRY(s390_base_pgm_handler)
180 stm %r0,%r15,__LC_SAVE_AREA_SYNC
182 0: ahi %r15,-STACK_FRAME_OVERHEAD
188 lm %r0,%r15,__LC_SAVE_AREA_SYNC
189 lpsw __LC_PGM_OLD_PSW
191 1: lpsw disabled_wait_psw-0b(%r13)
193 2: .long s390_base_pgm_handler_fn
197 .long 0x000a0000,0x00000000 + s390_base_pgm_handler
201 .globl s390_base_pgm_handler_fn
202 s390_base_pgm_handler_fn:
206 #endif /* CONFIG_64BIT */