From b241de25233d4ef491311be116b62ee7e73ec7a8 Mon Sep 17 00:00:00 2001 From: davidxu Date: Tue, 13 Jul 2004 22:54:23 +0000 Subject: Call kse_switchin to switch context when being debugged. --- lib/libkse/arch/arm/include/pthread_md.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lib/libkse/arch/arm/include') 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); } -- cgit v1.1