Deleted Added
full compact
procfs_ctl.c (155918) procfs_ctl.c (170307)
1/*-
2 * Copyright (c) 1993 Jan-Simon Pendry
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94
34 *
35 * From:
36 * $Id: procfs_ctl.c,v 1.51 2003/12/07 17:40:00 des Exp $
1/*-
2 * Copyright (c) 1993 Jan-Simon Pendry
3 * Copyright (c) 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

--- 20 unchanged lines hidden (view full) ---

29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94
34 *
35 * From:
36 * $Id: procfs_ctl.c,v 1.51 2003/12/07 17:40:00 des Exp $
37 * $FreeBSD: head/sys/fs/procfs/procfs_ctl.c 155918 2006-02-22 17:20:37Z jhb $
37 * $FreeBSD: head/sys/fs/procfs/procfs_ctl.c 170307 2007-06-05 00:00:57Z jeff $
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>
43#include <sys/mutex.h>
44#include <sys/proc.h>
45#include <sys/ptrace.h>

--- 235 unchanged lines hidden (view full) ---

281 PWAIT|PCATCH, "procfs", 0);
282 }
283 PROC_UNLOCK(p);
284 return (error);
285 default:
286 panic("procfs_control");
287 }
288
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>
43#include <sys/mutex.h>
44#include <sys/proc.h>
45#include <sys/ptrace.h>

--- 235 unchanged lines hidden (view full) ---

281 PWAIT|PCATCH, "procfs", 0);
282 }
283 PROC_UNLOCK(p);
284 return (error);
285 default:
286 panic("procfs_control");
287 }
288
289 mtx_lock_spin(&sched_lock);
289 PROC_SLOCK(p);
290 thread_unsuspend(p); /* If it can run, let it do so. */
290 thread_unsuspend(p); /* If it can run, let it do so. */
291 mtx_unlock_spin(&sched_lock);
291 PROC_SUNLOCK(p);
292 return (0);
293}
294
295static struct namemap *
296findname(struct namemap *nm, char *buf, int buflen)
297{
298
299 for (; nm->nm_name; nm++)

--- 39 unchanged lines hidden (view full) ---

339 if (TRACE_WAIT_P(td->td_proc, p)) {
340 p->p_xstat = nm->nm_val;
341#ifdef FIX_SSTEP
342 /* XXXKSE: */
343 FIX_SSTEP(FIRST_THREAD_IN_PROC(p));
344#endif
345 /* XXXKSE: */
346 p->p_flag &= ~P_STOPPED_SIG;
292 return (0);
293}
294
295static struct namemap *
296findname(struct namemap *nm, char *buf, int buflen)
297{
298
299 for (; nm->nm_name; nm++)

--- 39 unchanged lines hidden (view full) ---

339 if (TRACE_WAIT_P(td->td_proc, p)) {
340 p->p_xstat = nm->nm_val;
341#ifdef FIX_SSTEP
342 /* XXXKSE: */
343 FIX_SSTEP(FIRST_THREAD_IN_PROC(p));
344#endif
345 /* XXXKSE: */
346 p->p_flag &= ~P_STOPPED_SIG;
347 mtx_lock_spin(&sched_lock);
347 PROC_SLOCK(p);
348 thread_unsuspend(p);
348 thread_unsuspend(p);
349 mtx_unlock_spin(&sched_lock);
349 PROC_SUNLOCK(p);
350 } else
351 psignal(p, nm->nm_val);
352 PROC_UNLOCK(p);
353 error = 0;
354 }
355 }
356
357 return (error);
358}
350 } else
351 psignal(p, nm->nm_val);
352 PROC_UNLOCK(p);
353 error = 0;
354 }
355 }
356
357 return (error);
358}