Chinaunix首页 | 论坛 | 博客
  • 博客访问: 725500
  • 博文数量: 39
  • 博客积分: 10290
  • 博客等级: 上将
  • 技术积分: 1500
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-16 15:05
文章分类
文章存档

2011年(15)

2010年(2)

2009年(8)

2008年(14)

我的朋友

分类: LINUX

2008-09-03 17:00:07

   每次都找来找去的不方便,放到这里备忘,查的时候方便。

   在文件:include/linux/init.h 中的定义摘要如下:

/* initcalls are now grouped by functionality into separate 
* subsections. Ordering inside the subsections is determined
* by link order.
* For backwards compatibility, initcall() puts the call in
* the device init subsection.
*
* The `id' arg to __define_initcall() is needed so that multiple initcalls
* can point at the same handler without causing duplicate-symbol build errors.
*/

#define (,,) \
static ##fn##id \
(((".initcall" ".init"))) =

/*
* A "pure" initcall has no dependencies on anything else, and purely
* initializes variables that couldn't be statically initialized.
*
* This only exists for built-in code, not for modules.
*/
#define () ("0",,0)

#define () ("1",,1)
#define () ("1s",,1s)
#define () ("2",,2)
#define () ("2s",,2s)
#define () ("3",,3)
#define () ("3s",,3s)
#define () ("4",,4)
#define () ("4s",,4s)
#define () ("5",,5)
#define () ("5s",,5s)
#define () ("rootfs",,)
#define device_initcall() ("6",,6)
#define device_initcall_sync() ("6s",,6s)
#define () ("7",,7)
#define () ("7s",,7s)

#define () device_initcall()

#define () \
static ##fn =

#define () \
static ##fn \
(..) =

#define security_initcall() \
static ##fn \
(.security_initcall.) =

struct {
const char *;
int (*)(char *);
int ;
};

/*
* Only for really core code. See moduleparam.h for the normal way.
*
* Force the alignment so the compiler doesn't space elements of the
* obs_kernel_param "array" too far apart in .init.setup.
*/
#define (, , , ) \
static char ##unique_id[] (1) = ; \
static struct ##unique_id \
(..) \
((((sizeof(long))))) \
= { ##unique_id, , }

#define (, ) \
(, , , 0)

#define (, ) \
(, , , 0)

/* NOTE: fn is as per module_param, not __setup! Emits warning if fn
* returns non-zero. */
#define (, ) \
(, , , 1)

/* Relies on boot_command_line being set */
void (void);
#endif /* __ASSEMBLY__ */

/**
* module_init() - driver initialization entry point
* @x: function to be run at kernel boot time or module insertion
*
* module_init() will either be called during do_initcalls() (if
* builtin) or at module insertion time (if a module). There can only
* be one per module.
*/
#define () ();

/**
* module_exit() - driver exit entry point
* @x: function to be run when driver is removed
*
* module_exit() will wrap the driver clean-up code
* with cleanup_module() when used with rmmod when
* the driver is a module. If the driver is statically
* compiled into the kernel, module_exit() has no effect.
* There can only be one per module.
*/
#define () ();


   这些是在非模块化编译的情形下的定义。各个级别很明显了,如果要依赖某个可以驱动模块的话,唯一可选的级别就是late_initcall了。
   嗯。
阅读(1242) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~