aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2014-03-01 17:55:20 +0000
committerMark Johnston <markj@FreeBSD.org>2014-03-01 17:55:20 +0000
commitae520d3dc40708b15aa59aad84d875dbdf8eb14c (patch)
tree476cc7640fd1fad58ba9c9e81ef7f641fa96dc48
parent21efc33edcf64049e08f2014dfe31267c947b81a (diff)
downloadsrc-ae520d3dc40708b15aa59aad84d875dbdf8eb14c.tar.gz
src-ae520d3dc40708b15aa59aad84d875dbdf8eb14c.zip
Fix emulation of call and jmp instructions on i386 and for 32-bit processes
on amd64. Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in> MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=262661
-rw-r--r--sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
index 2a3e755a9cce..519956246b28 100644
--- a/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
+++ b/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
@@ -1442,10 +1442,7 @@ fasttrap_pid_probe(struct reg *rp)
if (tp->ftt_code == 0) {
new_pc = tp->ftt_dest;
} else {
-#ifdef __amd64
- uintptr_t value;
-#endif
- uintptr_t addr = tp->ftt_dest;
+ uintptr_t value, addr = tp->ftt_dest;
if (tp->ftt_base != FASTTRAP_NOREG)
addr += fasttrap_getreg(rp, tp->ftt_base);
@@ -1469,6 +1466,7 @@ fasttrap_pid_probe(struct reg *rp)
#ifdef __amd64
if (p->p_model == DATAMODEL_NATIVE) {
+#endif
if ((value = fasttrap_fulword((void *)addr))
== -1) {
fasttrap_sigsegv(p, curthread,
@@ -1477,9 +1475,8 @@ fasttrap_pid_probe(struct reg *rp)
break;
}
new_pc = value;
+#ifdef __amd64
} else {
-#endif
-#ifdef __i386__
uint32_t value32;
addr = (uintptr_t)(uint32_t)addr;
if ((value32 = fasttrap_fuword32((void *)addr))
@@ -1490,13 +1487,11 @@ fasttrap_pid_probe(struct reg *rp)
break;
}
new_pc = value32;
-#endif
}
-#ifdef __amd64
+#endif
} else {
new_pc = addr;
}
-#endif
}
/*
@@ -1515,11 +1510,9 @@ fasttrap_pid_probe(struct reg *rp)
ret = fasttrap_sulword((void *)addr, pcps);
} else {
#endif
-#ifdef __i386__
addr = rp->r_rsp - sizeof (uint32_t);
pcps = (uint32_t)(pc + tp->ftt_size);
ret = fasttrap_suword32((void *)addr, pcps);
-#endif
#ifdef __amd64
}
#endif