18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_GENERIC_KPROBES_H
38c2ecf20Sopenharmony_ci#define _ASM_GENERIC_KPROBES_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
68c2ecf20Sopenharmony_ci#ifdef CONFIG_KPROBES
78c2ecf20Sopenharmony_ci/*
88c2ecf20Sopenharmony_ci * Blacklist ganerating macro. Specify functions which is not probed
98c2ecf20Sopenharmony_ci * by using this macro.
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci# define __NOKPROBE_SYMBOL(fname)				\
128c2ecf20Sopenharmony_cistatic unsigned long __used					\
138c2ecf20Sopenharmony_ci	__section("_kprobe_blacklist")				\
148c2ecf20Sopenharmony_ci	_kbl_addr_##fname = (unsigned long)fname;
158c2ecf20Sopenharmony_ci# define NOKPROBE_SYMBOL(fname)	__NOKPROBE_SYMBOL(fname)
168c2ecf20Sopenharmony_ci/* Use this to forbid a kprobes attach on very low level functions */
178c2ecf20Sopenharmony_ci# define __kprobes	__section(".kprobes.text")
188c2ecf20Sopenharmony_ci# define nokprobe_inline	__always_inline
198c2ecf20Sopenharmony_ci#else
208c2ecf20Sopenharmony_ci# define NOKPROBE_SYMBOL(fname)
218c2ecf20Sopenharmony_ci# define __kprobes
228c2ecf20Sopenharmony_ci# define nokprobe_inline	inline
238c2ecf20Sopenharmony_ci#endif
248c2ecf20Sopenharmony_ci#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#endif /* _ASM_GENERIC_KPROBES_H */
27