vl_vbox.h revision f7f5cd7b1e530eb5636da51c974b48ae0c1775b3
/* $Id$ */
/** @file
* VBox vl.h Replacement.
*
* Avoid including this file whenever possible.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef ___build_vl_vbox_h
#define ___build_vl_vbox_h
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "VBoxDD.h"
/*
* Misc macros.
*/
#define TARGET_PAGE_BITS (PAGE_SHIFT)
#define TARGET_PAGE_SIZE (PAGE_SIZE)
#define TARGET_PAGE_MASK (~PAGE_OFFSET_MASK)
/*
* Necessary for pckbd and vga.
*/
#define TARGET_I386 1
#ifndef glue
# define _glue(x, y) x ## y
# define tostring(s) #s
#endif
#if defined(_MSC_VER) && !defined(__cplusplus)
#define inline _inline
#endif
#ifdef _MSC_VER
#define __func__ __FUNCTION__
#endif
/*
* Misc types.
*/
typedef RTGCPHYS target_phys_addr_t;
typedef RTGCUINTREG target_ulong;
/*
* Timers.
*/
#define QEMUTimerCB FNTMTIMERQEMU
#define rt_clock TMCLOCK_REAL
#define vm_clock TMCLOCK_VIRTUAL
#define qemu_new_timer(clock, callback, user) (QEMUTimer *)TMR3TimerCreateExternal((PVM)cpu_single_env->pVM, clock, callback, user, __FUNCTION__ )
#define cpu_disable_ticks() ASMBreakpoint()
#define cpu_enable_ticks() ASMBreakpoint()
#define cpu_calibrate_ticks() do {} while (0)
#define init_timers() do {} while (0)
#define quit_timers() do {} while (0)
#ifdef IN_RING3
/*
* Saved state.
*/
{
}
{
}
{
}
{
}
{
}
#endif /* IN_RING3 */
/*
* Memory access.
*/
{
return p[0] | (p[1] << 8);
}
/*
* Misc.
*/
#ifdef _MSC_VER
/**
* ffs -- vax ffs instruction
*/
{
int bit;
if (mask == 0)
return(0);
mask >>= 1;
return(bit);
}
#endif /* _MSC_VER */
/* bswap.h */
#ifdef _MSC_VER
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
{
return ((uint16_t)( \
}
{ \
return ((uint32_t)( \
}
{ \
return ((uint64_t)( \
}
#else
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN 1234
#endif
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#define bswap_16(x) \
(__extension__ ({ \
((uint16_t)( \
}))
#define bswap_32(x) \
(__extension__ ({ \
((uint32_t)( \
}))
#define bswap_64(x) \
(__extension__ ({ \
((uint64_t)( \
}))
#endif
#ifndef bswap16
{
return bswap_16(x);
}
#endif
#ifndef bswap32
{
return bswap_32(x);
}
#endif
#ifndef bswap64
{
return bswap_64(x);
}
#endif
{
*s = bswap16(*s);
}
{
*s = bswap32(*s);
}
{
*s = bswap64(*s);
}
{\
}\
\
{\
}\
\
{\
NOREF(p); \
}\
\
{\
NOREF(p); \
}\
\
{\
}\
\
{\
}
#define cpu_to_le16wu(p, v) cpu_to_le16w(p, v)
#define cpu_to_le32wu(p, v) cpu_to_le32w(p, v)
#define le16_to_cpupu(p) le16_to_cpup(p)
#define le32_to_cpupu(p) le32_to_cpup(p)
#define cpu_to_be16wu(p, v) cpu_to_be16w(p, v)
#define cpu_to_be32wu(p, v) cpu_to_be32w(p, v)
#define cpu_to_32wu cpu_to_le32wu
/* end of bswap.h */
#endif