hm.h revision ae20b83f0c94402a3e3ac021c3d4e5f827e4905c
/** @file
*/
/*
* Copyright (C) 2006-2013 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifndef ___VBox_vmm_hm_h
#define ___VBox_vmm_hm_h
/** @defgroup grp_hm The VM Hardware Manager API
* @{
*/
/**
*
* @retval @c true if used.
* @retval @c false if software virtualization (raw-mode) is used.
*
* @param a_pVM The cross context VM structure.
* @sa HMIsEnabledNotMacro, HMR3IsEnabled
* @internal
*/
#if defined(VBOX_STRICT) && defined(IN_RING3)
#else
#endif
/**
* Checks whether raw-mode context is required for any purpose.
*
* @retval @c true if required either by raw-mode itself or by HM for doing
* switching the cpu to 64-bit mode.
* @retval @c false if not required.
*
* @param a_pVM The cross context VM structure.
* @internal
*/
#if HC_ARCH_BITS == 64
#else
#endif
/**
* Check if the current CPU state is valid for emulating IO blocks in the recompiler
*
* @returns boolean
* @param a_pVCpu Pointer to the shared virtual CPU structure.
* @internal
*/
/**
* Check if the current CPU state is valid for emulating IO blocks in the recompiler
*
* @returns boolean
* @param a_pCtx Pointer to the CPU context (within PVM).
* @internal
*/
#ifndef IN_RC
#else /* Nops in RC: */
# define HMFlushTLB(pVCpu) do { } while (0)
# define HMIsNestedPagingActive(pVM) false
# define HMFlushTLBOnAllVCpus(pVM) do { } while (0)
#endif
#ifdef IN_RING0
/** @defgroup grp_hm_r0 The VM Hardware Manager API
* @ingroup grp_hm
* @{
*/
VMMR0_INT_DECL(int) HMR0Init(void);
VMMR0_INT_DECL(int) HMR0Term(void);
VMMR0_INT_DECL(void) HMR0SavePendingIOPortWrite(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext,
VMMR0_INT_DECL(void) HMR0SavePendingIOPortRead(PVMCPU pVCpu, RTGCPTR GCPtrRip, RTGCPTR GCPtrRipNext,
/** @} */
#endif /* IN_RING0 */
#ifdef IN_RING3
/** @defgroup grp_hm_r3 The VM Hardware Manager API
* @ingroup grp_hm
* @{
*/
VMMR3_INT_DECL(void) HMR3PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode, PGMMODE enmGuestMode);
/** @} */
#endif /* IN_RING3 */
#ifdef IN_RING0
/** @addtogroup grp_hm_r0
* @{
*/
VMMR0_INT_DECL(bool) HMR0SuspendPending(void);
# endif
/** @} */
#endif /* IN_RING0 */
/** @} */
#endif