__KERNEL__ 宏的作用

发布时间 2023-06-23 21:42:15作者: 流水灯

 编译内核代码,会定义宏 __KERNEL__

 

 

The kernel includes a set of headers that is exported to userspace.
Many headers can be exported as-is but other headers require a
minimal pre-processing before they are ready for user-space.
The pre-processing does:

- drop kernel-specific annotations
- drop include of compiler.h
- drop all sections that are kernel internal (guarded by `ifdef __KERNEL__`)