xref: /openbmc/qemu/include/sysemu/sysemu.h (revision 6a094d62)
1 #ifndef SYSEMU_H
2 #define SYSEMU_H
3 /* Misc. things related to the system emulator.  */
4 
5 #include "qemu/timer.h"
6 #include "qemu/notify.h"
7 #include "qemu/uuid.h"
8 
9 /* vl.c */
10 
11 extern int only_migratable;
12 extern const char *qemu_name;
13 extern QemuUUID qemu_uuid;
14 extern bool qemu_uuid_set;
15 
16 void qemu_add_exit_notifier(Notifier *notify);
17 void qemu_remove_exit_notifier(Notifier *notify);
18 
19 void qemu_add_machine_init_done_notifier(Notifier *notify);
20 void qemu_remove_machine_init_done_notifier(Notifier *notify);
21 
22 void configure_rtc(QemuOpts *opts);
23 
24 void qemu_init_subsystems(void);
25 
26 extern int autostart;
27 
28 typedef enum {
29     VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
30     VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO,
31     VGA_TYPE_MAX,
32 } VGAInterfaceType;
33 
34 extern int vga_interface_type;
35 
36 extern int graphic_width;
37 extern int graphic_height;
38 extern int graphic_depth;
39 extern int display_opengl;
40 extern const char *keyboard_layout;
41 extern int win2k_install_hack;
42 extern int alt_grab;
43 extern int ctrl_grab;
44 extern int graphic_rotate;
45 extern int old_param;
46 extern int boot_menu;
47 extern bool boot_strict;
48 extern uint8_t *boot_splash_filedata;
49 extern bool enable_mlock;
50 extern bool enable_cpu_pm;
51 extern QEMUClockType rtc_clock;
52 
53 #define MAX_OPTION_ROMS 16
54 typedef struct QEMUOptionRom {
55     const char *name;
56     int32_t bootindex;
57 } QEMUOptionRom;
58 extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
59 extern int nb_option_roms;
60 
61 #define MAX_PROM_ENVS 128
62 extern const char *prom_envs[MAX_PROM_ENVS];
63 extern unsigned int nb_prom_envs;
64 
65 /* pcie aer error injection */
66 void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict);
67 
68 /* serial ports */
69 
70 /* Return the Chardev for serial port i, or NULL if none */
71 Chardev *serial_hd(int i);
72 
73 /* parallel ports */
74 
75 #define MAX_PARALLEL_PORTS 3
76 
77 extern Chardev *parallel_hds[MAX_PARALLEL_PORTS];
78 
79 void hmp_info_usb(Monitor *mon, const QDict *qdict);
80 
81 void add_boot_device_path(int32_t bootindex, DeviceState *dev,
82                           const char *suffix);
83 char *get_boot_devices_list(size_t *size);
84 
85 DeviceState *get_boot_device(uint32_t position);
86 void check_boot_index(int32_t bootindex, Error **errp);
87 void del_boot_device_path(DeviceState *dev, const char *suffix);
88 void device_add_bootindex_property(Object *obj, int32_t *bootindex,
89                                    const char *name, const char *suffix,
90                                    DeviceState *dev);
91 void restore_boot_order(void *opaque);
92 void validate_bootdevices(const char *devices, Error **errp);
93 void add_boot_device_lchs(DeviceState *dev, const char *suffix,
94                           uint32_t lcyls, uint32_t lheads, uint32_t lsecs);
95 void del_boot_device_lchs(DeviceState *dev, const char *suffix);
96 char *get_boot_devices_lchs_list(size_t *size);
97 
98 /* handler to set the boot_device order for a specific type of MachineClass */
99 typedef void QEMUBootSetHandler(void *opaque, const char *boot_order,
100                                 Error **errp);
101 void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque);
102 void qemu_boot_set(const char *boot_order, Error **errp);
103 
104 bool defaults_enabled(void);
105 
106 void qemu_init(int argc, char **argv, char **envp);
107 void qemu_main_loop(void);
108 void qemu_cleanup(void);
109 
110 extern QemuOptsList qemu_legacy_drive_opts;
111 extern QemuOptsList qemu_common_drive_opts;
112 extern QemuOptsList qemu_drive_opts;
113 extern QemuOptsList bdrv_runtime_opts;
114 extern QemuOptsList qemu_chardev_opts;
115 extern QemuOptsList qemu_device_opts;
116 extern QemuOptsList qemu_netdev_opts;
117 extern QemuOptsList qemu_nic_opts;
118 extern QemuOptsList qemu_net_opts;
119 extern QemuOptsList qemu_global_opts;
120 extern QemuOptsList qemu_semihosting_config_opts;
121 
122 #endif
123