summaryrefslogtreecommitdiff
path: root/kern/thread.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-05-06 20:50:32 +0200
committerRichard Braun <rbraun@sceen.net>2014-05-06 20:50:32 +0200
commit8a6545b07c407f9fe942e7a5ab08e7f19c34bc1c (patch)
treea9bf6f47bdb7eda5d69dc345bb2096e713f4694e /kern/thread.h
parentb11e4e9411cb0a4e99c370a4ff9a275540036aae (diff)
kern/thread: new thread_from_tcb function
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());
}
/*