2 * MIPS specific syscalls
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
8 * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
10 * $Id: sysmips.c,v 1.6 1998/08/25 09:14:42 ralf Exp $
12 #include <linux/errno.h>
13 #include <linux/linkage.h>
15 #include <linux/smp.h>
16 #include <linux/smp_lock.h>
17 #include <linux/sched.h>
18 #include <linux/string.h>
19 #include <linux/utsname.h>
21 #include <asm/cachectl.h>
22 #include <asm/pgtable.h>
23 #include <asm/sysmips.h>
24 #include <asm/uaccess.h>
27 * How long a hostname can we get from user space?
28 * -EFAULT if invalid area or too long
30 * >0 EFAULT after xx bytes
33 get_max_hostname(unsigned long address
)
35 struct vm_area_struct
* vma
;
37 vma
= find_vma(current
->mm
, address
);
38 if (!vma
|| vma
->vm_start
> address
|| !(vma
->vm_flags
& VM_READ
))
40 address
= vma
->vm_end
- address
;
41 if (address
> PAGE_SIZE
)
43 if (vma
->vm_next
&& vma
->vm_next
->vm_start
== vma
->vm_end
&&
44 (vma
->vm_next
->vm_flags
& VM_READ
))
50 sys_sysmips(int cmd
, int arg1
, int arg2
, int arg3
)
54 int flags
, tmp
, len
, retval
;
61 if (!capable(CAP_SYS_ADMIN
))
65 len
= strlen_user(name
);
72 if (len
== 0 || len
> __NEW_UTS_LEN
)
75 copy_from_user(system_utsname
.nodename
, name
, len
);
76 system_utsname
.nodename
[len
] = '\0';
81 /* This is broken in case of page faults and SMP ...
82 Risc/OS fauls after maximum 20 tries with EAGAIN. */
84 retval
= verify_area(VERIFY_WRITE
, p
, sizeof(*p
));
94 tmp
= current
->tss
.mflags
& ~3;
95 current
->tss
.mflags
= tmp
| (arg1
& 3);
119 * No implemented yet ...
122 sys_cachectl(char *addr
, int nbytes
, int op
)