1/* 2 * linux/include/asm-m32r/ptrace.h 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * M32R version: 9 * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org> 10 */ 11#ifndef _ASM_M32R_PTRACE_H 12#define _ASM_M32R_PTRACE_H 13 14 15#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ 16#include <uapi/asm/ptrace.h> 17 18#define arch_has_single_step() (1) 19 20struct task_struct; 21extern void init_debug_traps(struct task_struct *); 22#define arch_ptrace_attach(child) \ 23 init_debug_traps(child) 24 25#if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2) 26#define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0) 27#elif defined(CONFIG_ISA_M32R) 28#define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0) 29#else 30#error unknown isa configuration 31#endif 32 33#define instruction_pointer(regs) ((regs)->bpc) 34#define profile_pc(regs) instruction_pointer(regs) 35#define user_stack_pointer(regs) ((regs)->spu) 36 37extern void withdraw_debug_trap(struct pt_regs *regs); 38 39#define task_pt_regs(task) \ 40 ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1) 41#define current_pt_regs() ((struct pt_regs *) \ 42 ((unsigned long)current_thread_info() + THREAD_SIZE) - 1) 43 44#endif /* _ASM_M32R_PTRACE_H */ 45