ia64/linux-2.6.18-xen.hg

annotate arch/m68knommu/kernel/sys_m68k.c @ 854:950b9eb27661

usbback: fix urb interval value for interrupt urbs.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Apr 06 13:51:20 2009 +0100 (2009-04-06)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 * linux/arch/m68knommu/kernel/sys_m68k.c
ian@0 3 *
ian@0 4 * This file contains various random system calls that
ian@0 5 * have a non-standard calling sequence on the Linux/m68k
ian@0 6 * platform.
ian@0 7 */
ian@0 8
ian@0 9 #include <linux/errno.h>
ian@0 10 #include <linux/sched.h>
ian@0 11 #include <linux/mm.h>
ian@0 12 #include <linux/smp.h>
ian@0 13 #include <linux/smp_lock.h>
ian@0 14 #include <linux/sem.h>
ian@0 15 #include <linux/msg.h>
ian@0 16 #include <linux/shm.h>
ian@0 17 #include <linux/stat.h>
ian@0 18 #include <linux/syscalls.h>
ian@0 19 #include <linux/mman.h>
ian@0 20 #include <linux/file.h>
ian@0 21 #include <linux/utsname.h>
ian@0 22
ian@0 23 #include <asm/setup.h>
ian@0 24 #include <asm/uaccess.h>
ian@0 25 #include <asm/cachectl.h>
ian@0 26 #include <asm/traps.h>
ian@0 27 #include <asm/ipc.h>
ian@0 28 #include <asm/cacheflush.h>
ian@0 29
ian@0 30 /*
ian@0 31 * sys_pipe() is the normal C calling standard for creating
ian@0 32 * a pipe. It's not the way unix traditionally does this, though.
ian@0 33 */
ian@0 34 asmlinkage int sys_pipe(unsigned long * fildes)
ian@0 35 {
ian@0 36 int fd[2];
ian@0 37 int error;
ian@0 38
ian@0 39 error = do_pipe(fd);
ian@0 40 if (!error) {
ian@0 41 if (copy_to_user(fildes, fd, 2*sizeof(int)))
ian@0 42 error = -EFAULT;
ian@0 43 }
ian@0 44 return error;
ian@0 45 }
ian@0 46
ian@0 47 /* common code for old and new mmaps */
ian@0 48 static inline long do_mmap2(
ian@0 49 unsigned long addr, unsigned long len,
ian@0 50 unsigned long prot, unsigned long flags,
ian@0 51 unsigned long fd, unsigned long pgoff)
ian@0 52 {
ian@0 53 int error = -EBADF;
ian@0 54 struct file * file = NULL;
ian@0 55
ian@0 56 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
ian@0 57 if (!(flags & MAP_ANONYMOUS)) {
ian@0 58 file = fget(fd);
ian@0 59 if (!file)
ian@0 60 goto out;
ian@0 61 }
ian@0 62
ian@0 63 down_write(&current->mm->mmap_sem);
ian@0 64 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
ian@0 65 up_write(&current->mm->mmap_sem);
ian@0 66
ian@0 67 if (file)
ian@0 68 fput(file);
ian@0 69 out:
ian@0 70 return error;
ian@0 71 }
ian@0 72
ian@0 73 asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
ian@0 74 unsigned long prot, unsigned long flags,
ian@0 75 unsigned long fd, unsigned long pgoff)
ian@0 76 {
ian@0 77 return do_mmap2(addr, len, prot, flags, fd, pgoff);
ian@0 78 }
ian@0 79
ian@0 80 /*
ian@0 81 * Perform the select(nd, in, out, ex, tv) and mmap() system
ian@0 82 * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to
ian@0 83 * handle more than 4 system call parameters, so these system calls
ian@0 84 * used a memory block for parameter passing..
ian@0 85 */
ian@0 86
ian@0 87 struct mmap_arg_struct {
ian@0 88 unsigned long addr;
ian@0 89 unsigned long len;
ian@0 90 unsigned long prot;
ian@0 91 unsigned long flags;
ian@0 92 unsigned long fd;
ian@0 93 unsigned long offset;
ian@0 94 };
ian@0 95
ian@0 96 asmlinkage int old_mmap(struct mmap_arg_struct *arg)
ian@0 97 {
ian@0 98 struct mmap_arg_struct a;
ian@0 99 int error = -EFAULT;
ian@0 100
ian@0 101 if (copy_from_user(&a, arg, sizeof(a)))
ian@0 102 goto out;
ian@0 103
ian@0 104 error = -EINVAL;
ian@0 105 if (a.offset & ~PAGE_MASK)
ian@0 106 goto out;
ian@0 107
ian@0 108 a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
ian@0 109
ian@0 110 error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
ian@0 111 out:
ian@0 112 return error;
ian@0 113 }
ian@0 114
ian@0 115 struct sel_arg_struct {
ian@0 116 unsigned long n;
ian@0 117 fd_set *inp, *outp, *exp;
ian@0 118 struct timeval *tvp;
ian@0 119 };
ian@0 120
ian@0 121 asmlinkage int old_select(struct sel_arg_struct *arg)
ian@0 122 {
ian@0 123 struct sel_arg_struct a;
ian@0 124
ian@0 125 if (copy_from_user(&a, arg, sizeof(a)))
ian@0 126 return -EFAULT;
ian@0 127 /* sys_select() does the appropriate kernel locking */
ian@0 128 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
ian@0 129 }
ian@0 130
ian@0 131 /*
ian@0 132 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
ian@0 133 *
ian@0 134 * This is really horribly ugly.
ian@0 135 */
ian@0 136 asmlinkage int sys_ipc (uint call, int first, int second,
ian@0 137 int third, void *ptr, long fifth)
ian@0 138 {
ian@0 139 int version;
ian@0 140
ian@0 141 version = call >> 16; /* hack for backward compatibility */
ian@0 142 call &= 0xffff;
ian@0 143
ian@0 144 if (call <= SEMCTL)
ian@0 145 switch (call) {
ian@0 146 case SEMOP:
ian@0 147 return sys_semop (first, (struct sembuf *)ptr, second);
ian@0 148 case SEMGET:
ian@0 149 return sys_semget (first, second, third);
ian@0 150 case SEMCTL: {
ian@0 151 union semun fourth;
ian@0 152 if (!ptr)
ian@0 153 return -EINVAL;
ian@0 154 if (get_user(fourth.__pad, (void **) ptr))
ian@0 155 return -EFAULT;
ian@0 156 return sys_semctl (first, second, third, fourth);
ian@0 157 }
ian@0 158 default:
ian@0 159 return -EINVAL;
ian@0 160 }
ian@0 161 if (call <= MSGCTL)
ian@0 162 switch (call) {
ian@0 163 case MSGSND:
ian@0 164 return sys_msgsnd (first, (struct msgbuf *) ptr,
ian@0 165 second, third);
ian@0 166 case MSGRCV:
ian@0 167 switch (version) {
ian@0 168 case 0: {
ian@0 169 struct ipc_kludge tmp;
ian@0 170 if (!ptr)
ian@0 171 return -EINVAL;
ian@0 172 if (copy_from_user (&tmp,
ian@0 173 (struct ipc_kludge *)ptr,
ian@0 174 sizeof (tmp)))
ian@0 175 return -EFAULT;
ian@0 176 return sys_msgrcv (first, tmp.msgp, second,
ian@0 177 tmp.msgtyp, third);
ian@0 178 }
ian@0 179 default:
ian@0 180 return sys_msgrcv (first,
ian@0 181 (struct msgbuf *) ptr,
ian@0 182 second, fifth, third);
ian@0 183 }
ian@0 184 case MSGGET:
ian@0 185 return sys_msgget ((key_t) first, second);
ian@0 186 case MSGCTL:
ian@0 187 return sys_msgctl (first, second,
ian@0 188 (struct msqid_ds *) ptr);
ian@0 189 default:
ian@0 190 return -EINVAL;
ian@0 191 }
ian@0 192
ian@0 193 return -EINVAL;
ian@0 194 }
ian@0 195
ian@0 196 /* sys_cacheflush -- flush (part of) the processor cache. */
ian@0 197 asmlinkage int
ian@0 198 sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
ian@0 199 {
ian@0 200 flush_cache_all();
ian@0 201 return(0);
ian@0 202 }
ian@0 203
ian@0 204 asmlinkage int sys_getpagesize(void)
ian@0 205 {
ian@0 206 return PAGE_SIZE;
ian@0 207 }
ian@0 208