--- zzzz-none-000/linux-3.10.107/arch/h8300/include/asm/ptrace.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/h8300/include/asm/ptrace.h 2021-02-04 17:41:59.000000000 +0000 @@ -4,30 +4,33 @@ #include #ifndef __ASSEMBLY__ -#if defined(CONFIG_CPU_H8S) -#endif #ifndef PS_S #define PS_S (0x10) #endif -#if defined(__H8300H__) +#if defined(CONFIG_CPU_H8300H) #define H8300_REGS_NO 11 #endif -#if defined(__H8300S__) +#if defined(CONFIG_CPU_H8S) #define H8300_REGS_NO 12 #endif -/* Find the stack offset for a register, relative to thread.esp0. */ -#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) - #define arch_has_single_step() (1) #define user_mode(regs) (!((regs)->ccr & PS_S)) #define instruction_pointer(regs) ((regs)->pc) #define profile_pc(regs) instruction_pointer(regs) +#define user_stack_pointer(regs) ((regs)->sp) #define current_pt_regs() ((struct pt_regs *) \ (THREAD_SIZE + (unsigned long)current_thread_info()) - 1) #define signal_pt_regs() ((struct pt_regs *)current->thread.esp0) #define current_user_stack_pointer() rdusp() +#define task_pt_regs(task) \ + ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE) - 1) + +extern long h8300_get_reg(struct task_struct *task, int regno); +extern int h8300_put_reg(struct task_struct *task, int regno, + unsigned long data); + #endif /* __ASSEMBLY__ */ #endif /* _H8300_PTRACE_H */