|
ArvernOS
|
Data Structures | |
| struct | task_t |
Macros | |
| #define | MAX_TASKS 64 |
| #define | SIGSEGV 11 |
| Invalid memory reference. | |
| #define | CURRENT_TASK (task_get_current()) |
| This special variable points to the current task being executed. | |
Functions | |
| void | task_init (const char *init_name) |
| void | task_schedule () |
| void | task_schedule_on_timer_tick () |
| void | task_exit (int code) |
| task_t * | task_get_current () |
| int | task_create (const char *name, uint64_t clone_flags, uintptr_t entrypoint) |
| void | task_print_info () |
| void | task_set_name (task_t *task, const char *name) |
This module implements multi-tasking and it is based on Sergey Matyukevich's work (specifically the scheduler implemented in RPi OS), released under a MIT license. See: https://s-matyukevich.github.io/raspberry-pi-os/docs/lesson04/rpi-os.html
| #define MAX_TASKS 64 |
| int task_create | ( | const char * | name, |
| uint64_t | clone_flags, | ||
| uintptr_t | entrypoint ) |
Creates a new task.
| name | the name of the task to create |
| clone_flags | configuration flags |
| entrypoint | the entrypoint of the task |
| void task_exit | ( | int | code | ) |
Terminates the current task.
| code | the status code |
| task_t * task_get_current | ( | ) |
Returns the current task.
| void task_init | ( | const char * | init_name | ) |
Initializes the scheduler.
| init_name | the name of the initial task. |
| void task_print_info | ( | ) |
Prints information about the tasks on the standard output.
| void task_schedule | ( | ) |
Schedules a new task.
| void task_schedule_on_timer_tick | ( | ) |
Schedules a new task.
This is similar to task_schedule() but designed to be automatically called at regular interval.
| void task_set_name | ( | task_t * | task, |
| const char * | name ) |
Sets the name of a task.
| task | the task to update |
| name | the new name (a NULL value clears the name) |