Revision ff151f4e pc-bios/s390-ccw/main.c
b/pc-bios/s390-ccw/main.c | ||
---|---|---|
12 | 12 |
|
13 | 13 |
struct subchannel_id blk_schid; |
14 | 14 |
char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); |
15 |
uint64_t boot_value; |
|
15 | 16 |
|
16 | 17 |
void virtio_panic(const char *string) |
17 | 18 |
{ |
... | ... | |
20 | 21 |
while (1) { } |
21 | 22 |
} |
22 | 23 |
|
23 |
static void virtio_setup(void)
|
|
24 |
static void virtio_setup(uint64_t dev_info)
|
|
24 | 25 |
{ |
25 | 26 |
struct schib schib; |
26 | 27 |
int i; |
27 | 28 |
int r; |
28 | 29 |
bool found = false; |
29 |
|
|
30 |
bool check_devno = false; |
|
31 |
uint16_t dev_no = -1; |
|
30 | 32 |
blk_schid.one = 1; |
31 | 33 |
|
34 |
if (dev_info != -1) { |
|
35 |
check_devno = true; |
|
36 |
dev_no = dev_info & 0xffff; |
|
37 |
debug_print_int("device no. ", dev_no); |
|
38 |
} |
|
39 |
|
|
32 | 40 |
for (i = 0; i < 0x10000; i++) { |
33 | 41 |
blk_schid.sch_no = i; |
34 | 42 |
r = stsch_err(blk_schid, &schib); |
... | ... | |
36 | 44 |
break; |
37 | 45 |
} |
38 | 46 |
if (schib.pmcw.dnv) { |
39 |
if (virtio_is_blk(blk_schid)) { |
|
40 |
found = true; |
|
41 |
break; |
|
47 |
if (!check_devno || (schib.pmcw.dev == dev_no)) { |
|
48 |
if (virtio_is_blk(blk_schid)) { |
|
49 |
found = true; |
|
50 |
break; |
|
51 |
} |
|
42 | 52 |
} |
43 | 53 |
} |
44 | 54 |
} |
... | ... | |
53 | 63 |
int main(void) |
54 | 64 |
{ |
55 | 65 |
sclp_setup(); |
56 |
virtio_setup(); |
|
66 |
debug_print_int("boot reg[7] ", boot_value); |
|
67 |
virtio_setup(boot_value); |
|
68 |
|
|
57 | 69 |
if (zipl_load() < 0) |
58 | 70 |
sclp_print("Failed to load OS from hard disk\n"); |
59 | 71 |
disabled_wait(); |
Also available in: Unified diff