From be74842e37ad54f4fd18ae647e2bdf3e435a0fb8 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Fri, 13 Jul 2018 03:51:23 +1000 Subject: Added a state field to the task structure to hold the task's run state. Now, reschedule() requires a task to be in the TSTATE_RUNNING state for it to run. Renamed the TSS structure within the task structure from 'state' to 'tss' to avoid confusion with the task's run state. Removed the task_state structure declaration from sched.c as it is no longer needed due to context switches now being performed entirely in hardware. Removed the cstate pointer from sched.c. Interrupt handlers no longer set a pointer to saved state information on the stack since this was only needed for software task switching. NOTE: This may be re-introduced should it become necessary to access state information on the stack. Added a basic implementation of the wake_up() scheduling primative. This function is currently not used and may be completely re-written in future. --- kernel/timer.s | 3 --- 1 file changed, 3 deletions(-) (limited to 'kernel/timer.s') diff --git a/kernel/timer.s b/kernel/timer.s index 12ea9d0..760bcd7 100644 --- a/kernel/timer.s +++ b/kernel/timer.s @@ -1,6 +1,5 @@ global ticks global timer_init -extern cstate extern register_isr extern sched_tick @@ -17,8 +16,6 @@ tick_handler: mov es, ax mov fs, ax mov gs, ax - ; save a pointer to the state information - mov [cstate], esp ; handle the timer tick inc dword [ticks] -- cgit v1.3