tstVMStructSize.cpp revision 37eb780874007e6c73f493edcfd7a1e498a6a2ef
/* $Id$ */
/** @file
* and to verify that HC and GC uses the same
* representation of the structures.
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* 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 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "PDMInternal.h"
#include "CFGMInternal.h"
#include "CPUMInternal.h"
#include "MMInternal.h"
#include "PGMInternal.h"
#include "SELMInternal.h"
#include "TRPMInternal.h"
#include "TMInternal.h"
#include "IOMInternal.h"
#include "REMInternal.h"
#include "SSMInternal.h"
#include "HWACCMInternal.h"
#include "PATMInternal.h"
#include "VMMInternal.h"
#include "DBGFInternal.h"
#include "STAMInternal.h"
#include "VMInternal.h"
#include "CSAMInternal.h"
#include "EMInternal.h"
#include "REMInternal.h"
#include "tstHelp.h"
#include <stdio.h>
int main()
{
int rc = 0;
printf("tstVMStructSize: TESTING\n");
#define CHECK_PADDING_VM(member) \
do \
{ \
} while (0)
#define CHECK_CPUMCTXCORE(member) \
do { \
{ \
rc++; \
} \
} while (0)
do \
{ \
printf("%s::%s offset %#x (%d) sizeof %d\n", #strct, #member, (int)RT_OFFSETOF(strct, member), (int)RT_OFFSETOF(strct, member), (int)RT_SIZEOFMEMB(strct, member)); \
} while (0)
{
printf("SELM:Tss is crossing a page!\n");
rc++;
}
if ((RT_OFFSETOF(VM, selm.s.TssTrap08) & PAGE_OFFSET_MASK) > PAGE_SIZE - sizeof(pVM->selm.s.TssTrap08))
{
printf("SELM:TssTrap08 is crossing a page!\n");
rc++;
}
/* cpumctx */
#if HC_ARCH_BITS == 32
/* CPUMHOSTCTX - lss pair */
{
printf("error: CPUMHOSTCTX lss has been split up!\n");
rc++;
}
#endif
/* pdm */
/* misc */
#if 0
#endif
/*
* Compare HC and GC.
*/
printf("tstVMStructSize: Comparing HC and GC...\n");
#include "tstVMStructGC.h"
/*
* Report result.
*/
if (rc)
else
printf("tstVMStructSize: SUCCESS\n");
return rc;
}