aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/sys-x86_64/registers.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-08 07:22:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:42 -0500
commit5134d8fea06ab51459fd095d091d1e6f73a44553 (patch)
tree504a84a9290a40f0c98b7c5731b7df82cb357ebe /arch/um/os-Linux/sys-x86_64/registers.c
parent536788fe2d28e11db6aeda74207d95d750fb761f (diff)
uml: style fixes in arch/um/os-Linux
Style changes under arch/um/os-Linux: include trimming CodingStyle fixes some printks needed severity indicators make_tempfile turns out not to be used outside of mem.c, so it is now static. Its declaration in tempfile.h is no longer needed, and tempfile.h itself is no longer needed. create_tmp_file was also made static. checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part of a macro definition - this is copying a bit of kernel infrastructure into the libc side of UML because the kernel headers can't be included there. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/sys-x86_64/registers.c')
-rw-r--r--arch/um/os-Linux/sys-x86_64/registers.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c
index 9bfa789992de..a375853337a7 100644
--- a/arch/um/os-Linux/sys-x86_64/registers.c
+++ b/arch/um/os-Linux/sys-x86_64/registers.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2006-2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) 2 * Copyright (C) 2006 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -7,31 +7,36 @@
7#include <sys/ptrace.h> 7#include <sys/ptrace.h>
8#define __FRAME_OFFSETS 8#define __FRAME_OFFSETS
9#include <asm/ptrace.h> 9#include <asm/ptrace.h>
10#include "kern_constants.h"
10#include "longjmp.h" 11#include "longjmp.h"
11#include "user.h" 12#include "user.h"
12 13
13int save_fp_registers(int pid, unsigned long *fp_regs) 14int save_fp_registers(int pid, unsigned long *fp_regs)
14{ 15{
15 if(ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0) 16 if (ptrace(PTRACE_GETFPREGS, pid, 0, fp_regs) < 0)
16 return -errno; 17 return -errno;
17 return 0; 18 return 0;
18} 19}
19 20
20int restore_fp_registers(int pid, unsigned long *fp_regs) 21int restore_fp_registers(int pid, unsigned long *fp_regs)
21{ 22{
22 if(ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0) 23 if (ptrace(PTRACE_SETFPREGS, pid, 0, fp_regs) < 0)
23 return -errno; 24 return -errno;
24 return 0; 25 return 0;
25} 26}
26 27
27unsigned long get_thread_reg(int reg, jmp_buf *buf) 28unsigned long get_thread_reg(int reg, jmp_buf *buf)
28{ 29{
29 switch(reg){ 30 switch (reg) {
30 case RIP: return buf[0]->__rip; 31 case RIP:
31 case RSP: return buf[0]->__rsp; 32 return buf[0]->__rip;
32 case RBP: return buf[0]->__rbp; 33 case RSP:
34 return buf[0]->__rsp;
35 case RBP:
36 return buf[0]->__rbp;
33 default: 37 default:
34 printk("get_thread_regs - unknown register %d\n", reg); 38 printk(UM_KERN_ERR "get_thread_regs - unknown register %d\n",
39 reg);
35 return 0; 40 return 0;
36 } 41 }
37} 42}