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

L4_uid Class Reference

L4 unique ID. More...

#include <l4_types.h>

List of all members.

Public Types

enum  { Invalid = 0xffffffff, Nil = 0x00000000 }
 The standard IDs. More...
enum  { Max_tasks = 1 << Task_size }
 must be constant since we build the spaces array from it More...

Public Member Functions

 L4_uid ()
 Create an uninitialized UID.
 L4_uid (Address addr, Address tcb_base, Address tcb_size)
 Create an UID from an virtual address.
unsigned version () const
 Extract the version part of the UID.
LThread_num lthread () const
 Extract the task local thread-number.
GThread_num gthread () const
 Extract the system global thread-number.
void version (unsigned)
 Set the version part.
void lthread (LThread_num)
 Set the local thread-number.
Mword is_nil () const
 Is this a NIL ID?
Mword is_invalid () const
 Is this the INVALID ID?
Mword is_irq () const
 Is this a IRQ ID?
Mword irq () const
 Get the IRQ number.
L4_uid preemption_id () const
 Return preemption ID corresponding to ID.
bool operator== (L4_uid o) const
 Test for equality.
bool operator!= (L4_uid o) const
 Test for inequality.
 L4_uid (Task_num task, LThread_num lthread)
 Create a UID for the given task and thread.
Task_num task () const
 Extract the task number.
void task (Task_num)
 Set the task number.
Task_num chief () const
 Extract the chief ID.
void chief (Task_num)
L4_uid task_id () const
bool abs_rcv_timeout () const
 Check if receive timeout is absolute.
bool abs_snd_timeout () const
 Check if send timeout is absolute.
bool abs_rcv_clock () const
 Check if receive timeout clock bit set.
bool abs_snd_clock () const
 Check if send timeout clock bit set.
bool next_period () const
 Check if next_period bit is set.
bool is_preemption () const
 Check if ID is a preemption ID.
Unsigned64 raw () const
 Extract the raw 64Bit representation.
 L4_uid (Unsigned64)
 Create an L4-V2 UID from the raw 64Bit representation.
 L4_uid (Task_num task, LThread_num lthread, unsigned site, Task_num chief, unsigned nest=0, unsigned version=0)
 Create an L4-V2 UID.
unsigned site () const
 Extract the V2-specific site ID.
void site (unsigned)
 Set the V2-specific site ID.
unsigned nest () const
 Extract the V2-specific Clans & Chiefs nesting level.
void nest (unsigned)
 Set the V2-specific Clans & Chiefs nesting level.
Task_num d_task ()
void d_task (Mword num)
LThread_num d_thread ()
void d_thread (Mword num)
void print (int task_format=0) const

Static Public Member Functions

static L4_uid irq (unsigned irq)
 Get the L4 UID for the given IRQ.
static unsigned const threads_per_task ()
 Get the maximum number of threads per task.
static Mword const max_threads ()
 Get number of threads in the system.
static Unsigned32 lthread_from_gthread (GThread_num g)
static Unsigned32 task_from_gthread (GThread_num g)

Private Types

enum  {
  Abs_rcv_mask = 0x1, Abs_snd_mask = 0x2, Abs_rcv_clock = 0x4, Abs_snd_clock = 0x8,
  Next_period = 0x10, Preemption_id = 0x20
}
 Bits used for absolute timeouts and RT scheduling. More...
enum  {
  Irq_mask = 0x00000000000000ffULL, Low_mask = 0x00000000ffffffffULL, Nil_mask = Low_mask, Version_low_mask = 0x00000000000003ffULL,
  Version_low_shift = 0, Version_low_size = 10, Lthread_mask = 0x000000000001fc00ULL, Lthread_shift = Version_low_shift + Version_low_size,
  Lthread_size = 7, Task_mask = 0x000000000ffe0000ULL, Task_shift = Lthread_shift + Lthread_size, Task_size = 11,
  Version_high_mask = 0x00000000f0000000ULL, Version_high_shift = Task_shift + Task_size, Version_high_size = 4, Site_mask = 0x0001ffff00000000ULL,
  Site_shift = Version_high_shift + Version_high_size, Site_size = 17, Chief_mask = 0x0ffe000000000000ULL, Chief_shift = Site_shift + Site_size,
  Chief_size = 11, Nest_mask = 0xf000000000000000ULL, Nest_shift = Chief_shift + Chief_size, Nest_size = 4
}

Private Attributes

Unsigned64 _raw


Detailed Description

L4 unique ID.

This class encapsulates UIDs in L4. Theese IDs are used for threads, tasks, and IRQs.

This is the general interface to access L4 Version 2 and also L4 Version X.0 UIDs, like specified in the resp. L4 reference manuals.


Member Enumeration Documentation

anonymous enum [private]
 

Bits used for absolute timeouts and RT scheduling.

Enumeration values:
Abs_rcv_mask 
Abs_snd_mask 
Abs_rcv_clock 
Abs_snd_clock 
Next_period 
Preemption_id 

anonymous enum
 

The standard IDs.

Enumeration values:
Invalid  The Invalid ID.
Nil  The Nil ID.

anonymous enum [private]
 

Enumeration values:
Irq_mask 
Low_mask 
Nil_mask 
Version_low_mask 
Version_low_shift 
Version_low_size 
Lthread_mask 
Lthread_shift 
Lthread_size 
Task_mask 
Task_shift 
Task_size 
Version_high_mask 
Version_high_shift 
Version_high_size 
Site_mask 
Site_shift 
Site_size 
Chief_mask 
Chief_shift 
Chief_size 
Nest_mask 
Nest_shift 
Nest_size 

anonymous enum
 

must be constant since we build the spaces array from it

Enumeration values:
Max_tasks 


Constructor & Destructor Documentation

L4_uid::L4_uid  )  [inline]
 

Create an uninitialized UID.

L4_uid::L4_uid Address  addr,
Address  tcb_base,
Address  tcb_size
[inline]
 

Create an UID from an virtual address.

L4_uid::L4_uid Task_num  task,
LThread_num  lthread
[inline]
 

Create a UID for the given task and thread.

L4_uid::L4_uid Unsigned64   )  [inline]
 

Create an L4-V2 UID from the raw 64Bit representation.

L4_uid::L4_uid Task_num  task,
LThread_num  lthread,
unsigned  site,
Task_num  chief,
unsigned  nest = 0,
unsigned  version = 0
[inline]
 

Create an L4-V2 UID.


Member Function Documentation

bool L4_uid::abs_rcv_clock  )  const [inline]
 

Check if receive timeout clock bit set.

bool L4_uid::abs_rcv_timeout  )  const [inline]
 

Check if receive timeout is absolute.

bool L4_uid::abs_snd_clock  )  const [inline]
 

Check if send timeout clock bit set.

bool L4_uid::abs_snd_timeout  )  const [inline]
 

Check if send timeout is absolute.

void L4_uid::chief Task_num   )  [inline]
 

Task_num L4_uid::chief  )  const [inline]
 

Extract the chief ID.

void L4_uid::d_task Mword  num  ) 
 

Task_num L4_uid::d_task  ) 
 

void L4_uid::d_thread Mword  num  ) 
 

LThread_num L4_uid::d_thread  ) 
 

GThread_num L4_uid::gthread  )  const [inline]
 

Extract the system global thread-number.

Mword L4_uid::irq  )  const [inline]
 

Get the IRQ number.

Precondition:
is_irq() must return true, or the result is unpredictable.
Returns:
the IRQ number for the L4 IRQ ID.

L4_uid L4_uid::irq unsigned  irq  )  [inline, static]
 

Get the L4 UID for the given IRQ.

Mword L4_uid::is_invalid  )  const [inline]
 

Is this the INVALID ID?

Returns:
0 if this is not the INVALID ID, not 0 else.

Mword L4_uid::is_irq  )  const [inline]
 

Is this a IRQ ID?

Mword L4_uid::is_nil  )  const [inline]
 

Is this a NIL ID?

Returns:
0 if this is not the NIL ID, not 0 else.

bool L4_uid::is_preemption  )  const [inline]
 

Check if ID is a preemption ID.

void L4_uid::lthread LThread_num   )  [inline]
 

Set the local thread-number.

LThread_num L4_uid::lthread  )  const [inline]
 

Extract the task local thread-number.

Unsigned32 L4_uid::lthread_from_gthread GThread_num  g  )  [inline, static]
 

Mword const L4_uid::max_threads  )  [inline, static]
 

Get number of threads in the system.

This method only works for v2 and x0 ABI. To get the max_threads value ABI-independently, use Config::max_threads() instead.

void L4_uid::nest unsigned   )  [inline]
 

Set the V2-specific Clans & Chiefs nesting level.

unsigned L4_uid::nest  )  const [inline]
 

Extract the V2-specific Clans & Chiefs nesting level.

bool L4_uid::next_period  )  const [inline]
 

Check if next_period bit is set.

bool L4_uid::operator!= L4_uid  o  )  const [inline]
 

Test for inequality.

bool L4_uid::operator== L4_uid  o  )  const [inline]
 

Test for equality.

L4_uid L4_uid::preemption_id  )  const [inline]
 

Return preemption ID corresponding to ID.

void L4_uid::print int  task_format = 0  )  const
 

Unsigned64 L4_uid::raw  )  const [inline]
 

Extract the raw 64Bit representation.

void L4_uid::site unsigned   )  [inline]
 

Set the V2-specific site ID.

unsigned L4_uid::site  )  const [inline]
 

Extract the V2-specific site ID.

void L4_uid::task Task_num   )  [inline]
 

Set the task number.

Task_num L4_uid::task  )  const [inline]
 

Extract the task number.

Unsigned32 L4_uid::task_from_gthread GThread_num  g  )  [inline, static]
 

L4_uid L4_uid::task_id  )  const [inline]
 

unsigned const L4_uid::threads_per_task  )  [inline, static]
 

Get the maximum number of threads per task.

void L4_uid::version unsigned   )  [inline]
 

Set the version part.

unsigned L4_uid::version  )  const [inline]
 

Extract the version part of the UID.

Returns:
The version (V2: low and high) of the UID.


Member Data Documentation

Unsigned64 L4_uid::_raw [private]
 


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