aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/riscv/kernel/sys_riscv.c
diff options
context:
space:
mode:
authorGuo Ren <guoren@linux.alibaba.com>2022-04-05 15:13:05 +0800
committerPalmer Dabbelt <palmer@rivosinc.com>2022-04-26 13:36:25 -0700
commit59c10c52f573faca862cda5ebcdd43831608eb5a (patch)
tree786a8dd25890ba8b97f07f01011c02d4a869ad08 /arch/riscv/kernel/sys_riscv.c
parentriscv: compat: Support TASK_SIZE for compat mode (diff)
downloadwireguard-linux-59c10c52f573faca862cda5ebcdd43831608eb5a.tar.xz
wireguard-linux-59c10c52f573faca862cda5ebcdd43831608eb5a.zip
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> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20220405071314.3225832-12-guoren@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/sys_riscv.c')
-rw-r--r--arch/riscv/kernel/sys_riscv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index 12f8a7fce78b..9c0194f176fc 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -33,7 +33,9 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
{
return riscv_sys_mmap(addr, len, prot, flags, fd, offset, 0);
}
-#else
+#endif
+
+#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
unsigned long, prot, unsigned long, flags,
unsigned long, fd, off_t, offset)
@@ -44,7 +46,7 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
*/
return riscv_sys_mmap(addr, len, prot, flags, fd, offset, 12);
}
-#endif /* !CONFIG_64BIT */
+#endif
/*
* Allows the instruction cache to be flushed from userspace. Despite RISC-V