[PATCH 12/23] Add ability to get rval2

Ajeet Singh posted 23 patches 5 months, 1 week ago
Only 22 patches received!
There is a newer version of this series
[PATCH 12/23] Add ability to get rval2
Posted by Ajeet Singh 5 months, 1 week ago
From: Warner Losh <imp@bsdimp.com>

Function accesses the x1 register which holds the value

Signed-off-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Ajeet Singh <itachis@FreeBSD.org>
---
 bsd-user/aarch64/target_arch_vmparam.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bsd-user/aarch64/target_arch_vmparam.h b/bsd-user/aarch64/target_arch_vmparam.h
index dc66e1289b..0c35491970 100644
--- a/bsd-user/aarch64/target_arch_vmparam.h
+++ b/bsd-user/aarch64/target_arch_vmparam.h
@@ -65,4 +65,10 @@ static inline void set_second_rval(CPUARMState *state, abi_ulong retval2)
 {
     state->xregs[1] = retval2; /* XXX not really used on 64-bit arch */
 }
+
+static inline abi_ulong get_second_rval(CPUARMState *state)
+{
+    return state->xregs[1];
+}
+
 #endif /* TARGET_ARCH_VMPARAM_H */
-- 
2.34.1
Re: [PATCH 12/23] Add ability to get rval2
Posted by Richard Henderson 5 months, 1 week ago
On 6/17/24 11:57, Ajeet Singh wrote:
> From: Warner Losh <imp@bsdimp.com>
> 
> Function accesses the x1 register which holds the value
> 
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> Signed-off-by: Ajeet Singh <itachis@FreeBSD.org>
> ---
>   bsd-user/aarch64/target_arch_vmparam.h | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/bsd-user/aarch64/target_arch_vmparam.h b/bsd-user/aarch64/target_arch_vmparam.h
> index dc66e1289b..0c35491970 100644
> --- a/bsd-user/aarch64/target_arch_vmparam.h
> +++ b/bsd-user/aarch64/target_arch_vmparam.h
> @@ -65,4 +65,10 @@ static inline void set_second_rval(CPUARMState *state, abi_ulong retval2)
>   {
>       state->xregs[1] = retval2; /* XXX not really used on 64-bit arch */
>   }
> +
> +static inline abi_ulong get_second_rval(CPUARMState *state)
> +{
> +    return state->xregs[1];
> +}

The other two ports only define set_second_rval, and this one only defines get?  This 
doesn't seem right...


r~
Re: [PATCH 12/23] Add ability to get rval2
Posted by Warner Losh 5 months ago
On Tue, Jun 18, 2024 at 4:17 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 6/17/24 11:57, Ajeet Singh wrote:
> > From: Warner Losh <imp@bsdimp.com>
> >
> > Function accesses the x1 register which holds the value
> >
> > Signed-off-by: Warner Losh <imp@bsdimp.com>
> > Signed-off-by: Ajeet Singh <itachis@FreeBSD.org>
> > ---
> >   bsd-user/aarch64/target_arch_vmparam.h | 6 ++++++
> >   1 file changed, 6 insertions(+)
> >
> > diff --git a/bsd-user/aarch64/target_arch_vmparam.h
> b/bsd-user/aarch64/target_arch_vmparam.h
> > index dc66e1289b..0c35491970 100644
> > --- a/bsd-user/aarch64/target_arch_vmparam.h
> > +++ b/bsd-user/aarch64/target_arch_vmparam.h
> > @@ -65,4 +65,10 @@ static inline void set_second_rval(CPUARMState
> *state, abi_ulong retval2)
> >   {
> >       state->xregs[1] = retval2; /* XXX not really used on 64-bit arch */
> >   }
> > +
> > +static inline abi_ulong get_second_rval(CPUARMState *state)
> > +{
> > +    return state->xregs[1];
> > +}
>
> The other two ports only define set_second_rval, and this one only defines
> get?  This
> doesn't seem right...
>

The other two ports need to have this added. Upstream, there's some code
that uses this in the system call tracing path.

Warner