ArvernOS
Loading...
Searching...
No Matches
proc.h File Reference
#include <proc/task.h>
Include dependency graph for proc.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)

Function Documentation

◆ arch_task_create()

task_t * arch_task_create ( uint64_t clone_flags,
uintptr_t entrypoint )

Creates a new task.

This function is called by task_create().

Parameters
clone_flagsconfiguration flags
entrypointthe entrypoint of the task
Returns
a task

◆ arch_task_enter_user()

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.

Parameters
entrythe user mode entry point
user_stack_topthe top (high address) of the user stack
taskthe task entering user mode

◆ arch_task_init()

task_t * arch_task_init ( )

Creates and returns the initial task.

This function is called by task_init().

Returns
the initial task

◆ arch_task_set_kernel_stack()

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.

Parameters
taskthe task whose kernel stack top should be installed

◆ arch_task_switch()

void arch_task_switch ( task_t * prev,
task_t * next )

Switches to a new task.

This function is called by task_switch(), which is called by task_schedule() and task_schedule_on_timer_tick().

Parameters
prevthe task that should be stopped
nextthe task that should be started