~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/kernel/sys_ppc32.c

Version: ~ [ linux-5.5-rc1 ] ~ [ linux-5.4.2 ] ~ [ linux-5.3.15 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.88 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.158 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.206 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.206 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * sys_ppc32.c: Conversion between 32bit and 64bit native syscalls.
  3  *
  4  * Copyright (C) 2001 IBM
  5  * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
  6  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
  7  *
  8  * These routines maintain argument size conversion between 32bit and 64bit
  9  * environment.
 10  *
 11  *      This program is free software; you can redistribute it and/or
 12  *      modify it under the terms of the GNU General Public License
 13  *      as published by the Free Software Foundation; either version
 14  *      2 of the License, or (at your option) any later version.
 15  */
 16 
 17 #include <linux/kernel.h>
 18 #include <linux/sched.h>
 19 #include <linux/fs.h> 
 20 #include <linux/mm.h> 
 21 #include <linux/file.h> 
 22 #include <linux/signal.h>
 23 #include <linux/resource.h>
 24 #include <linux/times.h>
 25 #include <linux/smp.h>
 26 #include <linux/sem.h>
 27 #include <linux/msg.h>
 28 #include <linux/shm.h>
 29 #include <linux/poll.h>
 30 #include <linux/personality.h>
 31 #include <linux/stat.h>
 32 #include <linux/mman.h>
 33 #include <linux/in.h>
 34 #include <linux/syscalls.h>
 35 #include <linux/unistd.h>
 36 #include <linux/sysctl.h>
 37 #include <linux/binfmts.h>
 38 #include <linux/security.h>
 39 #include <linux/compat.h>
 40 #include <linux/ptrace.h>
 41 #include <linux/elf.h>
 42 #include <linux/ipc.h>
 43 #include <linux/slab.h>
 44 
 45 #include <asm/ptrace.h>
 46 #include <asm/types.h>
 47 #include <asm/uaccess.h>
 48 #include <asm/unistd.h>
 49 #include <asm/time.h>
 50 #include <asm/mmu_context.h>
 51 #include <asm/ppc-pci.h>
 52 #include <asm/syscalls.h>
 53 #include <asm/switch_to.h>
 54 
 55 
 56 asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
 57                 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
 58                 compat_uptr_t tvp_x)
 59 {
 60         /* sign extend n */
 61         return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x));
 62 }
 63 
 64 unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
 65                           unsigned long prot, unsigned long flags,
 66                           unsigned long fd, unsigned long pgoff)
 67 {
 68         /* This should remain 12 even if PAGE_SIZE changes */
 69         return sys_mmap(addr, len, prot, flags, fd, pgoff << 12);
 70 }
 71 
 72 /* 
 73  * long long munging:
 74  * The 32 bit ABI passes long longs in an odd even register pair.
 75  */
 76 
 77 compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
 78                              u32 reg6, u32 poshi, u32 poslo)
 79 {
 80         return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
 81 }
 82 
 83 compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
 84                               u32 reg6, u32 poshi, u32 poslo)
 85 {
 86         return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo);
 87 }
 88 
 89 compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count)
 90 {
 91         return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count);
 92 }
 93 
 94 asmlinkage int compat_sys_truncate64(const char __user * path, u32 reg4,
 95                                 unsigned long high, unsigned long low)
 96 {
 97         return sys_truncate(path, (high << 32) | low);
 98 }
 99 
100 asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo,
101                                      u32 lenhi, u32 lenlo)
102 {
103         return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo,
104                              ((loff_t)lenhi << 32) | lenlo);
105 }
106 
107 asmlinkage int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long high,
108                                  unsigned long low)
109 {
110         return sys_ftruncate(fd, (high << 32) | low);
111 }
112 
113 long ppc32_fadvise64(int fd, u32 unused, u32 offset_high, u32 offset_low,
114                      size_t len, int advice)
115 {
116         return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low, len,
117                              advice);
118 }
119 
120 asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
121                                    unsigned offset_hi, unsigned offset_lo,
122                                    unsigned nbytes_hi, unsigned nbytes_lo)
123 {
124         loff_t offset = ((loff_t)offset_hi << 32) | offset_lo;
125         loff_t nbytes = ((loff_t)nbytes_hi << 32) | nbytes_lo;
126 
127         return sys_sync_file_range(fd, offset, nbytes, flags);
128 }
129 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp