[kernel][thread] Hook uthread context switch

thread_resched() calls into libuthread to switch userspace.

Change-Id: Iad8e5ade175316eb784410c369c6473b68b6f5d6
Signed-off-by: Satya Popuri <popuri@google.com>
This commit is contained in:
Satya Popuri
2013-06-27 10:16:09 -07:00
committed by Arve Hjønnevåg
parent e92da54410
commit 19c2ea6dc8
2 changed files with 10 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ typedef int (*thread_start_routine)(void *arg);
/* thread local storage */
enum thread_tls_list {
#ifdef WITH_LIB_UTHREAD
TLS_ENTRY_UTHREAD,
#endif
MAX_TLS_ENTRY
};
@@ -140,6 +143,10 @@ void thread_preempt(void); /* get preempted (inserted into head of run queue) */
void thread_block(void); /* block on something and reschedule */
void thread_unblock(thread_t *t, bool resched); /* go back in the run queue */
#ifdef WITH_LIB_UTHREAD
void uthread_context_switch(thread_t *oldthread, thread_t *newthread);
#endif
/* called on every timer tick for the scheduler to do quantum expiration */
enum handler_return thread_timer_tick(void);

View File

@@ -563,6 +563,9 @@ void thread_resched(void)
newthread->priority, newthread->flags);
#endif
#ifdef WITH_LIB_UTHREAD
uthread_context_switch(oldthread, newthread);
#endif
arch_context_switch(oldthread, newthread);
}