PGMDbg.cpp revision 56c9a42f56ef04b3f01d84e7ea8277f255899e72
/* $Id$ */
/** @file
* PGM - Page Manager and Monitor - Debugger & Debugging APIs.
*/
/*
* Copyright (C) 2006-2007 innotek 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include "PGMInternal.h"
/**
* Converts a HC pointer to a GC physical address.
*
* Only for the debugger.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success, *pGCPhys is set.
* @retval VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
*
* @param pVM The VM handle.
* @param HCPtr The HC pointer to convert.
* @param pGCPhys Where to store the GC physical address on success.
*/
{
#ifdef NEW_PHYS_CODE
*pGCPhys = NIL_RTGCPHYS;
return VERR_NOT_IMPLEMENTED;
#else
pRam;
{
{
{
{
if (off < PGM_DYNAMIC_CHUNK_SIZE)
{
return VINF_SUCCESS;
}
}
}
}
{
{
return VINF_SUCCESS;
}
}
}
return VERR_INVALID_POINTER;
#endif
}
/**
* Converts a HC pointer to a GC physical address.
*
* @returns VBox status code.
* @retval VINF_SUCCESS on success, *pHCPhys is set.
* @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid GC physical page but has no physical backing.
* @retval VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
*
* @param pVM The VM handle.
* @param HCPtr The HC pointer to convert.
* @param pHCPhys Where to store the HC physical address on success.
*/
{
#ifdef NEW_PHYS_CODE
*pHCPhys = NIL_RTHCPHYS;
return VERR_NOT_IMPLEMENTED;
#else
pRam;
{
{
{
{
if (off < PGM_DYNAMIC_CHUNK_SIZE)
{
if (PGM_PAGE_IS_RESERVED(pPage))
return VERR_PGM_PHYS_PAGE_RESERVED;
| (off & PAGE_OFFSET_MASK);
return VINF_SUCCESS;
}
}
}
}
{
{
if (PGM_PAGE_IS_RESERVED(pPage))
return VERR_PGM_PHYS_PAGE_RESERVED;
| (off & PAGE_OFFSET_MASK);
return VINF_SUCCESS;
}
}
}
return VERR_INVALID_POINTER;
#endif
}
/**
* Converts a HC physical address to a GC physical address.
*
* Only for the debugger.
*
* @returns VBox status code
* @retval VINF_SUCCESS on success, *pGCPhys is set.
* @retval VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory.
*
* @param pVM The VM handle.
* @param HCPhys The HC physical address to convert.
* @param pGCPhys Where to store the GC physical address on success.
*/
{
/*
* Validate and adjust the input a bit.
*/
if (HCPhys == NIL_RTHCPHYS)
return VERR_INVALID_POINTER;
if (HCPhys == 0)
return VERR_INVALID_POINTER;
pRam;
{
while (iPage-- > 0)
{
return VINF_SUCCESS;
}
}
return VERR_INVALID_POINTER;
}