TMAllCpu.cpp revision 7fb17fb4d1733756903db7f4daebced09bf30777
/* $Id$ */
/** @file
* TM - Timeout Manager, CPU Time, All Contexts.
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung 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.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include "TMInternal.h"
/**
* Gets the raw cpu tick from current virtual time.
*/
{
if (u64 != TMCLOCK_FREQ_VIRTUAL)
return u64;
}
/**
* Resumes the CPU timestamp counter ticking.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
{
{
{
else
}
return VINF_SUCCESS;
}
AssertFailed();
return VERR_INTERNAL_ERROR;
}
/**
* Pauses the CPU timestamp counter ticking.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
*/
{
{
return VINF_SUCCESS;
}
AssertFailed();
return VERR_INTERNAL_ERROR;
}
/**
* Returns the TSC offset
*
* @returns TSC ofset
* @param pVM The VM to operate on.
*/
{
}
/**
* Read the current CPU timstamp counter.
*
* @returns Gets the CPU tsc.
* @param pVM The VM to operate on.
*/
{
{
{
u64 = ASMReadTSC();
else
}
else
u64 = ASMReadTSC();
}
else
return u64;
}
/**
* Sets the current CPU timestamp counter.
*
* @returns VBox status code.
* @param pVM The VM to operate on.
* @param u64Tick The new timestamp value.
*/
{
return VINF_SUCCESS;
}
/**
* Get the timestamp frequency.
*
* @returns Number of ticks per second.
* @param pVM The VM.
*/
{
{
return cTSCTicksPerSecond;
}
}