File: old_code_loader.c

package info (click to toggle)
ksplice 0.9.9-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,220 kB
  • ctags: 2,350
  • sloc: ansic: 15,787; xml: 2,604; perl: 896; python: 458; makefile: 248; asm: 29
file content (74 lines) | stat: -rw-r--r-- 2,339 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*  Copyright (C) 2007-2009  Ksplice, Inc.
 *  Authors: Jeff Arnold, Anders Kaseorg, Tim Abbott
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License, version 2.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
 *  02110-1301, USA.
 */

#ifdef KSPLICE_STANDALONE
#include "ksplice.h"
#else
#include <linux/ksplice.h>
#endif

extern struct ksplice_reloc ksplice_relocs[], ksplice_relocs_end[];
extern struct ksplice_section ksplice_sections[], ksplice_sections_end[];
extern struct ksplice_symbol ksplice_symbols[], ksplice_symbols_end[];
#ifdef KSPLICE_NEED_PARAINSTRUCTIONS
extern struct paravirt_patch_site parainstructions[], parainstructions_end[];
#endif
#ifdef KSPLICE_STANDALONE
extern struct ksplice_system_map ksplice_system_map[], ksplice_system_map_end[];
#endif /* KSPLICE_STANDALONE */

/* Defined in new_code_loader.c */
#define change KSPLICE_UNIQ(change)
extern struct ksplice_mod_change change;

static struct ksplice_code old_code = {
	.relocs = ksplice_relocs,
	.relocs_end = ksplice_relocs_end,
	.sections = ksplice_sections,
	.sections_end = ksplice_sections_end,
	.symbols = ksplice_symbols,
	.symbols_end = ksplice_symbols_end,
#ifdef KSPLICE_NEED_PARAINSTRUCTIONS
	.parainstructions = parainstructions,
	.parainstructions_end = parainstructions_end,
#endif
#ifdef KSPLICE_STANDALONE
	.system_map = ksplice_system_map,
	.system_map_end = ksplice_system_map_end,
#endif /* KSPLICE_STANDALONE */
};

static int init_old_code(void)
{
	change.old_code = old_code;
	return init_ksplice_mod_change(&change);
}

static void cleanup_old_code(void)
{
	cleanup_ksplice_mod_change(&change);
}

module_init(init_old_code);
module_exit(cleanup_old_code);

MODULE_AUTHOR("Ksplice, Inc.");
MODULE_DESCRIPTION("Ksplice rebootless update old code module");
#ifdef KSPLICE_VERSION
MODULE_VERSION(KSPLICE_VERSION);
#endif
MODULE_LICENSE("GPL v2");