All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add noinline attribute
@ 2004-01-14  8:31 Andi Kleen
  2004-01-14 23:23 ` Linus Torvalds
  2004-01-15  0:35 ` [PATCH] Add noinline attribute Rusty Russell
  0 siblings, 2 replies; 14+ messages in thread
From: Andi Kleen @ 2004-01-14  8:31 UTC (permalink / raw)
  To: akpm, jh, linux-kernel


do_test_wp_bit cannot be inlined, otherwise the kernel doesn't boot
because the exception tables get reordered. 

Add a new noinline attribute to compiler.h and use it.

This patch is needed for the next unit-at-a-time patch. 

-Andi

diff -u linux-34/arch/i386/mm/init.c-o linux-34/arch/i386/mm/init.c
--- linux-34/arch/i386/mm/init.c-o	2004-01-09 09:27:09.000000000 +0100
+++ linux-34/arch/i386/mm/init.c	2004-01-13 22:19:19.000000000 +0100
@@ -555,7 +555,7 @@
  * This function cannot be __init, since exceptions don't work in that
  * section.  Put this after the callers, so that it cannot be inlined.
  */
-static int do_test_wp_bit(void)
+static int noinline do_test_wp_bit(void)
 {
 	char tmp_reg;
 	int flag;
diff -u linux-34/include/linux/compiler.h-o linux-34/include/linux/compiler.h
--- linux-34/include/linux/compiler.h-o	2003-11-24 04:46:36.000000000 +0100
+++ linux-34/include/linux/compiler.h	2004-01-13 22:17:26.000000000 +0100
@@ -76,6 +76,10 @@
 # define __attribute_pure__	/* unimplemented */
 #endif
 
+#ifndef noinline
+#define noinline
+#endif
+
 /* Optimization barrier */
 #ifndef barrier
 # define barrier() __memory_barrier()
diff -u linux-34/include/linux/compiler-gcc3.h-o linux-34/include/linux/compiler-gcc3.h
--- linux-34/include/linux/compiler-gcc3.h-o	2003-09-28 10:53:23.000000000 +0200
+++ linux-34/include/linux/compiler-gcc3.h	2004-01-13 22:36:22.000000000 +0100
@@ -20,3 +22,7 @@
 #endif
 
 #define __attribute_pure__	__attribute__((pure))
+
+#if __GNUC_MINOR__ >= 1
+#define  noinline __attribute__((noinline))
+#endif

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2004-01-19 11:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-14  8:31 [PATCH] Add noinline attribute Andi Kleen
2004-01-14 23:23 ` Linus Torvalds
2004-01-15  7:48   ` Andi Kleen
2004-01-15 22:55     ` Linus Torvalds
2004-01-16  0:26       ` Peter Osterlund
2004-01-16 10:13       ` Andi Kleen
2004-01-18 20:47         ` Richard Henderson
2004-01-18 20:58           ` Andi Kleen
2004-01-19  0:41             ` Richard Henderson
2004-01-18 23:07           ` [PATCH] Add noinline attribute - new extable sort patch Andi Kleen
2004-01-19  0:52             ` Richard Henderson
2004-01-19  1:01               ` Andi Kleen
2004-01-19 11:26                 ` Rusty Russell
2004-01-15  0:35 ` [PATCH] Add noinline attribute Rusty Russell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.