在linux中包含头文件时,有不少类似如下的写法:#include<asm/types.h>,但在linux kernel的include文件夹下并没有这个文件夹,倒是有不少以asm打头的文件夹,如:asm_powerpc、asm_ppc等。



源代码中没有asm这个文件夹,asm是一个符号连接,只有在你的主makefile的ARCH 变量赋值,编译内核的时候根据ARCH 的配置,

临时的生成asm文件夹及其下的文件,然后指向对应的体系结构的文件,如/include/asm-arm/ ,/include/asm-x86/


 


这样#include <asm/types.h> ==/include/asm-x86/types.h