=================================================================== RCS file: /cvs/funnyos/sys/kern_sched.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- funnyos/sys/kern_sched.h 2007/11/20 12:57:37 1.2 +++ funnyos/sys/kern_sched.h 2007/11/20 16:07:23 1.3 @@ -1,32 +1,49 @@ /* - * $Id: kern_sched.h,v 1.2 2007/11/20 12:57:37 nbrk Exp $ + * $Id: kern_sched.h,v 1.3 2007/11/20 16:07:23 nbrk Exp $ */ #ifndef _SYS_KERN_SCHED_H #define _SYS_KERN_SCHED_H #include /* - * Task header is used by user to describe task in config.c + * Task header 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 */ }; + +#if 0 /* - * Kernel sees each system task as struct task; + * Task PCB (process control block). + * this is task's hardware context. + */ +struct pcb __attribute__((packed)) { + + /* ARM general purpose registers */ + uint32_t p_r0; + +} +#endif /* 0 */ + +/* + * 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 */ + uint32_t kt_pcb[15]; /* hardware context (15 ARM registers) */ - struct task *ta_nextp; + + struct k_task *kt_next; }; /*