Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
thread.c File Reference
#include "procc/thread.h"
#include "autoconf.h"
#include "init/init.h"
#include "libk/serial.h"
#include "memory/slab.h"
#include "scheduler.h"
#include <hal/cpu/core.h>
#include <str.h>

Go to the source code of this file.

Functions

 INIT (Thread)
 
static thread_id thrAcquireNewSlot ()
 
static thread_tthrCreateInstance ()
 
static void vxUpdateThreadSlot (const thread_id id, thread_t *thr)
 
thread_tcreate_thread (volatile uintptr_t *page, uintptr_t entry, uintptr_t stack, uint16_t core_affinity, uint8_t priority, uint16_t flags)
 
void vxThreadExit ()
 

Variables

static struct slab_cachethread_cache = 0
 
static thread_bucket_t bucket = {0}
 

Function Documentation

◆ create_thread()

◆ INIT()

INIT ( Thread )

Definition at line 13 of file thread.c.

References thread_cache, and vxCreateSlabCache().

◆ thrAcquireNewSlot()

static thread_id thrAcquireNewSlot ( )
static

Definition at line 17 of file thread.c.

References bucket, LOG2_DEBUG, and THREAD_MAKE_ID.

Referenced by create_thread().

◆ thrCreateInstance()

static thread_t * thrCreateInstance ( )
static

Definition at line 31 of file thread.c.

References thread_cache, and vxSlabAlloc().

Referenced by create_thread().

◆ vxThreadExit()

void vxThreadExit ( void )

◆ vxUpdateThreadSlot()

static void vxUpdateThreadSlot ( const thread_id id,
thread_t * thr )
static

Definition at line 36 of file thread.c.

References bucket, idx, and THREAD_GET_ID.

Referenced by create_thread().

Variable Documentation

◆ bucket

thread_bucket_t bucket = {0}
static

◆ thread_cache

struct slab_cache* thread_cache = 0
static

Definition at line 10 of file thread.c.

Referenced by INIT(), and thrCreateInstance().