GIMR0Hv.cpp revision 63ff009f4d6033ac5e3557c9c5ec0329ed5c0a19
/* $Id$ */
/** @file
* Guest Interface Manager (GIM), Hyper-V - Host Context Ring-0.
*/
/*
* Copyright (C) 2014 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_GIM
#include "GIMInternal.h"
#include "GIMHvInternal.h"
#include <iprt/spinlock.h>
#if 0
/**
* Allocates and maps one physically contiguous page. The allocated page is
* zero'd out.
*
* @returns IPRT status code.
* @param pMemObj Pointer to the ring-0 memory object.
* @param ppVirt Where to store the virtual address of the
* allocation.
* @param pPhys Where to store the physical address of the
* allocation.
*/
{
if (RT_FAILURE(rc))
return rc;
return VINF_SUCCESS;
}
/**
* Frees and unmaps an allocated physical page.
*
* @param pMemObj Pointer to the ring-0 memory object.
* @param ppVirt Where to re-initialize the virtual address of
* allocation as 0.
* @param pHCPhys Where to re-initialize the physical address of the
* allocation as 0.
*/
{
if (*pMemObj != NIL_RTR0MEMOBJ)
{
*ppVirt = 0;
*pHCPhys = 0;
}
}
#endif
/**
* Updates Hyper-V's reference TSC page.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
* @param u64Offset The computed TSC offset.
* @thread EMT.
*/
{
if (RT_UNLIKELY(!fHvTscEnabled))
return VERR_GIM_PVTSC_NOT_ENABLED;
/*
* Hyper-V reports the reference time in 100 nanosecond units.
*/
/*
* The TSC page can be simulatenously read by other VCPUs in the guest. The
* spinlock is only for protecting simultaneous hypervisor writes from other
* EMTs.
*/
{
else
}
return VINF_SUCCESS;
}
/**
* Does ring-0 per-VM GIM Hyper-V initialization.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
*/
{
return rc;
}
/**
* Does ring-0 per-VM GIM Hyper-V termination.
*
* @returns VBox status code.
* @param pVM Pointer to the VM.
*/
{
return VINF_SUCCESS;
}