Annotation of funnyos/sys/kern_sched.h, Revision 1.2
1.1 nbrk 1: /*
1.2 ! nbrk 2: * $Id: kern_sched.h,v 1.1 2007/11/19 15:54:33 nbrk Exp $
1.1 nbrk 3: */
4: #ifndef _SYS_KERN_SCHED_H
5: #define _SYS_KERN_SCHED_H
6: #include <sys/types.h>
7:
8: /*
9: * Task header is used by user to describe task in config.c
10: */
11: struct taskheader {
12: const char *th_name; /* task name */
1.2 ! nbrk 13: uint8_t th_priority; /* priority, bigger the value = higher priority */
! 14: void (*th_enter)(void); /* entry point */
1.1 nbrk 15: };
16:
17: /*
18: * Kernel sees each system task as struct task;
19: * it is used for scheduling and context switches.
20: */
21: struct task {
22: struct taskheader *ta_theader; /* points to user-described data */
23: uint8_t ta_taskid; /* task id (TID) */
24:
25: uint8_t ta_state; /* task state (running, blocked, etc.) */
26: uint32_t ta_timeo; /* timeout (in HZ) if task is blocked */
27: uint32_t *ta_stackptr; /* task stack addr (used to switch-back to that task) */
1.2 ! nbrk 28:
! 29: struct task *ta_nextp;
1.1 nbrk 30: };
31:
32: /*
33: * Tasks states.
34: */
35: #define TASK_NOSCHED 0x00 /* task not ready or halted; will not schedule this */
36: #define TASK_READY 0x01 /* ready for schedule */
37: #define TASK_RUNNING 0x02 /* running now */
38: #define TASK_SLEEPING 0x04 /* task waits for (planned) timeout */
1.2 ! nbrk 39:
! 40:
! 41: /*
! 42: * Functions.
! 43: */
! 44: void sched_init(void);
1.1 nbrk 45:
46:
47: #endif /* not _SYS_KERN_SCHED_H */
48:
CVSweb