Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Cpu_lock Class Reference

Global CPU lock. More...

#include <cpu_lock.h>

List of all members.

Public Types

typedef Mword Status
 The return type of test methods.

Public Member Functions

 Cpu_lock ()
 ctor.
Status test () const
 Test if the lock is already held.
void lock ()
 Acquire the CPU lock.
void clear ()
 Release the CPU lock.
Status test_and_set ()
 Acquire the CPU lock and return the old status.
void set (Status state)
 Set the CPU lock according to the given status.

Private Member Functions

 Cpu_lock (const Cpu_lock &)
 Default copy constructor not implemented.


Detailed Description

Global CPU lock.

When held, irqs are disabled on the current CPU (preventing nested irq handling, and preventing the current thread from being preempted). It must only be held for very short amounts of time.

A generic (cli, sti) implementation of the lock can be found in cpu_lock-generic.cpp.


Member Typedef Documentation

typedef Mword Cpu_lock::Status
 

The return type of test methods.


Constructor & Destructor Documentation

Cpu_lock::Cpu_lock  )  [inline]
 

ctor.

Cpu_lock::Cpu_lock const Cpu_lock  )  [private]
 

Default copy constructor not implemented.


Member Function Documentation

void Cpu_lock::clear  )  [inline]
 

Release the CPU lock.

void Cpu_lock::lock  )  [inline]
 

Acquire the CPU lock.

The CPU lock disables IRQ's it should be held only for a very short amount of time.

void Cpu_lock::set Status  state  )  [inline]
 

Set the CPU lock according to the given status.

Parameters:
state the state to set (0 clear, else lock).

Cpu_lock::Status Cpu_lock::test  )  const [inline]
 

Test if the lock is already held.

Returns:
0 if the lock is not held, not 0 if it already is held.

Cpu_lock::Status Cpu_lock::test_and_set  )  [inline]
 

Acquire the CPU lock and return the old status.

Returns:
something else that 0 if the lock was already held and 0 if it was not held.


The documentation for this class was generated from the following file:
Generated on Mon Sep 26 14:20:14 2005 for Fiasco by  doxygen 1.4.2