forked from KolibriOS/kolibrios
9e5dea1997
git-svn-id: svn://kolibrios.org@6082 a494cfbc-eb01-0410-851d-a64ba20cac60
53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
#ifndef _LINUX_SCHED_H
|
|
#define _LINUX_SCHED_H
|
|
|
|
|
|
/*
|
|
* Task state bitmask. NOTE! These bits are also
|
|
* encoded in fs/proc/array.c: get_task_state().
|
|
*
|
|
* We have two separate sets of flags: task->state
|
|
* is about runnability, while task->exit_state are
|
|
* about the task exiting. Confusing, but this way
|
|
* modifying one set can't modify the other one by
|
|
* mistake.
|
|
*/
|
|
#define TASK_RUNNING 0
|
|
#define TASK_INTERRUPTIBLE 1
|
|
#define TASK_UNINTERRUPTIBLE 2
|
|
#define __TASK_STOPPED 4
|
|
#define __TASK_TRACED 8
|
|
/* in tsk->exit_state */
|
|
#define EXIT_DEAD 16
|
|
#define EXIT_ZOMBIE 32
|
|
#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
|
|
/* in tsk->state again */
|
|
#define TASK_DEAD 64
|
|
#define TASK_WAKEKILL 128
|
|
#define TASK_WAKING 256
|
|
#define TASK_PARKED 512
|
|
#define TASK_NOLOAD 1024
|
|
#define TASK_STATE_MAX 2048
|
|
/* Convenience macros for the sake of set_task_state */
|
|
#define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
|
|
#define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED)
|
|
#define TASK_TRACED (TASK_WAKEKILL | __TASK_TRACED)
|
|
|
|
#define TASK_IDLE (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)
|
|
|
|
/* Convenience macros for the sake of wake_up */
|
|
#define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
|
|
#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
|
|
|
|
/* get_task_state() */
|
|
#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
|
|
TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
|
|
__TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
|
|
/* Task command name length */
|
|
#define TASK_COMM_LEN 16
|
|
|
|
#define schedule_timeout(x) delay(x)
|
|
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
|
|
|
|
#endif
|