IOMInline.h revision 68b6f6be3501c8a658944893fee17fb6df5c3ad1
/* $Id$ */
/** @file
* IOM - Inlined functions.
*/
/*
* Copyright (C) 2006-2012 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.
*/
#ifndef ___IOMInline_h
#define ___IOMInline_h
/** @addtogroup grp_iom_int Internals
* @internal
* @{
*/
/**
* Gets the I/O port range for the specified I/O port in the current context.
*
* @returns Pointer to I/O port range.
* @returns NULL if no port registered.
*
* @param pVM Pointer to the VM.
* @param Port The I/O port lookup.
*/
{
return (CTX_SUFF(PIOMIOPORTRANGE))RTAvlroIOPortRangeGet(&pVM->iom.s.CTX_SUFF(pTrees)->CTX_SUFF(IOPortTree), Port);
}
/**
* Gets the I/O port range for the specified I/O port in the HC.
*
* @returns Pointer to I/O port range.
* @returns NULL if no port registered.
*
* @param pVM Pointer to the VM.
* @param Port The I/O port to lookup.
*/
{
}
/**
* Gets the MMIO range for the specified physical address in the current context.
*
* @returns Pointer to MMIO range.
* @returns NULL if address not in a MMIO range.
*
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the virtual CPU structure of the caller.
* @param GCPhys Physical address to lookup.
*/
{
if ( !pRange
return pRange;
}
/**
* Retain a MMIO range.
*
* @param pRange The range to release.
*/
{
}
/**
* Gets the referenced MMIO range for the specified physical address in the
* current context.
*
* @returns Pointer to MMIO range.
* @returns NULL if address not in a MMIO range.
*
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the virtual CPU structure of the caller.
* @param GCPhys Physical address to lookup.
*/
{
if ( !pRange
if (pRange)
return pRange;
}
/**
* Releases a MMIO range.
*
* @param pVM Pointer to the VM.
* @param pRange The range to release.
*/
{
if (!cRefs)
}
#ifdef VBOX_STRICT
/**
* Gets the MMIO range for the specified physical address in the current context.
*
* @returns Pointer to MMIO range.
* @returns NULL if address not in a MMIO range.
*
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the virtual CPU structure of the caller.
* @param GCPhys Physical address to lookup.
*/
{
if ( !pRange
return pRange;
}
#endif /* VBOX_STRICT */
#ifdef VBOX_WITH_STATISTICS
/**
* Gets the MMIO statistics record.
*
* return the appropriate status to defer the operation to ring-3.
*
* @returns Pointer to MMIO stats.
*
* @param pVM Pointer to the VM.
* @param pVCpu Pointer to the virtual CPU structure of the caller.
* @param GCPhys Physical address to lookup.
* @param pRange The MMIO range.
*
* @remarks The caller holds the IOM critical section with shared access prior
* to calling this method. Upon return, the lock has been released!
* This is ugly, but it's a necessary evil since we cannot upgrade read
* locks to write locks and the whole purpose here is calling
* iomR3MMIOStatsCreate.
*/
DECLINLINE(PIOMMMIOSTATS) iomMmioGetStats(PVM pVM, PVMCPU pVCpu, RTGCPHYS GCPhys, PIOMMMIORANGE pRange)
{
/* For large ranges, we'll put everything on the first byte. */
if ( !pStats
{
# ifdef IN_RING3
if (!pStats)
{
}
# endif
}
return pStats;
}
#endif /* VBOX_WITH_STATISTICS */
/** @} */
#endif