processor-x86_64.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #define KSTK_EIP(tsk) KSTK_REG(tsk, RIP)
  30. #define KSTK_ESP(tsk) KSTK_REG(tsk, RSP)
  31. #include "asm/processor-generic.h"
  32. #endif