Skip to contentSkip to conversation

ppc: make kernel inline redefinition ubiquitous

PATCH New Tim Bird 1 participant 1 message Sep 3, 2004

lore
Share & tools
lore

Tim Bird

author
#0 lore raw

PATCH 1/1 ppc: make kernel inline redefinition ubiquitous

Sometimes, the kernel redefinition for inline (with attribute(__always_inline)) is not being used when it should be. Most of the time, this has no detectable effect. However, under certain conditions, such as when one is using the gcc -finstrument-functions feature, this results in link errors.

This patch adds some include lines needed to avoid this situation (at least for configurations that I tested). Also, this patch removes a conditional which disables the kernel redefinition of inline for gcc 3.4 and above. (IOW, for gcc 3.4 and above, currently the kernel does NOT redefine 'inline' to be always inline, but with this change it will.)

This was discussed before at:

http://groups.google.com/groups?q=always_inline&hl=en&lr=&ie=UTF-8&selm=2hjY2-7YV-9%40gated-at.bofh.it&rnum=1

---
 asm-ppc/delay.h       |    1 +
 asm-ppc/processor.h   |    1 +
 linux/compiler-gcc3.h |    2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)
include/asm-ppc/delay.h +1 -0
diff -ruN -X ../../dontdiff linux-2.6.7/include/asm-ppc/delay.h branch_KFI/include/asm-ppc/delay.h
@@ -2,6 +2,7 @@
 #ifndef _PPC_DELAY_H
 #define _PPC_DELAY_H
 
+#include <linux/compiler.h>	/* for kernel inline definition */
 #include <asm/param.h>
 
 /*
include/asm-ppc/processor.h +1 -0
diff -ruN -X ../../dontdiff linux-2.6.7/include/asm-ppc/processor.h branch_KFI/include/asm-ppc/processor.h
@@ -10,6 +10,7 @@
 
 #include <linux/config.h>
 #include <linux/stringify.h>
+#include <linux/compiler.h>	/* for kernel inline definition */
 
 #include <asm/ptrace.h>
 #include <asm/types.h>
include/linux/compiler-gcc3.h +1 -1
diff -ruN -X ../../dontdiff linux-2.6.7/include/linux/compiler-gcc3.h branch_KFI/include/linux/compiler-gcc3.h
@@ -3,7 +3,7 @@
 /* These definitions are for GCC v3.x.  */
 #include <linux/compiler-gcc.h>
 
-#if __GNUC_MINOR__ >= 1  && __GNUC_MINOR__ < 4
+#if __GNUC_MINOR__ >= 1
 # define inline		__inline__ __attribute__((always_inline))
 # define __inline__	__inline__ __attribute__((always_inline))
 # define __inline	__inline__ __attribute__((always_inline))
Signature · 6 lines
=============================
Tim Bird
Architecture Group Co-Chair, CE Linux Forum
Senior Staff Engineer, Sony Electronics
E-mail: [email protected]
=============================