aboutsummaryrefslogtreecommitdiffstats
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.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c
index 516f66dd87e3..7cd0369e02b3 100644
--- a/arch/um/os-Linux/sys-i386/registers.c
+++ b/arch/um/os-Linux/sys-i386/registers.c
@@ -5,12 +5,12 @@
5 5
6#include <errno.h> 6#include <errno.h>
7#include <string.h> 7#include <string.h>
8#include <setjmp.h>
9#include "sysdep/ptrace_user.h" 8#include "sysdep/ptrace_user.h"
10#include "sysdep/ptrace.h" 9#include "sysdep/ptrace.h"
11#include "uml-config.h" 10#include "uml-config.h"
12#include "skas_ptregs.h" 11#include "skas_ptregs.h"
13#include "registers.h" 12#include "registers.h"
13#include "longjmp.h"
14#include "user.h" 14#include "user.h"
15 15
16/* These are set once at boot time and not changed thereafter */ 16/* These are set once at boot time and not changed thereafter */
@@ -130,11 +130,14 @@ void get_safe_registers(unsigned long *regs, unsigned long *fp_regs)
130 HOST_FP_SIZE * sizeof(unsigned long)); 130 HOST_FP_SIZE * sizeof(unsigned long));
131} 131}
132 132
133void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer) 133unsigned long get_thread_reg(int reg, jmp_buf *buf)
134{ 134{
135 struct __jmp_buf_tag *jmpbuf = buffer; 135 switch(reg){
136 136 case EIP: return buf[0]->__eip;
137 UPT_SET(uml_regs, EIP, jmpbuf->__jmpbuf[JB_PC]); 137 case UESP: return buf[0]->__esp;
138 UPT_SET(uml_regs, UESP, jmpbuf->__jmpbuf[JB_SP]); 138 case EBP: return buf[0]->__ebp;
139 UPT_SET(uml_regs, EBP, jmpbuf->__jmpbuf[JB_BP]); 139 default:
140 printk("get_thread_regs - unknown register %d\n", reg);
141 return 0;
142 }
140} 143}