1 /* Declarations for use by board files for creating devices. */ 2 3 #ifndef HW_BOARDS_H 4 #define HW_BOARDS_H 5 6 #include "sysemu/blockdev.h" 7 #include "sysemu/qemumachine.h" 8 #include "hw/qdev.h" 9 #include "qom/object.h" 10 11 typedef struct QEMUMachineInitArgs { 12 const QEMUMachine *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; 20 21 typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args); 22 23 typedef void QEMUMachineResetFunc(void); 24 25 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp); 26 27 typedef int QEMUMachineGetKvmtypeFunc(const char *arg); 28 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 struct QEMUMachine *next; 51 const char *hw_version; 52 }; 53 54 int qemu_register_machine(QEMUMachine *m); 55 QEMUMachine *find_default_machine(void); 56 57 extern QEMUMachine *current_machine; 58 59 #define TYPE_MACHINE "machine" 60 #define MACHINE(obj) \ 61 OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE) 62 #define MACHINE_GET_CLASS(obj) \ 63 OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE) 64 #define MACHINE_CLASS(klass) \ 65 OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE) 66 67 typedef struct MachineState MachineState; 68 typedef struct MachineClass MachineClass; 69 70 /** 71 * MachineClass: 72 * @qemu_machine: #QEMUMachine 73 */ 74 struct MachineClass { 75 /*< private >*/ 76 ObjectClass parent_class; 77 /*< public >*/ 78 79 QEMUMachine *qemu_machine; 80 }; 81 82 /** 83 * MachineState: 84 */ 85 struct MachineState { 86 /*< private >*/ 87 Object parent_obj; 88 /*< public >*/ 89 90 char *accel; 91 bool kernel_irqchip; 92 int kvm_shadow_mem; 93 char *kernel; 94 char *initrd; 95 char *append; 96 char *dtb; 97 char *dumpdtb; 98 int phandle_start; 99 char *dt_compatible; 100 bool dump_guest_core; 101 bool mem_merge; 102 bool usb; 103 char *firmware; 104 105 QEMUMachineInitArgs init_args; 106 }; 107 108 #endif 109