summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.h')
-rw-r--r--kern/thread.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/kern/thread.h b/kern/thread.h
index a1f6ed14..01a2a75b 100644
--- a/kern/thread.h
+++ b/kern/thread.h
@@ -315,9 +315,15 @@ void thread_yield(void);
void thread_tick(void);
static inline struct thread *
+thread_from_tcb(struct tcb *tcb)
+{
+ return structof(tcb, struct thread, tcb);
+}
+
+static inline struct thread *
thread_self(void)
{
- return structof(tcb_current(), struct thread, tcb);
+ return thread_from_tcb(tcb_current());
}
/*