Interface: reduced UNIX standard library.
More...
#include <tm.h>
#include <time.h>
Go to the source code of this file.
Detailed Description
Interface: reduced UNIX standard library.
- Author
- Markus L. Noga marku.nosp@m.s@no.nosp@m.ga.de
Definition in file unistd.h.
Function Documentation
tid_t execi |
( |
int(*)(int, char **) |
code_start, |
|
|
int |
argc, |
|
|
char ** |
argv, |
|
|
priority_t |
priority, |
|
|
size_t |
stack_size |
|
) |
| |
start task executing (with passed paramters) called from user code
- Parameters
-
code_start | the entry-point of the new task |
argc | the count of arguments passed (0 if none) |
argv | an array of pointers each pointing to an argument (NULL if none) |
priority | the priority at which to run this task |
stack_size | the amount of memory in bytes to allocate to this task for its call stack |
- Returns
- -1 if failed to start, else tid (task-id)
Referenced by kmain().
exit task, returning code
- Parameters
-
code | the exit code to return to the caller |
kill specified (tid) task
- Parameters
-
tid | TaskId of task to be killed |
- Todo:
- FIXME: this belongs in a different header
kill all tasks with priority less than or equal equal to p, excluding self.
- Parameters
-
p | priority of tasks at which or below we kill tasks |
- Side Effects:
- All tasks meeting this criteria are killed
unsigned int msleep |
( |
unsigned int |
msec | ) |
|
delay execution allowing other tasks to run
- Parameters
-
msec | sleep duration in milliSeconds |
- Returns
- number of milliSeconds left if interrupted, else 0
- Bug:
- interruptions not implemented
void shutdown_task |
( |
tid_t |
tid | ) |
|
signal shutdown for a task
- Parameters
-
tid | TaskId of task to be notified |
signal shutdown for many tasks
- Parameters
-
- Todo:
- research {flags}, then fix this documentation
unsigned int sleep |
( |
unsigned int |
sec | ) |
|
delay execution allowing other tasks to run
- Parameters
-
sec | sleep duration in seconds |
- Returns
- number of seconds left if interrupted, else 0
- Bug:
- interruptions not implemented
suspend task until wakeup function returns non-null
- Parameters
-
wakeup | the function to be called when woken up |
data | the wakeup_t structure to be passed to the called function |
- Returns
- wakeup() return value
- Note
- wakeup function is called in task scheduler context
Referenced by enter_critical_section(), and get_msg().
current task yields the rest of timeslice