0
Linux內核代碼中__cpuinit的真正意義是什麼? 我遇到了正常的內核代碼,它接受__cpuinit函數。這給我大量的modpost警告。這是正常的還是一個嚴重的錯誤?__cpuinit和modpost相關的警告的意義
Linux內核代碼中__cpuinit的真正意義是什麼? 我遇到了正常的內核代碼,它接受__cpuinit函數。這給我大量的modpost警告。這是正常的還是一個嚴重的錯誤?__cpuinit和modpost相關的警告的意義
__cpuinit實際上告訴編譯器將函數放入指定的elf部分。
#define __cpuinit __section(.cpuinit.text) __cold
內核代碼中說在include/linux/init.h中:
/* modpost check for section mismatches during the kernel build.
* A section mismatch happens when there are references from a
* code or data section to an init section (both code or data).
* The init sections are (for most archs) discarded by the kernel
* when early init has completed so all such references are potential bugs.
* For exit sections the same issue exists. ......