Whamcloud - gitweb
b=4336
[fs/lustre-release.git] / lustre / kernel_patches / patches / kernel_text_address-2.4.20-rh.patch
1 Index: linux-2.4.20-20.9/kernel/kksymoops.c
2 ===================================================================
3 --- linux-2.4.20-20.9.orig/kernel/kksymoops.c   2003-08-18 23:16:51.000000000 +0800
4 +++ linux-2.4.20-20.9/kernel/kksymoops.c        2003-11-06 18:38:12.000000000 +0800
5 @@ -80,3 +80,5 @@
6         printk("%s\n",modlist);
7  #endif
8  }
9 +
10 +EXPORT_SYMBOL(lookup_symbol);
11 Index: linux-2.4.20-20.9/kernel/Makefile
12 ===================================================================
13 --- linux-2.4.20-20.9.orig/kernel/Makefile      2003-11-06 18:35:56.000000000 +0800
14 +++ linux-2.4.20-20.9/kernel/Makefile   2003-11-06 18:42:57.000000000 +0800
15 @@ -9,7 +9,7 @@
16  
17  O_TARGET := kernel.o
18  
19 -export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o printk.o cpufreq.o profile.o
20 +export-objs = signal.o sys.o kmod.o context.o ksyms.o pm.o exec_domain.o printk.o cpufreq.o profile.o kksymoops.o
21  
22  obj-y     = sched.o dma.o fork.o exec_domain.o panic.o printk.o lowlat.o profile.o \
23             module.o exit.o itimer.o info.o time.o softirq.o resource.o \
24 Index: linux-2.4.20-20.9/arch/i386/kernel/traps.c
25 ===================================================================
26 --- linux-2.4.20-20.9.orig/arch/i386/kernel/traps.c     2003-11-06 18:35:56.000000000 +0800
27 +++ linux-2.4.20-20.9/arch/i386/kernel/traps.c  2003-11-06 18:43:26.000000000 +0800
28 @@ -1027,9 +1019,39 @@
29  #endif
30  }
31  
32 +#ifdef CONFIG_MODULES
33 +extern struct module *module_list;
34 +extern struct module kernel_module;
35 +#endif
36 +
37 +int is_kernel_text_address(unsigned long addr)
38 +{
39 +       int retval = 0;
40 +#ifdef CONFIG_MODULES
41 +       struct module *mod;
42 +#endif
43 +       if (addr >= (unsigned long) &_stext &&
44 +           addr <= (unsigned long) &_etext);
45 +               return 1;
46 +
47 +#ifdef CONFIG_MODULES
48 +       for (mod = module_list; mod != &kernel_module; mod = mod->next) {
49 +               /* mod_bound tests for addr being inside the vmalloc'ed
50 +                * module area. Of course it'd be better to test only
51 +                * for the .text subset... */
52 +               if (mod_bound(addr, 0, mod)) {
53 +                       retval = 1;
54 +                       break;
55 +               }
56 +       }
57 +#endif
58 +
59 +       return retval;
60 +}
61 +
62  EXPORT_SYMBOL_GPL(netdump_func);
63  EXPORT_SYMBOL_GPL(netdump_mode);
64  #if CONFIG_X86_LOCAL_APIC
65  EXPORT_SYMBOL_GPL(nmi_watchdog);
66  #endif
67 -
68 +EXPORT_SYMBOL_GPL(is_kernel_text_address);