processor_64.h 959 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. struct arch_thread {
  9. unsigned long debugregs[8];
  10. int debugregs_seq;
  11. unsigned long fs;
  12. struct faultinfo faultinfo;
  13. };
  14. /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
  15. static inline void rep_nop(void)
  16. {
  17. __asm__ __volatile__("rep;nop": : :"memory");
  18. }
  19. #define cpu_relax() rep_nop()
  20. #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
  21. .debugregs_seq = 0, \
  22. .fs = 0, \
  23. .faultinfo = { 0, 0, 0 } }
  24. static inline void arch_flush_thread(struct arch_thread *thread)
  25. {
  26. }
  27. static inline void arch_copy_thread(struct arch_thread *from,
  28. struct arch_thread *to)
  29. {
  30. to->fs = from->fs;
  31. }
  32. #include <asm/user.h>
  33. #define current_text_addr() \
  34. ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
  35. #endif