]>
Commit | Line | Data |
---|---|---|
87ecb68b PB |
1 | /* Declarations for use by board files for creating devices. */ |
2 | ||
3 | #ifndef HW_BOARDS_H | |
4 | #define HW_BOARDS_H | |
5 | ||
f1e29879 | 6 | #include "qemu/typedefs.h" |
9c17d615 | 7 | #include "sysemu/blockdev.h" |
83c9f4ca | 8 | #include "hw/qdev.h" |
36d20cb2 | 9 | #include "qom/object.h" |
b6b61144 | 10 | |
5f072e1f | 11 | typedef struct QEMUMachineInitArgs { |
aaa66391 | 12 | const MachineClass *machine; |
5f072e1f | 13 | ram_addr_t ram_size; |
c1654732 | 14 | const char *boot_order; |
5f072e1f EH |
15 | const char *kernel_filename; |
16 | const char *kernel_cmdline; | |
17 | const char *initrd_filename; | |
18 | const char *cpu_model; | |
19 | } QEMUMachineInitArgs; | |
20 | ||
21 | typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args); | |
87ecb68b | 22 | |
be522029 DG |
23 | typedef void QEMUMachineResetFunc(void); |
24 | ||
b4fc7b43 IM |
25 | typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp); |
26 | ||
135a129a AK |
27 | typedef int QEMUMachineGetKvmtypeFunc(const char *arg); |
28 | ||
e689f7c6 | 29 | struct QEMUMachine { |
87ecb68b | 30 | const char *name; |
3f6599e6 | 31 | const char *alias; |
87ecb68b PB |
32 | const char *desc; |
33 | QEMUMachineInitFunc *init; | |
be522029 | 34 | QEMUMachineResetFunc *reset; |
b4fc7b43 | 35 | QEMUMachineHotAddCPUFunc *hot_add_cpu; |
135a129a | 36 | QEMUMachineGetKvmtypeFunc *kvm_type; |
2d0d2837 | 37 | BlockInterfaceType block_default_type; |
b2097003 | 38 | int max_cpus; |
2fe0ee97 | 39 | unsigned int no_serial:1, |
986c5f78 GH |
40 | no_parallel:1, |
41 | use_virtcon:1, | |
3ef669e1 | 42 | use_sclp:1, |
ac33f8fa GH |
43 | no_floppy:1, |
44 | no_cdrom:1, | |
45 | no_sdcard:1; | |
0c257437 | 46 | int is_default; |
67b724e6 | 47 | const char *default_machine_opts; |
c1654732 | 48 | const char *default_boot_order; |
458fb679 | 49 | GlobalProperty *compat_props; |
93bfef4c | 50 | const char *hw_version; |
e689f7c6 | 51 | }; |
87ecb68b | 52 | |
261747f1 | 53 | #define TYPE_MACHINE_SUFFIX "-machine" |
87ecb68b | 54 | int qemu_register_machine(QEMUMachine *m); |
6f338c34 | 55 | |
36d20cb2 | 56 | #define TYPE_MACHINE "machine" |
c8897e8e | 57 | #undef MACHINE /* BSD defines it and QEMU does not use it */ |
36d20cb2 MA |
58 | #define MACHINE(obj) \ |
59 | OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE) | |
60 | #define MACHINE_GET_CLASS(obj) \ | |
61 | OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE) | |
62 | #define MACHINE_CLASS(klass) \ | |
63 | OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) | |
64 | ||
65 | typedef struct MachineState MachineState; | |
36d20cb2 | 66 | |
0056ae24 MA |
67 | MachineClass *find_default_machine(void); |
68 | extern MachineState *current_machine; | |
69 | ||
36d20cb2 MA |
70 | /** |
71 | * MachineClass: | |
72 | * @qemu_machine: #QEMUMachine | |
73 | */ | |
74 | struct MachineClass { | |
75 | /*< private >*/ | |
76 | ObjectClass parent_class; | |
77 | /*< public >*/ | |
78 | ||
00b4fbe2 MA |
79 | const char *name; |
80 | const char *alias; | |
81 | const char *desc; | |
82 | ||
83 | void (*init)(QEMUMachineInitArgs *args); | |
84 | void (*reset)(void); | |
85 | void (*hot_add_cpu)(const int64_t id, Error **errp); | |
86 | int (*kvm_type)(const char *arg); | |
87 | ||
88 | BlockInterfaceType block_default_type; | |
89 | int max_cpus; | |
90 | unsigned int no_serial:1, | |
91 | no_parallel:1, | |
92 | use_virtcon:1, | |
93 | use_sclp:1, | |
94 | no_floppy:1, | |
95 | no_cdrom:1, | |
96 | no_sdcard:1; | |
97 | int is_default; | |
98 | const char *default_machine_opts; | |
99 | const char *default_boot_order; | |
100 | GlobalProperty *compat_props; | |
101 | const char *hw_version; | |
36d20cb2 MA |
102 | }; |
103 | ||
104 | /** | |
105 | * MachineState: | |
106 | */ | |
107 | struct MachineState { | |
108 | /*< private >*/ | |
109 | Object parent_obj; | |
110 | /*< public >*/ | |
111 | ||
112 | char *accel; | |
113 | bool kernel_irqchip; | |
114 | int kvm_shadow_mem; | |
115 | char *kernel; | |
116 | char *initrd; | |
117 | char *append; | |
118 | char *dtb; | |
119 | char *dumpdtb; | |
120 | int phandle_start; | |
121 | char *dt_compatible; | |
122 | bool dump_guest_core; | |
123 | bool mem_merge; | |
124 | bool usb; | |
125 | char *firmware; | |
126 | ||
127 | QEMUMachineInitArgs init_args; | |
128 | }; | |
129 | ||
87ecb68b | 130 | #endif |