tstVMMR0CallHost-1.cpp revision 5c0c16a890a7447da4713a5e3eac208cbff325fe
/* $Id$ */
/** @file
* Testcase for the VMMR0JMPBUF operations.
*/
/*
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define IN_VMM_R0
#define IN_RING0 /* pretent we're in Ring-0 to get the prototypes. */
#include "VMMInternal.h"
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** The jump buffer. */
static VMMR0JMPBUF g_Jmp;
/** The saved stack. */
{
if ((i % 7) == 0)
{
if (!rc)
return i + 10000;
return -1;
}
return i;
}
{
if (i < 0 || i > 8192)
{
RTPrintf("tstVMMR0CallHost-1: FAILURE - i=%d is out of range [0..8192]\n", i);
return 1;
}
if (i2 != 0)
{
return 1;
}
{
return 1;
}
return 0;
}
{
{
{
return 1;
}
}
return 0;
}
int main()
{
/*
* Init.
*/
RTR3Init();
RTPrintf("tstVMMR0CallHost-1: Testing...\n");
/*
* Try about 1000 long jumps with increasing stack size..
*/
if (!rc)
if (!rc)
RTPrintf("tstVMMR0CallHost-1: SUCCESS\n");
else
RTPrintf("tstVMMR0CallHost-1: FAILED\n");
return !!rc;
}