#include <const.h>
Go to the source code of this file.
Data Structures | |||||||||||
struct | atomic | ||||||||||
The atomic variable structure. More... | |||||||||||
Defines | |||||||||||
#define | rdtsc(low, high) __asm__ __volatile__( "rdtsc" : "=a"(low), "=d"(high) ) | ||||||||||
Read the timestamp counter from the model-specific register and put it into two 32-bit registers. | |||||||||||
#define | rdtscll(val) __asm__ __volatile__( "rdtsc" : "=A"(val) ) | ||||||||||
Read the timestamp counter from the model-specific register and put it into eax:edx registers. This is a 64-bit value. | |||||||||||
#define | wmb() mb() | ||||||||||
A macro equivalent to the function mb(). | |||||||||||
#define | get_eip() ({ void *eip; __asm__("movl $1f,%0\n1:" : "=g" (eip)); eip; }) | ||||||||||
A macro that returns current instruction pointer. | |||||||||||
#define | in inportb | ||||||||||
A macro equivalent to the inportb(word port) function. | |||||||||||
#define | in16 inportw | ||||||||||
A macro equivalent to the inportw(word port) function. | |||||||||||
#define | in32 inportl | ||||||||||
A macro equivalent to the inportl(word port) function. | |||||||||||
#define | out outportb | ||||||||||
A macro equivalent to the outportb(word port, byte val) function. | |||||||||||
#define | out16 outportw | ||||||||||
A macro equivalent to the outportw(word port, word val) function. | |||||||||||
#define | out32 outportl | ||||||||||
A macro equivalent to the outportl(word port, dword val) function. | |||||||||||
#define | inportbm insb | ||||||||||
A macro equivalent to the insb(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | inportwm insw | ||||||||||
A macro equivalent to the insw(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | inportlm insl | ||||||||||
A macro equivalent to the insl(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | outportbm outsb | ||||||||||
A macro equivalent to the outsb(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | outportwm outsw | ||||||||||
A macro equivalent to the outsw(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | outportlm outsl | ||||||||||
A macro equivalent to the outsl(unsigned short port, void * addr, unsigned long count) function. | |||||||||||
#define | atomic_set(v, i) (((v)->counter) = (i)) | ||||||||||
Set the atomic value of v to i (guaranteed only 24 bits)
| |||||||||||
#define | atomic_read(v) ((v)->counter) | ||||||||||
Read the atomic value of v (guaranteed only 24 bits)
| |||||||||||
Typedefs | |||||||||||
typedef atomic | atomic_t | ||||||||||
The atomic variable structure. | |||||||||||
Functions | |||||||||||
__inline__ void | mb () | ||||||||||
Force strict CPU ordering (required for all out-of-order Intel CPUs to preserve the order of execution). | |||||||||||
__inline__ void | enable () | ||||||||||
Enable all interrupts. | |||||||||||
__inline__ void | disable () | ||||||||||
Disable all interrupts. | |||||||||||
__inline__ dword | GET_IF () | ||||||||||
Get the IF (interrupt enable flag) value from the EFLAGS register.
| |||||||||||
__inline__ void | SET_IF (dword IF) | ||||||||||
Set the IF (interrupt enable flag) value into the EFLAGS register.
| |||||||||||
__inline__ byte | inportb (word port) | ||||||||||
Get a byte from an I/O port.
| |||||||||||
__inline__ word | inportw (word port) | ||||||||||
Get a word from an I/O port.
| |||||||||||
__inline__ dword | inportl (word port) | ||||||||||
Get a dword from an I/O port.
| |||||||||||
__inline__ void | outportb (word port, byte val) | ||||||||||
Put a byte to an I/O port.
| |||||||||||
__inline__ void | outportw (word port, word val) | ||||||||||
Put a word to an I/O port.
| |||||||||||
__inline__ void | outportl (word port, dword val) | ||||||||||
Put a dword to an I/O port.
| |||||||||||
void | insb (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of in().
| |||||||||||
void | insw (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of in16().
| |||||||||||
void | insl (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of in32().
| |||||||||||
void | outsb (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of out().
| |||||||||||
void | outsw (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of out16().
| |||||||||||
void | outsl (unsigned short port, void *addr, unsigned long count) | ||||||||||
The string version of out32().
| |||||||||||
__inline__ void | cpuid (int op, int *eax, int *ebx, int *ecx, int *edx) | ||||||||||
Get the CPUID information.
| |||||||||||
__inline__ void | atomic_inc (atomic_t *v) | ||||||||||
Perform an atomic increment.
| |||||||||||
__inline__ void | atomic_dec (atomic_t *v) | ||||||||||
Perform an atomic decrement.
| |||||||||||
__inline__ void | halt () | ||||||||||
Halt the system by disabling the CPU.
| |||||||||||
__inline__ void | breakpoint () | ||||||||||
Perform a breakpoint exeception. |
Definition in file i386.h.