9 #include <linux/sched.h>
10 #include <linux/errno.h>
11 #define __FRAME_OFFSETS
12 #include <asm/ptrace.h>
13 #include <asm/uaccess.h>
19 #define FLAG_MASK 0x44dd5UL
21 static const int reg_offsets[] =
25 [
R10 >> 3] = HOST_R10,
26 [
R11 >> 3] = HOST_R11,
27 [
R12 >> 3] = HOST_R12,
28 [
R13 >> 3] = HOST_R13,
29 [
R14 >> 3] = HOST_R14,
30 [
R15 >> 3] = HOST_R15,
48 [
EFLAGS >> 3] = HOST_EFLAGS,
59 if (test_tsk_thread_flag(child,
TIF_IA32))
89 if (value && (value & 3) != 3)
96 if (!((value >> 48) == 0 || (value >> 48) == 0xffff))
106 panic(
"Bad register in putreg(): %d\n", regno);
109 child->
thread.regs.regs.gp[reg_offsets[regno >> 3]] =
value;
115 if ((addr & 3) || addr < 0)
119 return putreg(child, addr, data);
120 else if ((addr >=
offsetof(
struct user, u_debugreg[0])) &&
124 if ((addr == 4) || (addr == 5))
134 unsigned long mask = ~0
UL;
136 if (test_tsk_thread_flag(child,
TIF_IA32))
171 panic(
"Bad register in getreg: %d\n", regno);
173 return mask & child->
thread.regs.regs.gp[reg_offsets[regno >> 3]];
181 if ((addr & 3) || addr < 0)
186 tmp =
getreg(child, addr);
187 else if ((addr >=
offsetof(
struct user, u_debugreg[0])) &&
193 return put_user(tmp, (
unsigned long *) data);
199 unsigned short instr;
211 if (n !=
sizeof(instr)) {
212 printk(
"is_syscall : failed to read instruction from "
218 return instr == 0x050f;
224 long fpregs[HOST_FP_SIZE];
226 BUG_ON(
sizeof(*buf) !=
sizeof(fpregs));
241 long fpregs[HOST_FP_SIZE];
243 BUG_ON(
sizeof(*buf) !=
sizeof(fpregs));
252 unsigned long addr,
unsigned long data)
259 ret = get_fpregs(datap, child);
262 ret = set_fpregs(datap, child);
264 case PTRACE_ARCH_PRCTL: