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
55 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
68 #error unknown isa conifiguration
71 /* virtual pt_reg entry for gdb */
77 /* Control registers. */
78 #define SPR_CR0 PT_PSW
79 #define SPR_CR1 PT_CBR /* read only */
80 #define SPR_CR2 PT_SPI
81 #define SPR_CR3 PT_SPU
83 #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
84 #define SPR_CR6 PT_BPC
86 #define SPR_CR8 PT_BBPSW
91 #define SPR_CR13 PT_WR
92 #define SPR_CR14 PT_BBPC
95 /* this struct defines the way the registers are stored on the
96 stack during a system call. */
98 /* Saved main processor registers. */
102 struct pt_regs
*pt_regs
;
115 /* Saved main processor status and miscellaneous context registers. */
116 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
121 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
125 #error unknown isa configuration
128 unsigned long bpc
; /* saved PC for TRAP syscalls */
131 unsigned long spu
; /* saved user stack */
133 unsigned long lr
; /* saved PC for JL syscalls */
134 unsigned long spi
; /* saved kernel stack */
135 unsigned long orig_r0
;
138 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
139 #define PTRACE_GETREGS 12
140 #define PTRACE_SETREGS 13
142 #define PTRACE_OLDSETOPTIONS 21
144 /* options set using PTRACE_SETOPTIONS */
145 #define PTRACE_O_TRACESYSGOOD 0x00000001
149 #define __ARCH_SYS_PTRACE 1
151 #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
152 #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
153 #elif defined(CONFIG_ISA_M32R)
154 #define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0)
156 #error unknown isa configuration
159 #define instruction_pointer(regs) ((regs)->bpc)
160 #define profile_pc(regs) instruction_pointer(regs)
162 extern void show_regs(struct pt_regs
*);
164 extern void withdraw_debug_trap(struct pt_regs
*regs
);
166 #endif /* __KERNEL */
168 #endif /* _ASM_M32R_PTRACE_H */