machine: Replace QEMUMachine by MachineClass in accelerator configuration
[qemu/ar7.git] / include / hw / boards.h
blob8f533341110b7129a50d071c11fc20505fa40296
1 /* Declarations for use by board files for creating devices. */
3 #ifndef HW_BOARDS_H
4 #define HW_BOARDS_H
6 #include "qemu/typedefs.h"
7 #include "sysemu/blockdev.h"
8 #include "hw/qdev.h"
9 #include "qom/object.h"
11 typedef struct QEMUMachineInitArgs {
12 const MachineClass *machine;
13 ram_addr_t ram_size;
14 const char *boot_order;
15 const char *kernel_filename;
16 const char *kernel_cmdline;
17 const char *initrd_filename;
18 const char *cpu_model;
19 } QEMUMachineInitArgs;
21 typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args);
23 typedef void QEMUMachineResetFunc(void);
25 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
27 typedef int QEMUMachineGetKvmtypeFunc(const char *arg);
29 struct QEMUMachine {
30 const char *name;
31 const char *alias;
32 const char *desc;
33 QEMUMachineInitFunc *init;
34 QEMUMachineResetFunc *reset;
35 QEMUMachineHotAddCPUFunc *hot_add_cpu;
36 QEMUMachineGetKvmtypeFunc *kvm_type;
37 BlockInterfaceType block_default_type;
38 int max_cpus;
39 unsigned int no_serial:1,
40 no_parallel:1,
41 use_virtcon:1,
42 use_sclp:1,
43 no_floppy:1,
44 no_cdrom:1,
45 no_sdcard:1;
46 int is_default;
47 const char *default_machine_opts;
48 const char *default_boot_order;
49 GlobalProperty *compat_props;
50 const char *hw_version;
53 #define TYPE_MACHINE_SUFFIX "-machine"
54 int qemu_register_machine(QEMUMachine *m);
56 #define TYPE_MACHINE "machine"
57 #undef MACHINE /* BSD defines it and QEMU does not use it */
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)
65 typedef struct MachineState MachineState;
67 MachineClass *find_default_machine(void);
68 extern MachineState *current_machine;
70 /**
71 * MachineClass:
72 * @qemu_machine: #QEMUMachine
74 struct MachineClass {
75 /*< private >*/
76 ObjectClass parent_class;
77 /*< public >*/
79 QEMUMachine *qemu_machine;
81 const char *name;
82 const char *alias;
83 const char *desc;
85 void (*init)(QEMUMachineInitArgs *args);
86 void (*reset)(void);
87 void (*hot_add_cpu)(const int64_t id, Error **errp);
88 int (*kvm_type)(const char *arg);
90 BlockInterfaceType block_default_type;
91 int max_cpus;
92 unsigned int no_serial:1,
93 no_parallel:1,
94 use_virtcon:1,
95 use_sclp:1,
96 no_floppy:1,
97 no_cdrom:1,
98 no_sdcard:1;
99 int is_default;
100 const char *default_machine_opts;
101 const char *default_boot_order;
102 GlobalProperty *compat_props;
103 const char *hw_version;
107 * MachineState:
109 struct MachineState {
110 /*< private >*/
111 Object parent_obj;
112 /*< public >*/
114 char *accel;
115 bool kernel_irqchip;
116 int kvm_shadow_mem;
117 char *kernel;
118 char *initrd;
119 char *append;
120 char *dtb;
121 char *dumpdtb;
122 int phandle_start;
123 char *dt_compatible;
124 bool dump_guest_core;
125 bool mem_merge;
126 bool usb;
127 char *firmware;
129 QEMUMachineInitArgs init_args;
132 #endif