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/amd64/dtrace_subr.c 299746 2016-05-14 18:22:52Z jhb $ | 22 * $FreeBSD: stable/11/sys/cddl/dev/dtrace/amd64/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/* --- 5 unchanged lines hidden (view full) --- 36#include <sys/types.h> 37#include <sys/kernel.h> 38#include <sys/malloc.h> 39#include <sys/kmem.h> 40#include <sys/smp.h> 41#include <sys/dtrace_impl.h> 42#include <sys/dtrace_bsd.h> 43#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/* --- 5 unchanged lines hidden (view full) --- 36#include <sys/types.h> 37#include <sys/kernel.h> 38#include <sys/malloc.h> 39#include <sys/kmem.h> 40#include <sys/smp.h> 41#include <sys/dtrace_impl.h> 42#include <sys/dtrace_bsd.h> 43#include <machine/clock.h> |
44#include <machine/cpufunc.h> |
|
44#include <machine/frame.h> | 45#include <machine/frame.h> |
46#include <machine/psl.h> |
|
45#include <vm/pmap.h> 46 47extern void dtrace_getnanotime(struct timespec *tsp); 48 49int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); 50 51typedef struct dtrace_invop_hdlr { 52 int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); --- 326 unchanged lines hidden (view full) --- 379 380 return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); 381} 382 383/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c. */ 384int 385dtrace_trap(struct trapframe *frame, u_int type) 386{ | 47#include <vm/pmap.h> 48 49extern void dtrace_getnanotime(struct timespec *tsp); 50 51int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); 52 53typedef struct dtrace_invop_hdlr { 54 int (*dtih_func)(uintptr_t, struct trapframe *, uintptr_t); --- 326 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 amd64/amd64/trap.c. */ 386int 387dtrace_trap(struct trapframe *frame, u_int type) 388{ |
389 uint16_t nofault; 390 |
|
387 /* 388 * A trap can occur while DTrace executes a probe. Before 389 * executing the probe, DTrace blocks re-scheduling and sets 390 * a flag in its per-cpu flags to indicate that it doesn't 391 * want to fault. On returning from the probe, the no-fault 392 * flag is cleared and finally re-scheduling is enabled. 393 * 394 * Check if DTrace has enabled 'no-fault' mode: 395 */ | 391 /* 392 * A trap can occur while DTrace executes a probe. Before 393 * executing the probe, DTrace blocks re-scheduling and sets 394 * a flag in its per-cpu flags to indicate that it doesn't 395 * want to fault. On returning from the probe, the no-fault 396 * flag is cleared and finally re-scheduling is enabled. 397 * 398 * Check if DTrace has enabled 'no-fault' mode: 399 */ |
396 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { | 400 sched_pin(); 401 nofault = cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT; 402 sched_unpin(); 403 if (nofault) { 404 KASSERT((read_rflags() & PSL_I) == 0, ("interrupts enabled")); 405 |
397 /* 398 * There are only a couple of trap types that are expected. 399 * All the rest will be handled in the usual way. 400 */ 401 switch (type) { 402 /* General protection fault. */ 403 case T_PROTFLT: 404 /* Flag an illegal operation. */ --- 29 unchanged lines hidden --- | 406 /* 407 * There are only a couple of trap types that are expected. 408 * All the rest will be handled in the usual way. 409 */ 410 switch (type) { 411 /* General protection fault. */ 412 case T_PROTFLT: 413 /* Flag an illegal operation. */ --- 29 unchanged lines hidden --- |