Whamcloud - gitweb
- configurable stack size fo x86_64
[fs/lustre-release.git] / lustre / kernel_patches / patches / kernel_text_address-2.4.20-vanilla.patch
1 Index: linux-2.4.20-uml/arch/um/kernel/Makefile
2 ===================================================================
3 --- linux-2.4.20-uml.orig/arch/um/kernel/Makefile       2003-11-10 13:42:48.000000000 +0800
4 +++ linux-2.4.20-uml/arch/um/kernel/Makefile    2003-11-10 13:43:06.000000000 +0800
5 @@ -37,7 +37,8 @@
6  export-objs-$(CONFIG_GPROF) += gprof_syms.o
7  export-objs-$(CONFIG_GCOV) += gmon_syms.o
8  
9 -export-objs = ksyms.o process_kern.o signal_kern.o user_syms.o $(export-objs-y)
10 +export-objs = ksyms.o process_kern.o signal_kern.o user_syms.o sysrq.o \
11 +       $(export-objs-y)
12  
13  CFLAGS_user_syms.o = -D__AUTOCONF_INCLUDED__ $(DMODULES-y) $(DMODVERSIONS-y) \
14         -I/usr/include -I../include
15 Index: linux-2.4.20-uml/arch/um/kernel/sysrq.c
16 ===================================================================
17 --- linux-2.4.20-uml.orig/arch/um/kernel/sysrq.c        2003-11-10 13:42:49.000000000 +0800
18 +++ linux-2.4.20-uml/arch/um/kernel/sysrq.c     2003-11-10 13:43:06.000000000 +0800
19 @@ -86,6 +86,37 @@
20         show_trace((unsigned long *)esp);
21  }
22  
23 +#ifdef CONFIG_MODULES
24 +extern struct module *module_list;
25 +extern struct module kernel_module;
26 +#endif
27 +
28 +int is_kernel_text_address(unsigned long addr)
29 +{
30 +       int retval = 0;
31 +#ifdef CONFIG_MODULES
32 +       struct module *mod;
33 +#endif
34 +       if (addr >= (unsigned long) &_stext &&
35 +           addr <= (unsigned long) &_etext)
36 +               return 1;
37 +
38 +#ifdef CONFIG_MODULES
39 +       for (mod = module_list; mod != &kernel_module; mod = mod->next) {
40 +               /* mod_bound tests for addr being inside the vmalloc'ed
41 +                * module area. Of course it'd be better to test only
42 +                * for the .text subset... */
43 +               if (mod_bound(addr, 0, mod)) {
44 +                       retval = 1;
45 +                       break;
46 +               }
47 +       }
48 +#endif
49 +       return retval;
50 +}
51 +
52 +EXPORT_SYMBOL(is_kernel_text_address);
53 +
54  /*
55   * Overrides for Emacs so that we follow Linus's tabbing style.
56   * Emacs will notice this stuff at the end of the file and automatically
57 Index: linux-2.4.20-uml/arch/i386/kernel/Makefile
58 ===================================================================
59 --- linux-2.4.20-uml.orig/arch/i386/kernel/Makefile     2002-11-29 07:53:09.000000000 +0800
60 +++ linux-2.4.20-uml/arch/i386/kernel/Makefile  2003-11-10 14:39:28.000000000 +0800
61 @@ -14,7 +14,8 @@
62  
63  O_TARGET := kernel.o
64  
65 -export-objs     := mca.o mtrr.o msr.o cpuid.o microcode.o i386_ksyms.o time.o
66 +export-objs     := mca.o mtrr.o msr.o cpuid.o microcode.o i386_ksyms.o time.o \
67 +                       traps.o
68  
69  obj-y  := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \
70                 ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \
71 Index: linux-2.4.20-uml/arch/i386/kernel/traps.c
72 ===================================================================
73 --- linux-2.4.20-uml.orig/arch/i386/kernel/traps.c      2002-11-29 07:53:09.000000000 +0800
74 +++ linux-2.4.20-uml/arch/i386/kernel/traps.c   2003-11-10 14:53:53.000000000 +0800
75 @@ -1004,3 +1004,41 @@
76         cobalt_init();
77  #endif
78  }
79 +
80 +#ifdef CONFIG_MODULES
81 +extern struct module *module_list;
82 +extern struct module kernel_module;
83 +#endif
84 +                                                                                
85 +int is_kernel_text_address(unsigned long addr)
86 +{
87 +       int retval = 0;
88 +#ifdef CONFIG_MODULES
89 +       struct module *mod;
90 +#endif
91 +       if (addr >= (unsigned long) &_stext &&
92 +           addr <= (unsigned long) &_etext);
93 +               return 1;
94 +                                                                                
95 +#ifdef CONFIG_MODULES
96 +       for (mod = module_list; mod != &kernel_module; mod = mod->next) {
97 +               /* mod_bound tests for addr being inside the vmalloc'ed
98 +                * module area. Of course it'd be better to test only
99 +                * for the .text subset... */
100 +               if (mod_bound(addr, 0, mod)) {
101 +                       retval = 1;
102 +                       break;
103 +               }
104 +       }
105 +#endif
106 +                                                                                
107 +       return retval;
108 +}
109 +
110 +int lookup_symbol(unsigned long address, char *buf, int buflen)
111 +{
112 +       return -ENOSYS;
113 +}
114 +
115 +EXPORT_SYMBOL_GPL(is_kernel_text_address);
116 +EXPORT_SYMBOL_GPL(lookup_symbol);