[MIPS] Always pass -msoft-float.
[linux-2.6/openmoko-kernel/knife-kernel.git] / arch / um / sys-x86_64 / syscalls.c
blob6acee5c4ada6fcdff56ddd95313865dd295df508
1 /*
2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
5 */
7 #include "linux/linkage.h"
8 #include "linux/slab.h"
9 #include "linux/shm.h"
10 #include "linux/utsname.h"
11 #include "linux/personality.h"
12 #include "asm/uaccess.h"
13 #define __FRAME_OFFSETS
14 #include "asm/ptrace.h"
15 #include "asm/unistd.h"
16 #include "asm/prctl.h" /* XXX This should get the constants from libc */
17 #include "choose-mode.h"
18 #include "kern.h"
20 asmlinkage long sys_uname64(struct new_utsname __user * name)
22 int err;
23 down_read(&uts_sem);
24 err = copy_to_user(name, &system_utsname, sizeof (*name));
25 up_read(&uts_sem);
26 if (personality(current->personality) == PER_LINUX32)
27 err |= copy_to_user(&name->machine, "i686", 5);
28 return err ? -EFAULT : 0;
31 #ifdef CONFIG_MODE_TT
32 extern long arch_prctl(int code, unsigned long addr);
34 static long arch_prctl_tt(int code, unsigned long addr)
36 unsigned long tmp;
37 long ret;
39 switch(code){
40 case ARCH_SET_GS:
41 case ARCH_SET_FS:
42 ret = arch_prctl(code, addr);
43 break;
44 case ARCH_GET_FS:
45 case ARCH_GET_GS:
46 ret = arch_prctl(code, (unsigned long) &tmp);
47 if(!ret)
48 ret = put_user(tmp, &addr);
49 break;
50 default:
51 ret = -EINVAL;
52 break;
55 return(ret);
57 #endif
59 #ifdef CONFIG_MODE_SKAS
61 /* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */
62 static long arch_prctl_skas(int code, unsigned long addr)
64 long ret = 0;
66 switch(code){
67 case ARCH_SET_FS:
68 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr;
69 break;
70 case ARCH_SET_GS:
71 current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;
72 break;
73 case ARCH_GET_FS:
74 ret = put_user(current->thread.regs.regs.skas.
75 regs[FS_BASE / sizeof(unsigned long)],
76 (unsigned long __user *)addr);
77 break;
78 case ARCH_GET_GS:
79 ret = put_user(current->thread.regs.regs.skas.
80 regs[GS_BASE / sizeof(unsigned long)],
81 (unsigned long __user *)addr);
82 break;
83 default:
84 ret = -EINVAL;
85 break;
88 return(ret);
90 #endif
92 long sys_arch_prctl(int code, unsigned long addr)
94 return(CHOOSE_MODE_PROC(arch_prctl_tt, arch_prctl_skas, code, addr));
97 long sys_clone(unsigned long clone_flags, unsigned long newsp,
98 void __user *parent_tid, void __user *child_tid)
100 long ret;
102 if (!newsp)
103 newsp = UPT_SP(&current->thread.regs.regs);
104 current->thread.forking = 1;
105 ret = do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
106 child_tid);
107 current->thread.forking = 0;
108 return(ret);