current.h 402 B

12345678910111213141516171819202122
  1. #ifndef _ASM_X86_CURRENT_H
  2. #define _ASM_X86_CURRENT_H
  3. #include <linux/compiler.h>
  4. #include <asm/percpu.h>
  5. #ifndef __ASSEMBLY__
  6. struct task_struct;
  7. DECLARE_PER_CPU(struct task_struct *, current_task);
  8. static __always_inline struct task_struct *get_current(void)
  9. {
  10. return percpu_read_stable(current_task);
  11. }
  12. #define current get_current()
  13. #endif /* __ASSEMBLY__ */
  14. #endif /* _ASM_X86_CURRENT_H */