跪求编译hello world驱动时候,出现下面错误!

来源:互联网 发布:战争机器4 网络 编辑:程序博客网 时间:2024/05/21 19:18
make -C /home/tang/kxd/linux-04.06.00.08 M=`pwd` modules
make[1]: 正在进入目录 `/home/tang/kxd/linux-04.06.00.08'
  CC [M]  /home/tang/smart_card/smart_card.o
In file included from /home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/bitops.h:449:0,
                 from include/linux/bitops.h:22,
                 from include/linux/kernel.h:17,
                 from /home/tang/smart_card/smart_card.c:2:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/arch_hweight.h: 在函数‘__arch_hweight64’中:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/arch_hweight.h:53:7: 错误: expected ‘:’ or ‘)’ before ‘POPCNT64’
In file included from /home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/thread_info.h:22:0,
                 from include/linux/thread_info.h:53,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /home/tang/smart_card/smart_card.c:3:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h: 在文件作用域:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h:115:30: 错误: ‘CONFIG_X86_L1_CACHE_SHIFT’未声明(不在函数内)
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h:115:1: 错误: 要求的对齐边界不是常量
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h:157:0: 警告: “cache_line_size”重定义 [默认启用]
include/linux/cache.h:64:0: 附注: 这是先前定义的位置
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h:238:1: 错误: 要求的对齐边界不是常量
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/processor.h:269:1: 错误: 要求的对齐边界不是常量
In file included from /home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic.h:314:0,
                 from include/linux/atomic.h:4,
                 from /home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/thread_info.h:24,
                 from include/linux/thread_info.h:53,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:50,
                 from include/linux/seqlock.h:29,
                 from include/linux/time.h:8,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /home/tang/smart_card/smart_card.c:3:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:19:1: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h: 在函数‘atomic64_read’中:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:21:32: 错误: 在非结构或联合中请求成员‘counter’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h: 在文件作用域:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:31:33: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:43:41: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:57:41: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:73:49: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:89:33: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:102:33: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:117:41: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:135:41: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:154:49: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:171:48: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:176:48: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:184:37: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:189:34: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:203:39: 错误: 未知的类型名‘atomic64_t’
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/atomic64_64.h:227:45: 错误: 未知的类型名‘atomic64_t’
In file included from include/linux/elf.h:7:0,
                 from include/linux/module.h:14,
                 from /home/tang/smart_card/smart_card.c:3:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/elf.h: 在函数‘elf_common_init’中:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/elf.h:168:3: 错误: ‘struct thread_struct’没有名为‘fs’的成员
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/elf.h: 在文件作用域:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/elf.h:350:1: 错误: 要求的对齐边界不是常量
In file included from include/linux/module.h:22:0,
                 from /home/tang/smart_card/smart_card.c:3:
/home/tang/kxd/linux-04.06.00.08/arch/x86/include/asm/module.h:59:2: 错误: #error unknown processor family
In file included from include/linux/fs.h:382:0,
                 from /home/tang/smart_card/smart_card.c:6:
include/linux/dcache.h:173:1: 错误: 要求的对齐边界不是常量
In file included from /home/tang/smart_card/smart_card.c:6:0:
include/linux/fs.h:1641:1: 错误: 要求的对齐边界不是常量
make[2]: *** [/home/tang/smart_card/smart_card.o] 错误 1
make[1]: *** [_module_/home/tang/smart_card] 错误 2
make[1]:正在离开目录 `/home/tang/kxd/linux-04.06.00.08'
make: *** [all] 错误 2


Makefile obj-m += hello.o
  2 KERNEL = /home/tang/kxd/linux-04.06.00.08
  3 #KERNEL = /lib/modules/$(shell uname -r)/build
  4 all:
  5     make -C $(KERNEL) M=`pwd` modules
  6 #   arm-eabi-gcc -static -o hello hello.o
  7
  8 clean:
  9     make -C $(KERNEL) M=`pwd` clean
 10     rm -rf hello.o

内核版本是3.2的版本,如果改成本地的3 #KERNEL = /lib/modules/$(shell uname -r)/build就没有错误,奇怪了



0 0
原创粉丝点击