Chinaunix首页 | 论坛 | 博客
  • 博客访问: 358160
  • 博文数量: 92
  • 博客积分: 1037
  • 博客等级: 准尉
  • 技术积分: 854
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-27 11:13
文章分类

全部博文(92)

文章存档

2013年(2)

2012年(90)

分类: 嵌入式

2012-06-11 19:55:33

static int __init dev_init(void)

在驱动的初始化函数中经常看到,__init 前缀, 这个在下面文件中定义

file:/include/linux/init.h

点击(此处)折叠或打开

  1. /* These macros are used to mark some functions or
  2.  * initialized data (doesn't apply to uninitialized data)
  3.  * as `initialization' functions. The kernel can take this
  4.  * as hint that the function is used only during the initialization
  5.  * phase and free up used memory resources after
  6.  *
  7.  * Usage:
  8.  * For functions:
  9.  *
  10.  * You should add __init immediately before the function name, like:
  11.  *
  12.  * static void __init initme(int x, int y)
  13.  * {
  14.  * extern int z; z = x * y;
  15.  * }


 

阅读(4969) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~