linux/kernel/module/tree_lookup.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Modules tree lookup
 *
 * Copyright (C) 2015 Peter Zijlstra
 * Copyright (C) 2015 Rusty Russell
 */

#include <linux/module.h>
#include <linux/rbtree_latch.h>
#include "internal.h"

/*
 * Use a latched RB-tree for __module_address(); this allows us to use
 * RCU-sched lookups of the address from any context.
 *
 * This is conditional on PERF_EVENTS || TRACING because those can really hit
 * __module_address() hard by doing a lot of stack unwinding; potentially from
 * NMI context.
 */

static __always_inline unsigned long __mod_tree_val(struct latch_tree_node *n)
{}

static __always_inline unsigned long __mod_tree_size(struct latch_tree_node *n)
{}

static __always_inline bool
mod_tree_less(struct latch_tree_node *a, struct latch_tree_node *b)
{}

static __always_inline int
mod_tree_comp(void *key, struct latch_tree_node *n)
{}

static const struct latch_tree_ops mod_tree_ops =;

static noinline void __mod_tree_insert(struct mod_tree_node *node, struct mod_tree_root *tree)
{}

static void __mod_tree_remove(struct mod_tree_node *node, struct mod_tree_root *tree)
{}

/*
 * These modifications: insert, remove_init and remove; are serialized by the
 * module_mutex.
 */
void mod_tree_insert(struct module *mod)
{}

void mod_tree_remove_init(struct module *mod)
{}

void mod_tree_remove(struct module *mod)
{}

struct module *mod_find(unsigned long addr, struct mod_tree_root *tree)
{}