Process Level Activities
[Linux DDE Common]

This module emulates the process level environment inside the Linux kernel. More...

Scheduling Primitives

To circumvent real user-level threads and scheduling we support only sane user context states generated by bug-free drivers.

The task structure has a new member - dde_sem binary semaphore - and each process could sleep on this until awakened by any event.

This is from kernel/sched.c

int FASTCALL (wake_up_process(struct task_struct *p))
 Wake up dedicated user context.
signed long FASTCALL (schedule_timeout(signed long timeout))
 Schedule process but wake me at least after timeout.
void schedule (void)
 Schedule process.
void FASTCALL (__wake_up(wait_queue_head_t *q, unsigned int mode, int nr))
 Wake up wait queue entries.
void FASTCALL (__wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr))
 Wake up wait queue entries (sync).
void FASTCALL (interruptible_sleep_on(wait_queue_head_t *q))
 Sleep on wait queue (interruptible by signals).
long FASTCALL (interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout))
 Sleep on wait queue (interruptible by signals and timeout).
void FASTCALL (sleep_on(wait_queue_head_t *q))
 Sleep on wait queue.
long FASTCALL (sleep_on_timeout(wait_queue_head_t *q, long timeout))
 Sleep on wait queue (interruptible by timeout).
void daemonize (void)
 Put all the gunge required to become a kernel thread without attached user resources in one place where it belongs.
void yield (void)
 
void __cond_resched (void)
 

Wait Queue - List Manipulation

This is from kernel/fork.c

void FASTCALL (add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait))
 Enqueue process in wait queue.
void FASTCALL (add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait))
 Enqueue process in wait queue (exclusive flag set).
void FASTCALL (remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait))
 Dequeue process from wait queue.

Functions

struct task_struct * get_current ()
 Get pointer to current task structure

This replaces the "current" macro.

int l4dde_process_add_worker ()
 Add caller as new process level worker.
int l4dde_process_remove_worker ()
 Remove a caller as process level worker.
int l4dde_process_init ()
 Initalize process module.
long kernel_thread (int(*fn)(void *), void *arg, unsigned long flags)
 Create kernel thread.

Detailed Description

This module emulates the process level environment inside the Linux kernel.

It provides one task structure (PCB) per worker (L4-)thread. Functions like schedule(), sleep_on() and wake_up() rely on this. Kernel threads are also implemented here.

Requirements: (additionally to Global Requirements)


Function Documentation

void __cond_resched ( void   ) 

..

Definition at line 279 of file sched.c.

void daemonize ( void   ) 

Put all the gunge required to become a kernel thread without attached user resources in one place where it belongs.

(dummy)

Definition at line 264 of file sched.c.

struct task_struct* get_current (  )  [read]

Get pointer to current task structure

This replaces the "current" macro.

Test:
krishna: What about "current" derefences from irqs and softirqs? Are they all eliminated?

Definition at line 61 of file process.c.

int l4dde_process_add_worker (  ) 

Add caller as new process level worker.

Returns:
0 on success; negative error code otherwise
This allocates and initializes a new task_struct for the worker thread.

Definition at line 75 of file process.c.

int l4dde_process_init (  ) 

Initalize process module.

Returns:
0 on success; negative error code otherwise
Initializes process level emulation environment and adds caller as first and only worker thread. Additional threads can be used after calling l4dde_process_add_worker() in new thread's context.

Definition at line 135 of file process.c.

int l4dde_process_remove_worker (  ) 

Remove a caller as process level worker.

Returns:
0 on success; negative error code otherwise
This deallocates a task_struct of the worker thread.

Definition at line 107 of file process.c.

void yield ( void   ) 

..

Definition at line 270 of file sched.c.


Linux DDE, written by Christian Helmuth  © 2003 Technische Universitaet Dresden