Whamcloud - gitweb
- kernel_text_address patch against chaos-2.4.18 series
authoralex <alex>
Wed, 10 Dec 2003 23:26:10 +0000 (23:26 +0000)
committeralex <alex>
Wed, 10 Dec 2003 23:26:10 +0000 (23:26 +0000)
lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch [new file with mode: 0644]
lustre/kernel_patches/series/chaos-2.4.18

diff --git a/lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch b/lustre/kernel_patches/patches/kernel_text_address-2.4.18-chaos.patch
new file mode 100644 (file)
index 0000000..bcfc372
--- /dev/null
@@ -0,0 +1,40 @@
+Index: linux-2.4.18-chaos/arch/i386/kernel/traps.c
+===================================================================
+--- linux-2.4.18-chaos.orig/arch/i386/kernel/traps.c   2003-07-28 17:51:13.000000000 +0400
++++ linux-2.4.18-chaos/arch/i386/kernel/traps.c        2003-12-11 02:10:33.000000000 +0300
+@@ -1153,3 +1153,35 @@
+ EXPORT_SYMBOL_GPL(nmi_watchdog);
+ #endif
++#ifdef CONFIG_MODULES
++extern struct module *module_list;
++extern struct module kernel_module;
++#endif
++
++int is_kernel_text_address(unsigned long addr)
++{
++       int retval = 0;
++#ifdef CONFIG_MODULES
++       struct module *mod;
++#endif
++       if (addr >= (unsigned long) &_stext &&
++           addr <= (unsigned long) &_etext);
++               return 1;
++
++#ifdef CONFIG_MODULES
++       for (mod = module_list; mod != &kernel_module; mod = mod->next) {
++               /* mod_bound tests for addr being inside the vmalloc'ed
++                * module area. Of course it'd be better to test only
++                * for the .text subset... */
++               if (mod_bound(addr, 0, mod)) {
++                       retval = 1;
++                       break;
++               }
++       }
++#endif
++
++       return retval;
++}
++
++EXPORT_SYMBOL(lookup_symbol);
++EXPORT_SYMBOL_GPL(is_kernel_text_address);
index e517d06..c9ded5c 100644 (file)
@@ -33,3 +33,4 @@ listman-2.4.18.patch
 ext3-trusted_ea-2.4.18.patch
 gfp_memalloc-2.4.18-chaos.patch
 ext3-xattr-ptr-arith-fix.patch
+kernel_text_address-2.4.18-chaos.patch