Introduction   File List   Index  

Rmgr_api

contains types, macros and function for the Roottask API More...


Files

file  librmgr.h
 Client Roottask API interface.
file  proto.h

Functions

EXTERN_C_BEGIN L4_CV l4_threadid_t rmgr_pager_id (void)
 Get the L4 thread id of the roottask pager.
L4_CV l4_threadid_t rmgr_service_id (void)
 Get the L4 thread id of the roottask service.
L4_CV int rmgr_init (void)
 Initialize the roottask lib.
L4_CV int rmgr_set_small_space (l4_threadid_t dest, int num)
 Move a task into an allocated small space.
L4_CV int rmgr_set_prio (l4_threadid_t dest, int num)
 Set the priority of a thread.
L4_CV int rmgr_get_prio (l4_threadid_t dest, int *num)
 Query prio without rmgr involvement.
L4_CV int rmgr_get_task (int num)
 Request roottask to transfer right for a task to the caller.
L4_CV int rmgr_free_task (int num)
 Pass right for a task back to roottask.
L4_CV int rmgr_free_task_all (l4_threadid_t client)
 Free all L4 tasks occupied for a specific task.
L4_CV int rmgr_get_irq (int num)
 Get right to receive from specified IRQ.
L4_CV int rmgr_free_irq (int num)
 Return right to receive from IRQ back to roottask.
L4_CV int rmgr_free_irq_all (l4_threadid_t client)
 Free all IRQs occupied for a task.
L4_CV int rmgr_dump_mem (void)
 Dump the memory allocation map for all its clients.
L4_CV int rmgr_get_page0 (void *address)
 Request the first physical page (roottask does not hand out \ this page on pagefaults).
L4_CV int rmgr_get_task_id (const char *module_name, l4_threadid_t *thread_id)
 Request the task ID of the boot modules named by modname.
L4_CV int rmgr_set_task_id (const char *module_name, l4_threadid_t thread_id)
 Set the task ID of a module.
L4_CV l4_taskid_t rmgr_task_new (l4_taskid_t dest, l4_umword_t mcp_or_new_chief, l4_umword_t esp, l4_umword_t eip, l4_threadid_t pager)
 Create an L4 task.
L4_CV l4_taskid_t rmgr_task_new_long (l4_taskid_t dest, l4_umword_t mcp_or_new_chief, l4_umword_t esp, l4_umword_t eip, l4_threadid_t pager, l4_threadid_t caphandler, l4_quota_desc_t kquota)
 Create an L4 task with capability handler.
L4_CV l4_taskid_t rmgr_task_new_with_prio (l4_taskid_t dest, l4_umword_t mcp_or_new_chief, l4_umword_t esp, l4_umword_t eip, l4_threadid_t pager, l4_sched_param_t sched_param)
 Create an L4 task with capability handler.
L4_CV int rmgr_free_fpage (l4_fpage_t fp)
 Free an I/O memory page.
L4_CV int rmgr_free_page (l4_umword_t address)
 Free a memory page.
L4_CV int rmgr_free_mem_all (l4_threadid_t client)
 Free all memory a task.
L4_CV l4_umword_t rmgr_reserve_mem (l4_umword_t size, l4_umword_t align, l4_umword_t flags, l4_umword_t range_low, l4_umword_t range_high)
 reserve some memory chunk in an area
L4_CV int rmgr_privctrl (l4_umword_t cmd, l4_umword_t param)
 elevates the calling process to PL0

Detailed Description

contains types, macros and function for the Roottask API

The roottask is the initial task handling hardware resource access, such as memory pages, IRQ, or I/O ports. It is also responsible to monitor the creation and deletion of tasks. For these functions it implements a simple API.


Function Documentation

EXTERN_C_BEGIN L4_CV l4_threadid_t rmgr_pager_id ( void   ) 

Get the L4 thread id of the roottask pager.

Returns:
L4 thread id of the roottask pager.

L4_CV l4_threadid_t rmgr_service_id ( void   ) 

Get the L4 thread id of the roottask service.

Returns:
L4 thread id of the roottask service.

L4_CV int rmgr_init ( void   ) 

Initialize the roottask lib.

Returns:
0 on success, 1 otherwise.
Sets up the client lib and tests the availability of the roottask service.

L4_CV int rmgr_set_small_space ( l4_threadid_t  dest,
int  num 
)

Move a task into an allocated small space.

Parameters:
dest ID of the corresponding L4 task
num number of the target small space
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_set_prio ( l4_threadid_t  dest,
int  num 
)

Set the priority of a thread.

Parameters:
dest target thread ID
num new thread priority
Return values:
0 Ok, prio was set
-1 some error: thread does not exist or mcp of caller is below old or new prio of dest. Or prio support is disabled in librmgr.
16 L4_IPC_ENOT_EXISTENT: IPC error. Probably rmgr_init() was not called.

L4_CV int rmgr_get_prio ( l4_threadid_t  dest,
int *  num 
)

Query prio without rmgr involvement.

Parameters:
dest target thread ID
Return values:
num the thread's current prio
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_get_task ( int  num  ) 

Request roottask to transfer right for a task to the caller.

Parameters:
num task number
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_free_task ( int  num  ) 

Pass right for a task back to roottask.

Parameters:
num task number
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_free_task_all ( l4_threadid_t  client  ) 

Free all L4 tasks occupied for a specific task.

Parameters:
client target task ID
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_get_irq ( int  num  ) 

Get right to receive from specified IRQ.

Parameters:
num the number of the IRQ
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_free_irq ( int  num  ) 

Return right to receive from IRQ back to roottask.

Parameters:
num the irq number
Returns:
0 on success, 1 otherwise

L4_CV int rmgr_free_irq_all ( l4_threadid_t  client  ) 

Free all IRQs occupied for a task.

Parameters:
client task number
Returns:
0 on success, 1 otherwise

L4_CV int rmgr_dump_mem ( void   ) 

Dump the memory allocation map for all its clients.

Returns:
0 on success, 1 otherwise

L4_CV int rmgr_get_page0 ( void *  address  ) 

Request the first physical page (roottask does not hand out \ this page on pagefaults).

Parameters:
address address where to receive that page to
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_get_task_id ( const char *  module_name,
l4_threadid_t *  thread_id 
)

Request the task ID of the boot modules named by modname.

Parameters:
module_name the name of the modules
Return values:
thread_id the ID of the module
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_set_task_id ( const char *  module_name,
l4_threadid_t  thread_id 
)

Set the task ID of a module.

Parameters:
module_name the name of the module
thread_id the new task ID
Returns:
0 on success, 1 otherwise.

L4_CV l4_taskid_t rmgr_task_new ( l4_taskid_t  dest,
l4_umword_t  mcp_or_new_chief,
l4_umword_t  esp,
l4_umword_t  eip,
l4_threadid_t  pager 
)

Create an L4 task.

Parameters:
dest the intended new task ID
mcp_or_new_chief Master Control Prio
esp new stack pointer
eip new instruction pointer
pager pager of the new task
Returns:
a valid task ID on success, L4_NIL_ID otherwise

L4_CV l4_taskid_t rmgr_task_new_long ( l4_taskid_t  dest,
l4_umword_t  mcp_or_new_chief,
l4_umword_t  esp,
l4_umword_t  eip,
l4_threadid_t  pager,
l4_threadid_t  caphandler,
l4_quota_desc_t  kquota 
)

Create an L4 task with capability handler.

Parameters:
dest the intended new task ID
mcp_or_new_chief Master Control Prio
esp new stack pointer
eip new instruction pointer
pager pager of the new task
caphandler the capability fault handler
kquota kernel quota
Returns:
a valid task ID on success, L4_NIL_ID otherwise

L4_CV l4_taskid_t rmgr_task_new_with_prio ( l4_taskid_t  dest,
l4_umword_t  mcp_or_new_chief,
l4_umword_t  esp,
l4_umword_t  eip,
l4_threadid_t  pager,
l4_sched_param_t  sched_param 
)

Create an L4 task with capability handler.

Parameters:
dest the intended new task ID
mcp_or_new_chief Master Control Prio
esp new stack pointer
eip new instruction pointer
pager pager of the new task
sched_param Scheduling parameters determining the prio
Returns:
a valid task ID on success, L4_NIL_ID otherwise

L4_CV int rmgr_free_fpage ( l4_fpage_t  fp  ) 

Free an I/O memory page.

Parameters:
fp the flexpage describing the I/O memory page
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_free_page ( l4_umword_t  address  ) 

Free a memory page.

Parameters:
address the address in the memory page to free
Returns:
0 on success, 1 otherwise.

L4_CV int rmgr_free_mem_all ( l4_threadid_t  client  ) 

Free all memory a task.

Parameters:
client task ID to take memory from
Returns:
0 on success, 1 otherwise.

L4_CV l4_umword_t rmgr_reserve_mem ( l4_umword_t  size,
l4_umword_t  align,
l4_umword_t  flags,
l4_umword_t  range_low,
l4_umword_t  range_high 
)

reserve some memory chunk in an area

Parameters:
size the size of the chunk to reserve
align alignment of the reserved chunk
flags flags for memory reservation
range_low the lower range of the area to check
range_high the upper range of the area to check
Returns:
~0U if no area was found

L4_CV int rmgr_privctrl ( l4_umword_t  cmd,
l4_umword_t  param 
)

elevates the calling process to PL0

Parameters:
cmd ignored
param ignored
Returns:
0 on success, 1 otherwise.
This interface is for internal use only. Its unsafe, unstable, unsupported, and undocumented.


Roottask Reference Manual, written by Frank Mehnert  © 2006