~ubuntu-branches/ubuntu/raring/qemu-kvm/raring

« back to all changes in this revision

Viewing changes to qemu-common.h

  • Committer: Serge Hallyn
  • Date: 2011-12-06 22:40:24 UTC
  • mfrom: (1.2.8)
  • Revision ID: serge.hallyn@ubuntu.com-20111206224024-x6bw4wnn65pgf55v
Tags: 1.0+noroms-0ubuntu1
* New upstream release
* Remaining changes from upstream:
  - removed all binary roms and tests/pi_10.com
* debian/qemu-kvm.links: qemu is now called qemu-system-i386, don't symlink
  it
* remove patches applied upstream:
  - debian/patches/vpc.patch
  - debian/patches/e1000-Dont-set-the-Capabilities-List-bit.patch
  - debian/patches/CVE-2011-4111.patch
* replace default-to-tcg.patch with simpler fallback-to-tcg.patch
* keep remaining patches:
  - larger_default_ram_size.patch
  - CVE-2011-2212-virtqueue-indirect-overflow.patch
  - qemuifup-fix-paths.patch
  - dont-try-to-hotplug-cpu.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include "compiler.h"
6
6
#include "config-host.h"
7
7
 
 
8
#if defined(__arm__) || defined(__sparc__) || defined(__mips__) || defined(__hppa__) || defined(__ia64__)
 
9
#define WORDS_ALIGNED
 
10
#endif
 
11
 
8
12
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
9
13
 
10
14
typedef struct QEMUTimer QEMUTimer;
11
15
typedef struct QEMUFile QEMUFile;
12
 
typedef struct QEMUBH QEMUBH;
13
16
typedef struct DeviceState DeviceState;
14
17
 
15
18
struct Monitor;
33
36
#include <sys/time.h>
34
37
#include <assert.h>
35
38
#include <signal.h>
 
39
#include <glib.h>
36
40
 
37
41
#ifdef _WIN32
38
42
#include "qemu-os-win32.h"
91
95
}
92
96
#endif
93
97
 
 
98
/* icount */
 
99
void configure_icount(const char *option);
 
100
extern int use_icount;
 
101
 
94
102
/* FIXME: Remove NEED_CPU_H.  */
95
103
#ifndef NEED_CPU_H
96
104
 
108
116
int qemu_main(int argc, char **argv, char **envp);
109
117
#endif
110
118
 
111
 
/* bottom halves */
112
 
typedef void QEMUBHFunc(void *opaque);
113
 
 
114
 
void async_context_push(void);
115
 
void async_context_pop(void);
116
 
int get_async_context_id(void);
117
 
 
118
 
QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque);
119
 
void qemu_bh_schedule(QEMUBH *bh);
120
 
/* Bottom halfs that are scheduled from a bottom half handler are instantly
121
 
 * invoked.  This can create an infinite loop if a bottom half handler
122
 
 * schedules itself.  qemu_bh_schedule_idle() avoids this infinite loop by
123
 
 * ensuring that the bottom half isn't executed until the next main loop
124
 
 * iteration.
125
 
 */
126
 
void qemu_bh_schedule_idle(QEMUBH *bh);
127
 
void qemu_bh_cancel(QEMUBH *bh);
128
 
void qemu_bh_delete(QEMUBH *bh);
129
 
int qemu_bh_poll(void);
130
 
void qemu_bh_update_timeout(int *timeout);
131
 
 
132
119
void qemu_get_timedate(struct tm *tm, int offset);
133
120
int qemu_timedate_diff(struct tm *tm);
134
121
 
142
129
int qemu_fls(int i);
143
130
int qemu_fdatasync(int fd);
144
131
int fcntl_setfl(int fd, int flag);
 
132
int qemu_parse_fd(const char *param);
145
133
 
146
134
/*
147
135
 * strtosz() suffixes used to specify the default treatment of an
157
145
#define STRTOSZ_DEFSUFFIX_B     'B'
158
146
int64_t strtosz(const char *nptr, char **end);
159
147
int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix);
 
148
int64_t strtosz_suffix_unit(const char *nptr, char **end,
 
149
                            const char default_suffix, int64_t unit);
160
150
 
161
151
/* path.c */
162
152
void init_paths(const char *prefix);
179
169
#define qemu_toascii(c)         toascii((unsigned char)(c))
180
170
 
181
171
void *qemu_oom_check(void *ptr);
182
 
void *qemu_malloc(size_t size);
183
 
void *qemu_realloc(void *ptr, size_t size);
184
 
void *qemu_mallocz(size_t size);
185
 
void qemu_free(void *ptr);
186
 
char *qemu_strdup(const char *str);
187
 
char *qemu_strndup(const char *str, size_t size);
188
 
 
189
 
void qemu_mutex_lock_iothread(void);
190
 
void qemu_mutex_unlock_iothread(void);
191
172
 
192
173
int qemu_open(const char *name, int flags, ...);
193
174
ssize_t qemu_write_full(int fd, const void *buf, size_t count)
195
176
void qemu_set_cloexec(int fd);
196
177
 
197
178
#ifndef _WIN32
198
 
int qemu_add_child_watch(pid_t pid);
199
179
int qemu_eventfd(int pipefd[2]);
200
180
int qemu_pipe(int pipefd[2]);
201
181
#endif
210
190
 
211
191
void QEMU_NORETURN hw_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
212
192
 
213
 
/* IO callbacks.  */
214
 
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
215
 
typedef int IOCanReadHandler(void *opaque);
216
 
typedef void IOHandler(void *opaque);
217
 
 
218
 
void qemu_iohandler_fill(int *pnfds, fd_set *readfds, fd_set *writefds, fd_set *xfds);
219
 
void qemu_iohandler_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds, int rc);
220
 
 
221
193
struct ParallelIOArg {
222
194
    void *buffer;
223
195
    int count;
266
238
typedef struct SSIBus SSIBus;
267
239
typedef struct EventNotifier EventNotifier;
268
240
typedef struct VirtIODevice VirtIODevice;
 
241
typedef struct QEMUSGList QEMUSGList;
269
242
 
270
243
typedef uint64_t pcibus_t;
271
244
 
272
 
void cpu_exec_init_all(unsigned long tb_size);
 
245
void tcg_exec_init(unsigned long tb_size);
 
246
bool tcg_enabled(void);
 
247
 
 
248
void cpu_exec_init_all(void);
273
249
 
274
250
/* CPU save/load.  */
275
251
void cpu_save(QEMUFile *f, void *opaque);
276
252
int cpu_load(QEMUFile *f, void *opaque, int version_id);
277
253
 
278
 
/* Force QEMU to stop what it's doing and service IO */
279
 
void qemu_service_io(void);
280
 
 
281
 
/* Force QEMU to process pending events */
282
 
void qemu_notify_event(void);
283
 
 
284
254
/* Unblock cpu */
285
255
void qemu_cpu_kick(void *env);
286
256
void qemu_cpu_kick_self(void);