Message ID | 20240617185804.25075-13-itachis@FreeBSD.org |
---|---|
State | New |
Headers | show |
Series | ARM AArch64 Support for BSD | expand |
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~
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 --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 */