]> Git Repo - qemu.git/blame - pc-bios/s390-ccw/main.c
s390-ccw.img: Fix compile warning in s390 ccw virtio code
[qemu.git] / pc-bios / s390-ccw / main.c
CommitLineData
92f2ca38
AG
1/*
2 * S390 virtio-ccw loading program
3 *
4 * Copyright (c) 2013 Alexander Graf <[email protected]>
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or (at
7 * your option) any later version. See the COPYING file in the top-level
8 * directory.
9 */
10
11#include "s390-ccw.h"
12
13struct subchannel_id blk_schid;
14char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE)));
15
16void virtio_panic(const char *string)
17{
18 sclp_print(string);
7f61cbc1 19 disabled_wait();
92f2ca38
AG
20 while (1) { }
21}
22
23static void virtio_setup(void)
24{
25 struct irb irb;
26 int i;
27 int r;
28 bool found = false;
29
30 blk_schid.one = 1;
31
32 for (i = 0; i < 0x10000; i++) {
33 blk_schid.sch_no = i;
34 r = tsch(blk_schid, &irb);
35 if (r != 3) {
36 if (virtio_is_blk(blk_schid)) {
37 found = true;
38 break;
39 }
40 }
41 }
42
43 if (!found) {
44 virtio_panic("No virtio-blk device found!\n");
45 }
46
47 virtio_setup_block(blk_schid);
48}
49
50int main(void)
51{
52 sclp_setup();
53 virtio_setup();
54 if (zipl_load() < 0)
55 sclp_print("Failed to load OS from hard disk\n");
7f61cbc1 56 disabled_wait();
92f2ca38
AG
57 while (1) { }
58}
This page took 0.027454 seconds and 4 git commands to generate.