mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, so let's standardize on the __ASSEMBLER__ macro that is provided by the compilers now. This is a completely mechanical patch (done with a simple "sed -i" statement). Cc: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: linux-um@lists.infradead.org Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://patch.msgid.link/20250314071013.1575167-36-thuth@redhat.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
23 lines
412 B
C
23 lines
412 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_CURRENT_H
|
|
#define __ASM_CURRENT_H
|
|
|
|
#include <linux/compiler.h>
|
|
#include <linux/threads.h>
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
struct task_struct;
|
|
extern struct task_struct *cpu_tasks[NR_CPUS];
|
|
|
|
static __always_inline struct task_struct *get_current(void)
|
|
{
|
|
return cpu_tasks[0];
|
|
}
|
|
|
|
|
|
#define current get_current()
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* __ASM_CURRENT_H */
|