1725 /** 1726 * Header for the generated file 1727 **/ 1728 static void add_header(struct buffer *b, struct module *mod) 1729 { 1730 buf_printf(b, "#include \n"); 1731 buf_printf(b, "#include \n"); 1732 buf_printf(b, "#include \n"); 1733 buf_printf(b, "\n"); 1734 buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); 1735 buf_printf(b, "\n"); 1736 buf_printf(b, "struct module __this_module\n"); 1737 buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); 1738 buf_printf(b, " .name = KBUILD_MODNAME,\n"); 1739 if (mod->has_init) 1740 buf_printf(b, " .init = init_module,\n"); 1741 if (mod->has_cleanup) 1742 buf_printf(b, "#ifdef CONFIG_MODULE_UNLOAD\n" 1743 " .exit = cleanup_module,\n" 1744 "#endif\n"); 1745 buf_printf(b, " .arch = MODULE_ARCH_INIT,\n"); 1746 buf_printf(b, "};\n"); 1747 }