aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/syscalls.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
committerTony Luck <tony.luck@intel.com>2005-06-15 17:06:48 -0400
commitf2cbb4f01936a3e4225692e03b084b78c56d386d (patch)
treef89f3d8baa250589a38a4dd2df56f84cddae3c76 /arch/um/sys-x86_64/syscalls.c
parent325a479c4c110db278ef3361460a48c4093252cc (diff)
parent1016888fb69662936b32ab767c7419a3be9a69d3 (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'arch/um/sys-x86_64/syscalls.c')
-rw-r--r--arch/um/sys-x86_64/syscalls.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index ab4b0abf8af3..6f44f40204ed 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -7,12 +7,15 @@
7#include "linux/linkage.h" 7#include "linux/linkage.h"
8#include "linux/slab.h" 8#include "linux/slab.h"
9#include "linux/shm.h" 9#include "linux/shm.h"
10#include "linux/utsname.h"
11#include "linux/personality.h"
10#include "asm/uaccess.h" 12#include "asm/uaccess.h"
11#define __FRAME_OFFSETS 13#define __FRAME_OFFSETS
12#include "asm/ptrace.h" 14#include "asm/ptrace.h"
13#include "asm/unistd.h" 15#include "asm/unistd.h"
14#include "asm/prctl.h" /* XXX This should get the constants from libc */ 16#include "asm/prctl.h" /* XXX This should get the constants from libc */
15#include "choose-mode.h" 17#include "choose-mode.h"
18#include "kern.h"
16 19
17asmlinkage long sys_uname64(struct new_utsname __user * name) 20asmlinkage long sys_uname64(struct new_utsname __user * name)
18{ 21{
@@ -42,6 +45,8 @@ long sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount)
42#ifdef CONFIG_MODE_SKAS 45#ifdef CONFIG_MODE_SKAS
43extern int userspace_pid[]; 46extern int userspace_pid[];
44 47
48#include "skas_ptrace.h"
49
45long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) 50long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount)
46{ 51{
47 struct ptrace_ldt ldt; 52 struct ptrace_ldt ldt;
@@ -128,23 +133,27 @@ static long arch_prctl_tt(int code, unsigned long addr)
128 133
129#ifdef CONFIG_MODE_SKAS 134#ifdef CONFIG_MODE_SKAS
130 135
136/* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */
131static long arch_prctl_skas(int code, unsigned long addr) 137static long arch_prctl_skas(int code, unsigned long addr)
132{ 138{
133 long ret = 0; 139 long ret = 0;
134 140
135 switch(code){ 141 switch(code){
136 case ARCH_SET_GS:
137 current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;
138 break;
139 case ARCH_SET_FS: 142 case ARCH_SET_FS:
140 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr; 143 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr;
141 break; 144 break;
145 case ARCH_SET_GS:
146 current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;
147 break;
142 case ARCH_GET_FS: 148 case ARCH_GET_FS:
143 ret = put_user(current->thread.regs.regs.skas.regs[GS / sizeof(unsigned long)], &addr); 149 ret = put_user(current->thread.regs.regs.skas.
150 regs[FS_BASE / sizeof(unsigned long)],
151 (unsigned long __user *)addr);
144 break; 152 break;
145 case ARCH_GET_GS: 153 case ARCH_GET_GS:
146 ret = put_user(current->thread.regs.regs.skas.regs[FS / sizeof(unsigned \ 154 ret = put_user(current->thread.regs.regs.skas.
147long)], &addr); 155 regs[GS_BASE / sizeof(unsigned long)],
156 (unsigned long __user *)addr);
148 break; 157 break;
149 default: 158 default:
150 ret = -EINVAL; 159 ret = -EINVAL;