aboutsummaryrefslogtreecommitdiff
path: root/arch/um/os-Linux/sys-i386/registers.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/os-Linux/sys-i386/registers.c')
-rw-r--r--arch/um/os-Linux/sys-i386/registers.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c
index 8f1f0ab639b..d1997ca76e5 100644
--- a/arch/um/os-Linux/sys-i386/registers.c
+++ b/arch/um/os-Linux/sys-i386/registers.c
@@ -1,49 +1,55 @@
/*
* Copyright (C) 2004 PathScale, Inc
+ * Copyright (C) 2004 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
* Licensed under the GPL
*/
#include <errno.h>
-#include <sysdep/ptrace_user.h>
+#include "kern_constants.h"
#include "longjmp.h"
#include "user.h"
+#include "sysdep/ptrace_user.h"
int save_fp_registers(int pid, unsigned long *fp_regs)
{
- if(ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0)
+ 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)
+ if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
}
int save_fpx_registers(int pid, unsigned long *fp_regs)
{
- if(ptrace(PTRACE_GETFPXREGS, pid, 0, fp_regs) < 0)
+ if (ptrace(PTRACE_GETFPXREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
}
int restore_fpx_registers(int pid, unsigned long *fp_regs)
{
- if(ptrace(PTRACE_SETFPXREGS, pid, 0, fp_regs) < 0)
+ if (ptrace(PTRACE_SETFPXREGS, pid, 0, fp_regs) < 0)
return -errno;
return 0;
}
unsigned long get_thread_reg(int reg, jmp_buf *buf)
{
- switch(reg){
- case EIP: return buf[0]->__eip;
- case UESP: return buf[0]->__esp;
- case EBP: return buf[0]->__ebp;
+ switch (reg) {
+ case EIP:
+ return buf[0]->__eip;
+ case UESP:
+ return buf[0]->__esp;
+ case EBP:
+ return buf[0]->__ebp;
default:
- printk("get_thread_regs - unknown register %d\n", reg);
+ printk(UM_KERN_ERR "get_thread_regs - unknown register %d\n",
+ reg);
return 0;
}
}