linux/kernel/static_call_inline.c

// SPDX-License-Identifier: GPL-2.0
#include <linux/init.h>
#include <linux/static_call.h>
#include <linux/bug.h>
#include <linux/smp.h>
#include <linux/sort.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/processor.h>
#include <asm/sections.h>

extern struct static_call_site __start_static_call_sites[],
			       __stop_static_call_sites[];
extern struct static_call_tramp_key __start_static_call_tramp_key[],
				    __stop_static_call_tramp_key[];

static int static_call_initialized;

/*
 * Must be called before early_initcall() to be effective.
 */
void static_call_force_reinit(void)
{}

/* mutex to protect key modules/sites */
static DEFINE_MUTEX(static_call_mutex);

static void static_call_lock(void)
{}

static void static_call_unlock(void)
{}

static inline void *static_call_addr(struct static_call_site *site)
{}

static inline unsigned long __static_call_key(const struct static_call_site *site)
{}

static inline struct static_call_key *static_call_key(const struct static_call_site *site)
{}

/* These assume the key is word-aligned. */
static inline bool static_call_is_init(struct static_call_site *site)
{}

static inline bool static_call_is_tail(struct static_call_site *site)
{}

static inline void static_call_set_init(struct static_call_site *site)
{}

static int static_call_site_cmp(const void *_a, const void *_b)
{}

static void static_call_site_swap(void *_a, void *_b, int size)
{}

static inline void static_call_sort_entries(struct static_call_site *start,
					    struct static_call_site *stop)
{}

static inline bool static_call_key_has_mods(struct static_call_key *key)
{}

static inline struct static_call_mod *static_call_key_next(struct static_call_key *key)
{}

static inline struct static_call_site *static_call_key_sites(struct static_call_key *key)
{}

void __static_call_update(struct static_call_key *key, void *tramp, void *func)
{}
EXPORT_SYMBOL_GPL();

static int __static_call_init(struct module *mod,
			      struct static_call_site *start,
			      struct static_call_site *stop)
{}

static int addr_conflict(struct static_call_site *site, void *start, void *end)
{}

static int __static_call_text_reserved(struct static_call_site *iter_start,
				       struct static_call_site *iter_stop,
				       void *start, void *end, bool init)
{}

#ifdef CONFIG_MODULES

static int __static_call_mod_text_reserved(void *start, void *end)
{}

static unsigned long tramp_key_lookup(unsigned long addr)
{}

static int static_call_add_module(struct module *mod)
{}

static void static_call_del_module(struct module *mod)
{}

static int static_call_module_notify(struct notifier_block *nb,
				     unsigned long val, void *data)
{}

static struct notifier_block static_call_module_nb =;

#else

static inline int __static_call_mod_text_reserved(void *start, void *end)
{
	return 0;
}

#endif /* CONFIG_MODULES */

int static_call_text_reserved(void *start, void *end)
{}

int __init static_call_init(void)
{}
early_initcall(static_call_init);

#ifdef CONFIG_STATIC_CALL_SELFTEST

static int func_a(int x)
{}

static int func_b(int x)
{}

DEFINE_STATIC_CALL();

static struct static_call_data {} static_call_data [] __initdata =;

static int __init test_static_call_init(void)
{}
early_initcall(test_static_call_init);

#endif /* CONFIG_STATIC_CALL_SELFTEST */