root / sysemu.h @ 6643e2f0
History | View | Annotate | Download (5.5 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 | 87ecb68b | pbrook | void vm_start(void); |
41 | 87ecb68b | pbrook | void vm_stop(int reason); |
42 | 87ecb68b | pbrook | |
43 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_remaining(void);
|
44 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_transferred(void);
|
45 | 9f9e28cd | Glauber Costa | uint64_t ram_bytes_total(void);
|
46 | 9f9e28cd | Glauber Costa | |
47 | 87ecb68b | pbrook | int64_t cpu_get_ticks(void);
|
48 | 87ecb68b | pbrook | void cpu_enable_ticks(void); |
49 | 87ecb68b | pbrook | void cpu_disable_ticks(void); |
50 | 87ecb68b | pbrook | |
51 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
52 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
53 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
54 | cf7a2fe2 | aurel32 | int qemu_shutdown_requested(void); |
55 | cf7a2fe2 | aurel32 | int qemu_reset_requested(void); |
56 | cf7a2fe2 | aurel32 | int qemu_powerdown_requested(void); |
57 | d9c32310 | Blue Swirl | extern qemu_irq qemu_system_powerdown;
|
58 | cf7a2fe2 | aurel32 | void qemu_system_reset(void); |
59 | 87ecb68b | pbrook | |
60 | fd42deeb | Gerd Hoffmann | void qemu_add_exit_notifier(Notifier *notify);
|
61 | fd42deeb | Gerd Hoffmann | void qemu_remove_exit_notifier(Notifier *notify);
|
62 | fd42deeb | Gerd Hoffmann | |
63 | 4cab946a | Gleb Natapov | void qemu_add_machine_init_done_notifier(Notifier *notify);
|
64 | 4cab946a | Gleb Natapov | |
65 | d54908a5 | Luiz Capitulino | void do_savevm(Monitor *mon, const QDict *qdict); |
66 | 03cd4655 | Markus Armbruster | int load_vmstate(const char *name); |
67 | d54908a5 | Luiz Capitulino | void do_delvm(Monitor *mon, const QDict *qdict); |
68 | 376253ec | aliguori | void do_info_snapshots(Monitor *mon);
|
69 | 87ecb68b | pbrook | |
70 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_states(void); |
71 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_post_reset(void); |
72 | ea375f9a | Jan Kiszka | void cpu_synchronize_all_post_init(void); |
73 | ea375f9a | Jan Kiszka | |
74 | 210f41ba | aliguori | void qemu_announce_self(void); |
75 | 210f41ba | aliguori | |
76 | d6f4ade2 | Paolo Bonzini | void main_loop_wait(int nonblocking); |
77 | 87ecb68b | pbrook | |
78 | dc912121 | Alex Williamson | bool qemu_savevm_state_blocked(Monitor *mon);
|
79 | f327aa0c | Jan Kiszka | int qemu_savevm_state_begin(Monitor *mon, QEMUFile *f, int blk_enable, |
80 | f327aa0c | Jan Kiszka | int shared);
|
81 | f327aa0c | Jan Kiszka | int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f);
|
82 | f327aa0c | Jan Kiszka | int qemu_savevm_state_complete(Monitor *mon, QEMUFile *f);
|
83 | f327aa0c | Jan Kiszka | void qemu_savevm_state_cancel(Monitor *mon, QEMUFile *f);
|
84 | 9366f418 | aliguori | int qemu_loadvm_state(QEMUFile *f);
|
85 | 9366f418 | aliguori | |
86 | 87ecb68b | pbrook | /* SLIRP */
|
87 | 376253ec | aliguori | void do_info_slirp(Monitor *mon);
|
88 | 87ecb68b | pbrook | |
89 | 6170540b | Jes Sorensen | /* OS specific functions */
|
90 | fe98ac14 | Jes Sorensen | void os_setup_early_signal_handling(void); |
91 | 6170540b | Jes Sorensen | char *os_find_datadir(const char *argv0); |
92 | 59a5264b | Jes Sorensen | void os_parse_cmd_args(int index, const char *optarg); |
93 | eb505be1 | Jes Sorensen | void os_pidfile_error(void); |
94 | 69bd73b1 | Jes Sorensen | |
95 | 993fbfdb | Anthony Liguori | typedef enum DisplayType |
96 | 993fbfdb | Anthony Liguori | { |
97 | 993fbfdb | Anthony Liguori | DT_DEFAULT, |
98 | 993fbfdb | Anthony Liguori | DT_CURSES, |
99 | 993fbfdb | Anthony Liguori | DT_SDL, |
100 | 993fbfdb | Anthony Liguori | DT_NOGRAPHIC, |
101 | 993fbfdb | Anthony Liguori | } DisplayType; |
102 | 993fbfdb | Anthony Liguori | |
103 | d399f677 | Paolo Bonzini | extern int autostart; |
104 | 8e84865e | Amit Shah | extern int incoming_expected; |
105 | 87ecb68b | pbrook | extern int bios_size; |
106 | 86176759 | Zachary Amsden | |
107 | 86176759 | Zachary Amsden | typedef enum { |
108 | a19cbfb3 | Gerd Hoffmann | VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, |
109 | 86176759 | Zachary Amsden | } VGAInterfaceType; |
110 | 86176759 | Zachary Amsden | |
111 | 86176759 | Zachary Amsden | extern int vga_interface_type; |
112 | 86176759 | Zachary Amsden | #define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
|
113 | 86176759 | Zachary Amsden | #define std_vga_enabled (vga_interface_type == VGA_STD)
|
114 | 86176759 | Zachary Amsden | #define xenfb_enabled (vga_interface_type == VGA_XENFB)
|
115 | 86176759 | Zachary Amsden | #define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
|
116 | a19cbfb3 | Gerd Hoffmann | #define qxl_enabled (vga_interface_type == VGA_QXL)
|
117 | 86176759 | Zachary Amsden | |
118 | 87ecb68b | pbrook | extern int graphic_width; |
119 | 87ecb68b | pbrook | extern int graphic_height; |
120 | 87ecb68b | pbrook | extern int graphic_depth; |
121 | 6b35e7bf | Jes Sorensen | extern uint8_t irq0override;
|
122 | 993fbfdb | Anthony Liguori | extern DisplayType display_type;
|
123 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
124 | 87ecb68b | pbrook | extern int win2k_install_hack; |
125 | 73822ec8 | aliguori | extern int rtc_td_hack; |
126 | 87ecb68b | pbrook | extern int alt_grab; |
127 | 0ca9f8a4 | Dustin Kirkland | extern int ctrl_grab; |
128 | 87ecb68b | pbrook | extern int usb_enabled; |
129 | 87ecb68b | pbrook | extern int smp_cpus; |
130 | 6be68d7e | Jes Sorensen | extern int max_cpus; |
131 | 87ecb68b | pbrook | extern int cursor_hide; |
132 | 87ecb68b | pbrook | extern int graphic_rotate; |
133 | 87ecb68b | pbrook | extern int no_quit; |
134 | a691d41a | Luiz Capitulino | extern int no_shutdown; |
135 | 87ecb68b | pbrook | extern int semihosting_enabled; |
136 | 87ecb68b | pbrook | extern int old_param; |
137 | 95387491 | Jan Kiszka | extern int boot_menu; |
138 | 6875204c | Jan Kiszka | extern QEMUClock *rtc_clock;
|
139 | 87ecb68b | pbrook | |
140 | 268a362c | aliguori | #define MAX_NODES 64 |
141 | 268a362c | aliguori | extern int nb_numa_nodes; |
142 | 268a362c | aliguori | extern uint64_t node_mem[MAX_NODES];
|
143 | 075cd324 | Blue Swirl | extern uint64_t node_cpumask[MAX_NODES];
|
144 | 268a362c | aliguori | |
145 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
146 | 2e55e842 | Gleb Natapov | typedef struct QEMUOptionRom { |
147 | 2e55e842 | Gleb Natapov | const char *name; |
148 | 2e55e842 | Gleb Natapov | int32_t bootindex; |
149 | 2e55e842 | Gleb Natapov | } QEMUOptionRom; |
150 | 2e55e842 | Gleb Natapov | extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
|
151 | 87ecb68b | pbrook | extern int nb_option_roms; |
152 | 87ecb68b | pbrook | |
153 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
154 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
155 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
156 | 87ecb68b | pbrook | |
157 | 6f338c34 | aliguori | /* pci-hotplug */
|
158 | 6c6a58ae | Markus Armbruster | void pci_device_hot_add(Monitor *mon, const QDict *qdict); |
159 | f18c16de | Luiz Capitulino | void drive_hot_add(Monitor *mon, const QDict *qdict); |
160 | b752daf0 | Markus Armbruster | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); |
161 | 6f338c34 | aliguori | |
162 | 2ae63bda | Isaku Yamahata | /* pcie aer error injection */
|
163 | 2ae63bda | Isaku Yamahata | void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); |
164 | 2ae63bda | Isaku Yamahata | int do_pcie_aer_inejct_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 | 0e82f34d | aliguori | #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) |
180 | 0e82f34d | aliguori | |
181 | 87ecb68b | pbrook | #ifdef HAS_AUDIO
|
182 | 87ecb68b | pbrook | struct soundhw {
|
183 | 87ecb68b | pbrook | const char *name; |
184 | 87ecb68b | pbrook | const char *descr; |
185 | 87ecb68b | pbrook | int enabled;
|
186 | 87ecb68b | pbrook | int isa;
|
187 | 87ecb68b | pbrook | union {
|
188 | 22d83b14 | Paul Brook | int (*init_isa) (qemu_irq *pic);
|
189 | 22d83b14 | Paul Brook | int (*init_pci) (PCIBus *bus);
|
190 | 87ecb68b | pbrook | } init; |
191 | 87ecb68b | pbrook | }; |
192 | 87ecb68b | pbrook | |
193 | 87ecb68b | pbrook | extern struct soundhw soundhw[]; |
194 | 87ecb68b | pbrook | #endif
|
195 | 87ecb68b | pbrook | |
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 |