Lines Matching refs:mod
115 struct module *mod; in find_module() local
117 for (mod = modules; mod; mod = mod->next) in find_module()
118 if (strcmp(mod->name, modname) == 0) in find_module()
120 return mod; in find_module()
125 struct module *mod; in new_module() local
128 mod = NOFAIL(malloc(sizeof(*mod))); in new_module()
129 memset(mod, 0, sizeof(*mod)); in new_module()
137 mod->is_dot_o = 1; in new_module()
141 mod->name = p; in new_module()
142 mod->gpl_compatible = -1; in new_module()
143 mod->next = modules; in new_module()
144 modules = mod; in new_module()
146 return mod; in new_module()
301 static struct symbol *sym_add_exported(const char *name, struct module *mod, in sym_add_exported() argument
307 s = new_symbol(name, mod, export); in sym_add_exported()
311 "was in %s%s\n", mod->name, name, in sym_add_exported()
316 s->module = mod; in sym_add_exported()
320 s->vmlinux = is_vmlinux(mod->name); in sym_add_exported()
326 static void sym_update_crc(const char *name, struct module *mod, in sym_update_crc() argument
332 s = new_symbol(name, mod, export); in sym_update_crc()
586 static void handle_modversions(struct module *mod, struct elf_info *info, in handle_modversions() argument
592 if ((!is_vmlinux(mod->name) || mod->is_dot_o) && in handle_modversions()
600 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); in handle_modversions()
606 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, in handle_modversions()
639 mod->unres = in handle_modversions()
643 mod->unres); in handle_modversions()
649 sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, in handle_modversions()
653 mod->has_init = 1; in handle_modversions()
655 mod->has_cleanup = 1; in handle_modversions()
1659 static void check_sec_ref(struct module *mod, const char *modname, in check_sec_ref() argument
1681 struct module *mod; in read_symbols() local
1688 mod = new_module(modname); in read_symbols()
1694 mod->skip = 1; in read_symbols()
1704 mod->gpl_compatible = 1; in read_symbols()
1706 mod->gpl_compatible = 0; in read_symbols()
1716 handle_modversions(mod, &info, sym, symname); in read_symbols()
1717 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
1721 check_sec_ref(mod, modname, &info); in read_symbols()
1728 get_src_version(modname, mod->srcversion, in read_symbols()
1729 sizeof(mod->srcversion)-1); in read_symbols()
1738 mod->unres = alloc_symbol("module_layout", 0, mod->unres); in read_symbols()
1811 static void check_exports(struct module *mod) in check_exports() argument
1815 for (s = mod->unres; s; s = s->next) { in check_exports()
1818 if (!exp || exp->module == mod) in check_exports()
1820 basename = strrchr(mod->name, '/'); in check_exports()
1824 basename = mod->name; in check_exports()
1825 if (!mod->gpl_compatible) in check_exports()
1834 static void add_header(struct buffer *b, struct module *mod) in add_header() argument
1845 if (mod->has_init) in add_header()
1847 if (mod->has_cleanup) in add_header()
1866 static int add_versions(struct buffer *b, struct module *mod) in add_versions() argument
1871 for (s = mod->unres; s; s = s->next) { in add_versions()
1873 if (!exp || exp->module == mod) { in add_versions()
1877 s->name, mod->name); in add_versions()
1880 s->name, mod->name); in add_versions()
1899 for (s = mod->unres; s; s = s->next) { in add_versions()
1904 s->name, mod->name); in add_versions()
1915 static void add_depends(struct buffer *b, struct module *mod, in add_depends() argument
1930 for (s = mod->unres; s; s = s->next) { in add_depends()
1950 static void add_srcversion(struct buffer *b, struct module *mod) in add_srcversion() argument
1952 if (mod->srcversion[0]) { in add_srcversion()
1955 mod->srcversion); in add_srcversion()
2019 struct module *mod; in read_dump() local
2035 mod = find_module(modname); in read_dump()
2036 if (!mod) { in read_dump()
2039 mod = new_module(modname); in read_dump()
2040 mod->skip = 1; in read_dump()
2042 s = sym_add_exported(symname, mod, export_no(export)); in read_dump()
2045 sym_update_crc(symname, mod, crc, export_no(export)); in read_dump()
2092 struct module *mod; in main() local
2158 for (mod = modules; mod; mod = mod->next) { in main()
2159 if (mod->skip) in main()
2161 check_exports(mod); in main()
2166 for (mod = modules; mod; mod = mod->next) { in main()
2167 char fname[strlen(mod->name) + 10]; in main()
2169 if (mod->skip) in main()
2174 add_header(&buf, mod); in main()
2175 add_staging_flag(&buf, mod->name); in main()
2176 err |= add_versions(&buf, mod); in main()
2177 add_depends(&buf, mod, modules); in main()
2178 add_moddevtable(&buf, mod); in main()
2179 add_srcversion(&buf, mod); in main()
2181 sprintf(fname, "%s.mod.c", mod->name); in main()