root / sysemu.h @ 3d575329
History | View | Annotate | Download (4.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 | 87ecb68b | pbrook | /* vl.c */
|
6 | 87ecb68b | pbrook | extern const char *bios_name; |
7 | 87ecb68b | pbrook | extern const char *bios_dir; |
8 | 87ecb68b | pbrook | |
9 | 87ecb68b | pbrook | extern int vm_running; |
10 | 87ecb68b | pbrook | extern const char *qemu_name; |
11 | 87ecb68b | pbrook | |
12 | 87ecb68b | pbrook | typedef struct vm_change_state_entry VMChangeStateEntry; |
13 | 87ecb68b | pbrook | typedef void VMChangeStateHandler(void *opaque, int running); |
14 | 87ecb68b | pbrook | typedef void VMStopHandler(void *opaque, int reason); |
15 | 87ecb68b | pbrook | |
16 | 87ecb68b | pbrook | VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, |
17 | 87ecb68b | pbrook | void *opaque);
|
18 | 87ecb68b | pbrook | void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
19 | 87ecb68b | pbrook | |
20 | 87ecb68b | pbrook | int qemu_add_vm_stop_handler(VMStopHandler *cb, void *opaque); |
21 | 87ecb68b | pbrook | void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque); |
22 | 87ecb68b | pbrook | |
23 | 87ecb68b | pbrook | void vm_start(void); |
24 | 87ecb68b | pbrook | void vm_stop(int reason); |
25 | 87ecb68b | pbrook | |
26 | 87ecb68b | pbrook | int64_t cpu_get_ticks(void);
|
27 | 87ecb68b | pbrook | void cpu_enable_ticks(void); |
28 | 87ecb68b | pbrook | void cpu_disable_ticks(void); |
29 | 87ecb68b | pbrook | |
30 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
31 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
32 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
33 | 87ecb68b | pbrook | #if !defined(TARGET_SPARC)
|
34 | 87ecb68b | pbrook | // Please implement a power failure function to signal the OS
|
35 | 87ecb68b | pbrook | #define qemu_system_powerdown() do{}while(0) |
36 | 87ecb68b | pbrook | #else
|
37 | 87ecb68b | pbrook | void qemu_system_powerdown(void); |
38 | 87ecb68b | pbrook | #endif
|
39 | 87ecb68b | pbrook | |
40 | 87ecb68b | pbrook | void cpu_save(QEMUFile *f, void *opaque); |
41 | 87ecb68b | pbrook | int cpu_load(QEMUFile *f, void *opaque, int version_id); |
42 | 87ecb68b | pbrook | |
43 | 87ecb68b | pbrook | void do_savevm(const char *name); |
44 | 87ecb68b | pbrook | void do_loadvm(const char *name); |
45 | 87ecb68b | pbrook | void do_delvm(const char *name); |
46 | 87ecb68b | pbrook | void do_info_snapshots(void); |
47 | 87ecb68b | pbrook | |
48 | 87ecb68b | pbrook | void main_loop_wait(int timeout); |
49 | 87ecb68b | pbrook | |
50 | 87ecb68b | pbrook | /* Polling handling */
|
51 | 87ecb68b | pbrook | |
52 | 87ecb68b | pbrook | /* return TRUE if no sleep should be done afterwards */
|
53 | 87ecb68b | pbrook | typedef int PollingFunc(void *opaque); |
54 | 87ecb68b | pbrook | |
55 | 87ecb68b | pbrook | int qemu_add_polling_cb(PollingFunc *func, void *opaque); |
56 | 87ecb68b | pbrook | void qemu_del_polling_cb(PollingFunc *func, void *opaque); |
57 | 87ecb68b | pbrook | |
58 | 87ecb68b | pbrook | #ifdef _WIN32
|
59 | 87ecb68b | pbrook | /* Wait objects handling */
|
60 | 87ecb68b | pbrook | typedef void WaitObjectFunc(void *opaque); |
61 | 87ecb68b | pbrook | |
62 | 87ecb68b | pbrook | int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque); |
63 | 87ecb68b | pbrook | void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque); |
64 | 87ecb68b | pbrook | #endif
|
65 | 87ecb68b | pbrook | |
66 | 87ecb68b | pbrook | /* TAP win32 */
|
67 | 87ecb68b | pbrook | int tap_win32_init(VLANState *vlan, const char *ifname); |
68 | 87ecb68b | pbrook | |
69 | 87ecb68b | pbrook | /* SLIRP */
|
70 | 87ecb68b | pbrook | void do_info_slirp(void); |
71 | 87ecb68b | pbrook | |
72 | 87ecb68b | pbrook | extern int ram_size; |
73 | 87ecb68b | pbrook | extern int bios_size; |
74 | 87ecb68b | pbrook | extern int rtc_utc; |
75 | 87ecb68b | pbrook | extern int rtc_start_date; |
76 | 87ecb68b | pbrook | extern int cirrus_vga_enabled; |
77 | 87ecb68b | pbrook | extern int vmsvga_enabled; |
78 | 87ecb68b | pbrook | extern int graphic_width; |
79 | 87ecb68b | pbrook | extern int graphic_height; |
80 | 87ecb68b | pbrook | extern int graphic_depth; |
81 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
82 | 87ecb68b | pbrook | extern int win2k_install_hack; |
83 | 87ecb68b | pbrook | extern int alt_grab; |
84 | 87ecb68b | pbrook | extern int usb_enabled; |
85 | 87ecb68b | pbrook | extern int smp_cpus; |
86 | 87ecb68b | pbrook | extern int cursor_hide; |
87 | 87ecb68b | pbrook | extern int graphic_rotate; |
88 | 87ecb68b | pbrook | extern int no_quit; |
89 | 87ecb68b | pbrook | extern int semihosting_enabled; |
90 | 87ecb68b | pbrook | extern int autostart; |
91 | 87ecb68b | pbrook | extern int old_param; |
92 | 87ecb68b | pbrook | extern const char *bootp_filename; |
93 | 87ecb68b | pbrook | |
94 | 87ecb68b | pbrook | |
95 | 87ecb68b | pbrook | #ifdef USE_KQEMU
|
96 | 87ecb68b | pbrook | extern int kqemu_allowed; |
97 | 87ecb68b | pbrook | #endif
|
98 | 87ecb68b | pbrook | |
99 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
100 | 87ecb68b | pbrook | extern const char *option_rom[MAX_OPTION_ROMS]; |
101 | 87ecb68b | pbrook | extern int nb_option_roms; |
102 | 87ecb68b | pbrook | |
103 | 87ecb68b | pbrook | #ifdef TARGET_SPARC
|
104 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
105 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
106 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
107 | 87ecb68b | pbrook | #endif
|
108 | 87ecb68b | pbrook | |
109 | 87ecb68b | pbrook | /* XXX: make it dynamic */
|
110 | 87ecb68b | pbrook | #define MAX_BIOS_SIZE (4 * 1024 * 1024) |
111 | 87ecb68b | pbrook | #if defined (TARGET_PPC)
|
112 | 87ecb68b | pbrook | #define BIOS_SIZE (1024 * 1024) |
113 | 87ecb68b | pbrook | #elif defined (TARGET_SPARC64)
|
114 | 87ecb68b | pbrook | #define BIOS_SIZE ((512 + 32) * 1024) |
115 | 87ecb68b | pbrook | #elif defined(TARGET_MIPS)
|
116 | 87ecb68b | pbrook | #define BIOS_SIZE (4 * 1024 * 1024) |
117 | 87ecb68b | pbrook | #endif
|
118 | 87ecb68b | pbrook | |
119 | e4bcb14c | ths | typedef enum { |
120 | e4bcb14c | ths | IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD |
121 | e4bcb14c | ths | } BlockInterfaceType; |
122 | e4bcb14c | ths | |
123 | e4bcb14c | ths | typedef struct DriveInfo { |
124 | e4bcb14c | ths | BlockDriverState *bdrv; |
125 | f60d39bc | ths | BlockInterfaceType type; |
126 | e4bcb14c | ths | int bus;
|
127 | e4bcb14c | ths | int unit;
|
128 | e4bcb14c | ths | } DriveInfo; |
129 | e4bcb14c | ths | |
130 | e4bcb14c | ths | #define MAX_IDE_DEVS 2 |
131 | e4bcb14c | ths | #define MAX_SCSI_DEVS 7 |
132 | e4bcb14c | ths | #define MAX_DRIVES 32 |
133 | e4bcb14c | ths | |
134 | e4bcb14c | ths | int nb_drives;
|
135 | e4bcb14c | ths | DriveInfo drives_table[MAX_DRIVES+1];
|
136 | e4bcb14c | ths | |
137 | f60d39bc | ths | extern int drive_get_index(BlockInterfaceType type, int bus, int unit); |
138 | f60d39bc | ths | extern int drive_get_max_bus(BlockInterfaceType type); |
139 | 87ecb68b | pbrook | |
140 | 87ecb68b | pbrook | /* serial ports */
|
141 | 87ecb68b | pbrook | |
142 | 87ecb68b | pbrook | #define MAX_SERIAL_PORTS 4 |
143 | 87ecb68b | pbrook | |
144 | 87ecb68b | pbrook | extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
145 | 87ecb68b | pbrook | |
146 | 87ecb68b | pbrook | /* parallel ports */
|
147 | 87ecb68b | pbrook | |
148 | 87ecb68b | pbrook | #define MAX_PARALLEL_PORTS 3 |
149 | 87ecb68b | pbrook | |
150 | 87ecb68b | pbrook | extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
151 | 87ecb68b | pbrook | |
152 | 87ecb68b | pbrook | #ifdef NEED_CPU_H
|
153 | 87ecb68b | pbrook | /* loader.c */
|
154 | 87ecb68b | pbrook | int get_image_size(const char *filename); |
155 | 87ecb68b | pbrook | int load_image(const char *filename, uint8_t *addr); |
156 | 87ecb68b | pbrook | int load_elf(const char *filename, int64_t virt_to_phys_addend, |
157 | 87ecb68b | pbrook | uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr); |
158 | 87ecb68b | pbrook | int load_aout(const char *filename, uint8_t *addr); |
159 | 87ecb68b | pbrook | int load_uboot(const char *filename, target_ulong *ep, int *is_linux); |
160 | 87ecb68b | pbrook | #endif
|
161 | 87ecb68b | pbrook | |
162 | 87ecb68b | pbrook | #ifdef HAS_AUDIO
|
163 | 87ecb68b | pbrook | struct soundhw {
|
164 | 87ecb68b | pbrook | const char *name; |
165 | 87ecb68b | pbrook | const char *descr; |
166 | 87ecb68b | pbrook | int enabled;
|
167 | 87ecb68b | pbrook | int isa;
|
168 | 87ecb68b | pbrook | union {
|
169 | 87ecb68b | pbrook | int (*init_isa) (AudioState *s, qemu_irq *pic);
|
170 | 87ecb68b | pbrook | int (*init_pci) (PCIBus *bus, AudioState *s);
|
171 | 87ecb68b | pbrook | } init; |
172 | 87ecb68b | pbrook | }; |
173 | 87ecb68b | pbrook | |
174 | 87ecb68b | pbrook | extern struct soundhw soundhw[]; |
175 | 87ecb68b | pbrook | #endif
|
176 | 87ecb68b | pbrook | |
177 | 87ecb68b | pbrook | void do_usb_add(const char *devname); |
178 | 87ecb68b | pbrook | void do_usb_del(const char *devname); |
179 | 87ecb68b | pbrook | void usb_info(void); |
180 | 87ecb68b | pbrook | |
181 | 87ecb68b | pbrook | #endif |