bitops.h inline and extern has different names
Hi all!
I'm writing a LKM for my ARM/Linux 2.4.27 based server. I have downloaded the matching kernel code and also built my own armv5b GCC toolchain using the kegel crosstool. When I tried to load the module, insmod complained about "unresolved symbol" for "test_and_clear_bit" and some related functions. I traced those identifiers down to the asm/bitops.h include file and found that there where external declarations and matching inline function definitions with the difference that the inline has an "__" prefix. I don't really understand how this is supposed to work. After googling for a while without finding any explanation I tried adding these lines of code before the #include statements:
Code:
#define test_and_clear_bit __test_and_clear_bit
#define test_and_set_bit __test_and_set_bit
#define set_bit __set_bit
#define clear_bit __clear_bit
#include <asm/bitops.h>
After this change the insmod works and the module works too however the solution is most likely not the one that the kernel developers intended. Could someone give me some tips on what I may have done wrong?
(Yes, I do have optimization turned on: -O -O2).
Thanks,
Mats