git: a7aa3d4d758d - main - fbt/x86: Extract arg1 for return probes from the trapframe

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 09 Aug 2022 23:02:44 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=a7aa3d4d758dc60894e7f9c99411a64837fd3c18

commit a7aa3d4d758dc60894e7f9c99411a64837fd3c18
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-08-09 20:08:09 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-08-09 22:34:01 +0000

    fbt/x86: Extract arg1 for return probes from the trapframe
    
    dtrace invop handlers have access to the whole trapframe, just use that
    to extract %rax/%eax for return probes instead of relying on an
    additional parameter to the handler.  No functional change intended.
    
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
---
 sys/cddl/dev/fbt/x86/fbt_isa.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/cddl/dev/fbt/x86/fbt_isa.c b/sys/cddl/dev/fbt/x86/fbt_isa.c
index 74de00a3f00b..05ec87ab437f 100644
--- a/sys/cddl/dev/fbt/x86/fbt_isa.c
+++ b/sys/cddl/dev/fbt/x86/fbt_isa.c
@@ -61,19 +61,21 @@
 #define	FBT_RETURN	"return"
 
 int
-fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t rval)
+fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch __unused)
 {
 	solaris_cpu_t *cpu;
 	uintptr_t *stack;
-	uintptr_t arg0, arg1, arg2, arg3, arg4;
+	uintptr_t arg0, arg1, arg2, arg3, arg4, rval;
 	fbt_probe_t *fbt;
 	int8_t fbtrval;
 
 #ifdef __amd64__
 	stack = (uintptr_t *)frame->tf_rsp;
+	rval = frame->tf_rax;
 #else
 	/* Skip hardware-saved registers. */
 	stack = (uintptr_t *)frame->tf_isp + 3;
+	rval = frame->tf_eax;
 #endif
 
 	cpu = &solaris_cpu[curcpu];