summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_kse.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-04-25 01:50:30 +0000
committerdeischen <deischen@FreeBSD.org>2003-04-25 01:50:30 +0000
commit3d51b3a2809784a3fd4e35c34422c2f82d8fd818 (patch)
treebb8eb253f377c8996df874bb13ce8f388ab880c7 /sys/kern/kern_kse.c
parentaf0b381b9f2eb4edc2bbd4c4d7b902ed42d913d7 (diff)
downloadFreeBSD-src-3d51b3a2809784a3fd4e35c34422c2f82d8fd818.zip
FreeBSD-src-3d51b3a2809784a3fd4e35c34422c2f82d8fd818.tar.gz
Add an argument to get_mcontext() which specified whether the
syscall return values should be cleared. The system calls getcontext() and swapcontext() want to return 0 on success but these contexts can be switched to at a later time so the return values need to be cleared in the saved register sets. Other callers of get_mcontext() would normally want the context without clearing the return values. Remove the i386-specific context saving from the KSE code. get_mcontext() is not i386-specific any more. Fix a bad pointer in the alpha get_mcontext() code. The context was being bcopy()'d from &td->tf_frame, but tf_frame is itself a pointer, so the thread was being copied instead. Spotted by jake. Glanced at by: jake Reviewed by: bde (months ago)
Diffstat (limited to 'sys/kern/kern_kse.c')
-rw-r--r--sys/kern/kern_kse.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 48f5ac0..ac7daa4 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -729,13 +729,7 @@ void
thread_getcontext(struct thread *td, ucontext_t *uc)
{
-/*
- * XXX this is declared in a MD include file, i386/include/ucontext.h but
- * is used in MI code.
- */
-#ifdef __i386__
- get_mcontext(td, &uc->uc_mcontext);
-#endif
+ get_mcontext(td, &uc->uc_mcontext, 0);
PROC_LOCK(td->td_proc);
uc->uc_sigmask = td->td_sigmask;
PROC_UNLOCK(td->td_proc);
@@ -751,15 +745,7 @@ thread_setcontext(struct thread *td, ucontext_t *uc)
{
int ret;
-/*
- * XXX this is declared in a MD include file, i386/include/ucontext.h but
- * is used in MI code.
- */
-#ifdef __i386__
ret = set_mcontext(td, &uc->uc_mcontext);
-#else
- ret = ENOSYS;
-#endif
if (ret == 0) {
SIG_CANTMASK(uc->uc_sigmask);
PROC_LOCK(td->td_proc);
OpenPOWER on IntegriCloud