2 * Copyright IBM Corp 2000, 2011
3 * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
7 #include <linux/linkage.h>
8 #include <asm/asm-offsets.h>
12 # Issue "store status" for the current CPU to its prefix page
13 # and call passed function afterwards
15 # r2 = Function to be called after store status
16 # r3 = Parameter for function
19 /* Save register one and load save area base */
20 stg %r1,__LC_SAVE_AREA_RESTART
21 /* General purpose registers */
22 lghi %r1,__LC_GPREGS_SAVE_AREA
24 mvc 8(8,%r1),__LC_SAVE_AREA_RESTART
25 /* Control registers */
26 lghi %r1,__LC_CREGS_SAVE_AREA
28 /* Access registers */
29 lghi %r1,__LC_AREGS_SAVE_AREA
31 /* Floating point registers */
32 lghi %r1,__LC_FPREGS_SAVE_AREA
49 /* Floating point control register */
50 lghi %r1,__LC_FP_CREG_SAVE_AREA
53 lghi %r1,__LC_CPU_TIMER_SAVE_AREA
55 /* Store prefix register */
56 lghi %r1,__LC_PREFIX_SAVE_AREA
58 /* Clock comparator - seven bytes */
59 lghi %r1,__LC_CLOCK_COMP_SAVE_AREA
63 /* Program status word */
64 lghi %r1,__LC_PSW_SAVE_AREA
75 .Lclkcmp: .quad 0x0000000000000000
80 # Parameter: r2 = schid of reipl device
85 .Lpg0: lpswe .Lnewpsw-.Lpg0(%r13)
88 brasl %r14,store_status
90 .Lstatus: lctlg %c6,%c6,.Lall-.Lpg0(%r13)
92 mvc __LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13)
93 stsch .Lschib-.Lpg0(%r13)
94 oi .Lschib+5-.Lpg0(%r13),0x84
95 .Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
96 msch .Lschib-.Lpg0(%r13)
98 .Lssch: ssch .Liplorb-.Lpg0(%r13)
101 bas %r14,.Ldisab-.Lpg0(%r13)
102 .L001: mvc __LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13)
103 .Ltpi: lpswe .Lwaitpsw-.Lpg0(%r13)
104 .Lcont: c %r1,__LC_SUBCHANNEL_ID
106 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
108 tsch .Liplirb-.Lpg0(%r13)
109 tm .Liplirb+9-.Lpg0(%r13),0xbf
111 bas %r14,.Ldisab-.Lpg0(%r13)
112 .L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
114 bas %r14,.Ldisab-.Lpg0(%r13)
115 .L003: st %r1,__LC_SUBCHANNEL_ID
116 lhi %r1,0 # mode 0 = esa
117 slr %r0,%r0 # set cpuid to zero
118 sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esa mode
121 srl %r14,1 # need to kill hi bit to avoid specification exceptions.
122 st %r14,.Ldispsw+12-.Lpg0(%r13)
123 lpswe .Ldispsw-.Lpg0(%r13)
125 .Lall: .quad 0x00000000ff000000
128 * These addresses have to be 31 bit otherwise
129 * the sigp will throw a specifcation exception
130 * when switching to ESA mode as bit 31 be set
132 * Bit 31 of the addresses has to be 0 for the
133 * 31bit lpswe instruction a fact they appear to have
134 * omitted from the pop.
136 .Lnewpsw: .quad 0x0000000080000000
138 .Lpcnew: .quad 0x0000000080000000
140 .Lionew: .quad 0x0000000080000000
142 .Lwaitpsw: .quad 0x0202000080000000
144 .Ldispsw: .quad 0x0002000080000000
145 .quad 0x0000000000000000
146 .Liplccws: .long 0x02000000,0x60000018
147 .long 0x08000008,0x20000001
148 .Liplorb: .long 0x0049504c,0x0040ff80
149 .long 0x00000000+.Liplccws
150 .Lschib: .long 0x00000000,0x00000000
151 .long 0x00000000,0x00000000
152 .long 0x00000000,0x00000000
153 .long 0x00000000,0x00000000
154 .long 0x00000000,0x00000000
155 .long 0x00000000,0x00000000
156 .Liplirb: .long 0x00000000,0x00000000
157 .long 0x00000000,0x00000000
158 .long 0x00000000,0x00000000
159 .long 0x00000000,0x00000000
160 .long 0x00000000,0x00000000
161 .long 0x00000000,0x00000000
162 .long 0x00000000,0x00000000
163 .long 0x00000000,0x00000000