mirror of https://github.com/xemu-project/xemu.git
Move generic or OS function declarations to qemu-common.h
Move generic or OS related function declarations and macro TFR to qemu-common.h. Move win32 include directives to qemu-os-win32.h. While moving, also add #include <winsock2.h> to fix a recent mingw32 build breakage. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
d8dfad9c41
commit
082b555799
|
@ -12,6 +12,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
|
#define QEMU_BUILD_BUG_ON(x) typedef char __build_bug_on__##__LINE__[(x)?-1:1];
|
||||||
|
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
|
||||||
|
|
||||||
typedef struct QEMUTimer QEMUTimer;
|
typedef struct QEMUTimer QEMUTimer;
|
||||||
typedef struct QEMUFile QEMUFile;
|
typedef struct QEMUFile QEMUFile;
|
||||||
|
@ -39,6 +40,14 @@ typedef struct Monitor Monitor;
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include "qemu-os-win32.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_POSIX
|
||||||
|
#include "qemu-os-posix.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef O_LARGEFILE
|
#ifndef O_LARGEFILE
|
||||||
#define O_LARGEFILE 0
|
#define O_LARGEFILE 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -339,6 +348,16 @@ void qemu_progress_init(int enabled, float min_skip);
|
||||||
void qemu_progress_end(void);
|
void qemu_progress_end(void);
|
||||||
void qemu_progress_print(float percent, int max);
|
void qemu_progress_print(float percent, int max);
|
||||||
|
|
||||||
|
#define QEMU_FILE_TYPE_BIOS 0
|
||||||
|
#define QEMU_FILE_TYPE_KEYMAP 1
|
||||||
|
char *qemu_find_file(int type, const char *name);
|
||||||
|
|
||||||
|
/* OS specific functions */
|
||||||
|
void os_setup_early_signal_handling(void);
|
||||||
|
char *os_find_datadir(const char *argv0);
|
||||||
|
void os_parse_cmd_args(int index, const char *optarg);
|
||||||
|
void os_pidfile_error(void);
|
||||||
|
|
||||||
/* Convert a byte between binary and BCD. */
|
/* Convert a byte between binary and BCD. */
|
||||||
static inline uint8_t to_bcd(uint8_t val)
|
static inline uint8_t to_bcd(uint8_t val)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#ifndef QEMU_OS_WIN32_H
|
#ifndef QEMU_OS_WIN32_H
|
||||||
#define QEMU_OS_WIN32_H
|
#define QEMU_OS_WIN32_H
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winsock2.h>
|
||||||
|
|
||||||
/* Polling handling */
|
/* Polling handling */
|
||||||
|
|
||||||
/* return TRUE if no sleep should be done afterwards */
|
/* return TRUE if no sleep should be done afterwards */
|
||||||
|
|
21
sysemu.h
21
sysemu.h
|
@ -8,22 +8,9 @@
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
#include "notify.h"
|
#include "notify.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include <windows.h>
|
|
||||||
#include "qemu-os-win32.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_POSIX
|
|
||||||
#include "qemu-os-posix.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* vl.c */
|
/* vl.c */
|
||||||
extern const char *bios_name;
|
extern const char *bios_name;
|
||||||
|
|
||||||
#define QEMU_FILE_TYPE_BIOS 0
|
|
||||||
#define QEMU_FILE_TYPE_KEYMAP 1
|
|
||||||
char *qemu_find_file(int type, const char *name);
|
|
||||||
|
|
||||||
extern int vm_running;
|
extern int vm_running;
|
||||||
extern const char *qemu_name;
|
extern const char *qemu_name;
|
||||||
extern uint8_t qemu_uuid[];
|
extern uint8_t qemu_uuid[];
|
||||||
|
@ -100,12 +87,6 @@ int qemu_loadvm_state(QEMUFile *f);
|
||||||
/* SLIRP */
|
/* SLIRP */
|
||||||
void do_info_slirp(Monitor *mon);
|
void do_info_slirp(Monitor *mon);
|
||||||
|
|
||||||
/* OS specific functions */
|
|
||||||
void os_setup_early_signal_handling(void);
|
|
||||||
char *os_find_datadir(const char *argv0);
|
|
||||||
void os_parse_cmd_args(int index, const char *optarg);
|
|
||||||
void os_pidfile_error(void);
|
|
||||||
|
|
||||||
typedef enum DisplayType
|
typedef enum DisplayType
|
||||||
{
|
{
|
||||||
DT_DEFAULT,
|
DT_DEFAULT,
|
||||||
|
@ -191,8 +172,6 @@ extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
||||||
|
|
||||||
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
||||||
|
|
||||||
#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
|
|
||||||
|
|
||||||
void do_usb_add(Monitor *mon, const QDict *qdict);
|
void do_usb_add(Monitor *mon, const QDict *qdict);
|
||||||
void do_usb_del(Monitor *mon, const QDict *qdict);
|
void do_usb_del(Monitor *mon, const QDict *qdict);
|
||||||
void usb_info(Monitor *mon);
|
void usb_info(Monitor *mon);
|
||||||
|
|
Loading…
Reference in New Issue