current.h 449 B

123456789101112131415161718192021222324
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_CURRENT_H
  3. #define __ASM_CURRENT_H
  4. #include <linux/compiler.h>
  5. #include <linux/threads.h>
  6. #ifndef __ASSEMBLER__
  7. #include <shared/smp.h>
  8. struct task_struct;
  9. extern struct task_struct *cpu_tasks[NR_CPUS];
  10. static __always_inline struct task_struct *get_current(void)
  11. {
  12. return cpu_tasks[uml_curr_cpu()];
  13. }
  14. #define current get_current()
  15. #endif /* __ASSEMBLER__ */
  16. #endif /* __ASM_CURRENT_H */