current.h 443 B

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