2 # Copyright (c) 2007-2011 Josef 'Jeff' Sipek
10 .type __wait_for_attn, @function
12 LARL
%r4,WAITPSW
# wait for the interrupt
15 # int __do_io(u32 sch);
18 .type __do_io, @function
20 LGR
%r1,%r2 # load subsystem ID
22 LA %r2,0xfff # error return code
25 SSCH
0(%r4) # issue IO
26 BCR 7, %r14 # return on error
28 LARL
%r4,WAITPSW
# wait for the interrupt
32 # The IO interrupt handler; it's very much like a continuation of __do_io
44 LLGF
%r1,0xb8 # load subsystem ID
49 # check the Channel Status for != 0
52 NILL
%r2,0xbf # get rid of SLI
54 BCR 7,%r14 # error, let's bail
56 # check the Device Status
60 # unit check, unit except?
63 BCR 4,%r14 # error return
68 BCR 4,%r14 # ok return
74 # The PGM interrupt handler
90 # grab the old PSW address, subtract length of TPROT, and compare it
91 # with the TPROT opcode (0xe501)
122 # bits value name desc
124 # 1 0 PER Mask (R) disabled
126 # 5 0 DAT Mode (T) disabled
127 # 6 0 I/O Mask (IO) enabled
128 # 7 0 External Mask (EX) disabled
131 # bits value name desc
134 # 13 0 Machine-Check Mask (M) disabled
135 # 14 0 Wait State (W) executing
136 # 15 0 Problem State (P) supervisor state
139 # bits value name desc
140 # 16-17 0 Address-Space Control (AS) disabled
141 # 18-19 0 Condition Code (CC)
142 # 20-23 0 Program Mask exceptions disabled
145 # bits value name desc
147 # 31 1 Extended Addressing (EA) EA + BA = 64 mode
149 .byte 0x80, 0x00, 0x00, 0x00
150 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
151 # bits value name desc
152 # 32 1 Basic Addressing (BA) BA = 31, !BA = 24
154 # 64-127 addr Instruction Address Address to exec
159 # bits value name desc
161 # 1 0 PER Mask (R) disabled
163 # 5 0 DAT Mode (T) disabled
164 # 6 1 I/O Mask (IO) enabled
165 # 7 0 External Mask (EX) disabled
168 # bits value name desc
171 # 13 0 Machine-Check Mask (M) disabled
172 # 14 1 Wait State (W) not executing
173 # 15 0 Problem State (P) supervisor state
176 # bits value name desc
177 # 16-17 0 Address-Space Control (AS) disabled
178 # 18-19 0 Condition Code (CC)
179 # 20-23 0 Program Mask exceptions disabled
182 # bits value name desc
184 # 31 1 Extended Addressing (EA) EA + BA = 64 mode
186 .byte 0x80, 0x00, 0x00, 0x00
187 .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
188 # bits value name desc
189 # 32 1 Basic Addressing (BA) BA = 31, !BA = 24
191 # 64-127 addr Instruction Address Address to exec