From owner-p4-projects Sun Aug 18 21:36: 5 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 15A0E37B401; Sun, 18 Aug 2002 21:35:59 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C289837B400 for ; Sun, 18 Aug 2002 21:35:58 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8245F43E6E for ; Sun, 18 Aug 2002 21:35:58 -0700 (PDT) (envelope-from mini@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7J4ZwJU076454 for ; Sun, 18 Aug 2002 21:35:58 -0700 (PDT) (envelope-from mini@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7J4ZwHe076451 for perforce@freebsd.org; Sun, 18 Aug 2002 21:35:58 -0700 (PDT) Date: Sun, 18 Aug 2002 21:35:58 -0700 (PDT) Message-Id: <200208190435.g7J4ZwHe076451@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to mini@freebsd.org using -f From: Jonathan Mini Subject: PERFORCE change 16244 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=16244 Change 16244 by mini@mini_stylus on 2002/08/18 21:35:41 Add function thread_setcontext(), which does the same thing as setcontext(3) in userland, but from the kernel. This is also Dan's code. Affected files ... .. //depot/projects/kse/sys/kern/kern_thread.c#85 edit .. //depot/projects/kse/sys/sys/kse.h#15 edit .. //depot/projects/kse/sys/sys/proc.h#121 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_thread.c#85 (text+ko) ==== @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -189,6 +190,21 @@ allocated_threads--; /* XXXSMP */ } +int +thread_setcontext(struct thread *td, ucontext_t *uc) +{ + int ret; + + ret = set_mcontext(td, &uc->uc_mcontext); + if (ret == 0) { + SIG_CANTMASK(uc->uc_sigmask); + PROC_LOCK(td->td_proc); + td->td_proc->p_sigmask = uc->uc_sigmask; + PROC_UNLOCK(td->td_proc); + } + return (ret); +} + /* * Initialize global thread allocation resources. */ ==== //depot/projects/kse/sys/sys/kse.h#15 (text+ko) ==== @@ -33,6 +33,7 @@ #ifndef SYS_KSE_H #define SYS_KSE_H #include +#include /* * This file defines the structures needed for communication between * the userland and the kernel when running a KSE-based threading system. @@ -75,4 +76,8 @@ }; #define GMBXF_CRITICAL 0x00000001 +#ifdef _KERNEL +int thread_setcontext(struct thread *td, ucontext_t *uc); +#endif /* _KERNEL */ + #endif ==== //depot/projects/kse/sys/sys/proc.h#121 (text+ko) ==== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message