ima

1.__setup()宏简介

内核组件用__setup宏来注册关键字及相关联的处理函数,__setup宏在include/linux/init.h中定义,其原型如下:

#define __setup(str, fn)

其中:str是关键字,fn是关联处理函数。__setup只是告诉内核在启动时输入串中含有str时,内核要去执行fn。Str必须以“=”符结束以使parse_args更方便解析。紧随“=”后的任何文本都会作为输入传给 fn。

2.DEFINE_SPINLOCK(x)
  该宏声明一个自旋锁x并初始化它。该宏在2.6.11中第一次被定义,在先前的内核中并没有该宏。


3.File magic numbersMagic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

4,代码定位__FILE__,__FUNCTION__,__LINE__

这是三个非常有用的全局变量,当程序需要输出一些内容,而又想知道输出的内容是在哪里输出的时候,这几个全局变量就派上用场了。
__FILE__,__FUNCTION__, __LINE__ 从名字可以直接看出来了,对应的:代码文件名,函数名, 行号。

5.

#define U32 unsigned int
#define U16 unsigned short

#define S32 int
#define S16 short int
#define U8  unsigned char
#define    S8  char


6.

经测试,select与depends on是相反的逻辑关系。
A depends on B
那么只有在B选中才能选A
A select
B
那么只要选中A就会选中B

 

所以select叫反向依赖。


你可能感兴趣的:(ima)