processor-x86_64.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. struct faultinfo faultinfo;
  14. };
  15. /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
  16. extern inline void rep_nop(void)
  17. {
  18. __asm__ __volatile__("rep;nop": : :"memory");
  19. }
  20. #define cpu_relax() rep_nop()
  21. #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
  22. .debugregs_seq = 0, \
  23. .faultinfo = { 0, 0, 0 } }
  24. #include "asm/arch/user.h"
  25. #define current_text_addr() \
  26. ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
  27. #define ARCH_IS_STACKGROW(address) \
  28. (address + 128 >= UPT_SP(&current->thread.regs.regs))
  29. #include "asm/processor-generic.h"
  30. #endif
  31. /*
  32. * Overrides for Emacs so that we follow Linus's tabbing style.
  33. * Emacs will notice this stuff at the end of the file and automatically
  34. * adjust the settings for this buffer only. This must remain at the end
  35. * of the file.
  36. * ---------------------------------------------------------------------------
  37. * Local variables:
  38. * c-file-style: "linux"
  39. * End:
  40. */