Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263820
b: refs/heads/master
c: f2833ae
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Sep 15, 2011
1 parent ba1ae11 commit 431066c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 47 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01599cdc2f891415387aed9921909b3e9f27c801
refs/heads/master: f2833aef6a0517e933992c8007f330d0df5d9317
4 changes: 0 additions & 4 deletions trunk/arch/um/include/asm/ptrace-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ extern long subarch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data);
extern unsigned long getreg(struct task_struct *child, int regno);
extern int putreg(struct task_struct *child, int regno, unsigned long value);
extern int get_fpregs(struct user_i387_struct __user *buf,
struct task_struct *child);
extern int set_fpregs(struct user_i387_struct __user *buf,
struct task_struct *child);

extern int arch_copy_tls(struct task_struct *new);
extern void clear_flushed_tls(struct task_struct *task);
Expand Down
28 changes: 0 additions & 28 deletions trunk/arch/um/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,11 @@ long arch_ptrace(struct task_struct *child, long request,
void __user *vp = p;

switch (request) {
/* read word at location addr. */
case PTRACE_PEEKTEXT:
case PTRACE_PEEKDATA:
ret = generic_ptrace_peekdata(child, addr, data);
break;

/* read the word at location addr in the USER area. */
case PTRACE_PEEKUSR:
ret = peek_user(child, addr, data);
break;

/* write the word at location addr. */
case PTRACE_POKETEXT:
case PTRACE_POKEDATA:
ret = generic_ptrace_pokedata(child, addr, data);
break;

/* write the word at location addr in the USER area */
case PTRACE_POKEUSR:
ret = poke_user(child, addr, data);
Expand Down Expand Up @@ -106,16 +94,6 @@ long arch_ptrace(struct task_struct *child, long request,
ret = 0;
break;
}
#endif
#ifdef PTRACE_GETFPREGS
case PTRACE_GETFPREGS: /* Get the child FPU state. */
ret = get_fpregs(vp, child);
break;
#endif
#ifdef PTRACE_SETFPREGS
case PTRACE_SETFPREGS: /* Set the child FPU state. */
ret = set_fpregs(vp, child);
break;
#endif
case PTRACE_GET_THREAD_AREA:
ret = ptrace_get_thread_area(child, addr, vp);
Expand Down Expand Up @@ -153,12 +131,6 @@ long arch_ptrace(struct task_struct *child, long request,
ret = -EIO;
break;
}
#endif
#ifdef PTRACE_ARCH_PRCTL
case PTRACE_ARCH_PRCTL:
/* XXX Calls ptrace on the host - needs some SMP thinking */
ret = arch_prctl(child, data, (void __user *) addr);
break;
#endif
default:
ret = ptrace_request(child, request, addr, data);
Expand Down
5 changes: 0 additions & 5 deletions trunk/arch/um/sys-i386/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
*/
struct user_desc;

extern int get_fpxregs(struct user_fxsr_struct __user *buf,
struct task_struct *child);
extern int set_fpxregs(struct user_fxsr_struct __user *buf,
struct task_struct *tsk);

extern int ptrace_get_thread_area(struct task_struct *child, int idx,
struct user_desc __user *user_desc);

Expand Down
18 changes: 12 additions & 6 deletions trunk/arch/um/sys-i386/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int peek_user(struct task_struct *child, long addr, long data)
return put_user(tmp, (unsigned long __user *) data);
}

int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
{
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
struct user_i387_struct fpregs;
Expand All @@ -161,7 +161,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
return n;
}

int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
{
int n, cpu = ((struct thread_info *) child->stack)->cpu;
struct user_i387_struct fpregs;
Expand All @@ -174,7 +174,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
(unsigned long *) &fpregs);
}

int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
{
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
struct user_fxsr_struct fpregs;
Expand All @@ -190,7 +190,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
return n;
}

int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child)
{
int n, cpu = ((struct thread_info *) child->stack)->cpu;
struct user_fxsr_struct fpregs;
Expand All @@ -208,15 +208,21 @@ long subarch_ptrace(struct task_struct *child, long request,
{
int ret = -EIO;
void __user *datap = (void __user *) data;

switch (request) {
case PTRACE_GETFPREGS: /* Get the child FPU state. */
ret = get_fpregs(datap, child);
break;
case PTRACE_SETFPREGS: /* Set the child FPU state. */
ret = set_fpregs(datap, child);
break;
case PTRACE_GETFPXREGS: /* Get the child FPU state. */
ret = get_fpxregs(datap, child);
break;
case PTRACE_SETFPXREGS: /* Set the child FPU state. */
ret = set_fpxregs(datap, child);
break;
default:
ret = -EIO;
}

return ret;
}
22 changes: 19 additions & 3 deletions trunk/arch/um/sys-x86_64/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int is_syscall(unsigned long addr)
return instr == 0x050f;
}

int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
{
int err, n, cpu = ((struct thread_info *) child->stack)->cpu;
long fpregs[HOST_FP_SIZE];
Expand All @@ -162,7 +162,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
return n;
}

int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
{
int n, cpu = ((struct thread_info *) child->stack)->cpu;
long fpregs[HOST_FP_SIZE];
Expand All @@ -178,5 +178,21 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child)
long subarch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsigned long data)
{
return -EIO;
int ret = -EIO;
void __user *datap = (void __user *) data;

switch (request) {
case PTRACE_GETFPREGS: /* Get the child FPU state. */
ret = get_fpregs(datap, child);
break;
case PTRACE_SETFPREGS: /* Set the child FPU state. */
ret = set_fpregs(datap, child);
break;
case PTRACE_ARCH_PRCTL:
/* XXX Calls ptrace on the host - needs some SMP thinking */
ret = arch_prctl(child, data, (void __user *) addr);
break;
}

return ret;
}

0 comments on commit 431066c

Please sign in to comment.