diff options
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/start_up.c | 1 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-i386/registers.c | 15 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-x86_64/registers.c | 15 |
3 files changed, 18 insertions, 13 deletions
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 50314850400..7fe92680c7d 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c @@ -14,7 +14,6 @@ #include <sched.h> #include <fcntl.h> #include <errno.h> -#include <setjmp.h> #include <sys/time.h> #include <sys/wait.h> #include <sys/mman.h> diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c index 1f90a2d7138..7cd0369e02b 100644 --- a/arch/um/os-Linux/sys-i386/registers.c +++ b/arch/um/os-Linux/sys-i386/registers.c @@ -130,11 +130,14 @@ void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) HOST_FP_SIZE * sizeof(unsigned long)); } -void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer) +unsigned long get_thread_reg(int reg, jmp_buf *buf) { - struct __jmp_buf *jmpbuf = buffer; - - UPT_SET(uml_regs, EIP, jmpbuf->__eip); - UPT_SET(uml_regs, UESP, jmpbuf->__esp); - UPT_SET(uml_regs, EBP, jmpbuf->__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); + return 0; + } } diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c index e730447d6c0..cb8e8a26328 100644 --- a/arch/um/os-Linux/sys-x86_64/registers.c +++ b/arch/um/os-Linux/sys-x86_64/registers.c @@ -78,11 +78,14 @@ void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) HOST_FP_SIZE * sizeof(unsigned long)); } -void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer) +unsigned long get_thread_reg(int reg, jmp_buf *buf) { - struct __jmp_buf *jmpbuf = buffer; - - UPT_SET(uml_regs, RIP, jmpbuf->__rip); - UPT_SET(uml_regs, RSP, jmpbuf->__rsp); - UPT_SET(uml_regs, RBP, jmpbuf->__rbp); + switch(reg){ + case RIP: return buf[0]->__rip; + case RSP: return buf[0]->__rsp; + case RBP: return buf[0]->__rbp; + default: + printk("get_thread_regs - unknown register %d\n", reg); + return 0; + } } |