__KERNEL__ 宏的作用

 编译内核代码,会定义宏 __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__`)

 

posted @ 2023-06-23 21:37  流水灯  阅读(46)  评论(0编辑  收藏  举报