processor-x86_64.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright 2003 PathScale, Inc.
  3. *
  4. * Licensed under the GPL
  5. */
  6. #ifndef __UM_PROCESSOR_X86_64_H
  7. #define __UM_PROCESSOR_X86_64_H
  8. /* include faultinfo structure */
  9. #include "sysdep/faultinfo.h"
  10. struct arch_thread {
  11. unsigned long debugregs[8];
  12. int debugregs_seq;
  13. unsigned long fs;
  14. struct faultinfo faultinfo;
  15. };
  16. /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
  17. extern inline void rep_nop(void)
  18. {
  19. __asm__ __volatile__("rep;nop": : :"memory");
  20. }
  21. #define cpu_relax() rep_nop()
  22. #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
  23. .debugregs_seq = 0, \
  24. .fs = 0, \
  25. .faultinfo = { 0, 0, 0 } }
  26. static inline void arch_flush_thread(struct arch_thread *thread)
  27. {
  28. }
  29. static inline void arch_copy_thread(struct arch_thread *from,
  30. struct arch_thread *to)
  31. {
  32. }
  33. #include "asm/arch/user.h"
  34. #define current_text_addr() \
  35. ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
  36. #define ARCH_IS_STACKGROW(address) \
  37. (address + 128 >= UPT_SP(&current->thread.regs.regs))
  38. #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
  39. #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
  40. #include "asm/processor-generic.h"
  41. #endif