structs.h revision 27268f5d1d723d53b107fd3c0672cec7d752ca74
/* $Id$ */
/** @file
* VBox Recompiler - structure offset tables.
*
* Used by op.c and VBoxRecompiler.c to verify they have the
* same understanding of the internal structures when using
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#if REM_STRUCT_OP
/*
* we're in op.c
*/
#else /* !REM_STRUCT_OP */
/*
* We're in VBoxRecompiler.c.
*/
# define REM_STRUCT_TABLE(strct) \
extern const int g_aiOpStruct_ ## strct []; \
\
/** Matches the My and Op tables for a strct. */
# define ASSERT_STRUCT_TABLE(strct) \
(#strct "[%d] - %d != %d - %s\n", \
i, \
g_aiOpStruct_ ## strct [i], \
/** Struct check entry. */
typedef struct REMSTRUCTENTRY
{
int iValue;
const char *pszExpr;
#endif /* !REM_STRUCT_OP */
{
REM_SIZEOF(char),
REM_SIZEOF(short),
REM_SIZEOF(int),
REM_SIZEOF(long),
REM_SIZEOF(float),
REM_SIZEOF(double),
REM_SIZEOF(long double),
REM_SIZEOF(void *),
REM_SIZEOF(char *),
REM_SIZEOF(short *),
REM_SIZEOF(long *),
REM_THE_END(char)
};
{
};
{
};
{
};
{
REM_OFFSETOF(MMXReg, q),
};
{
//REM_OFFSETOF(float_status, float_detect_tininess),
//REM_OFFSETOF(float_status, float_exception_flags),
};
{
REM_OFFSETOF(float32u, f),
REM_SIZEOFMEMB(float32u, f),
REM_OFFSETOF(float32u, i),
REM_SIZEOFMEMB(float32u, i),
};
{
REM_OFFSETOF(float64u, f),
REM_SIZEOFMEMB(float64u, f),
REM_OFFSETOF(float64u, i),
REM_SIZEOFMEMB(float64u, i),
};
{
REM_OFFSETOF(floatx80u, f),
REM_SIZEOFMEMB(floatx80u, f),
REM_OFFSETOF(floatx80u, i),
REM_SIZEOFMEMB(floatx80u, i),
};
{
/* cpu-defs.h */
};