ptrace.h 1.0 KB

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