Go to the documentation of this file.
70 kpanic(
"Unable to create task list");
72 taskList->
id = nextID++;
75 kprintf(
"sched0 - Address: [0x%X]\n", taskList);
94 for (; tmpTask != 0x0; tmpTask = tmpTask->
next) {
95 if (tmpTask->
state > 0x0) {
103 tmpTask = tmpTask->
next;
111 if (0x0 == tmpTask) {
127 asm(
"ljmp $0x20,$0\n");
139 struct file *fp = 0x0;
141 kpanic(
"Error: schedNewTask() - kmalloc failed trying to initialize a new task struct\n");
149 for (i = 0; i < 3; i++) {
157 tmpTask->
id = nextID++;
158 tmpTask->
next = taskList;
160 taskList->
prev = tmpTask;
172 for (tmpTask = taskList; tmpTask != 0x0; tmpTask = tmpTask->
next) {
173 if (tmpTask->
id ==
id) {
174 if (tmpTask->
prev != 0x0)
176 if (tmpTask->
next != 0x0)
178 if (taskList == tmpTask)
179 taskList = tmpTask->
next;
188 tmpTask->
next = delList;
191 delList->
prev = tmpTask;
203 delList = delList->
next;
211 for (tmpTask = taskList; tmpTask; tmpTask = tmpTask->
next) {
212 if (tmpTask->
id ==
id)
273 tmpTask->
state = state;
int sched_addDelTask(kTask_t *tmpTask)
struct gdtDescriptor descriptor
union descriptorTableUnion ubixGDT[11]
void schedEndTask(pidType pid)
void irqDisable(uInt16 irqNo)
void spinUnlock(spinLock_t *lock)
#define SPIN_LOCK_INITIALIZER
void kpanic(const char *fmt,...)
print panic message and halt system
void spinLock(spinLock_t *lock)
kTask_t * schedFindTask(uInt32 id)
int sched_setStatus(pidType pid, tState state)
void * kmalloc(uInt32 len)
void * memset(void *dst, int c, size_t length)
int kprintf(const char *,...)
int sched_deleteTask(pidType id)
int spinTryLock(spinLock_t *lock)
kTask_t * sched_getDelTask()