hi, I am porting yaffs2 to linuix user mode. In yaffs2 i got direct module compiled. but i am getting errors in tne mtd emul.. the errors are written below. please help me out..... cc -c -D__KERNEL__ -DMODULE -I/opt/linux-source-2.6.24/include -O2 -Wall -g nandemul2k.c -o nandemul2k.o In file included from /usr/include/asm/pda.h:4, from /usr/include/asm-x86_64/current.h:7, from /usr/include/asm/current.h:4, from /usr/include/asm-x86_64/processor.h:18, from /usr/include/asm/processor.h:4, from /usr/include/linux/prefetch.h:13, from /usr/include/linux/list.h:6, from /usr/include/linux/module.h:11, from nandemul2k.c:20: /usr/include/asm-x86_64/pda.h:26: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function) /usr/include/asm-x86_64/pda.h:26: requested alignment is not a constant In file included from /usr/include/asm/system.h:4, from /usr/include/asm-x86_64/processor.h:19, from /usr/include/asm/processor.h:4, from /usr/include/linux/prefetch.h:13, from /usr/include/linux/list.h:6, from /usr/include/linux/module.h:11, from nandemul2k.c:20: /usr/include/asm-x86_64/system.h: In function `__cmpxchg': /usr/include/asm-x86_64/system.h:75: `LOCK_PREFIX' undeclared (first use in this function) /usr/include/asm-x86_64/system.h:75: (Each undeclared identifier is reported only once /usr/include/asm-x86_64/system.h:75: for each function it appears in.) /usr/include/asm-x86_64/system.h:75: syntax error before string constant /usr/include/asm-x86_64/system.h:81: syntax error before string constant /usr/include/asm-x86_64/system.h:87: syntax error before string constant /usr/include/asm-x86_64/system.h:93: syntax error before string constant In file included from /usr/include/asm/processor.h:4, from /usr/include/linux/prefetch.h:13, from /usr/include/linux/list.h:6, from /usr/include/linux/module.h:11, from nandemul2k.c:20: /usr/include/asm-x86_64/processor.h: At top level: /usr/include/asm-x86_64/processor.h:75: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function) /usr/include/asm-x86_64/processor.h:75: requested alignment is not a constant /usr/include/asm-x86_64/processor.h:292: syntax error before "u16" /usr/include/asm-x86_64/processor.h:294: syntax error before "twd" /usr/include/asm-x86_64/processor.h:295: syntax error before "fop" /usr/include/asm-x86_64/processor.h:296: syntax error before "rip" /usr/include/asm-x86_64/processor.h:297: syntax error before "rdp" /usr/include/asm-x86_64/processor.h:298: syntax error before "mxcsr" /usr/include/asm-x86_64/processor.h:299: syntax error before "mxcsr_mask" /usr/include/asm-x86_64/processor.h:300: syntax error before "st_space" /usr/include/asm-x86_64/processor.h:301: syntax error before "xmm_space" /usr/include/asm-x86_64/processor.h:302: syntax error before "padding" /usr/include/asm-x86_64/processor.h:303: syntax error before '}' token /usr/include/asm-x86_64/processor.h:306: field `fxsave' has incomplete type /usr/include/asm-x86_64/processor.h:314: syntax error before "u32" /usr/include/asm-x86_64/processor.h:316: syntax error before "rsp1" /usr/include/asm-x86_64/processor.h:317: syntax error before "rsp2" /usr/include/asm-x86_64/processor.h:318: syntax error before "reserved2" /usr/include/asm-x86_64/processor.h:319: syntax error before "ist" /usr/include/asm-x86_64/processor.h:320: syntax error before "reserved3" /usr/include/asm-x86_64/processor.h:321: syntax error before "reserved4" /usr/include/asm-x86_64/processor.h:322: syntax error before "reserved5" /usr/include/asm-x86_64/processor.h:323: syntax error before "io_map_base" /usr/include/asm-x86_64/processor.h:324: syntax error before "io_bitmap" /usr/include/asm-x86_64/processor.h:325: syntax error before '}' token /usr/include/asm-x86_64/processor.h:347: syntax error before "u32" /usr/include/asm-x86_64/processor.h: In function `thread_saved_pc': /usr/include/asm-x86_64/processor.h:396: dereferencing pointer to incomplete type In file included from nandemul2k.c:26: /usr/include/linux/proc_fs.h: At top level: /usr/include/linux/proc_fs.h:70: syntax error before "atomic_t" /usr/include/linux/proc_fs.h:73: syntax error before '}' token /usr/include/linux/proc_fs.h:203: syntax error before "void" nandemul2k.c:27:27: linux/pagemap.h: No such file or directory In file included from /usr/include/linux/sched.h:14, from /usr/include/asm-x86_64/uaccess.h:8, from /usr/include/asm/uaccess.h:4, from /usr/include/linux/compatmac.h:137, from /usr/include/linux/mtd/compatmac.h:20, from /usr/include/linux/mtd/mtd.h:12, from nandemul2k.c:28: /usr/include/linux/timex.h:173: field `time' has incomplete type /usr/include/linux/timex.h:188: confused by earlier errors, bailing out make: *** [nandemul2k.o] Error