static int __init dev_init(void)
在驱动的初始化函数中经常看到,__init 前缀, 这个在下面文件中定义
file:/include/linux/init.h
- /* These macros are used to mark some functions or
- * initialized data (doesn't apply to uninitialized data)
- * as `initialization' functions. The kernel can take this
- * as hint that the function is used only during the initialization
- * phase and free up used memory resources after
- *
- * Usage:
- * For functions:
- *
- * You should add __init immediately before the function name, like:
- *
- * static void __init initme(int x, int y)
- * {
- * extern int z; z = x * y;
- * }
阅读(5060) | 评论(0) | 转发(0) |