UbixOS V2  2.0
sched.c File Reference
#include <sys/_null.h>
#include <ubixos/sched.h>
#include <ubixos/kpanic.h>
#include <ubixos/spinlock.h>
#include <ubixos/endtask.h>
#include <ubixos/wait.h>
#include <vfs/mount.h>
#include <lib/kmalloc.h>
#include <lib/kprintf.h>
#include <vmm/vmm.h>
#include <sys/gdt.h>
#include <sys/idt.h>
#include <isa/8259.h>
#include <string.h>
#include <assert.h>
#include <sys/descrip.h>
Include dependency graph for sched.c:

Go to the source code of this file.

Functions

void add_wait_queue (struct wait_queue **p, struct wait_queue *wait)
 
void remove_wait_queue (struct wait_queue **p, struct wait_queue *wait)
 
void sched ()
 
int sched_addDelTask (kTask_t *tmpTask)
 
int sched_deleteTask (pidType id)
 
kTask_tsched_getDelTask ()
 
int sched_init ()
 
int sched_setStatus (pidType pid, tState state)
 
void sched_yield ()
 
void schedEndTask (pidType pid)
 
kTask_tschedFindTask (uint32_t id)
 
kTask_tschedNewTask ()
 
void wake_up (struct wait_queue **q)
 
void wake_up_interruptible (struct wait_queue **q)
 

Variables

kTask_t_current = 0x0
 
kTask_t_usedMath = 0x0
 
int need_resched = 0
 

Function Documentation

◆ add_wait_queue()

void add_wait_queue ( struct wait_queue **  p,
struct wait_queue wait 
)

Definition at line 299 of file sched.c.

◆ remove_wait_queue()

void remove_wait_queue ( struct wait_queue **  p,
struct wait_queue wait 
)

Definition at line 315 of file sched.c.

◆ sched()

void sched ( )

Definition at line 84 of file sched.c.

References spinTryLock().

Here is the call graph for this function:

◆ sched_addDelTask()

int sched_addDelTask ( kTask_t tmpTask)

Definition at line 213 of file sched.c.

References taskStruct::next.

◆ sched_deleteTask()

int sched_deleteTask ( pidType  id)

Definition at line 194 of file sched.c.

◆ sched_getDelTask()

kTask_t* sched_getDelTask ( )

Definition at line 222 of file sched.c.

◆ sched_init()

int sched_init ( )

Definition at line 70 of file sched.c.

◆ sched_setStatus()

int sched_setStatus ( pidType  pid,
tState  state 
)

Definition at line 291 of file sched.c.

References schedFindTask(), and taskStruct::state.

Here is the call graph for this function:

◆ sched_yield()

void sched_yield ( )

Definition at line 270 of file sched.c.

References sched().

Here is the call graph for this function:

◆ schedEndTask()

void schedEndTask ( pidType  pid)

Definition at line 254 of file sched.c.

References _current, endTask(), taskStruct::id, and sched_yield().

Here is the call graph for this function:

◆ schedFindTask()

kTask_t* schedFindTask ( uint32_t  id)

Definition at line 233 of file sched.c.

◆ schedNewTask()

kTask_t* schedNewTask ( )

Definition at line 156 of file sched.c.

References file::f_flag, kmalloc(), kpanic(), memcpy(), memset(), NEW, thread::o_files, spinLock(), taskStruct::state, taskStruct::td, taskStruct::usedMath, and taskStruct::username.

Here is the call graph for this function:

◆ wake_up()

void wake_up ( struct wait_queue **  q)

Definition at line 360 of file sched.c.

◆ wake_up_interruptible()

void wake_up_interruptible ( struct wait_queue **  q)

Definition at line 335 of file sched.c.

Variable Documentation

◆ _current

kTask_t* _current = 0x0

Definition at line 52 of file sched.c.

◆ _usedMath

kTask_t* _usedMath = 0x0

Definition at line 53 of file sched.c.

◆ need_resched

int need_resched = 0

Definition at line 57 of file sched.c.