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. */
38 #define PT_ACC1H 17 /* ISA_DSP_LEVEL2 only */
39 #define PT_ACC1L 18 /* ISA_DSP_LEVEL2 only */
50 /* virtual pt_reg entry for gdb */
56 /* Control registers. */
57 #define SPR_CR0 PT_PSW
58 #define SPR_CR1 PT_CBR /* read only */
59 #define SPR_CR2 PT_SPI
60 #define SPR_CR3 PT_SPU
62 #define SPR_CR5 PT_EVB /* part of M32R/E, M32R/I core only */
63 #define SPR_CR6 PT_BPC
65 #define SPR_CR8 PT_BBPSW
70 #define SPR_CR13 PT_WR
71 #define SPR_CR14 PT_BBPC
74 /* this struct defines the way the registers are stored on the
75 stack during a system call. */
77 /* Saved main processor registers. */
81 struct pt_regs
*pt_regs
;
94 /* Saved main processor status and miscellaneous context registers. */
97 unsigned long acc1h
; /* ISA_DSP_LEVEL2 only */
98 unsigned long acc1l
; /* ISA_DSP_LEVEL2 only */
100 unsigned long bpc
; /* saved PC for TRAP syscalls */
103 unsigned long spu
; /* saved user stack */
105 unsigned long lr
; /* saved PC for JL syscalls */
106 unsigned long spi
; /* saved kernel stack */
107 unsigned long orig_r0
;
110 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
111 #define PTRACE_GETREGS 12
112 #define PTRACE_SETREGS 13
114 #define PTRACE_OLDSETOPTIONS 21
116 /* options set using PTRACE_SETOPTIONS */
117 #define PTRACE_O_TRACESYSGOOD 0x00000001
121 #include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
124 extern void init_debug_traps(struct task_struct
*);
125 #define arch_ptrace_attach(child) \
126 init_debug_traps(child)
128 #if defined(CONFIG_ISA_M32R2) || defined(CONFIG_CHIP_VDEC2)
129 #define user_mode(regs) ((M32R_PSW_BPM & (regs)->psw) != 0)
130 #elif defined(CONFIG_ISA_M32R)
131 #define user_mode(regs) ((M32R_PSW_BSM & (regs)->psw) != 0)
133 #error unknown isa configuration
136 #define instruction_pointer(regs) ((regs)->bpc)
137 #define profile_pc(regs) instruction_pointer(regs)
139 extern void show_regs(struct pt_regs
*);
141 extern void withdraw_debug_trap(struct pt_regs
*regs
);
143 #define task_pt_regs(task) \
144 ((struct pt_regs *)(task_stack_page(task) + THREAD_SIZE) - 1)
146 #endif /* __KERNEL */
148 #endif /* _ASM_M32R_PTRACE_H */