1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2b8b572e1SStephen Rothwell #ifndef __ASM_POWERPC_SYSCALLS_H 3b8b572e1SStephen Rothwell #define __ASM_POWERPC_SYSCALLS_H 4b8b572e1SStephen Rothwell #ifdef __KERNEL__ 5b8b572e1SStephen Rothwell 6b8b572e1SStephen Rothwell #include <linux/compiler.h> 7b8b572e1SStephen Rothwell #include <linux/linkage.h> 8b8b572e1SStephen Rothwell #include <linux/types.h> 9cc47ad40SCédric Le Goater #include <linux/compat.h> 10b8b572e1SStephen Rothwell 11016ff72bSRohan McLure /* 12016ff72bSRohan McLure * long long munging: 13016ff72bSRohan McLure * The 32 bit ABI passes long longs in an odd even register pair. 14016ff72bSRohan McLure * High and low parts are swapped depending on endian mode, 15016ff72bSRohan McLure * so define a macro (similar to mips linux32) to handle that. 16016ff72bSRohan McLure */ 17016ff72bSRohan McLure #ifdef __LITTLE_ENDIAN__ 18016ff72bSRohan McLure #define merge_64(low, high) (((u64)high << 32) | low) 19016ff72bSRohan McLure #else 20016ff72bSRohan McLure #define merge_64(high, low) (((u64)high << 32) | low) 21016ff72bSRohan McLure #endif 22016ff72bSRohan McLure 23b8b572e1SStephen Rothwell struct rtas_args; 24b8b572e1SStephen Rothwell 255ba6c9a9SRohan McLure long sys_mmap(unsigned long addr, size_t len, 26b8b572e1SStephen Rothwell unsigned long prot, unsigned long flags, 27b8b572e1SStephen Rothwell unsigned long fd, off_t offset); 285ba6c9a9SRohan McLure long sys_mmap2(unsigned long addr, size_t len, 29b8b572e1SStephen Rothwell unsigned long prot, unsigned long flags, 30b8b572e1SStephen Rothwell unsigned long fd, unsigned long pgoff); 31*dec20c50SRohan McLure long sys_ppc64_personality(unsigned long personality); 325ba6c9a9SRohan McLure long sys_rtas(struct rtas_args __user *uargs); 33*dec20c50SRohan McLure long sys_ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, 3476222808SChristophe Leroy u32 len_high, u32 len_low); 35b8b572e1SStephen Rothwell 36cc47ad40SCédric Le Goater #ifdef CONFIG_COMPAT 37b7fa9ce8SRohan McLure long compat_sys_mmap2(unsigned long addr, size_t len, 38cc47ad40SCédric Le Goater unsigned long prot, unsigned long flags, 39cc47ad40SCédric Le Goater unsigned long fd, unsigned long pgoff); 40cc47ad40SCédric Le Goater 41cc47ad40SCédric Le Goater compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, 42cc47ad40SCédric Le Goater u32 reg6, u32 pos1, u32 pos2); 43cc47ad40SCédric Le Goater 44cc47ad40SCédric Le Goater compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, 45cc47ad40SCédric Le Goater u32 reg6, u32 pos1, u32 pos2); 46cc47ad40SCédric Le Goater 47cc47ad40SCédric Le Goater compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offset1, u32 offset2, u32 count); 48cc47ad40SCédric Le Goater 49cc47ad40SCédric Le Goater int compat_sys_truncate64(const char __user *path, u32 reg4, 50cc47ad40SCédric Le Goater unsigned long len1, unsigned long len2); 51cc47ad40SCédric Le Goater 52cc47ad40SCédric Le Goater int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long len1, 53cc47ad40SCédric Le Goater unsigned long len2); 54cc47ad40SCédric Le Goater 55*dec20c50SRohan McLure long compat_sys_ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2, 56cc47ad40SCédric Le Goater size_t len, int advice); 57cc47ad40SCédric Le Goater 58cc47ad40SCédric Le Goater long compat_sys_sync_file_range2(int fd, unsigned int flags, 59cc47ad40SCédric Le Goater unsigned int offset1, unsigned int offset2, 60cc47ad40SCédric Le Goater unsigned int nbytes1, unsigned int nbytes2); 61cc47ad40SCédric Le Goater #endif 62cc47ad40SCédric Le Goater 63b8b572e1SStephen Rothwell #endif /* __KERNEL__ */ 64b8b572e1SStephen Rothwell #endif /* __ASM_POWERPC_SYSCALLS_H */ 65