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