13 #include <linux/kernel.h>
14 #include <linux/sched.h>
17 #include <linux/errno.h>
18 #include <linux/ptrace.h>
20 #include <linux/signal.h>
23 #include <asm/uaccess.h>
25 #include <asm/pgtable.h>
26 #include <asm/processor.h>
35 #define SR_MASK 0x001f
38 #define TRACE_BITS 0xC000
43 #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
44 #define SW_REG(reg) ((long)&((struct switch_stack *)0)->reg \
45 - sizeof(struct switch_stack))
49 static const int regoff[] = {
81 addr = (
unsigned long *)(task->
thread.esp0 + regoff[regno]);
86 long stkadj = *(
long *)(task->
thread.esp0 +
PT_REG(stkadj));
87 addr = (
unsigned long *) ((
unsigned long)addr + stkadj);
90 return *(
unsigned short *)addr;
106 addr = (
unsigned long *)(task->
thread.esp0 + regoff[regno]);
111 long stkadj = *(
long *)(task->
thread.esp0 +
PT_REG(stkadj));
112 addr = (
unsigned long *) ((
unsigned long)addr + stkadj);
114 if (regno ==
PT_SR) {
115 *(
unsigned short *)addr = data;
138 singlestep_disable(child);
158 singlestep_disable(child);
162 unsigned long addr,
unsigned long data)
166 int regno = addr >> 2;
167 unsigned long __user *datap = (
unsigned long __user *) data;
175 if (regno >= 0 && regno < 19) {
177 }
else if (regno >= 21 && regno < 49) {
178 tmp = child->
thread.fp[regno - 21];
182 if (
FPU_IS_EMU && (regno < 45) && !(regno % 3))
183 tmp = ((tmp & 0xffff0000) << 15) |
184 ((tmp & 0x0000ffff) << 16);
186 }
else if (regno == 49) {
187 tmp = child->
mm->start_code;
188 }
else if (regno == 50) {
189 tmp = child->
mm->start_data;
190 }
else if (regno == 51) {
191 tmp = child->
mm->end_code;
203 if (regno ==
PT_SR) {
207 if (regno >= 0 && regno < 19) {
208 if (
put_reg(child, regno, data))
210 }
else if (regno >= 21 && regno < 48) {
214 if (
FPU_IS_EMU && (regno < 45) && !(regno % 3)) {
216 data = (data & 0xffff0000) |
217 ((data & 0x0000ffff) >> 1);
225 for (i = 0; i < 19; i++) {
235 for (i = 0; i < 19; i++) {
289 #if defined(CONFIG_COLDFIRE) || !defined(CONFIG_MMU)