1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef HW_I386_X86_H
18#define HW_I386_X86_H
19
20#include "qemu-common.h"
21#include "exec/hwaddr.h"
22#include "qemu/notify.h"
23
24#include "hw/boards.h"
25#include "hw/nmi.h"
26
27typedef struct {
28
29 MachineClass parent;
30
31
32
33
34 bool save_tsc_khz;
35
36 bool compat_apic_id_mode;
37} X86MachineClass;
38
39typedef struct {
40
41 MachineState parent;
42
43
44
45
46 ISADevice *rtc;
47 FWCfgState *fw_cfg;
48 qemu_irq *gsi;
49 GMappedFile *initrd_mapped_file;
50
51
52 uint64_t max_ram_below_4g;
53
54
55 ram_addr_t below_4g_mem_size, above_4g_mem_size;
56
57
58 bool apic_xrupt_override;
59 unsigned apic_id_limit;
60 uint16_t boot_cpus;
61 unsigned smp_dies;
62
63
64
65
66
67 AddressSpace *ioapic_as;
68} X86MachineState;
69
70#define X86_MACHINE_MAX_RAM_BELOW_4G "max-ram-below-4g"
71
72#define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86")
73#define X86_MACHINE(obj) \
74 OBJECT_CHECK(X86MachineState, (obj), TYPE_X86_MACHINE)
75#define X86_MACHINE_GET_CLASS(obj) \
76 OBJECT_GET_CLASS(X86MachineClass, obj, TYPE_X86_MACHINE)
77#define X86_MACHINE_CLASS(class) \
78 OBJECT_CLASS_CHECK(X86MachineClass, class, TYPE_X86_MACHINE)
79
80uint32_t x86_cpu_apic_id_from_index(X86MachineState *pcms,
81 unsigned int cpu_index);
82
83void x86_cpu_new(X86MachineState *pcms, int64_t apic_id, Error **errp);
84void x86_cpus_init(X86MachineState *pcms, int default_cpu_version);
85CpuInstanceProperties x86_cpu_index_to_props(MachineState *ms,
86 unsigned cpu_index);
87int64_t x86_get_default_cpu_node_id(const MachineState *ms, int idx);
88const CPUArchIdList *x86_possible_cpu_arch_ids(MachineState *ms);
89
90void x86_bios_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw);
91
92void x86_load_linux(X86MachineState *x86ms,
93 FWCfgState *fw_cfg,
94 int acpi_data_size,
95 bool pvh_enabled,
96 bool linuxboot_dma_enabled);
97
98#endif
99