patch-2.1.112 linux/include/linux/init.h
Next file: linux/include/linux/kd.h
Previous file: linux/include/linux/in6.h
Back to the patch index
Back to the overall index
- Lines: 53
- Date:
Tue Jul 28 11:18:47 1998
- Orig file:
v2.1.111/linux/include/linux/init.h
- Orig date:
Wed Apr 23 19:01:29 1997
diff -u --recursive --new-file v2.1.111/linux/include/linux/init.h linux/include/linux/init.h
@@ -9,7 +9,15 @@
*
* Usage:
* For functions:
- * you can surround the whole function declaration
+ *
+ * You should add __init immediately before the function name, like:
+ *
+ * static void __init initme(int x, int y)
+ * {
+ * extern int z; z = x * y;
+ * }
+ *
+ * Depricated: you can surround the whole function declaration
* just before function body into __initfunc() macro, like:
*
* __initfunc (static void initme(int x, int y))
@@ -17,17 +25,20 @@
* extern int z; z = x * y;
* }
*
- * if the function has a prototype somewhere, you can also add
+ * If the function has a prototype somewhere, you can also add
* __init between closing brace of the prototype and semicolon:
*
* extern int initialize_foobar_device(int, int, int) __init;
*
* For initialized data:
- * you should insert __initdata between the variable name and equal
+ * You should insert __initdata between the variable name and equal
* sign followed by value, e.g.:
*
* static int init_variable __initdata = 0;
* static char linux_logo[] __initdata = { 0x32, 0x36, ... };
+ *
+ * For initialized data not at file scope, i.e. within a function,
+ * you should use __initlocaldata instead, due to a bug in GCC 2.7.
*/
/*
@@ -46,6 +57,12 @@
#define __INIT
#define __FINIT
#define __INITDATA
+#endif
+
+#if __GNUC__ >= 2 && __GNUC_MINOR__ >= 8
+#define __initlocaldata __initdata
+#else
+#define __initlocaldata
#endif
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov