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

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

1.1     ! nbrk        1: /*
        !             2:  * $Id$
        !             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 */
        !            13:        void            (*th_enter)(void *arg); /* entry point */
        !            14:        uint8_t         ta_priority;                    /* priority, less value = higher priority */
        !            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) */
        !            28: };
        !            29:
        !            30: /*
        !            31:  * Tasks states.
        !            32:  */
        !            33: #define TASK_NOSCHED   0x00    /* task not ready or halted; will not schedule this */
        !            34: #define TASK_READY             0x01    /* ready for schedule */
        !            35: #define TASK_RUNNING   0x02    /* running now */
        !            36: #define TASK_SLEEPING  0x04    /* task waits for (planned) timeout */
        !            37:
        !            38:
        !            39: #endif /* not _SYS_KERN_SCHED_H */
        !            40:

CVSweb