Subversion Repositories Kolibri OS

Rev

Rev 5270 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef _LINUX_SCHED_H
  2. #define _LINUX_SCHED_H
  3.  
  4.  
  5. /*
  6.  * Task state bitmask. NOTE! These bits are also
  7.  * encoded in fs/proc/array.c: get_task_state().
  8.  *
  9.  * We have two separate sets of flags: task->state
  10.  * is about runnability, while task->exit_state are
  11.  * about the task exiting. Confusing, but this way
  12.  * modifying one set can't modify the other one by
  13.  * mistake.
  14.  */
  15. #define TASK_RUNNING            0
  16. #define TASK_INTERRUPTIBLE      1
  17. #define TASK_UNINTERRUPTIBLE    2
  18. #define __TASK_STOPPED          4
  19. #define __TASK_TRACED           8
  20. /* in tsk->exit_state */
  21. #define EXIT_DEAD               16
  22. #define EXIT_ZOMBIE             32
  23. #define EXIT_TRACE              (EXIT_ZOMBIE | EXIT_DEAD)
  24. /* in tsk->state again */
  25. #define TASK_DEAD               64
  26. #define TASK_WAKEKILL           128
  27. #define TASK_WAKING             256
  28. #define TASK_PARKED             512
  29. #define TASK_NOLOAD             1024
  30. #define TASK_STATE_MAX          2048
  31. /* Convenience macros for the sake of set_task_state */
  32. #define TASK_KILLABLE           (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
  33. #define TASK_STOPPED            (TASK_WAKEKILL | __TASK_STOPPED)
  34. #define TASK_TRACED             (TASK_WAKEKILL | __TASK_TRACED)
  35.  
  36. #define TASK_IDLE               (TASK_UNINTERRUPTIBLE | TASK_NOLOAD)
  37.  
  38. /* Convenience macros for the sake of wake_up */
  39. #define TASK_NORMAL             (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
  40. #define TASK_ALL                (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
  41.  
  42. /* get_task_state() */
  43. #define TASK_REPORT             (TASK_RUNNING | TASK_INTERRUPTIBLE | \
  44.                                  TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
  45.                                  __TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
  46. /* Task command name length */
  47. #define TASK_COMM_LEN 16
  48.  
  49. #define schedule_timeout(x)  delay(x)
  50. #define MAX_SCHEDULE_TIMEOUT    LONG_MAX
  51.  
  52. #endif
  53.