summaryrefslogtreecommitdiffstats
path: root/lib/libkse/arch/arm/include/pthread_md.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libkse/arch/arm/include/pthread_md.h')
-rw-r--r--lib/libkse/arch/arm/include/pthread_md.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/libkse/arch/arm/include/pthread_md.h b/lib/libkse/arch/arm/include/pthread_md.h
index 107eb03..4cce212 100644
--- a/lib/libkse/arch/arm/include/pthread_md.h
+++ b/lib/libkse/arch/arm/include/pthread_md.h
@@ -227,15 +227,24 @@ _thread_enter_uts(struct tcb *tcb, struct kcb *kcb)
static __inline int
_thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
{
+ extern int _libkse_debug;
mcontext_t *mc;
_tcb_set(kcb, tcb);
mc = &tcb->tcb_tmbx.tm_context.uc_mcontext;
- if (setmbox)
- _thr_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
- (intptr_t *)&kcb->kcb_kmbx.km_curthread);
- else
- _thr_setcontext(mc, 0, NULL);
+ if (_libkse_debug == 0) {
+ if (setmbox)
+ _thr_setcontext(mc, (intptr_t)&tcb->tcb_tmbx,
+ (intptr_t *)&kcb->kcb_kmbx.km_curthread);
+ else
+ _thr_setcontext(mc, 0, NULL);
+ } else {
+ if (setmbox)
+ kse_switchin(&tcb->tcb_tmbx, KSE_SWITCHIN_SETTMBX);
+ else
+ kse_switchin(&tcb->tcb_tmbx, 0);
+ }
+
/* We should not reach here. */
return (-1);
}
OpenPOWER on IntegriCloud