Commit a10c95d8 authored by Al Viro's avatar Al Viro Committed by Richard Weinberger

um: unify KSTK_...

... and switch get_thread_register() to HOST_... for register numbers
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 4d211093
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
# include "processor_64.h" # include "processor_64.h"
#endif #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) \ #define ARCH_IS_STACKGROW(address) \
(address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs)) (address + 65536 + 32 * sizeof(unsigned long) >= UPT_SP(&current->thread.regs.regs))
......
...@@ -63,8 +63,4 @@ static inline void rep_nop(void) ...@@ -63,8 +63,4 @@ static inline void rep_nop(void)
#define current_text_addr() \ #define current_text_addr() \
({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; }) ({ 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 #endif
...@@ -42,7 +42,4 @@ static inline void arch_copy_thread(struct arch_thread *from, ...@@ -42,7 +42,4 @@ static inline void arch_copy_thread(struct arch_thread *from,
#define current_text_addr() \ #define current_text_addr() \
({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; }) ({ 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 #endif
...@@ -89,18 +89,18 @@ unsigned long get_thread_reg(int reg, jmp_buf *buf) ...@@ -89,18 +89,18 @@ unsigned long get_thread_reg(int reg, jmp_buf *buf)
{ {
switch (reg) { switch (reg) {
#ifdef __i386__ #ifdef __i386__
case EIP: case HOST_IP:
return buf[0]->__eip; return buf[0]->__eip;
case UESP: case HOST_SP:
return buf[0]->__esp; return buf[0]->__esp;
case EBP: case HOST_BP:
return buf[0]->__ebp; return buf[0]->__ebp;
#else #else
case RIP: case HOST_IP:
return buf[0]->__rip; return buf[0]->__rip;
case RSP: case HOST_SP:
return buf[0]->__rsp; return buf[0]->__rsp;
case RBP: case HOST_BP:
return buf[0]->__rbp; return buf[0]->__rbp;
#endif #endif
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment