blob: c1826b95c5ca1cb1d810216a4b4a12c9a869811f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _H8300_PTRACE_H
2#define _H8300_PTRACE_H
3
David Howells1ec94e72012-12-19 16:07:13 +00004#include <uapi/asm/ptrace.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#ifndef __ASSEMBLY__
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#if defined(CONFIG_CPU_H8S)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -07009#ifndef PS_S
10#define PS_S (0x10)
11#endif
12
13#if defined(__H8300H__)
14#define H8300_REGS_NO 11
15#endif
16#if defined(__H8300S__)
17#define H8300_REGS_NO 12
18#endif
19
20/* Find the stack offset for a register, relative to thread.esp0. */
21#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
22
Christoph Hellwig857fb252010-03-10 15:22:52 -080023#define arch_has_single_step() (1)
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#define user_mode(regs) (!((regs)->ccr & PS_S))
26#define instruction_pointer(regs) ((regs)->pc)
27#define profile_pc(regs) instruction_pointer(regs)
Al Viro557e1992012-10-10 13:17:31 -040028#define current_pt_regs() ((struct pt_regs *) \
29 (THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
Al Viro22062a92012-11-05 13:00:27 -050030#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
Al Viro1ca97bb2012-11-18 12:50:10 -050031#define current_user_stack_pointer() rdusp()
Linus Torvalds1da177e2005-04-16 15:20:36 -070032#endif /* __ASSEMBLY__ */
33#endif /* _H8300_PTRACE_H */