osdep.h revision 4af48bf7c72ef1e201c64bd475377b5af9d8e8a1
#ifndef QEMU_OSDEP_H
#define QEMU_OSDEP_H
#ifdef VBOX /** @todo clean up this, it's not fully synched. */
#ifndef RT_OS_WINDOWS
#endif
#include "config.h"
#define VBOX_ONLY(x) x
#define qemu_printf RTLogPrintf
#ifndef NULL
# define NULL 0
#endif
/* If DEBUG_TMP_LOGGING - goes to QEMU log file */
#ifndef DEBUG_TMP_LOGGING
#endif
#else /* !VBOX */
#include <stdarg.h>
#define VBOX_ONLY(x)
#define qemu_printf printf
char *qemu_strdup(const char *str);
void qemu_vfree(void *ptr);
void *get_mmap_addr(unsigned long size);
#endif /* !VBOX */
#ifdef __OpenBSD__
#endif
#ifndef glue
#define xglue(x, y) x ## y
#define tostring(s) #s
#endif
#ifndef likely
#if __GNUC__ < 3
#define __builtin_expect(x, n) (x)
#endif
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
#ifndef offsetof
#endif
#ifndef container_of
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#endif
#ifndef always_inline
#define always_inline inline
#else
#ifdef __OPTIMIZE__
#define inline always_inline
#endif
#endif
#else
#define inline always_inline
#endif
#ifdef __i386__
#else
#define REGPARM
#endif
#ifndef VBOX
#define qemu_printf printf
#endif
#if defined (__GNUC__) && defined (__GNUC_MINOR__)
#else
#endif
#ifndef VBOX
void qemu_vfree(void *ptr);
int qemu_create_pidfile(const char *filename);
#ifdef _WIN32
int ffs(int i);
typedef struct {
long tv_sec;
long tv_usec;
} qemu_timeval;
#else
typedef struct timeval qemu_timeval;
#endif /* !_WIN32 */
#else /* VBOX */
# define qemu_memalign(alignment, size) ( (alignment) <= PAGE_SIZE ? RTMemPageAlloc((size)) : NULL )
#endif /* VBOX */
#endif