diff options
Diffstat (limited to 'arch/um/sys-x86_64')
-rw-r--r-- | arch/um/sys-x86_64/ptrace.c | 44 | ||||
-rw-r--r-- | arch/um/sys-x86_64/signal.c | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscalls.c | 2 |
3 files changed, 47 insertions, 1 deletions
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index 8c146b2a1e00..b593bb256f2c 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -62,6 +62,27 @@ int putreg(struct task_struct *child, int regno, unsigned long value) | |||
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | int poke_user(struct task_struct *child, long addr, long data) | ||
66 | { | ||
67 | if ((addr & 3) || addr < 0) | ||
68 | return -EIO; | ||
69 | |||
70 | if (addr < MAX_REG_OFFSET) | ||
71 | return putreg(child, addr, data); | ||
72 | |||
73 | #if 0 /* Need x86_64 debugregs handling */ | ||
74 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
75 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
76 | addr -= offsetof(struct user, u_debugreg[0]); | ||
77 | addr = addr >> 2; | ||
78 | if((addr == 4) || (addr == 5)) return -EIO; | ||
79 | child->thread.arch.debugregs[addr] = data; | ||
80 | return 0; | ||
81 | } | ||
82 | #endif | ||
83 | return -EIO; | ||
84 | } | ||
85 | |||
65 | unsigned long getreg(struct task_struct *child, int regno) | 86 | unsigned long getreg(struct task_struct *child, int regno) |
66 | { | 87 | { |
67 | unsigned long retval = ~0UL; | 88 | unsigned long retval = ~0UL; |
@@ -84,6 +105,29 @@ unsigned long getreg(struct task_struct *child, int regno) | |||
84 | return retval; | 105 | return retval; |
85 | } | 106 | } |
86 | 107 | ||
108 | int peek_user(struct task_struct *child, long addr, long data) | ||
109 | { | ||
110 | /* read the word at location addr in the USER area. */ | ||
111 | unsigned long tmp; | ||
112 | |||
113 | if ((addr & 3) || addr < 0) | ||
114 | return -EIO; | ||
115 | |||
116 | tmp = 0; /* Default return condition */ | ||
117 | if(addr < MAX_REG_OFFSET){ | ||
118 | tmp = getreg(child, addr); | ||
119 | } | ||
120 | #if 0 /* Need x86_64 debugregs handling */ | ||
121 | else if((addr >= offsetof(struct user, u_debugreg[0])) && | ||
122 | (addr <= offsetof(struct user, u_debugreg[7]))){ | ||
123 | addr -= offsetof(struct user, u_debugreg[0]); | ||
124 | addr = addr >> 2; | ||
125 | tmp = child->thread.arch.debugregs[addr]; | ||
126 | } | ||
127 | #endif | ||
128 | return put_user(tmp, (unsigned long *) data); | ||
129 | } | ||
130 | |||
87 | void arch_switch(void) | 131 | void arch_switch(void) |
88 | { | 132 | { |
89 | /* XXX | 133 | /* XXX |
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c index b740177066a0..73a7926f7370 100644 --- a/arch/um/sys-x86_64/signal.c +++ b/arch/um/sys-x86_64/signal.c | |||
@@ -168,7 +168,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig, | |||
168 | 168 | ||
169 | frame = (struct rt_sigframe __user *) | 169 | frame = (struct rt_sigframe __user *) |
170 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; | 170 | round_down(stack_top - sizeof(struct rt_sigframe), 16) - 8; |
171 | frame -= 128; | 171 | ((unsigned char *) frame) -= 128; |
172 | 172 | ||
173 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) | 173 | if (!access_ok(VERIFY_WRITE, fp, sizeof(struct _fpstate))) |
174 | goto out; | 174 | goto out; |
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index 2a575ef52bba..dd9914642b8e 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -44,6 +44,8 @@ long sys_modify_ldt_tt(int func, void *ptr, unsigned long bytecount) | |||
44 | #ifdef CONFIG_MODE_SKAS | 44 | #ifdef CONFIG_MODE_SKAS |
45 | extern int userspace_pid[]; | 45 | extern int userspace_pid[]; |
46 | 46 | ||
47 | #include "skas_ptrace.h" | ||
48 | |||
47 | long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) | 49 | long sys_modify_ldt_skas(int func, void *ptr, unsigned long bytecount) |
48 | { | 50 | { |
49 | struct ptrace_ldt ldt; | 51 | struct ptrace_ldt ldt; |