Deleted Added
full compact
dtrace_subr.c (302408) dtrace_subr.c (315011)
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: stable/11/sys/cddl/dev/dtrace/i386/dtrace_subr.c 299746 2016-05-14 18:22:52Z jhb $
22 * $FreeBSD: stable/11/sys/cddl/dev/dtrace/i386/dtrace_subr.c 315011 2017-03-10 18:51:47Z markj $
23 *
24 */
25/*
26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30/*

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

37#include <sys/cpuset.h>
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/kmem.h>
41#include <sys/smp.h>
42#include <sys/dtrace_impl.h>
43#include <sys/dtrace_bsd.h>
44#include <machine/clock.h>
23 *
24 */
25/*
26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
28 */
29
30/*

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

37#include <sys/cpuset.h>
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/kmem.h>
41#include <sys/smp.h>
42#include <sys/dtrace_impl.h>
43#include <sys/dtrace_bsd.h>
44#include <machine/clock.h>
45#include <machine/cpufunc.h>
45#include <machine/frame.h>
46#include <machine/frame.h>
47#include <machine/psl.h>
46#include <vm/pmap.h>
47
48extern uintptr_t kernelbase;
49
50extern void dtrace_getnanotime(struct timespec *tsp);
51
52int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
53

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

381
382 return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec);
383}
384
385/* Function to handle DTrace traps during probes. See i386/i386/trap.c */
386int
387dtrace_trap(struct trapframe *frame, u_int type)
388{
48#include <vm/pmap.h>
49
50extern uintptr_t kernelbase;
51
52extern void dtrace_getnanotime(struct timespec *tsp);
53
54int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t);
55

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

383
384 return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec);
385}
386
387/* Function to handle DTrace traps during probes. See i386/i386/trap.c */
388int
389dtrace_trap(struct trapframe *frame, u_int type)
390{
391 uint16_t nofault;
392
389 /*
390 * A trap can occur while DTrace executes a probe. Before
391 * executing the probe, DTrace blocks re-scheduling and sets
392 * a flag in its per-cpu flags to indicate that it doesn't
393 * want to fault. On returning from the probe, the no-fault
394 * flag is cleared and finally re-scheduling is enabled.
395 *
396 * Check if DTrace has enabled 'no-fault' mode:
397 */
393 /*
394 * A trap can occur while DTrace executes a probe. Before
395 * executing the probe, DTrace blocks re-scheduling and sets
396 * a flag in its per-cpu flags to indicate that it doesn't
397 * want to fault. On returning from the probe, the no-fault
398 * flag is cleared and finally re-scheduling is enabled.
399 *
400 * Check if DTrace has enabled 'no-fault' mode:
401 */
398 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) {
402 sched_pin();
403 nofault = cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT;
404 sched_unpin();
405 if (nofault) {
406 KASSERT((read_eflags() & PSL_I) == 0, ("interrupts enabled"));
407
399 /*
400 * There are only a couple of trap types that are expected.
401 * All the rest will be handled in the usual way.
402 */
403 switch (type) {
404 /* General protection fault. */
405 case T_PROTFLT:
406 /* Flag an illegal operation. */

--- 29 unchanged lines hidden ---
408 /*
409 * There are only a couple of trap types that are expected.
410 * All the rest will be handled in the usual way.
411 */
412 switch (type) {
413 /* General protection fault. */
414 case T_PROTFLT:
415 /* Flag an illegal operation. */

--- 29 unchanged lines hidden ---