=================================================================== RCS file: /cvs/funnyos/sys/kern_sched.h,v retrieving revision 1.2 retrieving revision 1.4 diff -u -r1.2 -r1.4 --- funnyos/sys/kern_sched.h 2007/11/20 12:57:37 1.2 +++ funnyos/sys/kern_sched.h 2007/11/23 13:37:43 1.4 @@ -1,32 +1,37 @@ /* - * $Id: kern_sched.h,v 1.2 2007/11/20 12:57:37 nbrk Exp $ + * $Id: kern_sched.h,v 1.4 2007/11/23 13:37:43 nbrk Exp $ */ #ifndef _SYS_KERN_SCHED_H #define _SYS_KERN_SCHED_H #include +#include /* - * Task header is used by user to describe task in config.c + * u_task is used by user to describe task in config.c. + * "user task". */ -struct taskheader { - const char *th_name; /* task name */ - uint8_t th_priority; /* priority, bigger the value = higher priority */ - void (*th_enter)(void); /* entry point */ +struct u_task { + const char *ut_name; /* task name */ + uint8_t ut_priority; /* priority, bigger the value = higher priority */ + void (*ut_enter)(void); /* entry point */ }; + /* - * Kernel sees each system task as struct task; + * Kernel sees each system task as struct k_task; * it is used for scheduling and context switches. + * "kernel task". */ -struct task { - struct taskheader *ta_theader; /* points to user-described data */ - uint8_t ta_taskid; /* task id (TID) */ +struct k_task { + struct u_task *kt_utask; /* points to user-described data */ + uint8_t kt_tid; /* task id (TID) */ - uint8_t ta_state; /* task state (running, blocked, etc.) */ - uint32_t ta_timeo; /* timeout (in HZ) if task is blocked */ - uint32_t *ta_stackptr; /* task stack addr (used to switch-back to that task) */ + uint8_t kt_state; /* task state (running, blocked, etc.) */ +// uint32_t kt_timeo; /* timeout (in HZ) if task is blocked */ + struct pcb kt_pcb; /* hardware context (15 ARM registers) */ - struct task *ta_nextp; + + struct k_task *kt_next; }; /* @@ -42,7 +47,7 @@ * Functions. */ void sched_init(void); - +void sched_tick(void); #endif /* not _SYS_KERN_SCHED_H */