Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35707
b: refs/heads/master
c: 75e29b1
h: refs/heads/master
i:
  35705: 4f9c014
  35703: ccf1057
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Sep 26, 2006
1 parent 1b5ce55 commit 12aa938
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf61f50d63b4d9e30d7a86a2d44bb300ae7c1dd4
refs/heads/master: 75e29b18d9a46bf3193278e92dc95609a8cca2ab
3 changes: 2 additions & 1 deletion trunk/arch/um/include/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define __REGISTERS_H

#include "sysdep/ptrace.h"
#include "sysdep/archsetjmp.h"

extern void init_thread_registers(union uml_pt_regs *to);
extern int save_fp_registers(int pid, unsigned long *fp_regs);
Expand All @@ -15,6 +16,6 @@ extern void save_registers(int pid, union uml_pt_regs *regs);
extern void restore_registers(int pid, union uml_pt_regs *regs);
extern void init_registers(int pid);
extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs);
extern void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer);
extern unsigned long get_thread_reg(int reg, jmp_buf *buf);

#endif
1 change: 0 additions & 1 deletion trunk/arch/um/os-Linux/start_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
15 changes: 9 additions & 6 deletions trunk/arch/um/os-Linux/sys-i386/registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
15 changes: 9 additions & 6 deletions trunk/arch/um/os-Linux/sys-x86_64/registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 1 addition & 3 deletions trunk/include/asm-um/processor-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ extern struct cpuinfo_um cpu_data[];

#ifdef CONFIG_MODE_SKAS
#define KSTK_REG(tsk, reg) \
({ union uml_pt_regs regs; \
get_thread_regs(&regs, tsk->thread.mode.skas.switch_buf); \
UPT_REG(&regs, reg); })
get_thread_reg(reg, tsk->thread.mode.skas.switch_buf)
#else
#define KSTK_REG(tsk, reg) (0xbadbabe)
#endif
Expand Down

0 comments on commit 12aa938

Please sign in to comment.