Revision decbc880 hw/s390x/ipl.c
b/hw/s390x/ipl.c | ||
---|---|---|
62 | 62 |
static int s390_ipl_init(SysBusDevice *dev) |
63 | 63 |
{ |
64 | 64 |
S390IPLState *ipl = S390_IPL(dev); |
65 |
ram_addr_t kernel_size = 0;
|
|
65 |
int kernel_size;
|
|
66 | 66 |
|
67 | 67 |
if (!ipl->kernel) { |
68 |
ram_addr_t bios_size = 0;
|
|
68 |
int bios_size;
|
|
69 | 69 |
char *bios_filename; |
70 | 70 |
|
71 | 71 |
/* Load zipl bootloader */ |
... | ... | |
80 | 80 |
|
81 | 81 |
bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL, |
82 | 82 |
NULL, 1, ELF_MACHINE, 0); |
83 |
if (bios_size == -1UL) {
|
|
83 |
if (bios_size == -1) { |
|
84 | 84 |
bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, |
85 | 85 |
4096); |
86 | 86 |
ipl->start_addr = ZIPL_IMAGE_START; |
... | ... | |
90 | 90 |
} |
91 | 91 |
g_free(bios_filename); |
92 | 92 |
|
93 |
if ((long)bios_size < 0) {
|
|
93 |
if (bios_size == -1) {
|
|
94 | 94 |
hw_error("could not load bootloader '%s'\n", bios_name); |
95 | 95 |
} |
96 | 96 |
return 0; |
97 | 97 |
} else { |
98 | 98 |
kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL, NULL, |
99 | 99 |
NULL, 1, ELF_MACHINE, 0); |
100 |
if (kernel_size == -1UL) {
|
|
100 |
if (kernel_size == -1) { |
|
101 | 101 |
kernel_size = load_image_targphys(ipl->kernel, 0, ram_size); |
102 | 102 |
} |
103 |
if (kernel_size == -1UL) {
|
|
103 |
if (kernel_size == -1) { |
|
104 | 104 |
fprintf(stderr, "could not load kernel '%s'\n", ipl->kernel); |
105 | 105 |
return -1; |
106 | 106 |
} |
... | ... | |
115 | 115 |
ipl->start_addr = KERN_IMAGE_START; |
116 | 116 |
} |
117 | 117 |
if (ipl->initrd) { |
118 |
ram_addr_t initrd_offset, initrd_size; |
|
118 |
ram_addr_t initrd_offset; |
|
119 |
int initrd_size; |
|
119 | 120 |
|
120 | 121 |
initrd_offset = INITRD_START; |
121 | 122 |
while (kernel_size + 0x100000 > initrd_offset) { |
... | ... | |
123 | 124 |
} |
124 | 125 |
initrd_size = load_image_targphys(ipl->initrd, initrd_offset, |
125 | 126 |
ram_size - initrd_offset); |
126 |
if (initrd_size == -1UL) {
|
|
127 |
if (initrd_size == -1) { |
|
127 | 128 |
fprintf(stderr, "qemu: could not load initrd '%s'\n", ipl->initrd); |
128 | 129 |
exit(1); |
129 | 130 |
} |
Also available in: Unified diff