1 #ifndef _ASM_M32R_PTRACE_H
2 #define _ASM_M32R_PTRACE_H
5 * linux/include/asm-m32r/ptrace.h
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
12 * Copyright (C) 2001-2002, 2004 Hirokazu Takata <takata at linux-m32r.org>
15 #include <linux/config.h>
16 #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
18 /* 0 - 13 are integer registers (general purpose registers). */
38 /* processor status and miscellaneous context registers. */
39 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
44 #define PT_ACCH PT_ACC0H
45 #define PT_ACCL PT_ACC0L
46 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
49 #define PT_DUMMY_ACC1H 17
50 #define PT_DUMMY_ACC1L 18
52 #error unknown isa conifiguration
64 /* virtual pt_reg entry for gdb */
70 /* Control registers. */
71 #define SPR_CR0 PT_PSW
72 #define SPR_CR1 PT_CBR /* read only */
73 #define SPR_CR2 PT_SPI
74 #define SPR_CR3 PT_SPU
76 #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
77 #define SPR_CR6 PT_BPC
79 #define SPR_CR8 PT_BBPSW
84 #define SPR_CR13 PT_WR
85 #define SPR_CR14 PT_BBPC
88 /* this struct defines the way the registers are stored on the
89 stack during a system call. */
91 /* Saved main processor registers. */
95 struct pt_regs *pt_regs;
108 /* Saved main processor status and miscellaneous context registers. */
109 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
114 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
117 unsigned long dummy_acc1h;
118 unsigned long dummy_acc1l;
120 #error unknown isa configuration
123 unsigned long bpc; /* saved PC for TRAP syscalls */
126 unsigned long spu; /* saved user stack */
128 unsigned long lr; /* saved PC for JL syscalls */
129 unsigned long spi; /* saved kernel stack */
130 unsigned long orig_r0;
133 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
134 #define PTRACE_GETREGS 12
135 #define PTRACE_SETREGS 13
137 #define PTRACE_OLDSETOPTIONS 21
139 /* options set using PTRACE_SETOPTIONS */
140 #define PTRACE_O_TRACESYSGOOD 0x00000001
144 #define __ARCH_SYS_PTRACE 1
146 #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
147 #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
148 #elif defined(CONFIG_ISA_M32R)
149 #define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0)
151 #error unknown isa configuration
154 #define instruction_pointer(regs) ((regs)->bpc)
155 #define profile_pc(regs) instruction_pointer(regs)
157 extern void show_regs(struct pt_regs *);
159 extern void withdraw_debug_trap(struct pt_regs *regs);
161 #define task_pt_regs(task) \
162 ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)
164 #endif /* __KERNEL */
166 #endif /* _ASM_M32R_PTRACE_H */