Statistics
| Branch: | Revision:

root / qemu-os-win32.h @ a74cdab4

History | View | Annotate | Download (2.3 kB)

1 39626c03 Jes Sorensen
/*
2 39626c03 Jes Sorensen
 * win32 specific declarations
3 39626c03 Jes Sorensen
 *
4 39626c03 Jes Sorensen
 * Copyright (c) 2003-2008 Fabrice Bellard
5 39626c03 Jes Sorensen
 * Copyright (c) 2010 Jes Sorensen <Jes.Sorensen@redhat.com>
6 39626c03 Jes Sorensen
 *
7 39626c03 Jes Sorensen
 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 39626c03 Jes Sorensen
 * of this software and associated documentation files (the "Software"), to deal
9 39626c03 Jes Sorensen
 * in the Software without restriction, including without limitation the rights
10 39626c03 Jes Sorensen
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 39626c03 Jes Sorensen
 * copies of the Software, and to permit persons to whom the Software is
12 39626c03 Jes Sorensen
 * furnished to do so, subject to the following conditions:
13 39626c03 Jes Sorensen
 *
14 39626c03 Jes Sorensen
 * The above copyright notice and this permission notice shall be included in
15 39626c03 Jes Sorensen
 * all copies or substantial portions of the Software.
16 39626c03 Jes Sorensen
 *
17 39626c03 Jes Sorensen
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 39626c03 Jes Sorensen
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 39626c03 Jes Sorensen
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 39626c03 Jes Sorensen
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 39626c03 Jes Sorensen
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 39626c03 Jes Sorensen
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 39626c03 Jes Sorensen
 * THE SOFTWARE.
24 39626c03 Jes Sorensen
 */
25 39626c03 Jes Sorensen
26 39626c03 Jes Sorensen
#ifndef QEMU_OS_WIN32_H
27 39626c03 Jes Sorensen
#define QEMU_OS_WIN32_H
28 39626c03 Jes Sorensen
29 082b5557 Blue Swirl
#include <windows.h>
30 082b5557 Blue Swirl
#include <winsock2.h>
31 082b5557 Blue Swirl
32 077030d1 Stefan Weil
/* Declaration of ffs() is missing in MinGW's strings.h. */
33 077030d1 Stefan Weil
int ffs(int i);
34 077030d1 Stefan Weil
35 39626c03 Jes Sorensen
/* Polling handling */
36 39626c03 Jes Sorensen
37 39626c03 Jes Sorensen
/* return TRUE if no sleep should be done afterwards */
38 39626c03 Jes Sorensen
typedef int PollingFunc(void *opaque);
39 39626c03 Jes Sorensen
40 39626c03 Jes Sorensen
int qemu_add_polling_cb(PollingFunc *func, void *opaque);
41 39626c03 Jes Sorensen
void qemu_del_polling_cb(PollingFunc *func, void *opaque);
42 39626c03 Jes Sorensen
43 39626c03 Jes Sorensen
/* Wait objects handling */
44 39626c03 Jes Sorensen
typedef void WaitObjectFunc(void *opaque);
45 39626c03 Jes Sorensen
46 39626c03 Jes Sorensen
int qemu_add_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
47 39626c03 Jes Sorensen
void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
48 39626c03 Jes Sorensen
49 0d93ca7c Jes Sorensen
void os_host_main_loop_wait(int *timeout);
50 8d963e6a Jes Sorensen
51 8d963e6a Jes Sorensen
static inline void os_setup_signal_handling(void) {}
52 eb505be1 Jes Sorensen
static inline void os_daemonize(void) {}
53 eb505be1 Jes Sorensen
static inline void os_setup_post(void) {}
54 6650b710 Stefan Weil
void os_set_line_buffering(void);
55 ce798cf2 Jes Sorensen
static inline void os_set_proc_name(const char *dummy) {}
56 8d963e6a Jes Sorensen
57 5635efc3 Stefan Weil
#if !defined(EPROTONOSUPPORT)
58 5635efc3 Stefan Weil
# define EPROTONOSUPPORT EINVAL
59 5635efc3 Stefan Weil
#endif
60 5635efc3 Stefan Weil
61 dc786bc9 Jes Sorensen
int setenv(const char *name, const char *value, int overwrite);
62 dc786bc9 Jes Sorensen
63 dc786bc9 Jes Sorensen
typedef struct {
64 dc786bc9 Jes Sorensen
    long tv_sec;
65 dc786bc9 Jes Sorensen
    long tv_usec;
66 dc786bc9 Jes Sorensen
} qemu_timeval;
67 dc786bc9 Jes Sorensen
int qemu_gettimeofday(qemu_timeval *tp);
68 dc786bc9 Jes Sorensen
69 39626c03 Jes Sorensen
#endif