root / sysemu.h @ 0ecb72a5
History | View | Annotate | Download (5.6 kB)
1 | 87ecb68b | pbrook | #ifndef SYSEMU_H
|
---|---|---|---|
2 | 87ecb68b | pbrook | #define SYSEMU_H
|
3 | 87ecb68b | pbrook | /* Misc. things related to the system emulator. */
|
4 | 87ecb68b | pbrook | |
5 | 376253ec | aliguori | #include "qemu-common.h" |
6 | 62c5802e | Gerd Hoffmann | #include "qemu-option.h" |
7 | 72cf2d4f | Blue Swirl | #include "qemu-queue.h" |
8 | 6875204c | Jan Kiszka | #include "qemu-timer.h" |
9 | 1fa9a5e4 | Luiz Capitulino | #include "qapi-types.h" |
10 | fd42deeb | Gerd Hoffmann | #include "notify.h" |
11 | 44a9b356 | Paolo Bonzini | #include "main-loop.h" |
12 | 376253ec | aliguori | |
13 | 87ecb68b | pbrook | /* vl.c */
|
14 | 1dfb4dd9 | Luiz Capitulino | |
15 | 87ecb68b | pbrook | extern const char *bios_name; |
16 | 5cea8590 | Paul Brook | |
17 | 87ecb68b | pbrook | extern const char *qemu_name; |
18 | 8fcb1b90 | blueswir1 | extern uint8_t qemu_uuid[];
|
19 | c4be29ff | aliguori | int qemu_uuid_parse(const char *str, uint8_t *uuid); |
20 | 8fcb1b90 | blueswir1 | #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" |
21 | 87ecb68b | pbrook | |
22 | 5db9d4d1 | Luiz Capitulino | void runstate_init(void); |
23 | f5bbfba1 | Luiz Capitulino | bool runstate_check(RunState state);
|
24 | f5bbfba1 | Luiz Capitulino | void runstate_set(RunState new_state);
|
25 | 1354869c | Luiz Capitulino | int runstate_is_running(void); |
26 | 87ecb68b | pbrook | typedef struct vm_change_state_entry VMChangeStateEntry; |
27 | 1dfb4dd9 | Luiz Capitulino | typedef void VMChangeStateHandler(void *opaque, int running, RunState state); |
28 | 87ecb68b | pbrook | |
29 | 87ecb68b | pbrook | VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, |
30 | 87ecb68b | pbrook | void *opaque);
|
31 | 87ecb68b | pbrook | void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
32 | 1dfb4dd9 | Luiz Capitulino | void vm_state_notify(int running, RunState state); |
33 | e07bbac5 | Jan Kiszka | |
34 | e063eb1f | Jan Kiszka | #define VMRESET_SILENT false |
35 | e063eb1f | Jan Kiszka | #define VMRESET_REPORT true |
36 | e063eb1f | Jan Kiszka | |
37 | 87ecb68b | pbrook | void vm_start(void); |
38 | 1dfb4dd9 | Luiz Capitulino | void vm_stop(RunState state);
|
39 | 8a9236f1 | Luiz Capitulino | void vm_stop_force_state(RunState state);
|
40 | 87ecb68b | pbrook | |
41 | 95b363b5 | Gerd Hoffmann | typedef enum WakeupReason { |
42 | 95b363b5 | Gerd Hoffmann | QEMU_WAKEUP_REASON_OTHER = 0,
|
43 | 62aeb0f7 | Gerd Hoffmann | QEMU_WAKEUP_REASON_RTC, |
44 | 6595abc0 | Gerd Hoffmann | QEMU_WAKEUP_REASON_PMTIMER, |
45 | 95b363b5 | Gerd Hoffmann | } WakeupReason; |
46 | 95b363b5 | Gerd Hoffmann | |
47 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
48 | 95b363b5 | Gerd Hoffmann | void qemu_system_suspend_request(void); |
49 | 95b363b5 | Gerd Hoffmann | void qemu_register_suspend_notifier(Notifier *notifier);
|
50 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_request(WakeupReason reason);
|
51 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); |
52 | 95b363b5 | Gerd Hoffmann | void qemu_register_wakeup_notifier(Notifier *notifier);
|
53 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
54 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
55 | 8cf71710 | Jan Kiszka | void qemu_system_debug_request(void); |
56 | 1dfb4dd9 | Luiz Capitulino | void qemu_system_vmstop_request(RunState reason);
|
57 | 1291eb35 | Anthony PERARD | int qemu_shutdown_requested_get(void); |
58 | 1291eb35 | Anthony PERARD | int qemu_reset_requested_get(void); |
59 | cf7a2fe2 | aurel32 | int qemu_shutdown_requested(void); |
60 | cf7a2fe2 | aurel32 | int qemu_reset_requested(void); |
61 | cf7a2fe2 | aurel32 | int qemu_powerdown_requested(void); |
62 | f64622c4 | Gleb Natapov | void qemu_system_killed(int signal, pid_t pid); |
63 | f64622c4 | Gleb Natapov | void qemu_kill_report(void); |
64 | d9c32310 | Blue Swirl | extern qemu_irq qemu_system_powerdown;
|
65 | e063eb1f | Jan Kiszka | void qemu_system_reset(bool report); |
66 | 87ecb68b | pbrook | |
67 | fd42deeb | Gerd Hoffmann | void qemu_add_exit_notifier(Notifier *notify);
|
68 | fd42deeb | Gerd Hoffmann | void qemu_remove_exit_notifier(Notifier *notify);
|
69 | fd42deeb | Gerd Hoffmann | |
70 | 4cab946a | Gleb Natapov | void qemu_add_machine_init_done_notifier(Notifier *notify);
|
71 | 4cab946a | Gleb Natapov | |
72 | d54908a5 | Luiz Capitulino | void do_savevm(Monitor *mon, const QDict *qdict); |
73 | 03cd4655 | Markus Armbruster | int load_vmstate(const char *name); |
74 | d54908a5 | Luiz Capitulino | void do_delvm(Monitor *mon, const QDict *qdict); |
75 | 376253ec | aliguori | void do_info_snapshots(Monitor *mon);
|
76 | 87ecb68b | pbrook | |
77 | 210f41ba | aliguori | void qemu_announce_self(void); |
78 | 210f41ba | aliguori | |
79 | dc912121 | Alex Williamson | bool qemu_savevm_state_blocked(Monitor *mon);
|
80 | f327aa0c | Jan Kiszka | int qemu_savevm_state_begin(Monitor *mon, QEMUFile *f, int blk_enable, |
81 | f327aa0c | Jan Kiszka | int shared);
|
82 | f327aa0c | Jan Kiszka | int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f);
|
83 | f327aa0c | Jan Kiszka | int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f);
|
84 | f327aa0c | Jan Kiszka | void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f);
|
85 | 9366f418 | aliguori | int qemu_loadvm_state(QEMUFile *f);
|
86 | 9366f418 | aliguori | |
87 | 87ecb68b | pbrook | /* SLIRP */
|
88 | 376253ec | aliguori | void do_info_slirp(Monitor *mon);
|
89 | 87ecb68b | pbrook | |
90 | 993fbfdb | Anthony Liguori | typedef enum DisplayType |
91 | 993fbfdb | Anthony Liguori | { |
92 | 993fbfdb | Anthony Liguori | DT_DEFAULT, |
93 | 993fbfdb | Anthony Liguori | DT_CURSES, |
94 | 993fbfdb | Anthony Liguori | DT_SDL, |
95 | 993fbfdb | Anthony Liguori | DT_NOGRAPHIC, |
96 | 4171d32e | Jes Sorensen | DT_NONE, |
97 | 993fbfdb | Anthony Liguori | } DisplayType; |
98 | 993fbfdb | Anthony Liguori | |
99 | d399f677 | Paolo Bonzini | extern int autostart; |
100 | 87ecb68b | pbrook | extern int bios_size; |
101 | 86176759 | Zachary Amsden | |
102 | 86176759 | Zachary Amsden | typedef enum { |
103 | a19cbfb3 | Gerd Hoffmann | VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, |
104 | 86176759 | Zachary Amsden | } VGAInterfaceType; |
105 | 86176759 | Zachary Amsden | |
106 | 86176759 | Zachary Amsden | extern int vga_interface_type; |
107 | 86176759 | Zachary Amsden | #define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
|
108 | 86176759 | Zachary Amsden | #define std_vga_enabled (vga_interface_type == VGA_STD)
|
109 | 86176759 | Zachary Amsden | #define xenfb_enabled (vga_interface_type == VGA_XENFB)
|
110 | 86176759 | Zachary Amsden | #define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
|
111 | a19cbfb3 | Gerd Hoffmann | #define qxl_enabled (vga_interface_type == VGA_QXL)
|
112 | 86176759 | Zachary Amsden | |
113 | 87ecb68b | pbrook | extern int graphic_width; |
114 | 87ecb68b | pbrook | extern int graphic_height; |
115 | 87ecb68b | pbrook | extern int graphic_depth; |
116 | 993fbfdb | Anthony Liguori | extern DisplayType display_type;
|
117 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
118 | 87ecb68b | pbrook | extern int win2k_install_hack; |
119 | 87ecb68b | pbrook | extern int alt_grab; |
120 | 0ca9f8a4 | Dustin Kirkland | extern int ctrl_grab; |
121 | 87ecb68b | pbrook | extern int usb_enabled; |
122 | 87ecb68b | pbrook | extern int smp_cpus; |
123 | 6be68d7e | Jes Sorensen | extern int max_cpus; |
124 | 87ecb68b | pbrook | extern int cursor_hide; |
125 | 87ecb68b | pbrook | extern int graphic_rotate; |
126 | 87ecb68b | pbrook | extern int no_quit; |
127 | a691d41a | Luiz Capitulino | extern int no_shutdown; |
128 | 87ecb68b | pbrook | extern int semihosting_enabled; |
129 | 87ecb68b | pbrook | extern int old_param; |
130 | 95387491 | Jan Kiszka | extern int boot_menu; |
131 | 3d3b8303 | wayne | extern uint8_t *boot_splash_filedata;
|
132 | 3d3b8303 | wayne | extern int boot_splash_filedata_size; |
133 | 3d3b8303 | wayne | extern uint8_t qemu_extra_params_fw[2]; |
134 | 6875204c | Jan Kiszka | extern QEMUClock *rtc_clock;
|
135 | 87ecb68b | pbrook | |
136 | 268a362c | aliguori | #define MAX_NODES 64 |
137 | 268a362c | aliguori | extern int nb_numa_nodes; |
138 | 268a362c | aliguori | extern uint64_t node_mem[MAX_NODES];
|
139 | 075cd324 | Blue Swirl | extern uint64_t node_cpumask[MAX_NODES];
|
140 | 268a362c | aliguori | |
141 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
142 | 2e55e842 | Gleb Natapov | typedef struct QEMUOptionRom { |
143 | 2e55e842 | Gleb Natapov | const char *name; |
144 | 2e55e842 | Gleb Natapov | int32_t bootindex; |
145 | 2e55e842 | Gleb Natapov | } QEMUOptionRom; |
146 | 2e55e842 | Gleb Natapov | extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
|
147 | 87ecb68b | pbrook | extern int nb_option_roms; |
148 | 87ecb68b | pbrook | |
149 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
150 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
151 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
152 | 87ecb68b | pbrook | |
153 | 6f338c34 | aliguori | /* pci-hotplug */
|
154 | 6c6a58ae | Markus Armbruster | void pci_device_hot_add(Monitor *mon, const QDict *qdict); |
155 | dd97aa8a | Alexander Graf | int pci_drive_hot_add(Monitor *mon, const QDict *qdict, |
156 | dd97aa8a | Alexander Graf | DriveInfo *dinfo, int type);
|
157 | b752daf0 | Markus Armbruster | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); |
158 | 6f338c34 | aliguori | |
159 | dd97aa8a | Alexander Graf | /* generic hotplug */
|
160 | dd97aa8a | Alexander Graf | void drive_hot_add(Monitor *mon, const QDict *qdict); |
161 | dd97aa8a | Alexander Graf | |
162 | 2ae63bda | Isaku Yamahata | /* pcie aer error injection */
|
163 | 2ae63bda | Isaku Yamahata | void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); |
164 | 1f3392b7 | Zhi Yong Wu | int do_pcie_aer_inject_error(Monitor *mon,
|
165 | 2ae63bda | Isaku Yamahata | const QDict *qdict, QObject **ret_data);
|
166 | 2ae63bda | Isaku Yamahata | |
167 | 87ecb68b | pbrook | /* serial ports */
|
168 | 87ecb68b | pbrook | |
169 | 87ecb68b | pbrook | #define MAX_SERIAL_PORTS 4 |
170 | 87ecb68b | pbrook | |
171 | 87ecb68b | pbrook | extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
172 | 87ecb68b | pbrook | |
173 | 87ecb68b | pbrook | /* parallel ports */
|
174 | 87ecb68b | pbrook | |
175 | 87ecb68b | pbrook | #define MAX_PARALLEL_PORTS 3 |
176 | 87ecb68b | pbrook | |
177 | 87ecb68b | pbrook | extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
178 | 87ecb68b | pbrook | |
179 | d54908a5 | Luiz Capitulino | void do_usb_add(Monitor *mon, const QDict *qdict); |
180 | d54908a5 | Luiz Capitulino | void do_usb_del(Monitor *mon, const QDict *qdict); |
181 | 376253ec | aliguori | void usb_info(Monitor *mon);
|
182 | 87ecb68b | pbrook | |
183 | 80cd3478 | Luiz Capitulino | void rtc_change_mon_event(struct tm *tm); |
184 | 80cd3478 | Luiz Capitulino | |
185 | aae9460e | Paul Brook | void register_devices(void); |
186 | aae9460e | Paul Brook | |
187 | 1ca4d09a | Gleb Natapov | void add_boot_device_path(int32_t bootindex, DeviceState *dev,
|
188 | 1ca4d09a | Gleb Natapov | const char *suffix); |
189 | 962630f2 | Gleb Natapov | char *get_boot_devices_list(uint32_t *size);
|
190 | 87ecb68b | pbrook | #endif |