linux/include/linux/export.h

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _LINUX_EXPORT_H
#define _LINUX_EXPORT_H

#include <linux/compiler.h>
#include <linux/linkage.h>
#include <linux/stringify.h>

/*
 * This comment block is used by fixdep. Please do not remove.
 *
 * When CONFIG_MODVERSIONS is changed from n to y, all source files having
 * EXPORT_SYMBOL variants must be re-compiled because genksyms is run as a
 * side effect of the *.o build rule.
 */

#ifdef CONFIG_64BIT
#define __EXPORT_SYMBOL_REF(sym)
#else
#define __EXPORT_SYMBOL_REF
#endif

#define ___EXPORT_SYMBOL(sym, license, ns)

#if defined(__DISABLE_EXPORTS)

/*
 * Allow symbol exports to be disabled completely so that C code may
 * be reused in other execution contexts such as the UEFI stub or the
 * decompressor.
 */
#define __EXPORT_SYMBOL

#elif defined(__GENKSYMS__)

#define __EXPORT_SYMBOL

#elif defined(__ASSEMBLY__)

#define __EXPORT_SYMBOL(sym, license, ns)

#else

#define __EXPORT_SYMBOL

#endif

#ifdef DEFAULT_SYMBOL_NAMESPACE
#define _EXPORT_SYMBOL
#else
#define _EXPORT_SYMBOL(sym, license)
#endif

#define EXPORT_SYMBOL(sym)
#define EXPORT_SYMBOL_GPL(sym)
#define EXPORT_SYMBOL_NS(sym, ns)
#define EXPORT_SYMBOL_NS_GPL(sym, ns)

#endif /* _LINUX_EXPORT_H */