aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris/uts/powerpc
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2017-12-11 19:21:39 +0000
committerMark Johnston <markj@FreeBSD.org>2017-12-11 19:21:39 +0000
commit5bab62343899b8c1aeaa4902a179423ef8915ec0 (patch)
treeb003bb357619076090e15658f79c4d2b72bca41c /sys/cddl/contrib/opensolaris/uts/powerpc
parentb9f5a3d3c0e43f210e8bd2c4cb5521e1445b7102 (diff)
downloadsrc-5bab62343899b8c1aeaa4902a179423ef8915ec0.tar.gz
src-5bab62343899b8c1aeaa4902a179423ef8915ec0.zip
Pass the trap frame to fasttrap hooks.
The DTrace fasttrap entry points expect a struct reg containing the register values of the calling thread. Perform the conversion in fasttrap rather than in the trap handler: this reduces the number of ifdefs and avoids wasting stack space for traps that don't involve DTrace. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=326774
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/powerpc')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c b/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
index b0fc5816c5e3..a2732cb5d56f 100644
--- a/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
+++ b/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c
@@ -328,8 +328,9 @@ fasttrap_branch_taken(int bo, int bi, struct reg *regs)
int
-fasttrap_pid_probe(struct reg *rp)
+fasttrap_pid_probe(struct trapframe *frame)
{
+ struct reg reg, *rp;
struct rm_priotracker tracker;
proc_t *p = curproc;
uintptr_t pc = rp->pc;
@@ -340,6 +341,9 @@ fasttrap_pid_probe(struct reg *rp)
dtrace_icookie_t cookie;
uint_t is_enabled = 0;
+ fill_regs(curthread, &reg);
+ rp = &reg;
+
/*
* It's possible that a user (in a veritable orgy of bad planning)
* could redirect this thread's flow of control before it reached the
@@ -515,8 +519,9 @@ done:
}
int
-fasttrap_return_probe(struct reg *rp)
+fasttrap_return_probe(struct trapframe *tf)
{
+ struct reg reg, *rp;
proc_t *p = curproc;
uintptr_t pc = curthread->t_dtrace_pc;
uintptr_t npc = curthread->t_dtrace_npc;
@@ -526,12 +531,13 @@ fasttrap_return_probe(struct reg *rp)
curthread->t_dtrace_scrpc = 0;
curthread->t_dtrace_astpc = 0;
+ fill_regs(curthread, &reg);
+ rp = &reg;
+
/*
* We set rp->pc to the address of the traced instruction so
* that it appears to dtrace_probe() that we're on the original
- * instruction, and so that the user can't easily detect our
- * complex web of lies. dtrace_return_probe() (our caller)
- * will correctly set %pc after we return.
+ * instruction.
*/
rp->pc = pc;
@@ -539,4 +545,3 @@ fasttrap_return_probe(struct reg *rp)
return (0);
}
-