|
ArvernOS
|
#include <proc/task.h>Functions | |
| task_t * | arch_task_init () |
| void | arch_task_switch (task_t *prev, task_t *next) |
| task_t * | arch_task_create (uint64_t clone_flags, uintptr_t entrypoint) |
| void | arch_task_enter_user (uintptr_t entry, uintptr_t user_stack_top, task_t *task) |
| void | arch_task_set_kernel_stack (task_t *task) |
| task_t * arch_task_create | ( | uint64_t | clone_flags, |
| uintptr_t | entrypoint ) |
Creates a new task.
This function is called by task_create().
| clone_flags | configuration flags |
| entrypoint | the entrypoint of the task |
| void arch_task_enter_user | ( | uintptr_t | entry, |
| uintptr_t | user_stack_top, | ||
| task_t * | task ) |
Enters user mode and starts executing at entry.
This function is called by k_execv() and it does not return.
| entry | the user mode entry point |
| user_stack_top | the top (high address) of the user stack |
| task | the task entering user mode |
| task_t * arch_task_init | ( | ) |
Creates and returns the initial task.
This function is called by task_init().
| void arch_task_set_kernel_stack | ( | task_t * | task | ) |
Installs the kernel stack used on the next entry into the kernel.
This function is called by task_switch() to make sure the next syscall or interrupt of task is handled on its own kernel stack.
| task | the task whose kernel stack top should be installed |
Switches to a new task.
This function is called by task_switch(), which is called by task_schedule() and task_schedule_on_timer_tick().
| prev | the task that should be stopped |
| next | the task that should be started |