c - why does ticket spinlock .h file not compiled by kernel? -


i use linux-2.6.31.8 kernel environment. need make modifications of ticket spinlock in kernel. surprise, ticket spinlock.h file isn't compiled kernel @ all. check adding illegal c statements , non compile error encounter. test code use below:

#include <asm/atomic.h> #include <asm/rwlock.h> #include <asm/page.h> #include <asm/processor.h> #include <linux/compiler.h> #include <asm/paravirt.h> test /an invalid statement, none errors/ /*  * basic smp spinlocks, allowing single cpu anywhere  *  * simple spin lock operations.  there 2 variants, 1 clears irq's  * on local processor, 1 not.  *  * these fair fifo ticket locks, limited 256  * cpus.  *  * (the type definitions in asm/spinlock_types.h)  */  #ifdef config_x86_32 # define lock_ptr_reg "a" # define reg_ptr_mode "k" #else # define lock_ptr_reg "d" # define reg_ptr_mode "q" #endif 

any plz. thank you~~

header files aren't compiled unless .c files include them.

kernel heavily depends on configuration, specify files compile. maybe, configuration no-one compiled file uses spinlock.

to find out, grep files, include header. then, should spot, whether compiled. use makefiles discover config option file compilation depends on. then, enable option , desirable error.

edit:

note: kernel not use spinlocks if build without smp.


Comments