Skip to content

Commit

Permalink
um: unify KSTK_...
Browse files Browse the repository at this point in the history
... and switch get_thread_register() to HOST_... for register numbers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Al Viro authored and Richard Weinberger committed Nov 2, 2011
1 parent 4d21109 commit a10c95d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 4 additions & 0 deletions arch/x86/um/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
# include "processor_64.h"
#endif

#define KSTK_EIP(tsk) KSTK_REG(tsk, HOST_IP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, HOST_IP)
#define KSTK_EBP(tsk) KSTK_REG(tsk, HOST_BP)

#define ARCH_IS_STACKGROW(address) \
(address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs))

Expand Down
4 changes: 0 additions & 4 deletions arch/x86/um/asm/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,4 @@ static inline void rep_nop(void)
#define current_text_addr() \
({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })

#define KSTK_EIP(tsk) KSTK_REG(tsk, EIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, UESP)
#define KSTK_EBP(tsk) KSTK_REG(tsk, EBP)

#endif
3 changes: 0 additions & 3 deletions arch/x86/um/asm/processor_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,4 @@ static inline void arch_copy_thread(struct arch_thread *from,
#define current_text_addr() \
({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })

#define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
#define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)

#endif
12 changes: 6 additions & 6 deletions arch/x86/um/os-Linux/registers.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ unsigned long get_thread_reg(int reg, jmp_buf *buf)
{
switch (reg) {
#ifdef __i386__
case EIP:
case HOST_IP:
return buf[0]->__eip;
case UESP:
case HOST_SP:
return buf[0]->__esp;
case EBP:
case HOST_BP:
return buf[0]->__ebp;
#else
case RIP:
case HOST_IP:
return buf[0]->__rip;
case RSP:
case HOST_SP:
return buf[0]->__rsp;
case RBP:
case HOST_BP:
return buf[0]->__rbp;
#endif
default:
Expand Down

0 comments on commit a10c95d

Please sign in to comment.