StuBS
tsc.cc File Reference
#include "tsc.h"
#include "machine/core.h"
#include "machine/cpuid.h"
#include "machine/pit.h"
#include "debug/output.h"
Include dependency graph for tsc.cc:

Namespaces

namespace  TSC
 Access to the Timestamp Counter (of the current Core)
 

Functions

static uint32_t TSC::ticksByProcessorInfo (void)
 Calculate the TSC frequency, if possible.
 
static uint32_t TSC::ticksByPIT (void)
 Measure the TSC frequency using PIT.
 
uint32_t TSC::ticks (bool use_pit=false)
 Gather the TSC frequency in ticks per milliseconds.
 
bool TSC::available (Instruction instruction=RDTSC)
 Check availability of TSC.
 
uint64_t TSC::nanoseconds (uint64_t delta)
 Convert a timestamp delta value to nanoseconds.
 
void TSC::delay (uint64_t us)
 Actively wait the provided waiting time.
 

Constants

static uint32_t TSC::ticks_value = 0