blob: 14ea93388c058d99fe576a0c1084284f64912678 [file] [log] [blame]
Robin Getz96f10502009-09-24 14:11:24 +00001/*
2 * Copyright 2004-2008 Analog Devices Inc.
3 *
4 * Licensed under the GPL-2 or later.
5 */
Bryan Wu1394f032007-05-06 14:50:22 -07006#ifndef _BFIN_PTRACE_H
7#define _BFIN_PTRACE_H
8
David Howells2ba36452012-10-09 09:46:39 +01009#include <uapi/asm/ptrace.h>
Bryan Wu1394f032007-05-06 14:50:22 -070010
11#ifndef __ASSEMBLY__
12
Bryan Wu1394f032007-05-06 14:50:22 -070013/* 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)))
Bryan Wu1394f032007-05-06 14:50:22 -070016
Mike Frysingere8f263d2010-01-26 07:33:53 +000017#define arch_has_single_step() (1)
Mike Frysingere8f263d2010-01-26 07:33:53 +000018/* common code demands this function */
19#define ptrace_disable(child) user_disable_single_step(child)
20
Sonic Zhang99a5b282010-09-06 10:16:04 +000021extern int is_user_addr_valid(struct task_struct *child,
22 unsigned long start, unsigned long len);
23
Mike Frysingere8f263d2010-01-26 07:33:53 +000024/*
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
Mike Frysinger82258c62011-05-26 16:25:42 -070038#include <asm-generic/ptrace.h>
39
Bryan Wu1394f032007-05-06 14:50:22 -070040#endif /* __ASSEMBLY__ */
Bryan Wu1394f032007-05-06 14:50:22 -070041#endif /* _BFIN_PTRACE_H */