• Home
  • Raw
  • Download

Lines Matching refs:mod

105 	struct module *mod;  in find_module()  local
107 for (mod = modules; mod; mod = mod->next) in find_module()
108 if (strcmp(mod->name, modname) == 0) in find_module()
110 return mod; in find_module()
115 struct module *mod; in new_module() local
118 mod = NOFAIL(malloc(sizeof(*mod))); in new_module()
119 memset(mod, 0, sizeof(*mod)); in new_module()
129 mod->name = p; in new_module()
130 mod->gpl_compatible = -1; in new_module()
131 mod->next = modules; in new_module()
132 modules = mod; in new_module()
134 return mod; in new_module()
267 static struct symbol *sym_add_exported(const char *name, struct module *mod, in sym_add_exported() argument
273 s = new_symbol(name, mod, export); in sym_add_exported()
277 "was in %s%s\n", mod->name, name, in sym_add_exported()
282 s->module = mod; in sym_add_exported()
286 s->vmlinux = is_vmlinux(mod->name); in sym_add_exported()
292 static void sym_update_crc(const char *name, struct module *mod, in sym_update_crc() argument
298 s = new_symbol(name, mod, export); in sym_update_crc()
492 static void handle_modversions(struct module *mod, struct elf_info *info, in handle_modversions() argument
500 warn("\"%s\" [%s] is COMMON symbol\n", symname, mod->name); in handle_modversions()
506 sym_update_crc(symname + strlen(CRC_PFX), mod, crc, in handle_modversions()
539 mod->unres = in handle_modversions()
543 mod->unres); in handle_modversions()
549 sym_add_exported(symname + strlen(KSYMTAB_PFX), mod, in handle_modversions()
553 mod->has_init = 1; in handle_modversions()
555 mod->has_cleanup = 1; in handle_modversions()
1472 static void check_sec_ref(struct module *mod, const char *modname, in check_sec_ref() argument
1489 static void get_markers(struct elf_info *info, struct module *mod) in get_markers() argument
1527 mod->markers = NOFAIL(malloc(sizeof mod->markers[0] * n)); in get_markers()
1528 mod->nmarkers = n; in get_markers()
1539 asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt); in get_markers()
1541 mod->markers[n++] = line; in get_markers()
1550 struct module *mod; in read_symbols() local
1557 mod = new_module(modname); in read_symbols()
1563 mod->skip = 1; in read_symbols()
1573 mod->gpl_compatible = 1; in read_symbols()
1575 mod->gpl_compatible = 0; in read_symbols()
1585 handle_modversions(mod, &info, sym, symname); in read_symbols()
1586 handle_moddevtable(mod, &info, sym, symname); in read_symbols()
1590 check_sec_ref(mod, modname, &info); in read_symbols()
1597 get_src_version(modname, mod->srcversion, in read_symbols()
1598 sizeof(mod->srcversion)-1); in read_symbols()
1600 get_markers(&info, mod); in read_symbols()
1609 mod->unres = alloc_symbol("struct_module", 0, mod->unres); in read_symbols()
1682 static void check_exports(struct module *mod) in check_exports() argument
1686 for (s = mod->unres; s; s = s->next) { in check_exports()
1689 if (!exp || exp->module == mod) in check_exports()
1691 basename = strrchr(mod->name, '/'); in check_exports()
1695 basename = mod->name; in check_exports()
1696 if (!mod->gpl_compatible) in check_exports()
1705 static void add_header(struct buffer *b, struct module *mod) in add_header() argument
1716 if (mod->has_init) in add_header()
1718 if (mod->has_cleanup) in add_header()
1737 static int add_versions(struct buffer *b, struct module *mod) in add_versions() argument
1742 for (s = mod->unres; s; s = s->next) { in add_versions()
1744 if (!exp || exp->module == mod) { in add_versions()
1748 s->name, mod->name); in add_versions()
1751 s->name, mod->name); in add_versions()
1770 for (s = mod->unres; s; s = s->next) { in add_versions()
1775 s->name, mod->name); in add_versions()
1786 static void add_depends(struct buffer *b, struct module *mod, in add_depends() argument
1801 for (s = mod->unres; s; s = s->next) { in add_depends()
1821 static void add_srcversion(struct buffer *b, struct module *mod) in add_srcversion() argument
1823 if (mod->srcversion[0]) { in add_srcversion()
1826 mod->srcversion); in add_srcversion()
1890 struct module *mod; in read_dump() local
1906 mod = find_module(modname); in read_dump()
1907 if (!mod) { in read_dump()
1910 mod = new_module(NOFAIL(strdup(modname))); in read_dump()
1911 mod->skip = 1; in read_dump()
1913 s = sym_add_exported(symname, mod, export_no(export)); in read_dump()
1916 sym_update_crc(symname, mod, crc, export_no(export)); in read_dump()
1956 static void add_marker(struct module *mod, const char *name, const char *fmt) in add_marker() argument
1959 asprintf(&line, "%s\t%s\t%s\n", name, mod->name, fmt); in add_marker()
1962 mod->markers = NOFAIL(realloc(mod->markers, ((mod->nmarkers + 1) * in add_marker()
1963 sizeof mod->markers[0]))); in add_marker()
1964 mod->markers[mod->nmarkers++] = line; in add_marker()
1978 struct module *mod; in read_markers() local
1992 mod = find_module(modname); in read_markers()
1993 if (!mod) { in read_markers()
1994 mod = new_module(NOFAIL(strdup(modname))); in read_markers()
1995 mod->skip = 1; in read_markers()
1999 mod->skip = 0; in read_markers()
2002 if (!mod->skip) in read_markers()
2003 add_marker(mod, marker, fmt); in read_markers()
2018 struct module *mod; in write_markers() local
2021 for (mod = modules; mod; mod = mod->next) in write_markers()
2022 if ((!external_module || !mod->skip) && mod->markers != NULL) { in write_markers()
2027 qsort(mod->markers, mod->nmarkers, in write_markers()
2028 sizeof mod->markers[0], &compare_strings); in write_markers()
2029 for (i = 0; i < mod->nmarkers; ++i) { in write_markers()
2030 char *line = mod->markers[i]; in write_markers()
2032 while (i + 1 < mod->nmarkers && in write_markers()
2033 !strcmp(mod->markers[i], in write_markers()
2034 mod->markers[i + 1])) in write_markers()
2035 free(mod->markers[i++]); in write_markers()
2036 free(mod->markers[i]); in write_markers()
2038 free(mod->markers); in write_markers()
2039 mod->markers = NULL; in write_markers()
2052 struct module *mod; in main() local
2126 for (mod = modules; mod; mod = mod->next) { in main()
2127 if (mod->skip) in main()
2129 check_exports(mod); in main()
2134 for (mod = modules; mod; mod = mod->next) { in main()
2135 char fname[strlen(mod->name) + 10]; in main()
2137 if (mod->skip) in main()
2142 add_header(&buf, mod); in main()
2143 add_staging_flag(&buf, mod->name); in main()
2144 err |= add_versions(&buf, mod); in main()
2145 add_depends(&buf, mod, modules); in main()
2146 add_moddevtable(&buf, mod); in main()
2147 add_srcversion(&buf, mod); in main()
2149 sprintf(fname, "%s.mod.c", mod->name); in main()