Static Public Member Functions

Cpu Class Reference

Cpu abstraction with inline asm. More...

#include <cpu.h>

List of all members.

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)
static unsigned bsf (unsigned value)
static unsigned minshift (unsigned long start, unsigned long size, unsigned minshift=31)
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.

Detailed Description

Cpu abstraction with inline asm.

Copyright (C) 2007-2010, Bernhard Kauer <bk@vmmon.org> Economic rights: Technische Universitaet Dresden (Germany)

This file is part of Vancouver and was developed for Vancouver.

Vancouver is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Vancouver is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details.


Member Function Documentation

template<typename T >
static void Cpu::atomic_and ( T *  ptr,
value 
) [inline, static]
template<typename T >
static void Cpu::atomic_or ( T *  ptr,
value 
) [inline, static]
static void Cpu::atomic_set_bit ( unsigned *  vector,
unsigned  bit,
bool  value = true 
) [inline, static]
template<typename T , typename Y >
static T Cpu::atomic_xadd ( T volatile *  ptr,
value 
) [inline, static]
static unsigned Cpu::bsf ( unsigned  value  )  [inline, static]
static unsigned Cpu::bsr ( unsigned  value  )  [inline, static]
static unsigned Cpu::cmpxchg4b ( unsigned *  var,
unsigned  oldvalue,
unsigned  newvalue 
) [inline, static]
static unsigned Cpu::cmpxchg4b ( volatile void *  var,
unsigned  oldvalue,
unsigned  newvalue 
) [inline, static]
static unsigned long long Cpu::cmpxchg8b ( void *  var,
unsigned long long  oldvalue,
unsigned long long  newvalue 
) [inline, static]
static unsigned long long Cpu::cmpxchg8b ( volatile void *  var,
unsigned long long  oldvalue,
unsigned long long  newvalue 
) [inline, static]
static unsigned Cpu::cpuid ( unsigned  eax,
unsigned &  ebx,
unsigned &  ecx,
unsigned &  edx 
) [inline, static]
static bool Cpu::get_bit ( unsigned *  vector,
unsigned  bit 
) [inline, static]
static unsigned Cpu::minshift ( unsigned long  start,
unsigned long  size,
unsigned  minshift = 31 
) [inline, static]
template<unsigned operand_size>
static void Cpu::move ( void *  tmp_dst,
void *  tmp_src 
) [inline, static]
static void Cpu::move ( void *  tmp_dst,
void *  tmp_src,
unsigned  order 
) [inline, static]

Transfer bytes from src to dst.

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

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines