current.h 404 B

123456789101112131415161718192021
  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 this_cpu_read_stable(current_task);
  11. }
  12. #define current get_current()
  13. #endif /* __ASSEMBLY__ */
  14. #endif /* _ASM_X86_CURRENT_H */