Messages in this thread | | | From | Arnd Bergmann <> | Date | Tue, 21 Dec 2021 18:12:46 +0100 | Subject | Re: [PATCH 03/13] riscv: compat: Add basic compat date type implementation |
| |
On Tue, Dec 21, 2021 at 5:35 PM <guoren@kernel.org> wrote: > > From: Guo Ren <guoren@linux.alibaba.com> > > Implement asm/compat.h for struct compat_xxx, RLIM_INFINITY, > OFF_T_MAX, is_compat_task, compat_user_regset, regset convert. > > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > --- > arch/riscv/include/asm/compat.h | 259 +++++++++++++++++++++++++++
Since both the native and compat side use the generic interface, I think this should all be part of asm-generic/compat.h, in case other architectures want to share this in the future. Maybe see if any other architectures use the same definition for some of the structures and then remove the duplicates.
> +struct compat_stat { > + compat_ulong_t st_dev; > + compat_ulong_t st_ino; > + compat_uint_t st_mode; > + compat_uint_t st_nlink;
You should not need a compat_stat, because native rv32 does not have a stat() syscall.
> +static inline int is_compat_task(void) > +{ > + return test_thread_flag(TIF_32BIT); > +} > + > +struct compat_user_regs_struct { > + compat_ulong_t pc; > + compat_ulong_t ra;
These clearly need to stay in arch/riscv
Arnd
| |