root / sysemu.h @ f64622c4
History | View | Annotate | Download (5.7 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 | fd42deeb | Gerd Hoffmann | #include "notify.h" |
10 | 376253ec | aliguori | |
11 | 49dc768d | aliguori | #ifdef _WIN32
|
12 | 49dc768d | aliguori | #include <windows.h> |
13 | 39626c03 | Jes Sorensen | #include "qemu-os-win32.h" |
14 | 49dc768d | aliguori | #endif
|
15 | 49dc768d | aliguori | |
16 | 0d93ca7c | Jes Sorensen | #ifdef CONFIG_POSIX
|
17 | 0d93ca7c | Jes Sorensen | #include "qemu-os-posix.h" |
18 | 0d93ca7c | Jes Sorensen | #endif
|
19 | 0d93ca7c | Jes Sorensen | |
20 | 87ecb68b | pbrook | /* vl.c */
|
21 | 87ecb68b | pbrook | extern const char *bios_name; |
22 | 5cea8590 | Paul Brook | |
23 | 5cea8590 | Paul Brook | #define QEMU_FILE_TYPE_BIOS 0 |
24 | 5cea8590 | Paul Brook | #define QEMU_FILE_TYPE_KEYMAP 1 |
25 | 5cea8590 | Paul Brook | char *qemu_find_file(int type, const char *name); |
26 | 87ecb68b | pbrook | |
27 | 87ecb68b | pbrook | extern int vm_running; |
28 | 87ecb68b | pbrook | extern const char *qemu_name; |
29 | 8fcb1b90 | blueswir1 | extern uint8_t qemu_uuid[];
|
30 | c4be29ff | aliguori | int qemu_uuid_parse(const char *str, uint8_t *uuid); |
31 | 8fcb1b90 | blueswir1 | #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" |
32 | 87ecb68b | pbrook | |
33 | 87ecb68b | pbrook | typedef struct vm_change_state_entry VMChangeStateEntry; |
34 | 9781e040 | aliguori | typedef void VMChangeStateHandler(void *opaque, int running, int reason); |
35 | 87ecb68b | pbrook | |
36 | 87ecb68b | pbrook | VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, |
37 | 87ecb68b | pbrook | void *opaque);
|
38 | 87ecb68b | pbrook | void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
39 | 87ecb68b | pbrook | |
40 | e07bbac5 | Jan Kiszka | #define VMSTOP_USER 0 |
41 | e07bbac5 | Jan Kiszka | #define VMSTOP_DEBUG 1 |
42 | e07bbac5 | Jan Kiszka | #define VMSTOP_SHUTDOWN 2 |
43 | e07bbac5 | Jan Kiszka | #define VMSTOP_DISKFULL 3 |
44 | e07bbac5 | Jan Kiszka | #define VMSTOP_WATCHDOG 4 |
45 | e07bbac5 | Jan Kiszka | #define VMSTOP_PANIC 5 |
46 | e07bbac5 | Jan Kiszka | #define VMSTOP_SAVEVM 6 |
47 | e07bbac5 | Jan Kiszka | #define VMSTOP_LOADVM 7 |
48 | e07bbac5 | Jan Kiszka | #define VMSTOP_MIGRATE 8 |
49 | e07bbac5 | Jan Kiszka | |
50 | 87ecb68b | pbrook | void vm_start(void); |
51 | 87ecb68b | pbrook | void vm_stop(int reason); |
52 | 87ecb68b | pbrook | |
53 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_remaining(void);
|
54 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_transferred(void);
|
55 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_total(void);
|
56 | 9f9e28cd | Glauber Costa | |
57 | 87ecb68b | pbrook | int64_t cpu_get_ticks(void);
|
58 | 87ecb68b | pbrook | void cpu_enable_ticks(void); |
59 | 87ecb68b | pbrook | void cpu_disable_ticks(void); |
60 | 87ecb68b | pbrook | |
61 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
62 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
63 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
64 | 8cf71710 | Jan Kiszka | void qemu_system_debug_request(void); |
65 | 8cf71710 | Jan Kiszka | void qemu_system_vmstop_request(int reason); |
66 | cf7a2fe2 | aurel32 | int qemu_shutdown_requested(void); |
67 | cf7a2fe2 | aurel32 | int qemu_reset_requested(void); |
68 | cf7a2fe2 | aurel32 | int qemu_powerdown_requested(void); |
69 | f64622c4 | Gleb Natapov | void qemu_system_killed(int signal, pid_t pid); |
70 | f64622c4 | Gleb Natapov | void qemu_kill_report(void); |
71 | d9c32310 | Blue Swirl | extern qemu_irq qemu_system_powerdown;
|
72 | cf7a2fe2 | aurel32 | void qemu_system_reset(void); |
73 | 87ecb68b | pbrook | |
74 | fd42deeb | Gerd Hoffmann | void qemu_add_exit_notifier(Notifier *notify);
|
75 | fd42deeb | Gerd Hoffmann | void qemu_remove_exit_notifier(Notifier *notify);
|
76 | fd42deeb | Gerd Hoffmann | |
77 | 4cab946a | Gleb Natapov | void qemu_add_machine_init_done_notifier(Notifier *notify);
|
78 | 4cab946a | Gleb Natapov | |
79 | d54908a5 | Luiz Capitulino | void do_savevm(Monitor *mon, const QDict *qdict); |
80 | 03cd4655 | Markus Armbruster | int load_vmstate(const char *name); |
81 | d54908a5 | Luiz Capitulino | void do_delvm(Monitor *mon, const QDict *qdict); |
82 | 376253ec | aliguori | void do_info_snapshots(Monitor *mon);
|
83 | 87ecb68b | pbrook | |
84 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_states(void); |
85 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_post_reset(void); |
86 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_post_init(void); |
87 | ea375f9a | Jan Kiszka | |
88 | 210f41ba | aliguori | void qemu_announce_self(void); |
89 | 210f41ba | aliguori | |
90 | d6f4ade2 | Paolo Bonzini | void main_loop_wait(int nonblocking); |
91 | 87ecb68b | pbrook | |
92 | dc912121 | Alex Williamson | bool qemu_savevm_state_blocked(Monitor *mon);
|
93 | f327aa0c | Jan Kiszka | int qemu_savevm_state_begin(Monitor *mon, QEMUFile *f, int blk_enable, |
94 | f327aa0c | Jan Kiszka | int shared);
|
95 | f327aa0c | Jan Kiszka | int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f);
|
96 | f327aa0c | Jan Kiszka | int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f);
|
97 | f327aa0c | Jan Kiszka | void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f);
|
98 | 9366f418 | aliguori | int qemu_loadvm_state(QEMUFile *f);
|
99 | 9366f418 | aliguori | |
100 | 87ecb68b | pbrook | /* SLIRP */
|
101 | 376253ec | aliguori | void do_info_slirp(Monitor *mon);
|
102 | 87ecb68b | pbrook | |
103 | 6170540b | Jes Sorensen | /* OS specific functions */
|
104 | fe98ac14 | Jes Sorensen | void os_setup_early_signal_handling(void); |
105 | 6170540b | Jes Sorensen | char *os_find_datadir(const char *argv0); |
106 | 59a5264b | Jes Sorensen | void os_parse_cmd_args(int index, const char *optarg); |
107 | eb505be1 | Jes Sorensen | void os_pidfile_error(void); |
108 | 69bd73b1 | Jes Sorensen | |
109 | 993fbfdb | Anthony Liguori | typedef enum DisplayType |
110 | 993fbfdb | Anthony Liguori | { |
111 | 993fbfdb | Anthony Liguori | DT_DEFAULT, |
112 | 993fbfdb | Anthony Liguori | DT_CURSES, |
113 | 993fbfdb | Anthony Liguori | DT_SDL, |
114 | 993fbfdb | Anthony Liguori | DT_NOGRAPHIC, |
115 | 4171d32e | Jes Sorensen | DT_NONE, |
116 | 993fbfdb | Anthony Liguori | } DisplayType; |
117 | 993fbfdb | Anthony Liguori | |
118 | d399f677 | Paolo Bonzini | extern int autostart; |
119 | 8e84865e | Amit Shah | extern int incoming_expected; |
120 | 87ecb68b | pbrook | extern int bios_size; |
121 | 86176759 | Zachary Amsden | |
122 | 86176759 | Zachary Amsden | typedef enum { |
123 | a19cbfb3 | Gerd Hoffmann | VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, |
124 | 86176759 | Zachary Amsden | } VGAInterfaceType; |
125 | 86176759 | Zachary Amsden | |
126 | 86176759 | Zachary Amsden | extern int vga_interface_type; |
127 | 86176759 | Zachary Amsden | #define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
|
128 | 86176759 | Zachary Amsden | #define std_vga_enabled (vga_interface_type == VGA_STD)
|
129 | 86176759 | Zachary Amsden | #define xenfb_enabled (vga_interface_type == VGA_XENFB)
|
130 | 86176759 | Zachary Amsden | #define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
|
131 | a19cbfb3 | Gerd Hoffmann | #define qxl_enabled (vga_interface_type == VGA_QXL)
|
132 | 86176759 | Zachary Amsden | |
133 | 87ecb68b | pbrook | extern int graphic_width; |
134 | 87ecb68b | pbrook | extern int graphic_height; |
135 | 87ecb68b | pbrook | extern int graphic_depth; |
136 | 6b35e7bf | Jes Sorensen | extern uint8_t irq0override;
|
137 | 993fbfdb | Anthony Liguori | extern DisplayType display_type;
|
138 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
139 | 87ecb68b | pbrook | extern int win2k_install_hack; |
140 | 73822ec8 | aliguori | extern int rtc_td_hack; |
141 | 87ecb68b | pbrook | extern int alt_grab; |
142 | 0ca9f8a4 | Dustin Kirkland | extern int ctrl_grab; |
143 | 87ecb68b | pbrook | extern int usb_enabled; |
144 | 87ecb68b | pbrook | extern int smp_cpus; |
145 | 6be68d7e | Jes Sorensen | extern int max_cpus; |
146 | 87ecb68b | pbrook | extern int cursor_hide; |
147 | 87ecb68b | pbrook | extern int graphic_rotate; |
148 | 87ecb68b | pbrook | extern int no_quit; |
149 | a691d41a | Luiz Capitulino | extern int no_shutdown; |
150 | 87ecb68b | pbrook | extern int semihosting_enabled; |
151 | 87ecb68b | pbrook | extern int old_param; |
152 | 95387491 | Jan Kiszka | extern int boot_menu; |
153 | 6875204c | Jan Kiszka | extern QEMUClock *rtc_clock;
|
154 | 87ecb68b | pbrook | |
155 | 268a362c | aliguori | #define MAX_NODES 64 |
156 | 268a362c | aliguori | extern int nb_numa_nodes; |
157 | 268a362c | aliguori | extern uint64_t node_mem[MAX_NODES];
|
158 | 075cd324 | Blue Swirl | extern uint64_t node_cpumask[MAX_NODES];
|
159 | 268a362c | aliguori | |
160 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
161 | 2e55e842 | Gleb Natapov | typedef struct QEMUOptionRom { |
162 | 2e55e842 | Gleb Natapov | const char *name; |
163 | 2e55e842 | Gleb Natapov | int32_t bootindex; |
164 | 2e55e842 | Gleb Natapov | } QEMUOptionRom; |
165 | 2e55e842 | Gleb Natapov | extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
|
166 | 87ecb68b | pbrook | extern int nb_option_roms; |
167 | 87ecb68b | pbrook | |
168 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
169 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
170 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
171 | 87ecb68b | pbrook | |
172 | 6f338c34 | aliguori | /* pci-hotplug */
|
173 | 6c6a58ae | Markus Armbruster | void pci_device_hot_add(Monitor *mon, const QDict *qdict); |
174 | f18c16de | Luiz Capitulino | void drive_hot_add(Monitor *mon, const QDict *qdict); |
175 | b752daf0 | Markus Armbruster | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); |
176 | 6f338c34 | aliguori | |
177 | 2ae63bda | Isaku Yamahata | /* pcie aer error injection */
|
178 | 2ae63bda | Isaku Yamahata | void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); |
179 | 2ae63bda | Isaku Yamahata | int do_pcie_aer_inejct_error(Monitor *mon,
|
180 | 2ae63bda | Isaku Yamahata | const QDict *qdict, QObject **ret_data);
|
181 | 2ae63bda | Isaku Yamahata | |
182 | 87ecb68b | pbrook | /* serial ports */
|
183 | 87ecb68b | pbrook | |
184 | 87ecb68b | pbrook | #define MAX_SERIAL_PORTS 4 |
185 | 87ecb68b | pbrook | |
186 | 87ecb68b | pbrook | extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
187 | 87ecb68b | pbrook | |
188 | 87ecb68b | pbrook | /* parallel ports */
|
189 | 87ecb68b | pbrook | |
190 | 87ecb68b | pbrook | #define MAX_PARALLEL_PORTS 3 |
191 | 87ecb68b | pbrook | |
192 | 87ecb68b | pbrook | extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
193 | 87ecb68b | pbrook | |
194 | 0e82f34d | aliguori | #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) |
195 | 0e82f34d | aliguori | |
196 | d54908a5 | Luiz Capitulino | void do_usb_add(Monitor *mon, const QDict *qdict); |
197 | d54908a5 | Luiz Capitulino | void do_usb_del(Monitor *mon, const QDict *qdict); |
198 | 376253ec | aliguori | void usb_info(Monitor *mon);
|
199 | 87ecb68b | pbrook | |
200 | 80cd3478 | Luiz Capitulino | void rtc_change_mon_event(struct tm *tm); |
201 | 80cd3478 | Luiz Capitulino | |
202 | aae9460e | Paul Brook | void register_devices(void); |
203 | aae9460e | Paul Brook | |
204 | 1ca4d09a | Gleb Natapov | void add_boot_device_path(int32_t bootindex, DeviceState *dev,
|
205 | 1ca4d09a | Gleb Natapov | const char *suffix); |
206 | 962630f2 | Gleb Natapov | char *get_boot_devices_list(uint32_t *size);
|
207 | 87ecb68b | pbrook | #endif |