• Home
  • Raw
  • Download

Lines Matching refs:mod

159 	struct module *mod;  in find_module()  local
161 for (mod = modules; mod; mod = mod->next) in find_module()
162 if (strcmp(mod->name, modname) == 0) in find_module()
164 return mod; in find_module()
169 struct module *mod; in new_module() local
171 mod = NOFAIL(malloc(sizeof(*mod) + strlen(modname) + 1)); in new_module()
172 memset(mod, 0, sizeof(*mod)); in new_module()
175 strcpy(mod->name, modname); in new_module()
176 mod->is_vmlinux = (strcmp(modname, "vmlinux") == 0); in new_module()
177 mod->gpl_compatible = -1; in new_module()
178 mod->next = modules; in new_module()
179 modules = mod; in new_module()
181 if (mod->is_vmlinux) in new_module()
184 return mod; in new_module()
417 static struct symbol *sym_add_exported(const char *name, struct module *mod, in sym_add_exported() argument
423 s = new_symbol(name, mod, export); in sym_add_exported()
425 s->module == mod) { in sym_add_exported()
427 mod->name, name, s->module->name, in sym_add_exported()
431 s->module = mod; in sym_add_exported()
675 static void handle_modversion(const struct module *mod, in handle_modversion() argument
683 symname, mod->name, mod->is_vmlinux ? "" : ".ko"); in handle_modversion()
699 static void handle_symbol(struct module *mod, struct elf_info *info, in handle_symbol() argument
715 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); in handle_symbol()
737 mod->unres = alloc_symbol(symname, in handle_symbol()
739 mod->unres); in handle_symbol()
745 sym_add_exported(name, mod, export); in handle_symbol()
748 mod->has_init = 1; in handle_symbol()
750 mod->has_cleanup = 1; in handle_symbol()
1977 static void check_sec_ref(struct module *mod, const char *modname, in check_sec_ref() argument
2016 struct module *mod; in read_symbols() local
2032 mod = new_module(tmp); in read_symbols()
2036 if (!mod->is_vmlinux) { in read_symbols()
2042 mod->gpl_compatible = 1; in read_symbols()
2044 mod->gpl_compatible = 0; in read_symbols()
2052 add_namespace(&mod->imported_namespaces, namespace); in read_symbols()
2061 handle_symbol(mod, &info, sym, symname); in read_symbols()
2062 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
2075 handle_modversion(mod, &info, sym, in read_symbols()
2093 check_sec_ref(mod, modname, &info); in read_symbols()
2095 if (!mod->is_vmlinux) { in read_symbols()
2098 get_src_version(modname, mod->srcversion, in read_symbols()
2099 sizeof(mod->srcversion) - 1); in read_symbols()
2109 mod->unres = alloc_symbol("module_layout", 0, mod->unres); in read_symbols()
2199 static void check_exports(struct module *mod) in check_exports() argument
2203 for (s = mod->unres; s; s = s->next) { in check_exports()
2206 if (!exp || exp->module == mod) { in check_exports()
2210 s->name, mod->name); in check_exports()
2213 basename = strrchr(mod->name, '/'); in check_exports()
2217 basename = mod->name; in check_exports()
2220 !module_imports_namespace(mod, exp->namespace)) { in check_exports()
2224 add_namespace(&mod->missing_namespaces, exp->namespace); in check_exports()
2227 if (!mod->gpl_compatible) in check_exports()
2233 static void check_modname_len(struct module *mod) in check_modname_len() argument
2237 mod_name = strrchr(mod->name, '/'); in check_modname_len()
2239 mod_name = mod->name; in check_modname_len()
2243 error("module name is too long [%s.ko]\n", mod->name); in check_modname_len()
2249 static void add_header(struct buffer *b, struct module *mod) in add_header() argument
2269 if (mod->has_init) in add_header()
2271 if (mod->has_cleanup) in add_header()
2316 static void add_versions(struct buffer *b, struct module *mod) in add_versions() argument
2320 for (s = mod->unres; s; s = s->next) { in add_versions()
2322 if (!exp || exp->module == mod) in add_versions()
2336 for (s = mod->unres; s; s = s->next) { in add_versions()
2341 s->name, mod->name); in add_versions()
2346 s->name, mod->name); in add_versions()
2356 static void add_depends(struct buffer *b, struct module *mod) in add_depends() argument
2362 for (s = mod->unres; s; s = s->next) in add_depends()
2368 for (s = mod->unres; s; s = s->next) { in add_depends()
2388 static void add_srcversion(struct buffer *b, struct module *mod) in add_srcversion() argument
2390 if (mod->srcversion[0]) { in add_srcversion()
2393 mod->srcversion); in add_srcversion()
2468 struct module *mod; in read_dump() local
2487 mod = find_module(modname); in read_dump()
2488 if (!mod) { in read_dump()
2489 mod = new_module(modname); in read_dump()
2490 mod->from_dump = 1; in read_dump()
2492 s = sym_add_exported(symname, mod, export_no(export)); in read_dump()
2531 struct module *mod; in write_namespace_deps_files() local
2535 for (mod = modules; mod; mod = mod->next) { in write_namespace_deps_files()
2537 if (mod->from_dump || !mod->missing_namespaces) in write_namespace_deps_files()
2540 buf_printf(&ns_deps_buf, "%s.ko:", mod->name); in write_namespace_deps_files()
2542 for (ns = mod->missing_namespaces; ns; ns = ns->next) in write_namespace_deps_files()
2559 struct module *mod; in main() local
2636 for (mod = modules; mod; mod = mod->next) { in main()
2639 if (mod->is_vmlinux || mod->from_dump) in main()
2644 check_modname_len(mod); in main()
2645 check_exports(mod); in main()
2647 add_header(&buf, mod); in main()
2650 add_staging_flag(&buf, mod->name); in main()
2651 add_versions(&buf, mod); in main()
2652 add_depends(&buf, mod); in main()
2653 add_moddevtable(&buf, mod); in main()
2654 add_srcversion(&buf, mod); in main()
2657 sprintf(fname, "%s.mod.c", mod->name); in main()