1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_CURRENT_H
3 #define _ASM_X86_CURRENT_H
5 #include <linux/compiler.h>
9 #include <linux/cache.h>
10 #include <asm/percpu.h>
17 struct task_struct *current_task;
20 #ifdef CONFIG_CALL_DEPTH_TRACKING
23 unsigned long top_of_stack;
24 void *hardirq_stack_ptr;
27 bool hardirq_stack_inuse;
29 void *softirq_stack_ptr;
35 static_assert(sizeof(struct pcpu_hot) == 64);
37 DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot);
39 static __always_inline struct task_struct *get_current(void)
41 return this_cpu_read_stable(pcpu_hot.current_task);
44 #define current get_current()
46 #endif /* __ASSEMBLY__ */
48 #endif /* _ASM_X86_CURRENT_H */