UbixOS  2.0
sched.h File Reference
#include <sys/types.h>
#include <vfs/file.h>
#include <ubixos/tty.h>
#include <sys/tss.h>
#include <sys/thread.h>
Include dependency graph for sched.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osInfo
 
struct  taskStruct
 

Macros

#define NO_GROUP   -1
 
#define NR_GROUPS   32
 

Typedefs

typedef struct taskStruct kTask_t
 

Enumerations

enum  tState {
  PLACEHOLDER = -2, DEAD = -1, NEW = 0, READY = 1,
  RUNNING = 2, IDLE = 3, FORK = 4, WAIT = 5,
  UNINTERRUPTIBLE = 6, INTERRUPTIBLE = 7
}
 

Functions

void sched ()
 
int sched_addDelTask (kTask_t *)
 
int sched_deleteTask (pidType)
 
kTask_tsched_getDelTask ()
 
int sched_init ()
 
int sched_setStatus (pidType, tState)
 
void sched_yield ()
 
void schedEndTask (pidType pid)
 
kTask_tschedFindTask (uInt32 id)
 
kTask_tschedNewTask ()
 

Variables

kTask_t_current
 
kTask_t_usedMath
 

Macro Definition Documentation

◆ NO_GROUP

#define NO_GROUP   -1

Definition at line 43 of file sched.h.

◆ NR_GROUPS

#define NR_GROUPS   32

Definition at line 44 of file sched.h.

Typedef Documentation

◆ kTask_t

typedef struct taskStruct kTask_t

Enumeration Type Documentation

◆ tState

enum tState
Enumerator
PLACEHOLDER 
DEAD 
NEW 
READY 
RUNNING 
IDLE 
FORK 
WAIT 
UNINTERRUPTIBLE 
INTERRUPTIBLE 

Definition at line 46 of file sched.h.

Function Documentation

◆ sched()

void sched ( )

Definition at line 80 of file sched.c.

References spinTryLock().

Referenced by sched_yield().

Here is the call graph for this function:

◆ sched_addDelTask()

int sched_addDelTask ( kTask_t )

Definition at line 186 of file sched.c.

References taskStruct::next.

◆ sched_deleteTask()

int sched_deleteTask ( pidType  )

Definition at line 167 of file sched.c.

◆ sched_getDelTask()

kTask_t* sched_getDelTask ( )

Definition at line 195 of file sched.c.

Referenced by systemTask().

◆ sched_init()

int sched_init ( )

Definition at line 66 of file sched.c.

◆ sched_setStatus()

int sched_setStatus ( pidType  ,
tState   
)

Definition at line 265 of file sched.c.

References schedFindTask(), and taskStruct::state.

Referenced by endTask(), execFile(), execThread(), and sys_wait4().

Here is the call graph for this function:

◆ sched_yield()

◆ schedEndTask()

void schedEndTask ( pidType  pid)

Definition at line 228 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  id)

Definition at line 207 of file sched.c.

Referenced by sched_setStatus(), sys_setpgid(), sys_wait4(), sysCheckPid(), and systemTask().

◆ schedNewTask()

kTask_t* schedNewTask ( )

Definition at line 135 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.

Referenced by biosCall(), execFile(), execThread(), and sys_fork().

Here is the call graph for this function:

Variable Documentation

◆ _current

◆ _usedMath

kTask_t* _usedMath

Definition at line 51 of file sched.c.

Referenced by mathStateRestore().