/**************************************************************************************
Copyright (c) 2002 The UbixOS Project
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
prohibited.
$UbixOS: schedule.h,v 1.5 2002/05/12 23:57:23 reddawg Exp $
**************************************************************************************/
#ifndef _SCHEDULE_H
#define _SCHEDULE_H
#define numTasks 1024
#define RUNABLE 3
#define ACTIVE 2
#define INACTIVE 1
#define AVAILABLE 0
struct tssStruct {
short back_link;
short back_link_reserved;
long esp0;
short ss0;
short ss0_reserved;
long esp1;
short ss1;
short ss1_reserved;
long esp2;
short ss2;
short ss2_reserved;
long cr3;
long eip;
long eflags;
long eax,ecx,edx,ebx;
long esp;
long ebp;
long esi;
long edi;
short es;
short es_reserved;
short cs;
short cs_reserved;
short ss;
short ss_reserved;
short ds;
short ds_reserved;
short fs;
short fs_reserved;
short gs;
short gs_reserved;
short ldt;
short ldt_reserved;
long trace_bitmap; /* bits: trace 0, bitmap 16-31 */
};
struct i387Struct {
long cwd;
long swd;
long twd;
long fip;
long fcs;
long foo;
long fos;
long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
};
struct taskStruct {
struct tssStruct tss;
struct i387Struct i387;
int id;
int status;
int usedMath;
int cpuTime;
};
extern struct taskStruct taskList[numTasks];
extern struct taskStruct *_current,*_usedMath;
extern int currentProc;
void initScheduler();
int findTask();
void timerInt();
#endif