Доброго времени суток!
Никак не могу разобраться почему компилятор упорно отказывается компилировать файл следующего содержания:
include <kernel.h>
include <module.h>
// end of file
Тело исходника было вырезано для того, чтобы убедиться, что затык именно в подключенном linux/module.h
$ gcc -g -D__KERNEL__ -DMODULE -O2 -I/usr/src/linux-headers-2.6.32-122/include -I/usr/src/linux-headers-2.6.32-122-rtai/include -I/usr/src/linux-headers-2.6.32-122/arch/x86/include -o ttt.o ttt.c
...
In file included from /usr/src/linux-headers-2.6.32-122/include/linux/prefetch.h:14,
from /usr/src/linux-headers-2.6.32-122/include/linux/list.h:6,
from /usr/src/linux-headers-2.6.32-122/include/linux/module.h:9,
from ttt.c:5:
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:116: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:116: error: requested alignment is not a constant
...
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h: In function ‘load_cr3’:
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:193: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function)
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:193: error: (Each undeclared identifier is reported only once
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:193: error: for each function it appears in.)
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h: At top level:
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:242: error: requested alignment is not a constant
/usr/src/linux-headers-2.6.32-122/arch/x86/include/asm/processor.h:273: error: requested alignment is not a constant
...
Что за CONFIG_X86_L1_CACHE_SHIFT ? Где он определяется?
Прочитал кучу статей про сборку модулей ядра. Все приведённые в статьях примеры начинаются с #include <linux/kernel.h> and <linux/module.h> . Что собственно я и сделал и тут же упёрся в не определённое определение/макрос.
Что я неправильно делаю?
Спасибо.