processor.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. static 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. to->fs = from->fs;
  33. }
  34. #include <asm/user.h>
  35. #define current_text_addr() \
  36. ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
  37. #define ARCH_IS_STACKGROW(address) \
  38. (address + 128 >= UPT_SP(&current->thread.regs.regs))
  39. #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
  40. #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
  41. #include "asm/processor-generic.h"
  42. #endif