Deleted Added
full compact
dtrace_subr.c (233409) dtrace_subr.c (268600)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

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

14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 *
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *

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

14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 *
22 * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $
22 * $FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 268600 2014-07-14 04:38:17Z markj $
23 *
24 */
25/*
26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30#include <sys/cdefs.h>
23 *
24 */
25/*
26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 233409 2012-03-24 05:14:37Z gonzo $");
31__FBSDID("$FreeBSD: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c 268600 2014-07-14 04:38:17Z markj $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/malloc.h>
38#include <sys/kmem.h>
39#include <sys/smp.h>

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

132
133 getnanotime(&curtime);
134
135 return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec);
136}
137
138/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */
139int
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/malloc.h>
38#include <sys/kmem.h>
39#include <sys/smp.h>

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

132
133 getnanotime(&curtime);
134
135 return (curtime.tv_sec * 1000000000UL + curtime.tv_nsec);
136}
137
138/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */
139int
140dtrace_trap(struct trapframe *frame, u_int type)
140dtrace_trap(struct trapframe *frame)
141{
141{
142 u_int type;
143
144 type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT;
145
142 /*
143 * A trap can occur while DTrace executes a probe. Before
144 * executing the probe, DTrace blocks re-scheduling and sets
146 /*
147 * A trap can occur while DTrace executes a probe. Before
148 * executing the probe, DTrace blocks re-scheduling and sets
145 * a flag in it's per-cpu flags to indicate that it doesn't
149 * a flag in its per-cpu flags to indicate that it doesn't
146 * want to fault. On returning from the probe, the no-fault
147 * flag is cleared and finally re-scheduling is enabled.
148 *
149 * Check if DTrace has enabled 'no-fault' mode:
150 * want to fault. On returning from the probe, the no-fault
151 * flag is cleared and finally re-scheduling is enabled.
152 *
153 * Check if DTrace has enabled 'no-fault' mode:
150 *
151 */
152 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) {
153 /*
154 * There are only a couple of trap types that are expected.
155 * All the rest will be handled in the usual way.
156 */
157 switch (type) {
158 /* Page fault. */

--- 45 unchanged lines hidden ---
154 */
155 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) {
156 /*
157 * There are only a couple of trap types that are expected.
158 * All the rest will be handled in the usual way.
159 */
160 switch (type) {
161 /* Page fault. */

--- 45 unchanged lines hidden ---