2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
7 #ifndef __UM_PROCESSOR_X86_64_H
8 #define __UM_PROCESSOR_X86_64_H
10 /* include faultinfo structure */
11 #include "sysdep/faultinfo.h"
14 unsigned long debugregs
[8];
16 struct faultinfo faultinfo
;
19 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
20 extern inline void rep_nop(void)
22 __asm__
__volatile__("rep;nop": : :"memory");
25 #define cpu_relax() rep_nop()
27 #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
29 .faultinfo = { 0, 0, 0 } }
31 static inline void arch_flush_thread(struct arch_thread
*thread
)
35 static inline void arch_copy_thread(struct arch_thread
*from
,
36 struct arch_thread
*to
)
40 #include "asm/arch/user.h"
42 #define current_text_addr() \
43 ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
45 #define ARCH_IS_STACKGROW(address) \
46 (address + 128 >= UPT_SP(¤t->thread.regs.regs))
48 #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
49 #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
51 #include "asm/processor-generic.h"