aboutsummaryrefslogtreecommitdiff
path: root/modutils/modutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'modutils/modutils.h')
-rw-r--r--modutils/modutils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/modutils/modutils.h b/modutils/modutils.h
index 5f059c716..2cbd1448a 100644
--- a/modutils/modutils.h
+++ b/modutils/modutils.h
@@ -16,6 +16,36 @@ PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
16/* linux/include/linux/module.h has 64, but this is also used 16/* linux/include/linux/module.h has 64, but this is also used
17 * internally for the maximum alias name length, which can be quite long */ 17 * internally for the maximum alias name length, which can be quite long */
18#define MODULE_NAME_LEN 256 18#define MODULE_NAME_LEN 256
19#define MODULE_HASH_SIZE 256
20
21typedef struct module_entry {
22 struct module_entry *next;
23 char *name, *modname;
24 llist_t *deps;
25 IF_MODPROBE(
26 llist_t *realnames;
27 unsigned flags;
28 const char *probed_name; /* verbatim as seen on cmdline */
29 char *options; /* options from config files */
30 )
31 IF_DEPMOD(
32 llist_t *aliases;
33 llist_t *symbols;
34 struct module_entry *dnext, *dprev;
35 )
36} module_entry;
37
38typedef struct module_db {
39 module_entry *buckets[MODULE_HASH_SIZE];
40} module_db;
41
42#define moddb_foreach_module(db, module, index) \
43 for ((index) = 0; (index) < MODULE_HASH_SIZE; (index)++) \
44 for (module = (db)->buckets[index]; module; module = module->next)
45
46module_entry *moddb_get(module_db *db, const char *s) FAST_FUNC;
47module_entry *moddb_get_or_create(module_db *db, const char *s) FAST_FUNC;
48void moddb_free(module_db *db) FAST_FUNC;
19 49
20void replace(char *s, char what, char with) FAST_FUNC; 50void replace(char *s, char what, char with) FAST_FUNC;
21char *replace_underscores(char *s) FAST_FUNC; 51char *replace_underscores(char *s) FAST_FUNC;