lkml.org 
[lkml]   [2022]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V4 08/17] riscv: compat: syscall: Add compat_sys_call_table implementation
> Implement compat sys_call_table and some system call functions:
> truncate64, ftruncate64, fallocate, pread64, pwrite64,
> sync_file_range, readahead, fadvise64_64 which need argument
> translation.
>
> Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
> Signed-off-by: Guo Ren <guoren@kernel.org>
> Cc: Arnd Bergmann <arnd@arndb.de>

This all looks really good, but I would change one detail:

> +#ifndef compat_arg_u64
> +#define compat_arg_u64(name) u32 name##_lo, u32 name##_hi
> +#define compat_arg_u64_dual(name) u32, name##_lo, u32, name##_hi
> +#define compat_arg_u64_glue(name) (((u64)name##_hi << 32) | \
> + ((u64)name##_lo & 0xffffffffUL))
> +#endif

I would make these endian-specific, and reverse them on big-endian
architectures. That way it
should be possible to share them across all compat architectures
without needing the override
option.

Arnd

\
 
 \ /
  Last update: 2022-01-29 23:43    [W:0.242 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site