Author: jhb Date: Wed Jul 14 21:48:16 2010 New Revision: 210084 URL: http://svn.freebsd.org/changeset/base/210084
Log: Partially MFC 209592: Add a tdksignal() routine that mirrors pksignal() except that it accepts a thread instead of a process. As an extension, if a NULL ksiginfo_t is passed in, setup a ksiginfo_t on the stack similar to psignal(). This provides semantics matching the new tdsignal() function in 9 while preserving the existing ABI. Modified: stable/8/sys/kern/kern_sig.c stable/8/sys/sys/signalvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Wed Jul 14 21:47:49 2010 (r210083) +++ stable/8/sys/kern/kern_sig.c Wed Jul 14 21:48:16 2010 (r210084) @@ -1987,6 +1987,24 @@ psignal_event(struct proc *p, struct sig return (tdsignal(p, td, ksi->ksi_signo, ksi)); } +void +tdksignal(struct thread *td, int sig, ksiginfo_t *ksi) +{ + ksiginfo_t ksi_thunk; + + /* + * If ksi is NULL, use ksi_thunk and provide semantics + * identical to tdsignal() in 9.0+. + */ + if (ksi == NULL) { + ksi = &ksi_thunk; + ksiginfo_init(ksi); + ksi->ksi_signo = sig; + ksi->ksi_code = SI_KERNEL; + } + (void) tdsignal(td->td_proc, td, sig, ksi); +} + int tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi) { Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Wed Jul 14 21:47:49 2010 (r210083) +++ stable/8/sys/sys/signalvar.h Wed Jul 14 21:48:16 2010 (r210084) @@ -345,6 +345,7 @@ void sigexit(struct thread *td, int sign int sig_ffs(sigset_t *set); void siginit(struct proc *p); void signotify(struct thread *td); +void tdksignal(struct thread *td, int sig, ksiginfo_t *ksi); void tdsigcleanup(struct thread *td); int tdsignal(struct proc *p, struct thread *td, int sig, ksiginfo_t *ksi); _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"