Lines Matching refs:mod
122 struct module *mod; in find_module() local
124 for (mod = modules; mod; mod = mod->next) in find_module()
125 if (strcmp(mod->name, modname) == 0) in find_module()
127 return mod; in find_module()
132 struct module *mod; in new_module() local
135 mod = NOFAIL(malloc(sizeof(*mod))); in new_module()
136 memset(mod, 0, sizeof(*mod)); in new_module()
142 mod->is_dot_o = 1; in new_module()
146 mod->name = p; in new_module()
147 mod->gpl_compatible = -1; in new_module()
148 mod->next = modules; in new_module()
149 modules = mod; in new_module()
151 return mod; in new_module()
306 static struct symbol *sym_add_exported(const char *name, struct module *mod, in sym_add_exported() argument
312 s = new_symbol(name, mod, export); in sym_add_exported()
316 "was in %s%s\n", mod->name, name, in sym_add_exported()
321 s->module = mod; in sym_add_exported()
325 s->vmlinux = is_vmlinux(mod->name); in sym_add_exported()
331 static void sym_update_crc(const char *name, struct module *mod, in sym_update_crc() argument
337 s = new_symbol(name, mod, export); in sym_update_crc()
606 static void handle_modversions(struct module *mod, struct elf_info *info, in handle_modversions() argument
612 if ((!is_vmlinux(mod->name) || mod->is_dot_o) && in handle_modversions()
621 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, in handle_modversions()
630 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); in handle_modversions()
665 mod->unres = alloc_symbol(symname, in handle_modversions()
667 mod->unres); in handle_modversions()
672 sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, in handle_modversions()
676 mod->has_init = 1; in handle_modversions()
678 mod->has_cleanup = 1; in handle_modversions()
1896 static void check_sec_ref(struct module *mod, const char *modname, in check_sec_ref() argument
1930 struct module *mod; in read_symbols() local
1937 mod = new_module(modname); in read_symbols()
1943 mod->skip = 1; in read_symbols()
1953 mod->gpl_compatible = 1; in read_symbols()
1955 mod->gpl_compatible = 0; in read_symbols()
1965 handle_modversions(mod, &info, sym, symname); in read_symbols()
1966 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
1970 check_sec_ref(mod, modname, &info); in read_symbols()
1977 get_src_version(modname, mod->srcversion, in read_symbols()
1978 sizeof(mod->srcversion)-1); in read_symbols()
1987 mod->unres = alloc_symbol("module_layout", 0, mod->unres); in read_symbols()
2081 static void check_exports(struct module *mod) in check_exports() argument
2085 for (s = mod->unres; s; s = s->next) { in check_exports()
2088 if (!exp || exp->module == mod) in check_exports()
2090 basename = strrchr(mod->name, '/'); in check_exports()
2094 basename = mod->name; in check_exports()
2095 if (!mod->gpl_compatible) in check_exports()
2104 static void add_header(struct buffer *b, struct module *mod) in add_header() argument
2115 if (mod->has_init) in add_header()
2117 if (mod->has_cleanup) in add_header()
2147 static int add_versions(struct buffer *b, struct module *mod) in add_versions() argument
2152 for (s = mod->unres; s; s = s->next) { in add_versions()
2154 if (!exp || exp->module == mod) { in add_versions()
2158 s->name, mod->name); in add_versions()
2161 s->name, mod->name); in add_versions()
2180 for (s = mod->unres; s; s = s->next) { in add_versions()
2185 s->name, mod->name); in add_versions()
2190 s->name, mod->name); in add_versions()
2203 static void add_depends(struct buffer *b, struct module *mod, in add_depends() argument
2218 for (s = mod->unres; s; s = s->next) { in add_depends()
2238 static void add_srcversion(struct buffer *b, struct module *mod) in add_srcversion() argument
2240 if (mod->srcversion[0]) { in add_srcversion()
2243 mod->srcversion); in add_srcversion()
2307 struct module *mod; in read_dump() local
2323 mod = find_module(modname); in read_dump()
2324 if (!mod) { in read_dump()
2327 mod = new_module(modname); in read_dump()
2328 mod->skip = 1; in read_dump()
2330 s = sym_add_exported(symname, mod, export_no(export)); in read_dump()
2333 sym_update_crc(symname, mod, crc, export_no(export)); in read_dump()
2382 struct module *mod; in main() local
2457 for (mod = modules; mod; mod = mod->next) { in main()
2458 if (mod->skip) in main()
2460 check_exports(mod); in main()
2465 for (mod = modules; mod; mod = mod->next) { in main()
2468 if (mod->skip) in main()
2473 add_header(&buf, mod); in main()
2475 add_staging_flag(&buf, mod->name); in main()
2476 err |= add_versions(&buf, mod); in main()
2477 add_depends(&buf, mod, modules); in main()
2478 add_moddevtable(&buf, mod); in main()
2479 add_srcversion(&buf, mod); in main()
2481 sprintf(fname, "%s.mod.c", mod->name); in main()