Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _H8300_PTRACE_H |
| 2 | #define _H8300_PTRACE_H |
| 3 | |
David Howells | 1ec94e7 | 2012-12-19 16:07:13 +0000 | [diff] [blame] | 4 | #include <uapi/asm/ptrace.h> |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #ifndef __ASSEMBLY__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | #if defined(CONFIG_CPU_H8S) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #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 Hellwig | 857fb25 | 2010-03-10 15:22:52 -0800 | [diff] [blame] | 23 | #define arch_has_single_step() (1) |
| 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | #define user_mode(regs) (!((regs)->ccr & PS_S)) |
| 26 | #define instruction_pointer(regs) ((regs)->pc) |
| 27 | #define profile_pc(regs) instruction_pointer(regs) |
Al Viro | 557e199 | 2012-10-10 13:17:31 -0400 | [diff] [blame] | 28 | #define current_pt_regs() ((struct pt_regs *) \ |
| 29 | (THREAD_SIZE + (unsigned long)current_thread_info()) - 1) |
Al Viro | 22062a9 | 2012-11-05 13:00:27 -0500 | [diff] [blame] | 30 | #define signal_pt_regs() ((struct pt_regs *)current->thread.esp0) |
Al Viro | 1ca97bb | 2012-11-18 12:50:10 -0500 | [diff] [blame] | 31 | #define current_user_stack_pointer() rdusp() |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #endif /* __ASSEMBLY__ */ |
| 33 | #endif /* _H8300_PTRACE_H */ |