4 * Copyright (c) 2005-2007 Analog Devices Inc.
6 * See file CREDITS for list of people who contributed to this
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
25 #ifndef _BLACKFIN_PTRACE_H
26 #define _BLACKFIN_PTRACE_H
31 * GCC defines register number like this:
32 * -----------------------------
33 * 0 - 7 are data registers R0-R7
34 * 8 - 15 are address registers P0-P7
35 * 16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3
36 * 32 - 33 A registers A0 & A1
37 * 34 - status register
39 * We follows above, except:
40 * 32-33 --- Low 32-bit of A0&1
41 * 34-35 --- High 8-bit of A0&1
44 #if defined(NEW_PT_REGS)
47 #define PT_SYSCFG (PT_IPEND+4)
48 #define PT_SEQSTAT (PT_SYSCFG+4)
49 #define PT_RETE (PT_SEQSTAT+4)
50 #define PT_RETN (PT_RETE+4)
51 #define PT_RETX (PT_RETN+4)
52 #define PT_RETI (PT_RETX+4)
54 #define PT_RETS (PT_RETI+4)
55 #define PT_RESERVED (PT_RETS+4)
56 #define PT_ASTAT (PT_RESERVED+4)
57 #define PT_LB1 (PT_ASTAT+4)
58 #define PT_LB0 (PT_LB1+4)
59 #define PT_LT1 (PT_LB0+4)
60 #define PT_LT0 (PT_LT1+4)
61 #define PT_LC1 (PT_LT0+4)
62 #define PT_LC0 (PT_LC1+4)
63 #define PT_A1W (PT_LC0+4)
64 #define PT_A1X (PT_A1W+4)
65 #define PT_A0W (PT_A1X+4)
66 #define PT_A0X (PT_A0W+4)
67 #define PT_B3 (PT_A0X+4)
68 #define PT_B2 (PT_B3+4)
69 #define PT_B1 (PT_B2+4)
70 #define PT_B0 (PT_B1+4)
71 #define PT_L3 (PT_B0+4)
72 #define PT_L2 (PT_L3+4)
73 #define PT_L1 (PT_L2+4)
74 #define PT_L0 (PT_L1+4)
75 #define PT_M3 (PT_L0+4)
76 #define PT_M2 (PT_M3+4)
77 #define PT_M1 (PT_M2+4)
78 #define PT_M0 (PT_M1+4)
79 #define PT_I3 (PT_M0+4)
80 #define PT_I2 (PT_I3+4)
81 #define PT_I1 (PT_I2+4)
82 #define PT_I0 (PT_I1+4)
83 #define PT_USP (PT_I0+4)
84 #define PT_FP (PT_USP+4)
85 #define PT_P5 (PT_FP+4)
86 #define PT_P4 (PT_P5+4)
87 #define PT_P3 (PT_P4+4)
88 #define PT_P2 (PT_P3+4)
89 #define PT_P1 (PT_P2+4)
90 #define PT_P0 (PT_P1+4)
91 #define PT_R7 (PT_P0+4)
92 #define PT_R6 (PT_R7+4)
93 #define PT_R5 (PT_R6+4)
94 #define PT_R4 (PT_R5+4)
95 #define PT_R3 (PT_R4+4)
96 #define PT_R2 (PT_R3+4)
97 #define PT_R1 (PT_R2+4)
98 #define PT_R0 (PT_R1+4)
99 #define PT_ORIG_R0 (PT_R0+4)
100 #define PT_SR PT_SEQSTAT
104 * Here utilize blackfin : dpregs = [pregs + imm16s4]
105 * [pregs + imm16s4] = dpregs
106 * to access defferent saved reg in stack
122 #define PT_SEQSTAT 56 /* so-called SR reg */
123 #define PT_SR PT_SEQSTAT
130 #define PT_ORIG_R0 84
136 /* Added by HuTao, May26 2003 3:18PM */
139 /* Add SYSCFG register for single stepping support */
140 #define PT_SYSCFG 104
146 #if defined(NEW_PT_REGS)
147 /* this struct defines the way the registers are stored on the
148 * stack during a system call.
207 /* now we don't know what regs the system call will use */
223 unsigned long seqstat;
235 * Added for supervisor/user mode switch.
237 * HuTao May26 03 3:23PM
245 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
246 #define PTRACE_GETREGS 12
247 #define PTRACE_SETREGS 13 /* ptrace signal */
252 #define PS_S (0x0c00)
254 /* Bit 11:10 of SEQSTAT defines user/supervisor/debug mode
260 #define PS_M (0x1000) /* I am not sure why this is required here Akbar */
263 #define user_mode(regs) (!((regs)->seqstat & PS_S))
264 #define instruction_pointer(regs) ((regs)->pc)
265 extern void show_regs(struct pt_regs *);