2 * First stage boot loader for virtio devices. The compiled output goes
3 * into the pc-bios directory of qemu.
5 * Copyright (c) 2013 Alexander Graf <agraf@suse.de>
6 * Copyright IBM Corp. 2013, 2017
8 * This work is licensed under the terms of the GNU GPL, version 2 or (at
9 * your option) any later version. See the COPYING file in the top-level
16 larl %r15, stack + 0x8000 /* Set up stack */
21 slgr %r3, %r2 /* get sizeof bss */
22 ltgr %r3,%r3 /* bss emtpy? */
25 srlg %r4,%r3,8 /* how many 256 byte chunks? */
37 /* set up a pgm exception disabled wait psw */
38 larl %r2, disabled_wait_psw
39 mvc 0x01d0(16), 0(%r2)
40 j main /* And call C */
47 * void disabled_wait(void)
49 * stops the current guest cpu.
53 larl %r1,disabled_wait_psw
59 * void consume_sclp_int(void)
61 * eats one sclp interrupt
63 .globl consume_sclp_int
65 /* enable service interrupts in cr0 */
69 /* prepare external call handler */
70 larl %r1, external_new_code
72 larl %r1, external_new_mask
74 /* load enabled wait PSW */
75 larl %r1, enabled_wait_psw
79 * void consume_io_int(void)
81 * eats one I/O interrupt
85 /* enable I/O interrupts in cr6 */
89 /* prepare i/o call handler */
94 /* load enabled wait PSW */
95 larl %r1, enabled_wait_psw
99 /* disable service interrupts in cr0 */
100 stctg %c0,%c0,0(%r15)
102 lctlg %c0,%c0,0(%r15)
106 /* disable I/O interrupts in cr6 */
107 stctg %c6,%c6,0(%r15)
109 lctlg %c6,%c6,0(%r15)
114 .quad 0x0002000180000000,0x0000000000000000
116 .quad 0x0302000180000000,0x0000000000000000
118 .quad 0x0000000180000000
120 .quad 0x0000000180000000