All pastes #1599692 Raw Edit

bblum

public text v1 · immutable
#1599692 ·published 2009-10-06 21:53 UTC
rendered paste body
1725 /**1726  * Header for the generated file1727  **/1728 static void add_header(struct buffer *b, struct module *mod)1729 {1730         buf_printf(b, "#include <linux/module.h>\n");1731         buf_printf(b, "#include <linux/vermagic.h>\n");1732         buf_printf(b, "#include <linux/compiler.h>\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 }