Thread (19 messages) flat view 19 messages, 4 authors, 2022-03-15

Re: [PATCH 6/6] powerpc/compat_sys: Declare syscalls

From: Christophe Leroy <hidden>
Date: 2022-03-15 11:45:58


Le 19/08/2021 à 14:56, Cédric Le Goater a écrit :
This fixes a compile error with W=1.

Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>

Instead of doing that, we should use COMPAT_SYSCALL_DEFINEx macros in 
the function definitions.

Thanks
Christophe
quoted hunk ↗ jump to hunk
---
  arch/powerpc/include/asm/syscalls.h | 31 +++++++++++++++++++++++++++++
  1 file changed, 31 insertions(+)
diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h
index 398171fdcd9f..1d5f2abaa38a 100644
--- a/arch/powerpc/include/asm/syscalls.h
+++ b/arch/powerpc/include/asm/syscalls.h
@@ -6,6 +6,7 @@
  #include <linux/compiler.h>
  #include <linux/linkage.h>
  #include <linux/types.h>
+#include <linux/compat.h>
  
  struct rtas_args;
  
@@ -18,5 +19,35 @@ asmlinkage long sys_mmap2(unsigned long addr, size_t len,
  asmlinkage long ppc64_personality(unsigned long personality);
  asmlinkage long sys_rtas(struct rtas_args __user *uargs);
  
+#ifdef CONFIG_COMPAT
+unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
+			       unsigned long prot, unsigned long flags,
+			       unsigned long fd, unsigned long pgoff);
+
+compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
+				  u32 reg6, u32 pos1, u32 pos2);
+
+compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
+				   u32 reg6, u32 pos1, u32 pos2);
+
+compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offset1, u32 offset2, u32 count);
+
+asmlinkage int compat_sys_truncate64(const char __user *path, u32 reg4,
+				     unsigned long len1, unsigned long len2);
+
+asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offset1, u32 offset2,
+				     u32 len1, u32 len2);
+
+asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long len1,
+				      unsigned long len2);
+
+long ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
+		     size_t len, int advice);
+
+asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
+					    unsigned int offset1, unsigned int offset2,
+					    unsigned int nbytes1, unsigned int nbytes2);
+#endif
+
  #endif /* __KERNEL__ */
  #endif /* __ASM_POWERPC_SYSCALLS_H */
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help