aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2014-12-23 15:38:19 +0000
committerMark Johnston <markj@FreeBSD.org>2014-12-23 15:38:19 +0000
commitcafe874475568bdd2f970b192ceb4185461b949d (patch)
treed6778eb5fb483953bf06a32dbffc3c9ff0294312
parent7a19455d223bcf956470de0b6677086df4f78446 (diff)
downloadsrc-cafe874475568bdd2f970b192ceb4185461b949d.tar.gz
src-cafe874475568bdd2f970b192ceb4185461b949d.zip
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.
Notes
Notes: svn path=/head/; revision=276142
-rw-r--r--sys/amd64/amd64/trap.c3
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_subr.c4
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_subr.c4
-rw-r--r--sys/cddl/dev/dtrace/mips/dtrace_subr.c5
-rw-r--r--sys/cddl/dev/dtrace/powerpc/dtrace_subr.c5
-rw-r--r--sys/i386/i386/trap.c2
-rw-r--r--sys/mips/mips/trap.c3
-rw-r--r--sys/powerpc/aim/trap.c2
-rw-r--r--sys/sys/dtrace_bsd.h4
9 files changed, 16 insertions, 16 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index 4880c9135520..67842cfc4a17 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -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);
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index c123cc6aa5bf..805add208cdc 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -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. */
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index e620a8fe6112..4073317e1651 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -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. */
diff --git a/sys/cddl/dev/dtrace/mips/dtrace_subr.c b/sys/cddl/dev/dtrace/mips/dtrace_subr.c
index 5565a616a17c..4f13b9869348 100644
--- a/sys/cddl/dev/dtrace/mips/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/mips/dtrace_subr.c
@@ -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
diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
index 5411ece1f335..a89f1d32adf0 100644
--- a/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
@@ -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:
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 490d4815c7d9..6d35c3af4545 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -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
diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c
index a4405ae5941f..98fe812dc93d 100644
--- a/sys/mips/mips/trap.c
+++ b/sys/mips/mips/trap.c
@@ -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
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c
index 354c63be4f69..2f30d6d5a5be 100644
--- a/sys/powerpc/aim/trap.c
+++ b/sys/powerpc/aim/trap.c
@@ -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
diff --git a/sys/sys/dtrace_bsd.h b/sys/sys/dtrace_bsd.h
index 6bcaf296396a..f46b900e1608 100644
--- a/sys/sys/dtrace_bsd.h
+++ b/sys/sys/dtrace_bsd.h
@@ -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;
/*