_ia64_break_setcontext() now takes a mcontext_t. While here, define

THR_SETCONTEXT as PANIC(). The THR_SETCONTEXT macro is currently not
used, which means that the definition we had could be wrong, overly
pessimistic or unknowingly right. I don't like the odds...

The new _ia64_break_setcontext() and corresponding kernel fixes make
KSE mostly usable. There's still a case where we don't properly
restore a context and end up with a NaT consumption fault (typically
an indication for not handling NaT collection points correctly),
but at least now mutex_d works...
This commit is contained in:
Marcel Moolenaar 2003-09-19 23:00:28 +00:00
parent 492eea0dcd
commit aec40a4c57
2 changed files with 6 additions and 20 deletions

View File

@ -34,14 +34,7 @@
#include <ucontext.h>
#define THR_GETCONTEXT(ucp) _ia64_save_context(&(ucp)->uc_mcontext)
#define THR_SETCONTEXT(ucp) \
do { \
if ((ucp)->uc_mcontext.mc_flags & _MC_FLAGS_ASYNC_CONTEXT) \
_ia64_break_setcontext(ucp); \
else \
_ia64_restore_context(&(ucp)->uc_mcontext, 0, \
NULL); \
} while (0)
#define THR_SETCONTEXT(ucp) PANIC("THR_SETCONTEXT() now in use!\n")
#define PER_THREAD
@ -200,7 +193,7 @@ _get_curkse(void)
return (_tcb->tcb_curkcb->kcb_kse);
}
void _ia64_break_setcontext(ucontext_t *ucp);
void _ia64_break_setcontext(mcontext_t *mc);
void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack,
size_t stacksz);
int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc);
@ -236,7 +229,7 @@ _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
(intptr_t)&kcb->kcb_kmbx.km_curthread;
mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx;
}
_ia64_break_setcontext(&tcb->tcb_tmbx.tm_context);
_ia64_break_setcontext(mc);
} else {
if (setmbox)
_ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx,

View File

@ -34,14 +34,7 @@
#include <ucontext.h>
#define THR_GETCONTEXT(ucp) _ia64_save_context(&(ucp)->uc_mcontext)
#define THR_SETCONTEXT(ucp) \
do { \
if ((ucp)->uc_mcontext.mc_flags & _MC_FLAGS_ASYNC_CONTEXT) \
_ia64_break_setcontext(ucp); \
else \
_ia64_restore_context(&(ucp)->uc_mcontext, 0, \
NULL); \
} while (0)
#define THR_SETCONTEXT(ucp) PANIC("THR_SETCONTEXT() now in use!\n")
#define PER_THREAD
@ -200,7 +193,7 @@ _get_curkse(void)
return (_tcb->tcb_curkcb->kcb_kse);
}
void _ia64_break_setcontext(ucontext_t *ucp);
void _ia64_break_setcontext(mcontext_t *mc);
void _ia64_enter_uts(kse_func_t uts, struct kse_mailbox *km, void *stack,
size_t stacksz);
int _ia64_restore_context(mcontext_t *mc, intptr_t val, intptr_t *loc);
@ -236,7 +229,7 @@ _thread_switch(struct kcb *kcb, struct tcb *tcb, int setmbox)
(intptr_t)&kcb->kcb_kmbx.km_curthread;
mc->mc_special.isr = (intptr_t)&tcb->tcb_tmbx;
}
_ia64_break_setcontext(&tcb->tcb_tmbx.tm_context);
_ia64_break_setcontext(mc);
} else {
if (setmbox)
_ia64_restore_context(mc, (intptr_t)&tcb->tcb_tmbx,