processor_64.h 954 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #define INIT_ARCH_THREAD { .debugregs = { [ 0 ... 7 ] = 0 }, \
  15. .debugregs_seq = 0, \
  16. .fs = 0, \
  17. .faultinfo = { 0, 0, 0 } }
  18. #define STACKSLOTS_PER_LINE 4
  19. static inline void arch_flush_thread(struct arch_thread *thread)
  20. {
  21. }
  22. static inline void arch_copy_thread(struct arch_thread *from,
  23. struct arch_thread *to)
  24. {
  25. to->fs = from->fs;
  26. }
  27. #define current_text_addr() \
  28. ({ void *pc; __asm__("movq $1f,%0\n1:":"=g" (pc)); pc; })
  29. #define current_sp() ({ void *sp; __asm__("movq %%rsp, %0" : "=r" (sp) : ); sp; })
  30. #define current_bp() ({ unsigned long bp; __asm__("movq %%rbp, %0" : "=r" (bp) : ); bp; })
  31. #endif