CPUMRC.cpp revision 37fb67be7d1d328213aeda3f56ab5aacd37416d1
/* $Id$ */
/** @file
* CPUM - Guest Context Code.
*/
/*
* 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include "CPUMInternal.h"
/*******************************************************************************
* Internal Functions *
*******************************************************************************/
RT_C_DECLS_BEGIN /* addressed from asm (not called so no DECLASM). */
/**
* Deal with traps occurring during segment loading and IRET
* when resuming guest context.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
* @param pRegFrame The register frame.
* @param uUser User argument. In this case a combination of the
* CPUM_HANDLER_* \#defines.
*/
{
Log(("********************************************************\n"));
Log(("********************************************************\n"));
/*
* Update the guest cpu state.
*/
if (uUser & CPUM_HANDLER_CTXCORE_IN_EBP)
{
}
/*
* Take action based on what's happened.
*/
switch (uUser & CPUM_HANDLER_TYPEMASK)
{
case CPUM_HANDLER_GS:
// if (!pVM->cpum.s.Guest.ldtr)
// {
// pRegFrame->gs = 0;
// pRegFrame->eip += 6; /* mov gs, [edx + CPUM.Guest.gs] */
// return VINF_SUCCESS;
// }
case CPUM_HANDLER_DS:
case CPUM_HANDLER_ES:
case CPUM_HANDLER_FS:
break;
/* Make sure we restore the guest context from the interrupt stack frame. */
case CPUM_HANDLER_IRET:
{
/* Sync general purpose registers */
*pGstCtxCore = *pRegFrame;
{
}
break;
}
}
return VERR_TRPM_DONT_PANIC;
}