diff options
author | Richard Braun <rbraun@sceen.net> | 2014-05-06 20:50:32 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2014-05-06 20:50:32 +0200 |
commit | 8a6545b07c407f9fe942e7a5ab08e7f19c34bc1c (patch) | |
tree | a9bf6f47bdb7eda5d69dc345bb2096e713f4694e /kern/thread.h | |
parent | b11e4e9411cb0a4e99c370a4ff9a275540036aae (diff) |
kern/thread: new thread_from_tcb function
Diffstat (limited to 'kern/thread.h')
-rw-r--r-- | kern/thread.h | 8 |
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()); } /* |