]> git.pld-linux.org Git - packages/kernel.git/blob - kernel-2.6.17-thread_info-buildfix.patch
- updated to 2.6.29.2 (builds and works --without apparmor --without grsecurity)
[packages/kernel.git] / kernel-2.6.17-thread_info-buildfix.patch
1
2 From: Chuck Ebbert <76306.1226@compuserve.com>
3
4 Using C code for current_thread_info() lets the compiler optimize it.
5 With gcc 4.0.2, kernel is smaller:
6
7     text           data     bss     dec     hex filename
8  3645212         555556  312024 4512792  44dc18 2.6.17-rc6-nb-post/vmlinux
9  3647276         555556  312024 4514856  44e428 2.6.17-rc6-nb/vmlinux
10  -------
11    -2064
12
13 Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
14 Signed-off-by: Andrew Morton <akpm@osdl.org>
15 ---
16
17  include/asm-i386/thread_info.h |   10 ++++------
18  1 file changed, 4 insertions(+), 6 deletions(-)
19
20 diff -puN include/asm-i386/thread_info.h~i386-use-c-code-for-current_thread_info include/asm-i386/thread_info.h
21 --- a/include/asm-i386/thread_info.h~i386-use-c-code-for-current_thread_info
22 +++ a/include/asm-i386/thread_info.h
23 @@ -83,17 +83,15 @@ struct thread_info {
24  #define init_stack             (init_thread_union.stack)
25  
26  
27 +/* how to get the current stack pointer from C */
28 +register unsigned long current_stack_pointer asm("esp") __attribute_used__;
29 +
30  /* how to get the thread information struct from C */
31  static inline struct thread_info *current_thread_info(void)
32  {
33 -       struct thread_info *ti;
34 -       __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
35 -       return ti;
36 +       return (struct thread_info *)(current_stack_pointer & ~(THREAD_SIZE - 1));
37  }
38  
39 -/* how to get the current stack pointer from C */
40 -register unsigned long current_stack_pointer asm("esp") __attribute_used__;
41 -
42  /* thread information allocation */
43  #ifdef CONFIG_DEBUG_STACK_USAGE
44  #define alloc_thread_info(tsk)                                 \
45 _
This page took 0.023698 seconds and 3 git commands to generate.