MyOS Kernel
tasking.h File Reference
#include <stdint.h>
#include <sys/types.h>

Go to the source code of this file.

Enumerations

enum  thread_state { THREAD_RUNNING, THREAD_READY, THREAD_EXITED, THREAD_BLOCKED }
 

Functions

void yield ()
 
void createProcCr3 (void *start, void *cr3)
 
void createProcCr3Param (void *start, void *cr3, void *param1, void *param2)
 
void blockThread (thread_state state)
 
void unblockThread (pid_t pid, pid_t tid)
 

Enumeration Type Documentation

◆ thread_state

Represents the state of a thread

Enumerator
THREAD_RUNNING 

The state of a running thread.

THREAD_READY 

The state of a ready to run thread.

THREAD_EXITED 

The state of an exited thread.

THREAD_BLOCKED 

The state of a generically blocked thread.

Function Documentation

◆ blockThread()

void blockThread ( thread_state  state)

Block the current thread

Parameters
stateThe state to block it with

◆ createProcCr3()

void createProcCr3 ( void *  start,
void *  cr3 
)

Create a process

Parameters
startThe start function of the process
cr3The address space of the process

◆ createProcCr3Param()

void createProcCr3Param ( void *  start,
void *  cr3,
void *  param1,
void *  param2 
)

Create a process with 2 arguments

Parameters
startThe start function of the process
cr3The address space of the process
param1The first parameter of the process
param2The second parameter of the process

◆ unblockThread()

void unblockThread ( pid_t  pid,
pid_t  tid 
)

Unblock a thread in a process

Parameters
pidThe PID of the thread's process
tidThe TID of the thread

◆ yield()

void yield ( )

Yield the CPU to another process