Use pointers rather than unsigned longs in run-pre comparisons.
[ksplice.git] / kmodsrc / primary.c
blobcb4c028c791ad1671d42862a6352f0b2c4b6ba88
1 /* Copyright (C) 2007-2008 Jeffrey Brian Arnold <jbarnold@mit.edu>
2 * Copyright (C) 2008 Anders Kaseorg <andersk@mit.edu>,
3 * Tim Abbott <tabbott@mit.edu>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
16 * 02110-1301, USA.
19 #ifdef KSPLICE_STANDALONE
20 #include "ksplice.h"
21 #else
22 #include <linux/ksplice.h>
23 #endif
25 extern const struct ksplice_reloc ksplice_relocs[], ksplice_relocs_end[];
26 extern const struct ksplice_section ksplice_sections[], ksplice_sections_end[];
27 extern struct ksplice_patch ksplice_patches[], ksplice_patches_end[];
28 extern struct ksplice_export ksplice_exports[], ksplice_exports_end[];
29 #ifdef KSPLICE_NEED_PARAINSTRUCTIONS
30 extern struct paravirt_patch_site parainstructions[], parainstructions_end[];
31 #endif
32 #ifdef KSPLICE_STANDALONE
33 extern struct ksplice_system_map ksplice_system_map[],
34 ksplice_system_map_end[];
35 #endif /* KSPLICE_STANDALONE */
37 #define pack KSPLICE_UNIQ(pack)
38 struct ksplice_pack pack = {
39 .name = "ksplice_" STR(KSPLICE_MID),
40 .kid = STR(KSPLICE_KID),
41 .target_name = STR(KSPLICE_TARGET),
42 #ifdef KSPLICE_STANDALONE
43 .map_printk = MAP_PRINTK,
44 #endif /* KSPLICE_STANDALONE */
45 .primary = THIS_MODULE,
46 .primary_relocs = ksplice_relocs,
47 .primary_relocs_end = ksplice_relocs_end,
48 .primary_sections = ksplice_sections,
49 .primary_sections_end = ksplice_sections_end,
50 .patches = ksplice_patches,
51 .patches_end = ksplice_patches_end,
52 .exports = ksplice_exports,
53 .exports_end = ksplice_exports_end,
54 #ifdef KSPLICE_NEED_PARAINSTRUCTIONS
55 .primary_parainstructions = parainstructions,
56 .primary_parainstructions_end = parainstructions_end,
57 #endif
58 #ifdef KSPLICE_STANDALONE
59 .primary_system_map = ksplice_system_map,
60 .primary_system_map_end = ksplice_system_map_end,
61 #endif /* KSPLICE_STANDALONE */
63 EXPORT_SYMBOL_GPL(pack);
65 static int init_primary(void)
67 return 0;
70 static void cleanup_primary(void)
72 cleanup_ksplice_module(&pack);
75 module_init(init_primary);
76 module_exit(cleanup_primary);
78 MODULE_AUTHOR("Jeffrey Brian Arnold <jbarnold@mit.edu>");
79 MODULE_DESCRIPTION("Ksplice rebootless update primary module");
80 #ifdef KSPLICE_VERSION
81 MODULE_VERSION(KSPLICE_VERSION);
82 #endif
83 MODULE_LICENSE("GPL v2");