Deleted Added
full compact
subr_trap.c (173601) subr_trap.c (174395)
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 * Copyright (c) 2007 The FreeBSD Foundation
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the University of Utah, and William Jolitz.
8 *
6 *
7 * This code is derived from software contributed to Berkeley by
8 * the University of Utah, and William Jolitz.
9 *
10 * Portions of this software were developed by A. Joseph Koshy under
11 * sponsorship from the FreeBSD Foundation and Google, Inc.
12 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.

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

33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
38 */
39
40#include <sys/cdefs.h>
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.

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

37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * SUCH DAMAGE.
40 *
41 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
42 */
43
44#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/sys/kern/subr_trap.c 173601 2007-11-14 06:51:33Z julian $");
45__FBSDID("$FreeBSD: head/sys/kern/subr_trap.c 174395 2007-12-07 08:20:17Z jkoshy $");
42
46
47#include "opt_hwpmc_hooks.h"
43#include "opt_ktrace.h"
44#include "opt_mac.h"
45#ifdef __i386__
46#include "opt_npx.h"
47#endif
48#include "opt_sched.h"
49
50#include <sys/param.h>
51#include <sys/bus.h>
52#include <sys/kernel.h>
53#include <sys/lock.h>
54#include <sys/mutex.h>
48#include "opt_ktrace.h"
49#include "opt_mac.h"
50#ifdef __i386__
51#include "opt_npx.h"
52#endif
53#include "opt_sched.h"
54
55#include <sys/param.h>
56#include <sys/bus.h>
57#include <sys/kernel.h>
58#include <sys/lock.h>
59#include <sys/mutex.h>
60#include <sys/pmckern.h>
55#include <sys/proc.h>
56#include <sys/ktr.h>
57#include <sys/resourcevar.h>
58#include <sys/sched.h>
59#include <sys/signalvar.h>
60#include <sys/systm.h>
61#include <sys/vmmeter.h>
62#ifdef KTRACE

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

196 */
197 if (td->td_ucred != p->p_ucred)
198 cred_update_thread(td);
199 if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
200 addupc_task(td, td->td_profil_addr, td->td_profil_ticks);
201 td->td_profil_ticks = 0;
202 td->td_pflags &= ~TDP_OWEUPC;
203 }
61#include <sys/proc.h>
62#include <sys/ktr.h>
63#include <sys/resourcevar.h>
64#include <sys/sched.h>
65#include <sys/signalvar.h>
66#include <sys/systm.h>
67#include <sys/vmmeter.h>
68#ifdef KTRACE

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

202 */
203 if (td->td_ucred != p->p_ucred)
204 cred_update_thread(td);
205 if (td->td_pflags & TDP_OWEUPC && p->p_flag & P_PROFIL) {
206 addupc_task(td, td->td_profil_addr, td->td_profil_ticks);
207 td->td_profil_ticks = 0;
208 td->td_pflags &= ~TDP_OWEUPC;
209 }
210#if defined(HWPMC_HOOKS)
211 if (td->td_pflags & TDP_CALLCHAIN) {
212 PMC_CALL_HOOK_UNLOCKED(td, PMC_FN_USER_CALLCHAIN,
213 (void *) framep);
214 td->td_pflags &= ~TDP_CALLCHAIN;
215 }
216#endif
204 if (flags & TDF_ALRMPEND) {
205 PROC_LOCK(p);
206 psignal(p, SIGVTALRM);
207 PROC_UNLOCK(p);
208 }
209#if defined(DEV_NPX) && !defined(SMP)
210 if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) {
211 atomic_clear_int(&PCPU_GET(curpcb)->pcb_flags,

--- 46 unchanged lines hidden ---
217 if (flags & TDF_ALRMPEND) {
218 PROC_LOCK(p);
219 psignal(p, SIGVTALRM);
220 PROC_UNLOCK(p);
221 }
222#if defined(DEV_NPX) && !defined(SMP)
223 if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) {
224 atomic_clear_int(&PCPU_GET(curpcb)->pcb_flags,

--- 46 unchanged lines hidden ---