diff mbox series

[12/23] Add ability to get rval2

Message ID 20240617185804.25075-13-itachis@FreeBSD.org
State New
Headers show
Series ARM AArch64 Support for BSD | expand

Commit Message

Ajeet Singh June 17, 2024, 6:57 p.m. UTC
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(+)

Comments

Richard Henderson June 18, 2024, 10:17 p.m. UTC | #1
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~
Warner Losh June 23, 2024, 10:48 p.m. UTC | #2
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
diff mbox series

Patch

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 */