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>
14 ENTRY(s390_base_mcck_handler)
16 0: lg %r15,__LC_PANIC_STACK # load panic stack
17 aghi %r15,-STACK_FRAME_OVERHEAD
18 larl %r1,s390_base_mcck_handler_fn
24 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)
25 lpswe __LC_MCK_OLD_PSW
29 .globl s390_base_mcck_handler_fn
30 s390_base_mcck_handler_fn:
34 ENTRY(s390_base_ext_handler)
35 stmg %r0,%r15,__LC_SAVE_AREA_ASYNC
37 0: aghi %r15,-STACK_FRAME_OVERHEAD
38 larl %r1,s390_base_ext_handler_fn
43 1: lmg %r0,%r15,__LC_SAVE_AREA_ASYNC
44 ni __LC_EXT_OLD_PSW+1,0xfd # clear wait state bit
45 lpswe __LC_EXT_OLD_PSW
49 .globl s390_base_ext_handler_fn
50 s390_base_ext_handler_fn:
54 ENTRY(s390_base_pgm_handler)
55 stmg %r0,%r15,__LC_SAVE_AREA_SYNC
57 0: aghi %r15,-STACK_FRAME_OVERHEAD
58 larl %r1,s390_base_pgm_handler_fn
63 lmg %r0,%r15,__LC_SAVE_AREA_SYNC
64 lpswe __LC_PGM_OLD_PSW
65 1: lpswe disabled_wait_psw-0b(%r13)
69 .quad 0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler
73 .globl s390_base_pgm_handler_fn
74 s390_base_pgm_handler_fn:
79 # Calls diag 308 subcode 1 and continues execution
82 larl %r4,.Lctlregs # Save control registers
84 lg %r2,0(%r4) # Disable lowcore protection
89 larl %r4,.Lfpctl # Floating point control register
91 larl %r4,.Lprefix # Save prefix register
93 larl %r4,.Lprefix_zero # Set prefix register to 0
95 larl %r4,.Lcontinue_psw # Save PSW flags
98 larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0
100 lg %r4,0(%r4) # Save PSW
101 sturg %r4,%r3 # Use sturg, because of large pages
106 lhi %r0,0 # Load r0 with zero
107 lhi %r1,2 # Use mode 2 = ESAME (dump)
108 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # Switch to ESAME mode
109 sam64 # Switch to 64 bit addressing mode
110 larl %r4,.Lctlregs # Restore control registers
111 lctlg %c0,%c15,0(%r4)
112 larl %r4,.Lfpctl # Restore floating point ctl register
114 larl %r4,.Lprefix # Restore prefix register
116 larl %r4,.Lcontinue_psw # Restore PSW flags
122 .long 0x00080000,0x80000000 + .Lrestart_part2
124 .section .data..nosave,"aw",@progbits