aboutsummaryrefslogtreecommitdiff
path: root/kernel/task/include/task/task.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/task/include/task/task.h')
-rw-r--r--kernel/task/include/task/task.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/task/include/task/task.h b/kernel/task/include/task/task.h
index 40f18a0..99f16dc 100644
--- a/kernel/task/include/task/task.h
+++ b/kernel/task/include/task/task.h
@@ -4,6 +4,18 @@
#include "collection/list.h"
/**
+ * Wakeup sources define the minimum power level
+ * at which a task that is waiting in a queue
+ * can be woken up
+ */
+enum wakeup_src {
+ WAKEUP_SRC_OFF = 0, //processor off, external interrupts may trigger this source
+ WAKEUP_SRC_CLOCK = 1, //main clock required
+ WAKEUP_SRC_IDLE = 2, //processor can be put in idle state
+ WAKEUP_SRC_ON = 3 //processor must stay on
+};
+
+/**
* Task control block, contains runtime
* information about tasks.
*/
@@ -23,8 +35,12 @@ struct tcb_t {
/** Current wait queue that this task is in.*/
struct list_head queue;
+ /** ID of task. */
char id;
+
+ enum wakeup_src wakeup_src;
+
};
/**
@@ -39,7 +55,8 @@ struct tcb_t {
.mem_high = _declared_stack_##name + stack_size - 1, \
.entry = entry_function, \
.queue = {}, \
- .id = pid \
+ .id = pid, \
+ .wakeup_src = WAKEUP_SRC_ON \
};
#endif \ No newline at end of file