xref: /openbmc/linux/arch/powerpc/include/asm/syscalls.h (revision 016ff72bd2090903715c0f9422a44afbb966f4ee)
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 
11*016ff72bSRohan McLure /*
12*016ff72bSRohan McLure  * long long munging:
13*016ff72bSRohan McLure  * The 32 bit ABI passes long longs in an odd even register pair.
14*016ff72bSRohan McLure  * High and low parts are swapped depending on endian mode,
15*016ff72bSRohan McLure  * so define a macro (similar to mips linux32) to handle that.
16*016ff72bSRohan McLure  */
17*016ff72bSRohan McLure #ifdef __LITTLE_ENDIAN__
18*016ff72bSRohan McLure #define merge_64(low, high) (((u64)high << 32) | low)
19*016ff72bSRohan McLure #else
20*016ff72bSRohan McLure #define merge_64(high, low) (((u64)high << 32) | low)
21*016ff72bSRohan McLure #endif
22*016ff72bSRohan 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);
315ba6c9a9SRohan McLure long ppc64_personality(unsigned long personality);
325ba6c9a9SRohan McLure long sys_rtas(struct rtas_args __user *uargs);
3376222808SChristophe Leroy int ppc_select(int n, fd_set __user *inp, fd_set __user *outp,
3476222808SChristophe Leroy 	       fd_set __user *exp, struct __kernel_old_timeval __user *tvp);
3576222808SChristophe Leroy long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
3676222808SChristophe Leroy 		      u32 len_high, u32 len_low);
37b8b572e1SStephen Rothwell 
38cc47ad40SCédric Le Goater #ifdef CONFIG_COMPAT
39cc47ad40SCédric Le Goater unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
40cc47ad40SCédric Le Goater 			       unsigned long prot, unsigned long flags,
41cc47ad40SCédric Le Goater 			       unsigned long fd, unsigned long pgoff);
42cc47ad40SCédric Le Goater 
43cc47ad40SCédric Le Goater compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
44cc47ad40SCédric Le Goater 				  u32 reg6, u32 pos1, u32 pos2);
45cc47ad40SCédric Le Goater 
46cc47ad40SCédric Le Goater compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
47cc47ad40SCédric Le Goater 				   u32 reg6, u32 pos1, u32 pos2);
48cc47ad40SCédric Le Goater 
49cc47ad40SCédric Le Goater compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offset1, u32 offset2, u32 count);
50cc47ad40SCédric Le Goater 
51cc47ad40SCédric Le Goater int compat_sys_truncate64(const char __user *path, u32 reg4,
52cc47ad40SCédric Le Goater 			  unsigned long len1, unsigned long len2);
53cc47ad40SCédric Le Goater 
54cc47ad40SCédric Le Goater long compat_sys_fallocate(int fd, int mode, u32 offset1, u32 offset2, u32 len1, u32 len2);
55cc47ad40SCédric Le Goater 
56cc47ad40SCédric Le Goater int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long len1,
57cc47ad40SCédric Le Goater 			   unsigned long len2);
58cc47ad40SCédric Le Goater 
59cc47ad40SCédric Le Goater long ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
60cc47ad40SCédric Le Goater 		     size_t len, int advice);
61cc47ad40SCédric Le Goater 
62cc47ad40SCédric Le Goater long compat_sys_sync_file_range2(int fd, unsigned int flags,
63cc47ad40SCédric Le Goater 				 unsigned int offset1, unsigned int offset2,
64cc47ad40SCédric Le Goater 				 unsigned int nbytes1, unsigned int nbytes2);
65cc47ad40SCédric Le Goater #endif
66cc47ad40SCédric Le Goater 
67b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
68b8b572e1SStephen Rothwell #endif /* __ASM_POWERPC_SYSCALLS_H */
69