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 above 16M
12 # 2) we are located below 2G
13 # 3) we are running in ESA/390
14 # 4) we are in 31-bit addressing mode
15 # 5) the guest registers are saved at GUEST_IPL_REGSAVE
16 # 6) R1 contains the subchannel #
17 # 7) R2 contains the device #
18 # 8) R12 contains the base address
22 # R1 = subchannel number
25 # R12 = base for this code
36 # new IO interruption PSW address
39 ###############################################################################
41 ###############################################################################
44 .type GUEST_IPL_CODE, @function
46 STSCH SCHIB
(r12) # get the SCHIB
49 OI SCHIB+
5(r12),0x80 # enable the subchannel
51 MSCH SCHIB
(r12) # load up the SCHIB
54 # got a functioning subchannel, let's set up the new IO psw
56 MVC PSANEWIO
(8,r0),IOPSW
(r12)
58 L r3,PSANEWIO+
4(r0,r0)
59 LA r3,IO
(r3,r12) # calculate the address of
60 ST r3,PSANEWIO+
4(r0,r0) # the IO handler
62 # let's set up a CCW + an ORB, start the IO, and wait
64 MVC
0(8,r0),INITCCW
(r12) # set up the initial CCW
65 OI ORB+
6(r12),0xff # set the LPM in the ORB
67 SSCH ORB
(r12) # start the IO
70 LPSW ENABLEDWAIT
(r12) # wait for IO interruptions
72 .equ IO,(.-GUEST_IPL_CODE)
73 # this is the IO interrupt handler
77 .equ ERROR,(.-GUEST_IPL_CODE)
78 # an error occured, return an error
80 LM r0,r15,REGSAVE
(r12)
81 DIAG
r0,r0,1 # return to hypervisor
83 .equ DONE,(.-GUEST_IPL_CODE)
86 LM r0,r15,REGSAVE
(r12)
87 DIAG
r0,r0,0 # return to hypervisor
89 ###############################################################################
91 ###############################################################################
93 .equ DISABLEDWAIT,(.-GUEST_IPL_CODE)
95 .long 0x80000000 # disabled wait PSW; signal
96 # return to hypervisor
97 .equ ENABLEDWAIT,(.-GUEST_IPL_CODE)
99 .long 0x80000000 # enabled wait PSW; wait for IO
101 .equ IOPSW,(.-GUEST_IPL_CODE)
103 .long 0x80000000 # new IO psw
105 .equ INITCCW,(.-GUEST_IPL_CODE)
107 .long 0x60000018 # fmt0, read 24 bytes to addr 0
110 .equ ORB,(.-GUEST_IPL_CODE)
111 .skip (8*4),0 # the ORB is BIG
114 .equ SCHIB,(.-GUEST_IPL_CODE)
115 .skip (13*4),0 # the SCHIB is BIG
118 .globl GUEST_IPL_REGSAVE
119 .type GUEST_IPL_REGSAVE, @function
121 .equ REGSAVE,(.-GUEST_IPL_CODE) # register save area