2 * Copyright 2004-2008 Analog Devices Inc.
4 * Licensed under the GPL-2 or later.
11 * GCC defines register number like this:
12 * -----------------------------
13 * 0 - 7 are data registers R0-R7
14 * 8 - 15 are address registers P0-P7
15 * 16 - 31 dsp registers I/B/L0 -- I/B/L3 & M0--M3
16 * 32 - 33 A registers A0 & A1
17 * 34 - status register
18 * -----------------------------
20 * We follows above, except:
21 * 32-33 --- Low 32-bit of A0&1
22 * 34-35 --- High 8-bit of A0&1
29 /* this struct defines the way the registers are stored on the
30 stack during a system call. */
39 long pc; /* PC == RETI */
41 long reserved; /* Used as scratch during system calls */
90 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
91 #define PTRACE_GETREGS 12
92 #define PTRACE_SETREGS 13 /* ptrace signal */
94 #define PTRACE_GETFDPIC 31 /* get the ELF fdpic loadmap address */
95 #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
96 #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
102 /* user_mode returns true if only one bit is set in IPEND, other than the
103 master interrupt enable. */
104 #define user_mode(regs) (!(((regs)->ipend & ~0x10) & (((regs)->ipend & ~0x10) - 1)))
105 #define instruction_pointer(regs) ((regs)->pc)
106 #define user_stack_pointer(regs) ((regs)->usp)
107 #define profile_pc(regs) instruction_pointer(regs)
108 extern void show_regs(struct pt_regs *);
110 #define arch_has_single_step() (1)
111 extern void user_enable_single_step(struct task_struct *child);
112 extern void user_disable_single_step(struct task_struct *child);
113 /* common code demands this function */
114 #define ptrace_disable(child) user_disable_single_step(child)
117 * Get the address of the live pt_regs for the specified task.
118 * These are saved onto the top kernel stack when the process
121 * Note: if a user thread is execve'd from kernel space, the
122 * kernel stack will not be empty on entry to the kernel, so
123 * ptracing these tasks will fail.
125 #define task_pt_regs(task) \
127 ((unsigned long)task_stack_page(task) + \
128 (THREAD_SIZE - sizeof(struct pt_regs)))
130 #endif /* __KERNEL__ */
132 #endif /* __ASSEMBLY__ */
135 * Offsets used by 'ptrace' system call interface.
181 #define PT_RESERVED 32
190 #define PT_ORIG_R0 208
191 #define PT_ORIG_P0 212
192 #define PT_SYSCFG 216
193 #define PT_TEXT_ADDR 220
194 #define PT_TEXT_END_ADDR 224
195 #define PT_DATA_ADDR 228
196 #define PT_FDPIC_EXEC 232
197 #define PT_FDPIC_INTERP 236
199 #define PT_LAST_PSEUDO PT_FDPIC_INTERP
201 #endif /* _BFIN_PTRACE_H */