Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 1 | // Paravirtualization support. |
| 2 | // |
Kevin O'Connor | b840ba9 | 2013-02-09 20:09:22 -0500 | [diff] [blame] | 3 | // Copyright (C) 2013 Kevin O'Connor <kevin@koconnor.net> |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 4 | // Copyright (C) 2009 Red Hat Inc. |
| 5 | // |
| 6 | // Authors: |
| 7 | // Gleb Natapov <gnatapov@redhat.com> |
| 8 | // |
| 9 | // This file may be distributed under the terms of the GNU LGPLv3 license. |
| 10 | |
Kevin O'Connor | 897fb11 | 2013-02-07 23:32:48 -0500 | [diff] [blame] | 11 | #include "config.h" // CONFIG_QEMU |
Kevin O'Connor | b306459 | 2012-08-14 21:20:10 -0400 | [diff] [blame] | 12 | #include "util.h" // dprintf |
| 13 | #include "byteorder.h" // be32_to_cpu |
Kevin O'Connor | 01a8520 | 2009-10-18 09:49:59 -0400 | [diff] [blame] | 14 | #include "ioport.h" // outw |
Kevin O'Connor | d83c87b | 2013-01-21 01:14:12 -0500 | [diff] [blame] | 15 | #include "paravirt.h" // qemu_cfg_preinit |
Kevin O'Connor | de9e705 | 2013-02-09 19:09:20 -0500 | [diff] [blame] | 16 | #include "smbios.h" // smbios_setup |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 17 | #include "memmap.h" // add_e820 |
Kevin O'Connor | 5d369d8 | 2013-09-02 20:48:46 -0400 | [diff] [blame] | 18 | #include "hw/cmos.h" // CMOS_* |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 19 | #include "acpi.h" // acpi_setup |
| 20 | #include "mptable.h" // mptable_setup |
Kevin O'Connor | 5d369d8 | 2013-09-02 20:48:46 -0400 | [diff] [blame] | 21 | #include "hw/pci.h" // create_pirtable |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 22 | #include "xen.h" // xen_biostable_setup |
Kevin O'Connor | fa9c66a | 2013-09-14 19:10:40 -0400 | [diff] [blame] | 23 | #include "string.h" // memset |
Kevin O'Connor | b9c6a96 | 2013-09-14 13:01:30 -0400 | [diff] [blame] | 24 | #include "x86.h" // cpuid |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 25 | |
Kevin O'Connor | f85e4bc | 2013-02-19 01:33:45 -0500 | [diff] [blame] | 26 | // Amount of continuous ram under 4Gig |
| 27 | u32 RamSize; |
| 28 | // Amount of continuous ram >4Gig |
| 29 | u64 RamSizeOver4G; |
Kevin O'Connor | 89a2f96 | 2013-02-18 23:36:03 -0500 | [diff] [blame] | 30 | // Type of emulator platform. |
| 31 | int PlatformRunningOn VARFSEG; |
| 32 | |
Kevin O'Connor | 7b5bc50 | 2013-02-09 13:07:23 -0500 | [diff] [blame] | 33 | /* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It |
| 34 | * should be used to determine that a VM is running under KVM. |
| 35 | */ |
| 36 | #define KVM_CPUID_SIGNATURE 0x40000000 |
| 37 | |
| 38 | static void kvm_preinit(void) |
| 39 | { |
| 40 | if (!CONFIG_QEMU) |
| 41 | return; |
| 42 | unsigned int eax, ebx, ecx, edx; |
| 43 | char signature[13]; |
| 44 | |
| 45 | cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); |
| 46 | memcpy(signature + 0, &ebx, 4); |
| 47 | memcpy(signature + 4, &ecx, 4); |
| 48 | memcpy(signature + 8, &edx, 4); |
| 49 | signature[12] = 0; |
| 50 | |
| 51 | if (strcmp(signature, "KVMKVMKVM") == 0) { |
| 52 | dprintf(1, "Running on KVM\n"); |
| 53 | PlatformRunningOn |= PF_KVM; |
| 54 | } |
| 55 | } |
| 56 | |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 57 | void |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 58 | qemu_preinit(void) |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 59 | { |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 60 | if (!CONFIG_QEMU) |
| 61 | return; |
| 62 | |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 63 | if (runningOnXen()) { |
| 64 | xen_ramsize_preinit(); |
| 65 | return; |
| 66 | } |
| 67 | |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 68 | PlatformRunningOn = PF_QEMU; |
Kevin O'Connor | 7b5bc50 | 2013-02-09 13:07:23 -0500 | [diff] [blame] | 69 | kvm_preinit(); |
Kevin O'Connor | 02313b2 | 2013-02-07 22:42:25 -0500 | [diff] [blame] | 70 | |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 71 | // On emulators, get memory size from nvram. |
| 72 | u32 rs = ((inb_cmos(CMOS_MEM_EXTMEM2_LOW) << 16) |
| 73 | | (inb_cmos(CMOS_MEM_EXTMEM2_HIGH) << 24)); |
| 74 | if (rs) |
| 75 | rs += 16 * 1024 * 1024; |
| 76 | else |
| 77 | rs = (((inb_cmos(CMOS_MEM_EXTMEM_LOW) << 10) |
| 78 | | (inb_cmos(CMOS_MEM_EXTMEM_HIGH) << 18)) |
| 79 | + 1 * 1024 * 1024); |
| 80 | RamSize = rs; |
| 81 | add_e820(0, rs, E820_RAM); |
| 82 | |
| 83 | // Check for memory over 4Gig |
| 84 | u64 high = ((inb_cmos(CMOS_MEM_HIGHMEM_LOW) << 16) |
| 85 | | ((u32)inb_cmos(CMOS_MEM_HIGHMEM_MID) << 24) |
| 86 | | ((u64)inb_cmos(CMOS_MEM_HIGHMEM_HIGH) << 32)); |
| 87 | RamSizeOver4G = high; |
| 88 | add_e820(0x100000000ull, high, E820_RAM); |
| 89 | |
| 90 | /* reserve 256KB BIOS area at the end of 4 GB */ |
| 91 | add_e820(0xfffc0000, 256*1024, E820_RESERVED); |
Kevin O'Connor | f85e4bc | 2013-02-19 01:33:45 -0500 | [diff] [blame] | 92 | |
| 93 | dprintf(1, "Ram Size=0x%08x (0x%016llx high)\n", RamSize, RamSizeOver4G); |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | void |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 97 | qemu_platform_setup(void) |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 98 | { |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 99 | if (!CONFIG_QEMU) |
| 100 | return; |
| 101 | |
| 102 | if (runningOnXen()) { |
| 103 | pci_probe_devices(); |
| 104 | xen_hypercall_setup(); |
| 105 | xen_biostable_setup(); |
| 106 | return; |
| 107 | } |
| 108 | |
| 109 | // Initialize pci |
| 110 | pci_setup(); |
Kevin O'Connor | cdbac7f | 2013-03-08 19:33:39 -0500 | [diff] [blame] | 111 | smm_device_setup(); |
Kevin O'Connor | a2a86e2 | 2013-02-13 19:35:12 -0500 | [diff] [blame] | 112 | smm_setup(); |
| 113 | |
| 114 | // Initialize mtrr and smp |
| 115 | mtrr_setup(); |
| 116 | smp_setup(); |
| 117 | |
| 118 | // Create bios tables |
Kevin O'Connor | 8ed2e53 | 2013-01-21 02:32:48 -0500 | [diff] [blame] | 119 | pirtable_setup(); |
| 120 | mptable_setup(); |
| 121 | smbios_setup(); |
| 122 | acpi_setup(); |
| 123 | } |
| 124 | |
Kevin O'Connor | 4edda08 | 2013-02-09 13:21:08 -0500 | [diff] [blame] | 125 | |
| 126 | /**************************************************************** |
| 127 | * QEMU firmware config (fw_cfg) interface |
| 128 | ****************************************************************/ |
| 129 | |
Kevin O'Connor | b840ba9 | 2013-02-09 20:09:22 -0500 | [diff] [blame] | 130 | // List of QEMU fw_cfg entries. DO NOT ADD MORE. (All new content |
| 131 | // should be passed via the fw_cfg "file" interface.) |
Kevin O'Connor | 4edda08 | 2013-02-09 13:21:08 -0500 | [diff] [blame] | 132 | #define QEMU_CFG_SIGNATURE 0x00 |
| 133 | #define QEMU_CFG_ID 0x01 |
| 134 | #define QEMU_CFG_UUID 0x02 |
| 135 | #define QEMU_CFG_NUMA 0x0d |
| 136 | #define QEMU_CFG_BOOT_MENU 0x0e |
| 137 | #define QEMU_CFG_MAX_CPUS 0x0f |
| 138 | #define QEMU_CFG_FILE_DIR 0x19 |
| 139 | #define QEMU_CFG_ARCH_LOCAL 0x8000 |
| 140 | #define QEMU_CFG_ACPI_TABLES (QEMU_CFG_ARCH_LOCAL + 0) |
| 141 | #define QEMU_CFG_SMBIOS_ENTRIES (QEMU_CFG_ARCH_LOCAL + 1) |
| 142 | #define QEMU_CFG_IRQ0_OVERRIDE (QEMU_CFG_ARCH_LOCAL + 2) |
| 143 | #define QEMU_CFG_E820_TABLE (QEMU_CFG_ARCH_LOCAL + 3) |
| 144 | |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 145 | static void |
| 146 | qemu_cfg_select(u16 f) |
| 147 | { |
| 148 | outw(f, PORT_QEMU_CFG_CTL); |
| 149 | } |
| 150 | |
| 151 | static void |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 152 | qemu_cfg_read(void *buf, int len) |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 153 | { |
Kevin O'Connor | 6039fc5 | 2010-08-25 21:43:19 -0400 | [diff] [blame] | 154 | insb(PORT_QEMU_CFG_DATA, buf, len); |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | static void |
Kevin O'Connor | 4e4b410 | 2009-10-08 21:21:59 -0400 | [diff] [blame] | 158 | qemu_cfg_skip(int len) |
| 159 | { |
| 160 | while (len--) |
| 161 | inb(PORT_QEMU_CFG_DATA); |
| 162 | } |
| 163 | |
| 164 | static void |
Kevin O'Connor | e7cc764 | 2009-10-04 10:05:16 -0400 | [diff] [blame] | 165 | qemu_cfg_read_entry(void *buf, int e, int len) |
| 166 | { |
| 167 | qemu_cfg_select(e); |
| 168 | qemu_cfg_read(buf, len); |
| 169 | } |
| 170 | |
Kevin O'Connor | 4158c8c | 2013-03-30 09:12:11 -0400 | [diff] [blame] | 171 | struct qemu_romfile_s { |
| 172 | struct romfile_s file; |
| 173 | int select, skip; |
| 174 | }; |
| 175 | |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 176 | static int |
| 177 | qemu_cfg_read_file(struct romfile_s *file, void *dst, u32 maxlen) |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 178 | { |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 179 | if (file->size > maxlen) |
| 180 | return -1; |
Kevin O'Connor | 4158c8c | 2013-03-30 09:12:11 -0400 | [diff] [blame] | 181 | struct qemu_romfile_s *qfile; |
| 182 | qfile = container_of(file, struct qemu_romfile_s, file); |
| 183 | qemu_cfg_select(qfile->select); |
| 184 | qemu_cfg_skip(qfile->skip); |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 185 | qemu_cfg_read(dst, file->size); |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 186 | return file->size; |
| 187 | } |
| 188 | |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 189 | static void |
| 190 | qemu_romfile_add(char *name, int select, int skip, int size) |
| 191 | { |
Kevin O'Connor | 4158c8c | 2013-03-30 09:12:11 -0400 | [diff] [blame] | 192 | struct qemu_romfile_s *qfile = malloc_tmp(sizeof(*qfile)); |
| 193 | if (!qfile) { |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 194 | warn_noalloc(); |
| 195 | return; |
| 196 | } |
Kevin O'Connor | 4158c8c | 2013-03-30 09:12:11 -0400 | [diff] [blame] | 197 | memset(qfile, 0, sizeof(*qfile)); |
| 198 | strtcpy(qfile->file.name, name, sizeof(qfile->file.name)); |
| 199 | qfile->file.size = size; |
| 200 | qfile->select = select; |
| 201 | qfile->skip = skip; |
| 202 | qfile->file.copy = qemu_cfg_read_file; |
| 203 | romfile_add(&qfile->file); |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 204 | } |
| 205 | |
Kevin O'Connor | fe09030 | 2013-02-09 20:00:06 -0500 | [diff] [blame] | 206 | struct e820_reservation { |
| 207 | u64 address; |
| 208 | u64 length; |
| 209 | u32 type; |
| 210 | }; |
| 211 | |
Kevin O'Connor | de9e705 | 2013-02-09 19:09:20 -0500 | [diff] [blame] | 212 | #define SMBIOS_FIELD_ENTRY 0 |
| 213 | #define SMBIOS_TABLE_ENTRY 1 |
| 214 | |
| 215 | struct qemu_smbios_header { |
| 216 | u16 length; |
| 217 | u8 headertype; |
| 218 | u8 tabletype; |
| 219 | u16 fieldoffset; |
| 220 | } PACKED; |
| 221 | |
Kevin O'Connor | 188d994 | 2013-02-09 15:24:08 -0500 | [diff] [blame] | 222 | // Populate romfile entries for legacy fw_cfg ports (that predate the |
| 223 | // "file" interface). |
| 224 | static void |
| 225 | qemu_cfg_legacy(void) |
| 226 | { |
Kevin O'Connor | 7507ce2 | 2013-06-13 20:04:31 -0400 | [diff] [blame] | 227 | if (!CONFIG_QEMU) |
| 228 | return; |
| 229 | |
Kevin O'Connor | 56c5089 | 2013-02-09 19:25:51 -0500 | [diff] [blame] | 230 | // Misc config items. |
| 231 | qemu_romfile_add("etc/show-boot-menu", QEMU_CFG_BOOT_MENU, 0, 2); |
| 232 | qemu_romfile_add("etc/irq0-override", QEMU_CFG_IRQ0_OVERRIDE, 0, 1); |
| 233 | qemu_romfile_add("etc/max-cpus", QEMU_CFG_MAX_CPUS, 0, 2); |
| 234 | |
Kevin O'Connor | f9e4e37 | 2013-02-09 19:45:45 -0500 | [diff] [blame] | 235 | // NUMA data |
| 236 | u64 numacount; |
| 237 | qemu_cfg_read_entry(&numacount, QEMU_CFG_NUMA, sizeof(numacount)); |
Kevin O'Connor | fb76cff | 2013-03-23 11:38:45 -0400 | [diff] [blame] | 238 | int max_cpu = romfile_loadint("etc/max-cpus", 0); |
| 239 | qemu_romfile_add("etc/numa-cpu-map", QEMU_CFG_NUMA, sizeof(numacount) |
| 240 | , max_cpu*sizeof(u64)); |
| 241 | qemu_romfile_add("etc/numa-nodes", QEMU_CFG_NUMA |
| 242 | , sizeof(numacount) + max_cpu*sizeof(u64) |
Kevin O'Connor | f9e4e37 | 2013-02-09 19:45:45 -0500 | [diff] [blame] | 243 | , numacount*sizeof(u64)); |
| 244 | |
Kevin O'Connor | fe09030 | 2013-02-09 20:00:06 -0500 | [diff] [blame] | 245 | // e820 data |
| 246 | u32 count32; |
| 247 | qemu_cfg_read_entry(&count32, QEMU_CFG_E820_TABLE, sizeof(count32)); |
| 248 | if (count32) { |
| 249 | struct e820_reservation entry; |
| 250 | int i; |
| 251 | for (i = 0; i < count32; i++) { |
| 252 | qemu_cfg_read(&entry, sizeof(entry)); |
| 253 | add_e820(entry.address, entry.length, entry.type); |
| 254 | } |
| 255 | } else if (runningOnKVM()) { |
| 256 | // Backwards compatibility - provide hard coded range. |
| 257 | // 4 pages before the bios, 3 pages for vmx tss pages, the |
| 258 | // other page for EPT real mode pagetable |
| 259 | add_e820(0xfffbc000, 4*4096, E820_RESERVED); |
| 260 | } |
| 261 | |
Kevin O'Connor | 188d994 | 2013-02-09 15:24:08 -0500 | [diff] [blame] | 262 | // ACPI tables |
| 263 | char name[128]; |
| 264 | u16 cnt; |
| 265 | qemu_cfg_read_entry(&cnt, QEMU_CFG_ACPI_TABLES, sizeof(cnt)); |
| 266 | int i, offset = sizeof(cnt); |
| 267 | for (i = 0; i < cnt; i++) { |
| 268 | u16 len; |
| 269 | qemu_cfg_read(&len, sizeof(len)); |
| 270 | offset += sizeof(len); |
| 271 | snprintf(name, sizeof(name), "acpi/table%d", i); |
| 272 | qemu_romfile_add(name, QEMU_CFG_ACPI_TABLES, offset, len); |
| 273 | qemu_cfg_skip(len); |
| 274 | offset += len; |
| 275 | } |
Kevin O'Connor | de9e705 | 2013-02-09 19:09:20 -0500 | [diff] [blame] | 276 | |
| 277 | // SMBIOS info |
| 278 | qemu_cfg_read_entry(&cnt, QEMU_CFG_SMBIOS_ENTRIES, sizeof(cnt)); |
| 279 | offset = sizeof(cnt); |
| 280 | for (i = 0; i < cnt; i++) { |
| 281 | struct qemu_smbios_header header; |
| 282 | qemu_cfg_read(&header, sizeof(header)); |
| 283 | if (header.headertype == SMBIOS_FIELD_ENTRY) { |
| 284 | snprintf(name, sizeof(name), "smbios/field%d-%d" |
| 285 | , header.tabletype, header.fieldoffset); |
| 286 | qemu_romfile_add(name, QEMU_CFG_SMBIOS_ENTRIES |
| 287 | , offset + sizeof(header) |
| 288 | , header.length - sizeof(header)); |
| 289 | } else { |
| 290 | snprintf(name, sizeof(name), "smbios/table%d-%d" |
| 291 | , header.tabletype, i); |
| 292 | qemu_romfile_add(name, QEMU_CFG_SMBIOS_ENTRIES |
| 293 | , offset + 3, header.length - 3); |
| 294 | } |
| 295 | qemu_cfg_skip(header.length - sizeof(header)); |
| 296 | offset += header.length; |
| 297 | } |
Kevin O'Connor | 188d994 | 2013-02-09 15:24:08 -0500 | [diff] [blame] | 298 | } |
| 299 | |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 300 | struct QemuCfgFile { |
| 301 | u32 size; /* file size */ |
| 302 | u16 select; /* write this to 0x510 to read it */ |
| 303 | u16 reserved; |
| 304 | char name[56]; |
| 305 | }; |
| 306 | |
Kevin O'Connor | b840ba9 | 2013-02-09 20:09:22 -0500 | [diff] [blame] | 307 | void qemu_cfg_init(void) |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 308 | { |
Kevin O'Connor | 7507ce2 | 2013-06-13 20:04:31 -0400 | [diff] [blame] | 309 | if (!runningOnQEMU()) |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 310 | return; |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 311 | |
Kevin O'Connor | b840ba9 | 2013-02-09 20:09:22 -0500 | [diff] [blame] | 312 | // Detect fw_cfg interface. |
| 313 | qemu_cfg_select(QEMU_CFG_SIGNATURE); |
| 314 | char *sig = "QEMU"; |
| 315 | int i; |
| 316 | for (i = 0; i < 4; i++) |
| 317 | if (inb(PORT_QEMU_CFG_DATA) != sig[i]) |
| 318 | return; |
| 319 | dprintf(1, "Found QEMU fw_cfg\n"); |
| 320 | |
Kevin O'Connor | 188d994 | 2013-02-09 15:24:08 -0500 | [diff] [blame] | 321 | // Populate romfiles for legacy fw_cfg entries |
| 322 | qemu_cfg_legacy(); |
| 323 | |
| 324 | // Load files found in the fw_cfg file directory |
Kevin O'Connor | e230426 | 2010-06-13 16:05:17 -0400 | [diff] [blame] | 325 | u32 count; |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 326 | qemu_cfg_read_entry(&count, QEMU_CFG_FILE_DIR, sizeof(count)); |
Kevin O'Connor | b306459 | 2012-08-14 21:20:10 -0400 | [diff] [blame] | 327 | count = be32_to_cpu(count); |
Kevin O'Connor | e230426 | 2010-06-13 16:05:17 -0400 | [diff] [blame] | 328 | u32 e; |
| 329 | for (e = 0; e < count; e++) { |
Kevin O'Connor | 59d6ca5 | 2012-05-31 00:20:55 -0400 | [diff] [blame] | 330 | struct QemuCfgFile qfile; |
Kevin O'Connor | c40e3fa | 2013-02-09 14:55:30 -0500 | [diff] [blame] | 331 | qemu_cfg_read(&qfile, sizeof(qfile)); |
| 332 | qemu_romfile_add(qfile.name, be16_to_cpu(qfile.select) |
| 333 | , 0, be32_to_cpu(qfile.size)); |
Gerd Hoffmann | c4c9fae | 2009-12-18 12:16:04 +0100 | [diff] [blame] | 334 | } |
Kevin O'Connor | 8b56578 | 2011-07-05 20:32:44 -0400 | [diff] [blame] | 335 | } |