Lines Matching refs:mod

121 	struct module *mod;  in find_module()  local
123 for (mod = modules; mod; mod = mod->next) in find_module()
124 if (strcmp(mod->name, modname) == 0) in find_module()
126 return mod; in find_module()
131 struct module *mod; in new_module() local
134 mod = NOFAIL(malloc(sizeof(*mod))); in new_module()
135 memset(mod, 0, sizeof(*mod)); in new_module()
141 mod->is_dot_o = 1; in new_module()
145 mod->name = p; in new_module()
146 mod->gpl_compatible = -1; in new_module()
147 mod->next = modules; in new_module()
148 modules = mod; in new_module()
150 return mod; in new_module()
305 static struct symbol *sym_add_exported(const char *name, struct module *mod, in sym_add_exported() argument
311 s = new_symbol(name, mod, export); in sym_add_exported()
315 "was in %s%s\n", mod->name, name, in sym_add_exported()
320 s->module = mod; in sym_add_exported()
324 s->vmlinux = is_vmlinux(mod->name); in sym_add_exported()
330 static void sym_update_crc(const char *name, struct module *mod, in sym_update_crc() argument
336 s = new_symbol(name, mod, export); in sym_update_crc()
605 static void handle_modversions(struct module *mod, struct elf_info *info, in handle_modversions() argument
611 if ((!is_vmlinux(mod->name) || mod->is_dot_o) && in handle_modversions()
620 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, in handle_modversions()
629 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); in handle_modversions()
664 mod->unres = alloc_symbol(symname, in handle_modversions()
666 mod->unres); in handle_modversions()
671 sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, in handle_modversions()
675 mod->has_init = 1; in handle_modversions()
677 mod->has_cleanup = 1; in handle_modversions()
1892 static void check_sec_ref(struct module *mod, const char *modname, in check_sec_ref() argument
1926 struct module *mod; in read_symbols() local
1933 mod = new_module(modname); in read_symbols()
1939 mod->skip = 1; in read_symbols()
1949 mod->gpl_compatible = 1; in read_symbols()
1951 mod->gpl_compatible = 0; in read_symbols()
1961 handle_modversions(mod, &info, sym, symname); in read_symbols()
1962 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
1966 check_sec_ref(mod, modname, &info); in read_symbols()
1973 get_src_version(modname, mod->srcversion, in read_symbols()
1974 sizeof(mod->srcversion)-1); in read_symbols()
1983 mod->unres = alloc_symbol("module_layout", 0, mod->unres); in read_symbols()
2077 static void check_exports(struct module *mod) in check_exports() argument
2081 for (s = mod->unres; s; s = s->next) { in check_exports()
2084 if (!exp || exp->module == mod) in check_exports()
2086 basename = strrchr(mod->name, '/'); in check_exports()
2090 basename = mod->name; in check_exports()
2091 if (!mod->gpl_compatible) in check_exports()
2100 static void add_header(struct buffer *b, struct module *mod) in add_header() argument
2111 if (mod->has_init) in add_header()
2113 if (mod->has_cleanup) in add_header()
2138 static int add_versions(struct buffer *b, struct module *mod) in add_versions() argument
2143 for (s = mod->unres; s; s = s->next) { in add_versions()
2145 if (!exp || exp->module == mod) { in add_versions()
2149 s->name, mod->name); in add_versions()
2152 s->name, mod->name); in add_versions()
2171 for (s = mod->unres; s; s = s->next) { in add_versions()
2176 s->name, mod->name); in add_versions()
2188 static void add_depends(struct buffer *b, struct module *mod, in add_depends() argument
2203 for (s = mod->unres; s; s = s->next) { in add_depends()
2223 static void add_srcversion(struct buffer *b, struct module *mod) in add_srcversion() argument
2225 if (mod->srcversion[0]) { in add_srcversion()
2228 mod->srcversion); in add_srcversion()
2292 struct module *mod; in read_dump() local
2308 mod = find_module(modname); in read_dump()
2309 if (!mod) { in read_dump()
2312 mod = new_module(modname); in read_dump()
2313 mod->skip = 1; in read_dump()
2315 s = sym_add_exported(symname, mod, export_no(export)); in read_dump()
2318 sym_update_crc(symname, mod, crc, export_no(export)); in read_dump()
2367 struct module *mod; in main() local
2439 for (mod = modules; mod; mod = mod->next) { in main()
2440 if (mod->skip) in main()
2442 check_exports(mod); in main()
2447 for (mod = modules; mod; mod = mod->next) { in main()
2450 if (mod->skip) in main()
2455 add_header(&buf, mod); in main()
2457 add_staging_flag(&buf, mod->name); in main()
2458 err |= add_versions(&buf, mod); in main()
2459 add_depends(&buf, mod, modules); in main()
2460 add_moddevtable(&buf, mod); in main()
2461 add_srcversion(&buf, mod); in main()
2463 sprintf(fname, "%s.mod.c", mod->name); in main()