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 /* 0 - 13 are integer registers (general purpose registers). */
35 /* processor status and miscellaneous context registers. */
36 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
41 #define PT_ACCH PT_ACC0H
42 #define PT_ACCL PT_ACC0L
43 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
46 #define PT_DUMMY_ACC1H 17
47 #define PT_DUMMY_ACC1L 18
49 #error unknown isa conifiguration
61 /* virtual pt_reg entry for gdb */
67 /* Control registers. */
68 #define SPR_CR0 PT_PSW
69 #define SPR_CR1 PT_CBR /* read only */
70 #define SPR_CR2 PT_SPI
71 #define SPR_CR3 PT_SPU
73 #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
74 #define SPR_CR6 PT_BPC
76 #define SPR_CR8 PT_BBPSW
81 #define SPR_CR13 PT_WR
82 #define SPR_CR14 PT_BBPC
85 /* this struct defines the way the registers are stored on the
86 stack during a system call. */
88 /* Saved main processor registers. */
92 struct pt_regs
*pt_regs
;
105 /* Saved main processor status and miscellaneous context registers. */
106 #if defined(CONFIG_ISA_M32R2) && defined(CONFIG_ISA_DSP_LEVEL2)
111 #elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
114 unsigned long dummy_acc1h
;
115 unsigned long dummy_acc1l
;
117 #error unknown isa configuration
120 unsigned long bpc
; /* saved PC for TRAP syscalls */
123 unsigned long spu
; /* saved user stack */
125 unsigned long lr
; /* saved PC for JL syscalls */
126 unsigned long spi
; /* saved kernel stack */
127 unsigned long orig_r0
;
130 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
131 #define PTRACE_GETREGS 12
132 #define PTRACE_SETREGS 13
134 #define PTRACE_OLDSETOPTIONS 21
136 /* options set using PTRACE_SETOPTIONS */
137 #define PTRACE_O_TRACESYSGOOD 0x00000001
141 #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
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 */