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. --- include/kernel/sched.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/kernel/sched.h b/include/kernel/sched.h index d040886..42b5b15 100644 --- a/include/kernel/sched.h +++ b/include/kernel/sched.h @@ -41,7 +41,8 @@ struct tss_struct { struct task_struct { pid_t pid; - struct tss_struct state; + int state; + struct tss_struct tss; } __attribute__((packed)); extern struct task_struct *ctask; -- cgit v1.3