2.4.36-stable kernel tree
Revision | 3c8aaf1e38d4bd893e82c7b74837b15abe6b7d3a (tree) |
---|---|
Zeit | 2007-09-09 02:38:56 |
Autor | Willy Tarreau <w@1wt....> |
Commiter | Willy Tarreau |
[PATCH] i386: do_test_wp_bit() must not be inlined
do_test_wp_bit() has a comment stating that it must not be inlined.
Unfortunately, the trick to prevent it from being inlined is not
reliable under gcc 4.x.
The simple fix consists in specifying the noinline attribute.
Tested and confirmed to produce the correct code for gcc versions
2.95.3, 3.3.6, 3.4.6, 4.0.2, 4.1.1 and 4.2.1.
Special thanks to Axel Reinhold and Richard Kojedzinszky for their
continuous feedback when trying to solve this issue.
Signed-off-by: Willy Tarreau <w@1wt.eu>
@@ -381,7 +381,7 @@ void __init paging_init(void) | ||
381 | 381 | * This function cannot be __init, since exceptions don't work in that |
382 | 382 | * section. |
383 | 383 | */ |
384 | -static int do_test_wp_bit(unsigned long vaddr); | |
384 | +static int __attribute__((noinline)) do_test_wp_bit(unsigned long vaddr); | |
385 | 385 | |
386 | 386 | void __init test_wp_bit(void) |
387 | 387 | { |
@@ -561,8 +561,8 @@ void __init mem_init(void) | ||
561 | 561 | |
562 | 562 | } |
563 | 563 | |
564 | -/* Put this after the callers, so that it cannot be inlined */ | |
565 | -static int do_test_wp_bit(unsigned long vaddr) | |
564 | +/* This function must not be inlined */ | |
565 | +static int __attribute__((noinline)) do_test_wp_bit(unsigned long vaddr) | |
566 | 566 | { |
567 | 567 | char tmp_reg; |
568 | 568 | int flag; |