NOVA User-Level Environment  Version testbox/changed-memory-timing-317-g320d8b5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Cpu Class Reference

#include <cpu.h>

Static Public Member Functions

static void pause ()
template<typename T >
static void atomic_and (T *ptr, T value)
template<typename T >
static void atomic_or (T *ptr, T value)
static void atomic_set_bit (unsigned *vector, unsigned bit, bool value=true)
static void set_bit (unsigned *vector, unsigned bit, bool value=true)
static bool get_bit (unsigned *vector, unsigned bit)
template<typename T >
static T xchg (volatile T *x, T y)
static unsigned cmpxchg4b (unsigned *var, unsigned oldvalue, unsigned newvalue)
static unsigned cmpxchg4b (volatile void *var, unsigned oldvalue, unsigned newvalue)
static unsigned long long cmpxchg8b (void *var, unsigned long long oldvalue, unsigned long long newvalue)
static unsigned long long cmpxchg8b (volatile void *var, unsigned long long oldvalue, unsigned long long newvalue)
template<typename T , typename Y >
static T atomic_xadd (T volatile *ptr, Y value)
static unsigned long long rdtsc ()
static unsigned bsr (unsigned value)
 Finds the position of the most significant "1" bit.
static unsigned bsf (unsigned value)
 Finds the position of the least significant "1" bit.
static unsigned minshift (unsigned long start, unsigned long size)
 Calculates the order (log2 of the size) of the largest naturally aligned block that starts at start and is no larger than size.
static unsigned maxalign (unsigned long offset, unsigned long begin, unsigned long begin2, unsigned long size)
static int popcount (unsigned int v)
static int popcount (unsigned long v)
static unsigned cpuid (unsigned eax, unsigned &ebx, unsigned &ecx, unsigned &edx)
template<unsigned operand_size>
static void move (void *tmp_dst, void *tmp_src)
static void move (void *tmp_dst, void *tmp_src, unsigned order)
 Transfer bytes from src to dst.

Member Function Documentation

template<typename T >
static void Cpu::atomic_and ( T *  ptr,
value 
)
inlinestatic
template<typename T >
static void Cpu::atomic_or ( T *  ptr,
value 
)
inlinestatic
static void Cpu::atomic_set_bit ( unsigned *  vector,
unsigned  bit,
bool  value = true 
)
inlinestatic
template<typename T , typename Y >
static T Cpu::atomic_xadd ( T volatile *  ptr,
value 
)
inlinestatic
static unsigned Cpu::bsf ( unsigned  value)
inlinestatic

Finds the position of the least significant "1" bit.

static unsigned Cpu::bsr ( unsigned  value)
inlinestatic

Finds the position of the most significant "1" bit.

static unsigned Cpu::cmpxchg4b ( unsigned *  var,
unsigned  oldvalue,
unsigned  newvalue 
)
inlinestatic
static unsigned Cpu::cmpxchg4b ( volatile void *  var,
unsigned  oldvalue,
unsigned  newvalue 
)
inlinestatic
static unsigned long long Cpu::cmpxchg8b ( void *  var,
unsigned long long  oldvalue,
unsigned long long  newvalue 
)
inlinestatic
static unsigned long long Cpu::cmpxchg8b ( volatile void *  var,
unsigned long long  oldvalue,
unsigned long long  newvalue 
)
inlinestatic
static unsigned Cpu::cpuid ( unsigned  eax,
unsigned &  ebx,
unsigned &  ecx,
unsigned &  edx 
)
inlinestatic
static bool Cpu::get_bit ( unsigned *  vector,
unsigned  bit 
)
inlinestatic
static unsigned Cpu::maxalign ( unsigned long  offset,
unsigned long  begin,
unsigned long  begin2,
unsigned long  size 
)
inlinestatic
static unsigned Cpu::minshift ( unsigned long  start,
unsigned long  size 
)
inlinestatic

Calculates the order (log2 of the size) of the largest naturally aligned block that starts at start and is no larger than size.

Parameters
minshiftThe largest value returned by this function.
Returns
The calculated order or the minshift parameter is it is smaller then the order.
template<unsigned operand_size>
static void Cpu::move ( void *  tmp_dst,
void *  tmp_src 
)
inlinestatic
static void Cpu::move ( void *  tmp_dst,
void *  tmp_src,
unsigned  order 
)
inlinestatic

Transfer bytes from src to dst.

static void Cpu::pause ( )
inlinestatic
static int Cpu::popcount ( unsigned int  v)
inlinestatic
static int Cpu::popcount ( unsigned long  v)
inlinestatic
static unsigned long long Cpu::rdtsc ( )
inlinestatic
static void Cpu::set_bit ( unsigned *  vector,
unsigned  bit,
bool  value = true 
)
inlinestatic
template<typename T >
static T Cpu::xchg ( volatile T *  x,
y 
)
inlinestatic

The documentation for this class was generated from the following file: