syscall.c (9ff77c469ed16221c6a4e882e48e4f0dcf451bda) | syscall.c (3c37026d43c47bec4710cbda286f4a17f416f5e6) |
---|---|
1/* 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 4 * for more details. 5 * 6 * Copyright (C) 1995, 1996, 1997, 2000, 2001, 05 by Ralf Baechle 7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 2001 MIPS Technologies, Inc. 9 */ | 1/* 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 4 * for more details. 5 * 6 * Copyright (C) 1995, 1996, 1997, 2000, 2001, 05 by Ralf Baechle 7 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 2001 MIPS Technologies, Inc. 9 */ |
10#include <linux/config.h> |
|
10#include <linux/a.out.h> 11#include <linux/errno.h> 12#include <linux/linkage.h> 13#include <linux/mm.h> 14#include <linux/smp.h> 15#include <linux/smp_lock.h> 16#include <linux/mman.h> 17#include <linux/ptrace.h> --- 153 unchanged lines hidden (view full) --- 171} 172 173save_static_function(sys_clone); 174__attribute_used__ noinline static int 175_sys_clone(nabi_no_regargs struct pt_regs regs) 176{ 177 unsigned long clone_flags; 178 unsigned long newsp; | 11#include <linux/a.out.h> 12#include <linux/errno.h> 13#include <linux/linkage.h> 14#include <linux/mm.h> 15#include <linux/smp.h> 16#include <linux/smp_lock.h> 17#include <linux/mman.h> 18#include <linux/ptrace.h> --- 153 unchanged lines hidden (view full) --- 172} 173 174save_static_function(sys_clone); 175__attribute_used__ noinline static int 176_sys_clone(nabi_no_regargs struct pt_regs regs) 177{ 178 unsigned long clone_flags; 179 unsigned long newsp; |
179 int *parent_tidptr, *child_tidptr; | 180 int __user *parent_tidptr, *child_tidptr; |
180 181 clone_flags = regs.regs[4]; 182 newsp = regs.regs[5]; 183 if (!newsp) 184 newsp = regs.regs[29]; | 181 182 clone_flags = regs.regs[4]; 183 newsp = regs.regs[5]; 184 if (!newsp) 185 newsp = regs.regs[29]; |
185 parent_tidptr = (int *) regs.regs[6]; 186 child_tidptr = (int *) regs.regs[7]; | 186 parent_tidptr = (int __user *) regs.regs[6]; 187#ifdef CONFIG_32BIT 188 /* We need to fetch the fifth argument off the stack. */ 189 child_tidptr = NULL; 190 if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) { 191 int __user *__user *usp = (int __user *__user *) regs.regs[29]; 192 if (regs.regs[2] == __NR_syscall) { 193 if (get_user (child_tidptr, &usp[5])) 194 return -EFAULT; 195 } 196 else if (get_user (child_tidptr, &usp[4])) 197 return -EFAULT; 198 } 199#else 200 child_tidptr = (int __user *) regs.regs[8]; 201#endif |
187 return do_fork(clone_flags, newsp, ®s, 0, 188 parent_tidptr, child_tidptr); 189} 190 191/* 192 * sys_execve() executes a new program. 193 */ 194asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs) --- 45 unchanged lines hidden (view full) --- 240 error -= __put_user(0,name->version+__OLD_UTS_LEN); 241 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 242 error = __put_user(0,name->machine+__OLD_UTS_LEN); 243 error = error ? -EFAULT : 0; 244 245 return error; 246} 247 | 202 return do_fork(clone_flags, newsp, ®s, 0, 203 parent_tidptr, child_tidptr); 204} 205 206/* 207 * sys_execve() executes a new program. 208 */ 209asmlinkage int sys_execve(nabi_no_regargs struct pt_regs regs) --- 45 unchanged lines hidden (view full) --- 255 error -= __put_user(0,name->version+__OLD_UTS_LEN); 256 error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); 257 error = __put_user(0,name->machine+__OLD_UTS_LEN); 258 error = error ? -EFAULT : 0; 259 260 return error; 261} 262 |
263void sys_set_thread_area(unsigned long addr) 264{ 265 struct thread_info *ti = current->thread_info; 266 267 ti->tp_value = addr; 268 269 /* If some future MIPS implementation has this register in hardware, 270 * we will need to update it here (and in context switches). */ 271} 272 |
|
248asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) 249{ 250 int tmp, len; 251 char *name; 252 253 switch(cmd) { 254 case SETNAME: { 255 char nodename[__NEW_UTS_LEN + 1]; --- 139 unchanged lines hidden --- | 273asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) 274{ 275 int tmp, len; 276 char *name; 277 278 switch(cmd) { 279 case SETNAME: { 280 char nodename[__NEW_UTS_LEN + 1]; --- 139 unchanged lines hidden --- |