1 /* SPDX-License-Identifier: GPL-2.0 */ 2 #ifndef __ASM_POWERPC_SYSCALLS_H 3 #define __ASM_POWERPC_SYSCALLS_H 4 #ifdef __KERNEL__ 5 6 #include <linux/compiler.h> 7 #include <linux/linkage.h> 8 #include <linux/types.h> 9 #include <linux/compat.h> 10 11 /* 12 * long long munging: 13 * The 32 bit ABI passes long longs in an odd even register pair. 14 * High and low parts are swapped depending on endian mode, 15 * so define a macro (similar to mips linux32) to handle that. 16 */ 17 #ifdef __LITTLE_ENDIAN__ 18 #define merge_64(low, high) (((u64)high << 32) | low) 19 #else 20 #define merge_64(high, low) (((u64)high << 32) | low) 21 #endif 22 23 struct rtas_args; 24 25 asmlinkage long sys_mmap(unsigned long addr, size_t len, 26 unsigned long prot, unsigned long flags, 27 unsigned long fd, off_t offset); 28 asmlinkage long sys_mmap2(unsigned long addr, size_t len, 29 unsigned long prot, unsigned long flags, 30 unsigned long fd, unsigned long pgoff); 31 asmlinkage long ppc64_personality(unsigned long personality); 32 asmlinkage long sys_rtas(struct rtas_args __user *uargs); 33 34 #ifdef CONFIG_COMPAT 35 unsigned long compat_sys_mmap2(unsigned long addr, size_t len, 36 unsigned long prot, unsigned long flags, 37 unsigned long fd, unsigned long pgoff); 38 39 compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, 40 u32 reg6, u32 pos1, u32 pos2); 41 42 compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, 43 u32 reg6, u32 pos1, u32 pos2); 44 45 compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offset1, u32 offset2, u32 count); 46 47 int compat_sys_truncate64(const char __user *path, u32 reg4, 48 unsigned long len1, unsigned long len2); 49 50 long compat_sys_fallocate(int fd, int mode, u32 offset1, u32 offset2, u32 len1, u32 len2); 51 52 int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long len1, 53 unsigned long len2); 54 55 long ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2, 56 size_t len, int advice); 57 58 long compat_sys_sync_file_range2(int fd, unsigned int flags, 59 unsigned int offset1, unsigned int offset2, 60 unsigned int nbytes1, unsigned int nbytes2); 61 #endif 62 63 #endif /* __KERNEL__ */ 64 #endif /* __ASM_POWERPC_SYSCALLS_H */ 65