]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/thread_state.cpp
6caa2c1a9c69d6fef8db4e7c25609cd4b59a94e4
[l4.git] / kernel / fiasco / src / kern / thread_state.cpp
1 INTERFACE:
2
3 // When changing these constants, change them also in shared/shortcut.h!
4 enum Thread_state
5 {
6   Thread_invalid          = 0,    // tcb unallocated
7   Thread_ready            = 0x1,  // can be scheduled
8   Thread_drq_ready        = 0x2,
9   Thread_receiving        = 0x4,  // waiting for message from specified sender
10   Thread_ready_mask       = Thread_ready | Thread_drq_ready,
11   Thread_polling          = 0x8,  // waiting to send message to specified rcvr
12   Thread_ipc_in_progress  = 0x10, // an IPC operation has not been finished
13   Thread_send_in_progress = 0x20, // an IPC send operation hasn't been finished
14   // the ipc handshake bits needs to be in the first byte,
15   // the shortcut depends on it
16
17   Thread_cancel               = 0x40,// state has been changed -- cancel activity
18   Thread_dead                 = 0x200,// tcb allocated, but inactive (not in any q)
19   Thread_suspended            = 0x400,// thread must not execute user code
20   // 0x800, 0x1000 are free
21   Thread_delayed_deadline     = 0x2000, // delayed until periodic deadline
22   Thread_delayed_ipc          = 0x4000, // delayed until periodic ipc event
23   Thread_fpu_owner            = 0x8000, // currently owns the fpu
24   Thread_alien                = 0x10000, // Thread is an alien, is not allowed
25                                      // to do system calls
26   Thread_dis_alien            = 0x20000, // Thread is an alien, however the next
27                                      // system call is allowed
28   Thread_in_exception         = 0x40000, // Thread has sent an exception but still
29                                      // got no reply
30   Thread_transfer_in_progress = 0x80000, // ipc transfer
31
32   Thread_drq_wait             = 0x100000, // Thread polls for DRQs
33   Thread_waiting              = 0x200000, // Thread waits for a lock
34
35   Thread_vcpu_enabled         = 0x400000,
36   Thread_vcpu_fpu_disabled    = 0x1000000,
37   Thread_ext_vcpu_enabled     = 0x2000000,
38
39   // constants for convenience
40   Thread_ipc_sending_mask    = Thread_send_in_progress |
41                                Thread_polling,
42
43   Thread_ipc_receiving_mask  = Thread_receiving |
44                                Thread_transfer_in_progress,
45
46   Thread_ipc_mask            = Thread_ipc_in_progress |
47                                Thread_ipc_sending_mask |
48                                Thread_ipc_receiving_mask,
49 };