2 * Copyright (C) 2006-2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL
7 #include <sys/ptrace.h>
8 #define __FRAME_OFFSETS
9 #include <asm/ptrace.h>
13 int save_fp_registers(int pid
, unsigned long *fp_regs
)
15 if(ptrace(PTRACE_GETFPREGS
, pid
, 0, fp_regs
) < 0)
20 int restore_fp_registers(int pid
, unsigned long *fp_regs
)
22 if(ptrace(PTRACE_SETFPREGS
, pid
, 0, fp_regs
) < 0)
27 unsigned long get_thread_reg(int reg
, jmp_buf *buf
)
30 case RIP
: return buf
[0]->__rip
;
31 case RSP
: return buf
[0]->__rsp
;
32 case RBP
: return buf
[0]->__rbp
;
34 printk("get_thread_regs - unknown register %d\n", reg
);