aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-x86_64/ptrace.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-05 01:31:20 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:31 -0500
commit95906b24fbe4d22e5861f67fe1e8274c7ecfeda1 (patch)
treef5ac2e3e2fc0369bf0c9ba0fb327eaba5a1ae047 /arch/um/sys-x86_64/ptrace.c
parent7281ff952c7b3cbefb14847460e5fe73a2d240e4 (diff)
uml: style fixes in arch/um/sys-x86_64
Style fixes in arch/um/sys-x86_64: updated copyrights CodingStyle fixes added severities to printks which needed them A bunch of functions in sys-*/ptrace_user.c turn out to be unused, so they and their declarations are gone. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/sys-x86_64/ptrace.c')
-rw-r--r--arch/um/sys-x86_64/ptrace.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c
index b7631b0e9ddc..f3458d7d1c5a 100644
--- a/arch/um/sys-x86_64/ptrace.c
+++ b/arch/um/sys-x86_64/ptrace.c
@@ -5,13 +5,12 @@
5 * Licensed under the GPL 5 * Licensed under the GPL
6 */ 6 */
7 7
8#define __FRAME_OFFSETS 8#include <linux/mm.h>
9#include <asm/ptrace.h>
10#include <linux/sched.h> 9#include <linux/sched.h>
11#include <linux/errno.h> 10#include <linux/errno.h>
12#include <linux/mm.h> 11#define __FRAME_OFFSETS
12#include <asm/ptrace.h>
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/elf.h>
15 14
16/* 15/*
17 * determines which flags the user has access to. 16 * determines which flags the user has access to.
@@ -24,12 +23,14 @@ int putreg(struct task_struct *child, int regno, unsigned long value)
24 unsigned long tmp; 23 unsigned long tmp;
25 24
26#ifdef TIF_IA32 25#ifdef TIF_IA32
27 /* Some code in the 64bit emulation may not be 64bit clean. 26 /*
28 Don't take any chances. */ 27 * Some code in the 64bit emulation may not be 64bit clean.
28 * Don't take any chances.
29 */
29 if (test_tsk_thread_flag(child, TIF_IA32)) 30 if (test_tsk_thread_flag(child, TIF_IA32))
30 value &= 0xffffffff; 31 value &= 0xffffffff;
31#endif 32#endif
32 switch (regno){ 33 switch (regno) {
33 case FS: 34 case FS:
34 case GS: 35 case GS:
35 case DS: 36 case DS:
@@ -66,7 +67,7 @@ int poke_user(struct task_struct *child, long addr, long data)
66 if (addr < MAX_REG_OFFSET) 67 if (addr < MAX_REG_OFFSET)
67 return putreg(child, addr, data); 68 return putreg(child, addr, data);
68 else if ((addr >= offsetof(struct user, u_debugreg[0])) && 69 else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
69 (addr <= offsetof(struct user, u_debugreg[7]))){ 70 (addr <= offsetof(struct user, u_debugreg[7]))) {
70 addr -= offsetof(struct user, u_debugreg[0]); 71 addr -= offsetof(struct user, u_debugreg[0]);
71 addr = addr >> 2; 72 addr = addr >> 2;
72 if ((addr == 4) || (addr == 5)) 73 if ((addr == 4) || (addr == 5))
@@ -108,11 +109,10 @@ int peek_user(struct task_struct *child, long addr, long data)
108 return -EIO; 109 return -EIO;
109 110
110 tmp = 0; /* Default return condition */ 111 tmp = 0; /* Default return condition */
111 if (addr < MAX_REG_OFFSET){ 112 if (addr < MAX_REG_OFFSET)
112 tmp = getreg(child, addr); 113 tmp = getreg(child, addr);
113 }
114 else if ((addr >= offsetof(struct user, u_debugreg[0])) && 114 else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
115 (addr <= offsetof(struct user, u_debugreg[7]))){ 115 (addr <= offsetof(struct user, u_debugreg[7]))) {
116 addr -= offsetof(struct user, u_debugreg[0]); 116 addr -= offsetof(struct user, u_debugreg[0]);
117 addr = addr >> 2; 117 addr = addr >> 2;
118 tmp = child->thread.arch.debugregs[addr]; 118 tmp = child->thread.arch.debugregs[addr];
@@ -127,8 +127,9 @@ int is_syscall(unsigned long addr)
127 int n; 127 int n;
128 128
129 n = copy_from_user(&instr, (void __user *) addr, sizeof(instr)); 129 n = copy_from_user(&instr, (void __user *) addr, sizeof(instr));
130 if (n){ 130 if (n) {
131 /* access_process_vm() grants access to vsyscall and stub, 131 /*
132 * access_process_vm() grants access to vsyscall and stub,
132 * while copy_from_user doesn't. Maybe access_process_vm is 133 * while copy_from_user doesn't. Maybe access_process_vm is
133 * slow, but that doesn't matter, since it will be called only 134 * slow, but that doesn't matter, since it will be called only
134 * in case of singlestepping, if copy_from_user failed. 135 * in case of singlestepping, if copy_from_user failed.
@@ -155,7 +156,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
155 return err; 156 return err;
156 157
157 n = copy_to_user(buf, fpregs, sizeof(fpregs)); 158 n = copy_to_user(buf, fpregs, sizeof(fpregs));
158 if(n > 0) 159 if (n > 0)
159 return -EFAULT; 160 return -EFAULT;
160 161
161 return n; 162 return n;