Merge tag 'upstream-3.8-rc1' of git://git.infradead.org/linux-ubi
[cascardo/linux.git] / arch / blackfin / include / asm / ptrace.h
1 /*
2  * Copyright 2004-2008 Analog Devices Inc.
3  *
4  * Licensed under the GPL-2 or later.
5  */
6 #ifndef _BFIN_PTRACE_H
7 #define _BFIN_PTRACE_H
8
9 #include <uapi/asm/ptrace.h>
10
11 #ifndef __ASSEMBLY__
12
13 /* user_mode returns true if only one bit is set in IPEND, other than the
14    master interrupt enable.  */
15 #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
16
17 #define arch_has_single_step()  (1)
18 /* common code demands this function */
19 #define ptrace_disable(child) user_disable_single_step(child)
20
21 extern int is_user_addr_valid(struct task_struct *child,
22                               unsigned long start, unsigned long len);
23
24 /*
25  * Get the address of the live pt_regs for the specified task.
26  * These are saved onto the top kernel stack when the process
27  * is not running.
28  *
29  * Note: if a user thread is execve'd from kernel space, the
30  * kernel stack will not be empty on entry to the kernel, so
31  * ptracing these tasks will fail.
32  */
33 #define task_pt_regs(task) \
34         (struct pt_regs *) \
35             ((unsigned long)task_stack_page(task) + \
36              (THREAD_SIZE - sizeof(struct pt_regs)))
37
38 #include <asm-generic/ptrace.h>
39
40 #endif                          /* __ASSEMBLY__ */
41 #endif                          /* _BFIN_PTRACE_H */