#include <errno.h>
#include <string.h>
-#include <sys/ptrace.h>
+#include "sysdep/ptrace_user.h"
#include "sysdep/ptrace.h"
#include "uml-config.h"
#include "skas_ptregs.h"
memcpy(to->skas.xfp, exec_fpx_regs, sizeof(to->skas.xfp));
}
+/* XXX These need to use [GS]ETFPXREGS and copy_sc_{to,from}_user_skas needs
+ * to pass in a sufficiently large buffer
+ */
+int save_fp_registers(int pid, unsigned long *fp_regs)
+{
+ if(ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0)
+ return(-errno);
+ return(0);
+}
+
+int restore_fp_registers(int pid, unsigned long *fp_regs)
+{
+ if(ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
+ return(-errno);
+ return(0);
+}
+
static int move_registers(int pid, int int_op, union uml_pt_regs *regs,
int fp_op, unsigned long *fp_regs)
{
panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
err);
+ errno = 0;
err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs);
if(!err)
return;
+ if(errno != EIO)
+ panic("check_ptrace : PTRACE_GETFPXREGS failed, errno = %d",
+ errno);
have_fpx_regs = 0;
- if(err != EIO)
- panic("check_ptrace : PTRACE_GETFPXREGS failed, errno = %d",
- err);
err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs);
if(err)