2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1995, 1996, 1997, 2000, 2001 by Ralf Baechle
7 * Copyright (C) 2001 MIPS Technologies, Inc.
9 #include <linux/errno.h>
10 #include <linux/linkage.h>
12 #include <linux/smp.h>
13 #include <linux/smp_lock.h>
14 #include <linux/sched.h>
15 #include <linux/string.h>
16 #include <linux/utsname.h>
18 #include <asm/cachectl.h>
19 #include <asm/pgalloc.h>
20 #include <asm/sysmips.h>
21 #include <asm/uaccess.h>
23 extern asmlinkage void syscall_trace(void);
26 * How long a hostname can we get from user space?
27 * -EFAULT if invalid area or too long
29 * >0 EFAULT after xx bytes
32 get_max_hostname(unsigned long address)
34 struct vm_area_struct * vma;
36 vma = find_vma(current->mm, address);
37 if (!vma || vma->vm_start > address || !(vma->vm_flags & VM_READ))
39 address = vma->vm_end - address;
40 if (address > PAGE_SIZE)
42 if (vma->vm_next && vma->vm_next->vm_start == vma->vm_end &&
43 (vma->vm_next->vm_flags & VM_READ))
49 _sys_sysmips(int cmd, int arg1, int arg2, int arg3)
56 char nodename[__NEW_UTS_LEN + 1];
58 if (!capable(CAP_SYS_ADMIN))
63 len = strncpy_from_user(nodename, name, sizeof(nodename));
68 strncpy(system_utsname.nodename, nodename, len);
69 system_utsname.nodename[len] = '\0';
75 printk(KERN_CRIT "How did I get here?\n");
80 tmp = current->thread.mflags & ~3;
81 current->thread.mflags = tmp | (arg1 & 3);
104 * No implemented yet ...
107 sys_cachectl(char *addr, int nbytes, int op)
112 asmlinkage int sys_pause(void)
114 current->state = TASK_INTERRUPTIBLE;
116 return -ERESTARTNOHAND;