From owner-svn-src-head@FreeBSD.ORG Tue Dec 23 15:38:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D6A74EE; Tue, 23 Dec 2014 15:38:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAFBC64034; Tue, 23 Dec 2014 15:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBNFcMGF091264; Tue, 23 Dec 2014 15:38:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBNFcKrx091251; Tue, 23 Dec 2014 15:38:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412231538.sBNFcKrx091251@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 23 Dec 2014 15:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r276142 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/mips cddl/dev/dtrace/powerpc i386/i386 mips/mips powerpc/aim sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2014 15:38:23 -0000 Author: markj Date: Tue Dec 23 15:38:19 2014 New Revision: 276142 URL: https://svnweb.freebsd.org/changeset/base/276142 Log: Restore the trap type argument to the DTrace trap hook, removed in r268600. It's redundant at the moment since it can be obtained from the trapframe on the architectures where DTrace is supported, but this won't be the case with ARM. Modified: head/sys/amd64/amd64/trap.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c head/sys/i386/i386/trap.c head/sys/mips/mips/trap.c head/sys/powerpc/aim/trap.c head/sys/sys/dtrace_bsd.h Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/amd64/amd64/trap.c Tue Dec 23 15:38:19 2014 (r276142) @@ -614,7 +614,8 @@ trap_check(struct trapframe *frame) { #ifdef KDTRACE_HOOKS - if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) + if (dtrace_trap_func != NULL && + (*dtrace_trap_func)(frame, frame->tf_trapno) != 0) return; #endif trap(frame); Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue Dec 23 15:38:19 2014 (r276142) @@ -464,7 +464,7 @@ dtrace_gethrestime(void) /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c. */ int -dtrace_trap(struct trapframe *frame) +dtrace_trap(struct trapframe *frame, u_int type) { /* * A trap can occur while DTrace executes a probe. Before @@ -480,7 +480,7 @@ dtrace_trap(struct trapframe *frame) * There are only a couple of trap types that are expected. * All the rest will be handled in the usual way. */ - switch (frame->tf_trapno) { + switch (type) { /* General protection fault. */ case T_PROTFLT: /* Flag an illegal operation. */ Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 23 15:38:19 2014 (r276142) @@ -473,7 +473,7 @@ dtrace_gethrestime(void) /* Function to handle DTrace traps during probes. See i386/i386/trap.c */ int -dtrace_trap(struct trapframe *frame) +dtrace_trap(struct trapframe *frame, u_int type) { /* * A trap can occur while DTrace executes a probe. Before @@ -489,7 +489,7 @@ dtrace_trap(struct trapframe *frame) * There are only a couple of trap types that are expected. * All the rest will be handled in the usual way. */ - switch (frame->tf_trapno) { + switch (type) { /* General protection fault. */ case T_PROTFLT: /* Flag an illegal operation. */ Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Tue Dec 23 15:38:19 2014 (r276142) @@ -137,11 +137,8 @@ dtrace_gethrestime(void) /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ int -dtrace_trap(struct trapframe *frame) +dtrace_trap(struct trapframe *frame, u_int type) { - u_int type; - - type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; /* * A trap can occur while DTrace executes a probe. Before Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Tue Dec 23 15:38:19 2014 (r276142) @@ -262,8 +262,9 @@ dtrace_gethrestime(void) /* Function to handle DTrace traps during probes. See powerpc/powerpc/trap.c */ int -dtrace_trap(struct trapframe *frame) +dtrace_trap(struct trapframe *frame, u_int type) { + /* * A trap can occur while DTrace executes a probe. Before * executing the probe, DTrace blocks re-scheduling and sets @@ -278,7 +279,7 @@ dtrace_trap(struct trapframe *frame) * There are only a couple of trap types that are expected. * All the rest will be handled in the usual way. */ - switch (frame->exc) { + switch (type) { /* Page fault. */ case EXC_DSI: case EXC_DSE: Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/i386/i386/trap.c Tue Dec 23 15:38:19 2014 (r276142) @@ -246,7 +246,7 @@ trap(struct trapframe *frame) * flag is cleared and finally re-scheduling is enabled. */ if ((type == T_PROTFLT || type == T_PAGEFLT) && - dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) + dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) goto out; #endif Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/mips/mips/trap.c Tue Dec 23 15:38:19 2014 (r276142) @@ -617,7 +617,8 @@ trap(struct trapframe *trapframe) * XXXDTRACE: add pid probe handler here (if ever) */ if (!usermode) { - if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe)) + if (dtrace_trap_func != NULL && + (*dtrace_trap_func)(trapframe, type) != 0) return (trapframe->pc); } #endif Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/powerpc/aim/trap.c Tue Dec 23 15:38:19 2014 (r276142) @@ -177,7 +177,7 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type) != 0) return; #endif Modified: head/sys/sys/dtrace_bsd.h ============================================================================== --- head/sys/sys/dtrace_bsd.h Tue Dec 23 15:18:28 2014 (r276141) +++ head/sys/sys/dtrace_bsd.h Tue Dec 23 15:38:19 2014 (r276142) @@ -39,14 +39,14 @@ struct vattr; struct vnode; struct reg; -int dtrace_trap(struct trapframe *); +int dtrace_trap(struct trapframe *, u_int); /* * The dtrace module handles traps that occur during a DTrace probe. * This type definition is used in the trap handler to provide a * hook for the dtrace module to register its handler with. */ -typedef int (*dtrace_trap_func_t)(struct trapframe *); +typedef int (*dtrace_trap_func_t)(struct trapframe *, u_int); extern dtrace_trap_func_t dtrace_trap_func; /*