current_64.h 434 B

123456789101112131415161718192021222324252627
  1. #ifndef _X86_64_CURRENT_H
  2. #define _X86_64_CURRENT_H
  3. #if !defined(__ASSEMBLY__)
  4. struct task_struct;
  5. #include <asm/pda.h>
  6. static inline struct task_struct *get_current(void)
  7. {
  8. struct task_struct *t = read_pda(pcurrent);
  9. return t;
  10. }
  11. #define current get_current()
  12. #else
  13. #ifndef ASM_OFFSET_H
  14. #include <asm/asm-offsets.h>
  15. #endif
  16. #define GET_CURRENT(reg) movq %gs:(pda_pcurrent),reg
  17. #endif
  18. #endif /* !(_X86_64_CURRENT_H) */