Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31018
b: refs/heads/master
c: 5429b06
h: refs/heads/master
v: v3
  • Loading branch information
Lennert Buytenhek authored and Russell King committed Jun 28, 2006
1 parent 8d8179a commit 8a68f9b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3bec6ded282b331552587267d67a06ed7fd95ddd
refs/heads/master: 5429b060df6d556f396b78364ad017686015bc34
36 changes: 36 additions & 0 deletions trunk/arch/arm/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,32 @@ static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp)

#endif

#ifdef CONFIG_CRUNCH
/*
* Get the child Crunch state.
*/
static int ptrace_getcrunchregs(struct task_struct *tsk, void __user *ufp)
{
struct thread_info *thread = task_thread_info(tsk);

crunch_task_disable(thread); /* force it to ram */
return copy_to_user(ufp, &thread->crunchstate, CRUNCH_SIZE)
? -EFAULT : 0;
}

/*
* Set the child Crunch state.
*/
static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp)
{
struct thread_info *thread = task_thread_info(tsk);

crunch_task_release(thread); /* force a reload */
return copy_from_user(&thread->crunchstate, ufp, CRUNCH_SIZE)
? -EFAULT : 0;
}
#endif

long arch_ptrace(struct task_struct *child, long request, long addr, long data)
{
unsigned long tmp;
Expand Down Expand Up @@ -765,6 +791,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
child->ptrace_message = data;
break;

#ifdef CONFIG_CRUNCH
case PTRACE_GETCRUNCHREGS:
ret = ptrace_getcrunchregs(child, (void __user *)data);
break;

case PTRACE_SETCRUNCHREGS:
ret = ptrace_setcrunchregs(child, (void __user *)data);
break;
#endif

default:
ret = ptrace_request(child, request, addr, data);
break;
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-arm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

#define PTRACE_SET_SYSCALL 23

/* PTRACE_SYSCALL is 24 */

#define PTRACE_GETCRUNCHREGS 25
#define PTRACE_SETCRUNCHREGS 26

/*
* PSR bits
*/
Expand Down

0 comments on commit 8a68f9b

Please sign in to comment.