MyOS Kernel
tasking_helpers.h File Reference
#include "../tasking.h"

Go to the source code of this file.

Functions

void switch_to_thread_asm (Thread *thread)
 
void task_init ()
 
void wait_for_unblocked_thread_asm ()
 
void setup_kstack (Thread *thread, void *param1, void *param2, char kmode, void *eip)
 

Function Documentation

◆ setup_kstack()

void setup_kstack ( Thread thread,
void *  param1,
void *  param2,
char  kmode,
void *  eip 
)

Setup a kernel stack for a thread

Parameters
threadThe thread to setup a stack for
param1The thread's start function first parameter
param2The thread's start function second parameter
kmodeWhether the thread is a kernel mode thread
eipThe start address of the thread

◆ switch_to_thread_asm()

void switch_to_thread_asm ( Thread thread)

The assembly part of switching to a thread. Performs the actual context switch.

Parameters
threadThe thread to switch to.

◆ task_init()

void task_init ( )

Initializes a usermode task

◆ wait_for_unblocked_thread_asm()

void wait_for_unblocked_thread_asm ( )

An assembly helper for waiting for an unblocked thread Starts interrupts, halts, then clears interrupts.