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 <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
17 /* 0 - 13 are integer registers (general purpose registers). */
37 /* processor status and miscellaneous context registers. */
38 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
43 #define PT_ACCH PT_ACC0H
44 #define PT_ACCL PT_ACC0L
45 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
48 #define PT_DUMMY_ACC1H 17
49 #define PT_DUMMY_ACC1L 18
51 #error unknown isa conifiguration
63 /* virtual pt_reg entry for gdb */
69 /* Control registers. */
70 #define SPR_CR0 PT_PSW
71 #define SPR_CR1 PT_CBR /* read only */
72 #define SPR_CR2 PT_SPI
73 #define SPR_CR3 PT_SPU
75 #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
76 #define SPR_CR6 PT_BPC
78 #define SPR_CR8 PT_BBPSW
83 #define SPR_CR13 PT_WR
84 #define SPR_CR14 PT_BBPC
87 /* this struct defines the way the registers are stored on the
88 stack during a system call. */
90 /* Saved main processor registers. */
94 struct pt_regs
*pt_regs
;
107 /* Saved main processor status and miscellaneous context registers. */
108 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
113 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
116 unsigned long dummy_acc1h
;
117 unsigned long dummy_acc1l
;
119 #error unknown isa configuration
122 unsigned long bpc
; /* saved PC for TRAP syscalls */
125 unsigned long spu
; /* saved user stack */
127 unsigned long lr
; /* saved PC for JL syscalls */
128 unsigned long spi
; /* saved kernel stack */
129 unsigned long orig_r0
;
132 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
133 #define PTRACE_GETREGS 12
134 #define PTRACE_SETREGS 13
136 #define PTRACE_OLDSETOPTIONS 21
138 /* options set using PTRACE_SETOPTIONS */
139 #define PTRACE_O_TRACESYSGOOD 0x00000001
143 #define __ARCH_SYS_PTRACE 1
145 #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
146 #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
147 #elif defined(CONFIG_ISA_M32R)
148 #define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0)
150 #error unknown isa configuration
153 #define instruction_pointer(regs) ((regs)->bpc)
154 #define profile_pc(regs) instruction_pointer(regs)
156 extern void show_regs(struct pt_regs
*);
158 extern void withdraw_debug_trap(struct pt_regs
*regs
);
160 #define task_pt_regs(task) \
161 ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)
163 #endif /* __KERNEL */
165 #endif /* _ASM_M32R_PTRACE_H */