lkml.org 
[lkml]   [2021]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2021-12-21 18:14    [W:0.133 / U:3.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site