mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 19:16:02 +02: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, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers. Link: https://lore.kernel.org/all/20260619161434.88270-1-thuth@redhat.com/ Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
27 lines
843 B
C
27 lines
843 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_GENERIC_KPROBES_H
|
|
#define _ASM_GENERIC_KPROBES_H
|
|
|
|
#if defined(__KERNEL__) && !defined(__ASSEMBLER__)
|
|
#ifdef CONFIG_KPROBES
|
|
/*
|
|
* Blacklist ganerating macro. Specify functions which is not probed
|
|
* by using this macro.
|
|
*/
|
|
# define __NOKPROBE_SYMBOL(fname) \
|
|
static unsigned long __used \
|
|
__section("_kprobe_blacklist") \
|
|
_kbl_addr_##fname = (unsigned long)fname;
|
|
# define NOKPROBE_SYMBOL(fname) __NOKPROBE_SYMBOL(fname)
|
|
/* Use this to forbid a kprobes attach on very low level functions */
|
|
# define __kprobes notrace __section(".kprobes.text")
|
|
# define nokprobe_inline __always_inline
|
|
#else
|
|
# define NOKPROBE_SYMBOL(fname)
|
|
# define __kprobes
|
|
# define nokprobe_inline inline
|
|
#endif
|
|
#endif /* defined(__KERNEL__) && !defined(__ASSEMBLER__) */
|
|
|
|
#endif /* _ASM_GENERIC_KPROBES_H */
|