⑴ 如何使用spinlock要哪個頭文件
在kernel2.4.20下面:
include <linux/spinlock.h>
spinlock_t mysiglock = SPIN_LOCK_UNLOCKED;
unsigned int flags;
然後:
spin_lock_irqsave(&mysiglock,flags);
spin_unlock_irqrestore(&mysiglock,flags);
可以編譯,但連接的時候kernel.o時說:
undefined reference to 'local_irq_save'