2 * (C) Copyright 2007-2010 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
9 # We are guaranteed the following:
11 # 1) we are located at 16M
12 # 2) we are running in ESA/390
13 # 3) we are in 31-bit addressing mode
14 # 4) the guest registers are saved at GUEST_IPL_REGSAVE
15 # 5) R1 contains the subchannel #
16 # 6) R2 contains the device #
20 # R1 = subchannel number
23 # R12 = base for this code
34 # new IO interruption PSW address
37 ###############################################################################
39 ###############################################################################
43 .type START, @function
47 STSCH SCHIB
(r12) # get the SCHIB
50 OI SCHIB+
5(r12),0x80 # enable the subchannel
52 MSCH SCHIB
(r12) # load up the SCHIB
55 # got a functioning subchannel, let's set up the new IO psw
57 MVC PSANEWIO
(8,r0),IOPSW
(r12)
59 L r3,PSANEWIO+
4(r0,r0)
60 LA r3,IO
(r3,r12) # calculate the address of
61 ST r3,PSANEWIO+
4(r0,r0) # the IO handler
63 # let's set up a CCW + an ORB, start the IO, and wait
65 MVC
0(8,r0),INITCCW
(r12) # set up the initial CCW
66 OI ORB+
6(r12),0xff # set the LPM in the ORB
68 SSCH ORB
(r12) # start the IO
71 LPSW ENABLEDWAIT
(r12) # wait for IO interruptions
74 # this is the IO interrupt handler
79 # an error occured, return an error
81 LM r0,r15,REGSAVE
(r12)
82 DIAG
r0,r0,1 # return to hypervisor
87 LM r0,r15,REGSAVE
(r12)
88 DIAG
r0,r0,0 # return to hypervisor
90 ###############################################################################
92 ###############################################################################
93 .equ DISABLEDWAIT,(.-START)
95 .long 0x80000000 # disabled wait PSW; signal
96 # return to hypervisor
97 .equ ENABLEDWAIT,(.-START)
99 .long 0x80000000 # enabled wait PSW; wait for IO
103 .long 0x80000000 # new IO psw
105 .equ INITCCW,(.-START)
107 .long 0x60000018 # fmt0, read 24 bytes to addr 0
111 .skip (8*4),0 # the ORB is BIG
115 .skip (13*4),0 # the SCHIB is BIG
118 .globl GUEST_IPL_REGSAVE
119 .type GUEST_IPL_REGSAVE, @function
121 .equ REGSAVE,(.-START) # register save area