aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGeorge V. Neville-Neil <gnn@FreeBSD.org>2012-06-04 16:15:40 +0000
committerGeorge V. Neville-Neil <gnn@FreeBSD.org>2012-06-04 16:15:40 +0000
commit4737d389b0dc2d93fb731ad5976b5451ab6488e3 (patch)
tree3069c8e539de6a1cfdc484c87884bd16998d328f /sys
parentdb5c7d363db6ae18902d7071b6bed09e2bea6d3f (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/cddl/dev/dtrace/amd64/dtrace_subr.c19
-rw-r--r--sys/cddl/dev/dtrace/i386/dtrace_subr.c19
2 files changed, 24 insertions, 14 deletions
diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
index d80287ba964c..48952314ecf8 100644
--- a/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
@@ -27,6 +27,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
@@ -297,14 +301,15 @@ dtrace_safe_defer_signal(void)
}
/*
- * If we've executed the original instruction, but haven't performed
- * the jmp back to t->t_dtrace_npc or the clean up of any registers
- * used to emulate %rip-relative instructions in 64-bit mode, do that
- * here and take the signal right away. We detect this condition by
- * seeing if the program counter is the range [scrpc + isz, astpc).
+ * If we have executed the original instruction, but we have performed
+ * neither the jmp back to t->t_dtrace_npc nor the clean up of any
+ * registers used to emulate %rip-relative instructions in 64-bit mode,
+ * we'll save ourselves some effort by doing that here and taking the
+ * signal right away. We detect this condition by seeing if the program
+ * counter is the range [scrpc + isz, astpc).
*/
- if (t->t_dtrace_astpc - rp->r_pc <
- t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+ if (rp->r_pc >= t->t_dtrace_scrpc + isz &&
+ rp->r_pc < t->t_dtrace_astpc) {
#ifdef __amd64
/*
* If there is a scratch register and we're on the
diff --git a/sys/cddl/dev/dtrace/i386/dtrace_subr.c b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
index e0e9750583f8..e8384bf66edf 100644
--- a/sys/cddl/dev/dtrace/i386/dtrace_subr.c
+++ b/sys/cddl/dev/dtrace/i386/dtrace_subr.c
@@ -27,6 +27,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
@@ -298,14 +302,15 @@ dtrace_safe_defer_signal(void)
}
/*
- * If we've executed the original instruction, but haven't performed
- * the jmp back to t->t_dtrace_npc or the clean up of any registers
- * used to emulate %rip-relative instructions in 64-bit mode, do that
- * here and take the signal right away. We detect this condition by
- * seeing if the program counter is the range [scrpc + isz, astpc).
+ * If we have executed the original instruction, but we have performed
+ * neither the jmp back to t->t_dtrace_npc nor the clean up of any
+ * registers used to emulate %rip-relative instructions in 64-bit mode,
+ * we'll save ourselves some effort by doing that here and taking the
+ * signal right away. We detect this condition by seeing if the program
+ * counter is the range [scrpc + isz, astpc).
*/
- if (t->t_dtrace_astpc - rp->r_pc <
- t->t_dtrace_astpc - t->t_dtrace_scrpc - isz) {
+ if (rp->r_pc >= t->t_dtrace_scrpc + isz &&
+ rp->r_pc < t->t_dtrace_astpc) {
#ifdef __amd64
/*
* If there is a scratch register and we're on the