[BACK]Return to kern_sched.h CVS log [TXT][DIR] Up to [local] / funnyos / sys

Annotation of funnyos/sys/kern_sched.h, Revision 1.4

1.1       nbrk        1: /*
1.4     ! nbrk        2:  * $Id: kern_sched.h,v 1.3 2007/11/20 16:07:23 nbrk Exp $
1.1       nbrk        3:  */
                      4: #ifndef _SYS_KERN_SCHED_H
                      5: #define _SYS_KERN_SCHED_H
                      6: #include <sys/types.h>
1.4     ! nbrk        7: #include <sys/pcb.h>
1.1       nbrk        8:
                      9: /*
1.4     ! nbrk       10:  * u_task is used by user to describe task in config.c.
1.3       nbrk       11:  * "user task".
1.1       nbrk       12:  */
1.3       nbrk       13: struct u_task {
                     14:        const char *ut_name;                    /* task name */
                     15:        uint8_t         ut_priority;            /* priority, bigger the value = higher priority */
                     16:        void            (*ut_enter)(void);      /* entry point */
1.1       nbrk       17: };
                     18:
1.3       nbrk       19:
1.1       nbrk       20: /*
1.3       nbrk       21:  * Kernel sees each system task as struct k_task;
1.1       nbrk       22:  * it is used for scheduling and context switches.
1.3       nbrk       23:  * "kernel task".
1.1       nbrk       24:  */
1.3       nbrk       25: struct k_task {
                     26:        struct u_task   *kt_utask;      /* points to user-described data */
                     27:        uint8_t                 kt_tid;         /* task id (TID) */
                     28:
                     29:        uint8_t                 kt_state;       /* task state (running, blocked, etc.) */
                     30: //     uint32_t                kt_timeo;       /* timeout (in HZ) if task is blocked */
1.4     ! nbrk       31:        struct pcb              kt_pcb;         /* hardware context (15 ARM registers) */
1.3       nbrk       32:
1.2       nbrk       33:
1.3       nbrk       34:        struct k_task   *kt_next;
1.1       nbrk       35: };
                     36:
                     37: /*
                     38:  * Tasks states.
                     39:  */
                     40: #define TASK_NOSCHED   0x00    /* task not ready or halted; will not schedule this */
                     41: #define TASK_READY             0x01    /* ready for schedule */
                     42: #define TASK_RUNNING   0x02    /* running now */
                     43: #define TASK_SLEEPING  0x04    /* task waits for (planned) timeout */
1.2       nbrk       44:
                     45:
                     46: /*
                     47:  * Functions.
                     48:  */
                     49: void   sched_init(void);
1.4     ! nbrk       50: void   sched_tick(void);
1.1       nbrk       51:
                     52: #endif /* not _SYS_KERN_SCHED_H */
                     53:

CVSweb