patch-2.1.101 linux/include/asm-ppc/init.h

Next file: linux/include/asm-ppc/irq.h
Previous file: linux/include/asm-ppc/cuda.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.100/linux/include/asm-ppc/init.h linux/include/asm-ppc/init.h
@@ -1,23 +1,56 @@
 #ifndef _PPC_INIT_H
 #define _PPC_INIT_H
 
-#define __init
-#define __initdata
-#define __initfunc(x) x
-/*
+#if __GNUC__ > 2 || __GNUC_MINOR__ >= 90 /* egcs */
 #define __init __attribute__ ((__section__ (".text.init")))
 #define __initdata __attribute__ ((__section__ (".data.init")))
 #define __initfunc(__arginit) \
 	__arginit __init; \
 	__arginit
-*/
-	/* For assembly routines */
-#define __INIT
-#define __FINIT
-#define __INITDATA
-/*	
+
+#define __pmac __attribute__ ((__section__ (".text.pmac")))
+#define __pmacdata __attribute__ ((__section__ (".data.pmac")))
+#define __pmacfunc(__argpmac) \
+	__argpmac __pmac; \
+	__argpmac
+	
+#define __prep __attribute__ ((__section__ (".text.prep")))
+#define __prepdata __attribute__ ((__section__ (".data.prep")))
+#define __prepfunc(__argprep) \
+	__argprep __prep; \
+	__argprep
+
+/* this is actually just common chrp/pmac code, not OF code -- Cort */
+#define __openfirmware __attribute__ ((__section__ (".text.openfirmware")))
+#define __openfirmwaredata __attribute__ ((__section__ (".data.openfirmware")))
+#define __openfirmwarefunc(__argopenfirmware) \
+	__argopenfirmware __openfirmware; \
+	__argopenfirmware
+	
 #define __INIT		.section	".text.init",#alloc,#execinstr
 #define __FINIT	.previous
 #define __INITDATA	.section	".data.init",#alloc,#write
-*/
+
+#else /* not egcs */
+
+#define __init
+#define __initdata
+#define __initfunc(x) x
+	
+#define __INIT
+#define __FINIT
+#define __INITDATA
+	
+#define __pmac
+#define __pmacdata
+#define __pmacfunc(x) x
+	
+#define __prep
+#define __prepdata
+#define __prepfunc(x) x
+
+#define __openfirmware
+#define __openfirmwaredata
+#define __openfirmwarefunc(x) x
+#endif /* egcs */
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov