blob: e693fb463ea8ef481ee901deb34f9599b42f1781 [file] [log] [blame]
Yoshinori Satod2a5f492015-05-11 02:20:06 +09001#ifndef _H8300_PTRACE_H
2#define _H8300_PTRACE_H
3
4#include <uapi/asm/ptrace.h>
5
6#ifndef __ASSEMBLY__
7#ifndef PS_S
8#define PS_S (0x10)
9#endif
10
11#if defined(CONFIG_CPU_H8300H)
12#define H8300_REGS_NO 11
13#endif
14#if defined(CONFIG_CPU_H8S)
15#define H8300_REGS_NO 12
16#endif
17
18#define arch_has_single_step() (1)
19
20#define user_mode(regs) (!((regs)->ccr & PS_S))
21#define instruction_pointer(regs) ((regs)->pc)
22#define profile_pc(regs) instruction_pointer(regs)
23#define user_stack_pointer(regs) ((regs)->sp)
24#define current_pt_regs() ((struct pt_regs *) \
25 (THREAD_SIZE + (unsigned long)current_thread_info()) - 1)
26#define signal_pt_regs() ((struct pt_regs *)current->thread.esp0)
27#define current_user_stack_pointer() rdusp()
28#define task_pt_regs(task) \
29 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1)
30
31extern long h8300_get_reg(struct task_struct *task, int regno);
32extern int h8300_put_reg(struct task_struct *task, int regno,
33 unsigned long data);
34
35#endif /* __ASSEMBLY__ */
36#endif /* _H8300_PTRACE_H */