public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: akpm@osdl.org, jh@suse.cz, linux-kernel@vger.kernel.org
Subject: [PATCH] Add noinline attribute
Date: Wed, 14 Jan 2004 09:31:14 +0100	[thread overview]
Message-ID: <20040114083114.GA1784@averell> (raw)


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

             reply	other threads:[~2004-01-14  8:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-14  8:31 Andi Kleen [this message]
2004-01-14 23:23 ` [PATCH] Add noinline attribute 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040114083114.GA1784@averell \
    --to=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=jh@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox