diff --git a/src/sys/include/ubixos/sched.h b/src/sys/include/ubixos/sched.h index 5f3dd2c..915c2e5 100644 --- a/src/sys/include/ubixos/sched.h +++ b/src/sys/include/ubixos/sched.h @@ -81,10 +81,12 @@ #define MAXPRIOLEVELS 11 -int sched_init(); -int sched_setStatus(pidType,tState); -uInt32 sched(struct i386_frame); -void sched_yield(); +int sched_init(); +int sched_setStatus(pidType,tState); +uInt32 sched(struct i386_frame); +void sched_yield(); +int sched_addDelTask(kTask_t *); +kTask_t *sched_getDelTask(); void schedEndTask(pidType pid); kTask_t *schedNewTask(); @@ -100,6 +102,9 @@ /*** $Log$ + Revision 1.24 2004/09/06 21:39:21 reddawg + Fixes: Changed the order in which tasks are deleted from the queues. Also fixed backspace to work in the virtual ttys.... + Revision 1.23 2004/08/26 22:51:18 reddawg TCA touched me :( i think he likes men.... diff --git a/src/sys/kernel/endtask.c b/src/sys/kernel/endtask.c index daddd2e..4f4009e 100644 --- a/src/sys/kernel/endtask.c +++ b/src/sys/kernel/endtask.c @@ -61,17 +61,11 @@ if (tmpTask == runList) runList = tmpTask->next; - /* Add task to del queue */ - tmpTask->next = delList; - tmpTask->prev = 0x0; - - if (delList != 0x0) - delList->prev = tmpTask; - - delList = tmpTask; - irqEnable(0x1); + /* Add task to del queue */ + sched_addDelTask(tmpTask); + while (1); return; @@ -79,6 +73,9 @@ /*** $Log$ + Revision 1.18 2004/09/06 21:39:21 reddawg + Fixes: Changed the order in which tasks are deleted from the queues. Also fixed backspace to work in the virtual ttys.... + Revision 1.17 2004/08/26 22:51:18 reddawg TCA touched me :( i think he likes men.... diff --git a/src/sys/kernel/sched.c b/src/sys/kernel/sched.c index 3173682..9c0d487 100644 --- a/src/sys/kernel/sched.c +++ b/src/sys/kernel/sched.c @@ -39,7 +39,8 @@ #include #include -static spinLock_t sched_spinLock = SPIN_LOCK_INITIALIZER; +static spinLock_t sched_spinLock = SPIN_LOCK_INITIALIZER; +static spinLock_t sched_delTaskLock = SPIN_LOCK_INITIALIZER; static uInt32 nextID = -1; @@ -262,9 +263,43 @@ tmpTask->state = state; return(0x0); } + +int sched_addDelTask(kTask_t *task) { + + spinLock(&sched_delTaskLock); + + task->next = delList; + task->prev = 0x0; + + if (delList != 0x0) + delList->prev = task; + + delList = task; + + spinUnlock(&sched_delTaskLock); + return(0x0); + } + +kTask_t *sched_getDelTask() { + kTask_t *tmpTask = 0x0; + spinLock(&sched_delTaskLock); + + if (delList != 0x0) { + tmpTask = delList; + delList = delList->next; + spinUnlock(&sched_delTaskLock); + return(tmpTask); + } + + spinUnlock(&sched_delTaskLock); + return(0x0); + } /*** $Log$ + Revision 1.46 2004/09/06 21:39:21 reddawg + Fixes: Changed the order in which tasks are deleted from the queues. Also fixed backspace to work in the virtual ttys.... + Revision 1.45 2004/08/29 21:43:06 reddawg sched: we now yeild almost propper syscall: it still uses ebx,ecx,edx diff --git a/src/sys/kernel/systemtask.c b/src/sys/kernel/systemtask.c index f8f38a9..5d4da36 100644 --- a/src/sys/kernel/systemtask.c +++ b/src/sys/kernel/systemtask.c @@ -94,9 +94,8 @@ break; } } - if (delList != 0x0) { - tmpTask = delList; - delList = tmpTask->next; + tmpTask = sched_getDelTask(); + if (tmpTask != 0x0) { vmmFreeProcessPages(tmpTask->id); @@ -117,6 +116,9 @@ /*** $Log$ + Revision 1.17 2004/09/06 21:39:21 reddawg + Fixes: Changed the order in which tasks are deleted from the queues. Also fixed backspace to work in the virtual ttys.... + Revision 1.16 2004/08/29 21:43:06 reddawg sched: we now yeild almost propper syscall: it still uses ebx,ecx,edx