git: edf2d935b50a - stable/13 - fbt/x86: Extract arg1 for return probes from the trapframe

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 23 Aug 2022 20:46:51 UTC
The branch stable/13 has been updated by markj:

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

commit edf2d935b50abefdf5f1dd9bb3670f74ce0f8698
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-08-09 20:08:09 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-08-23 20:03:02 +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.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit a7aa3d4d758dc60894e7f9c99411a64837fd3c18)
---
 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];