From 4b6eafd82fbafd73173a2b8ae6f21e80991de13c Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 7 Dec 2003 20:47:33 +0000 Subject: Simplify the contexts created by the kernel and remove the related flags. We now create asynchronous contexts or syscall contexts only. Syscall contexts differ from the minimal ABI dictated contexts by having the scratch registers saved and restored because that's where we keep the syscall arguments and syscall return values. Since this change affects KSE, have it use kse_switchin(2) for the "new" syscall context. --- lib/libkse/arch/ia64/include/pthread_md.h | 6 ++++++ lib/libpthread/arch/ia64/include/pthread_md.h | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/libkse/arch/ia64/include/pthread_md.h b/lib/libkse/arch/ia64/include/pthread_md.h index 6598f3d..a72c953 100644 --- a/lib/libkse/arch/ia64/include/pthread_md.h +++ b/lib/libkse/arch/ia64/include/pthread_md.h @@ -232,6 +232,12 @@ _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox) mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx; } _ia64_break_setcontext(mc); + } else if (mc->mc_flags & _MC_FLAGS_SYSCALL_CONTEXT) { + if (setmbox) + kse_switchin(mc, (long)&tcb->tcb_tmbx, + (long *)&kcb->kcb_kmbx.km_curthread); + else + kse_switchin(mc, 0L, NULL); } else { if (setmbox) _ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx, diff --git a/lib/libpthread/arch/ia64/include/pthread_md.h b/lib/libpthread/arch/ia64/include/pthread_md.h index 6598f3d..a72c953 100644 --- a/lib/libpthread/arch/ia64/include/pthread_md.h +++ b/lib/libpthread/arch/ia64/include/pthread_md.h @@ -232,6 +232,12 @@ _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox) mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx; } _ia64_break_setcontext(mc); + } else if (mc->mc_flags & _MC_FLAGS_SYSCALL_CONTEXT) { + if (setmbox) + kse_switchin(mc, (long)&tcb->tcb_tmbx, + (long *)&kcb->kcb_kmbx.km_curthread); + else + kse_switchin(mc, 0L, NULL); } else { if (setmbox) _ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx, -- cgit v1.1