免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2107 | 回复: 4
打印 上一主题 下一主题

关于内核链表的使用问题,请教大家,修改了内核头文件解决了 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-04 09:53 |只看该作者 |倒序浏览
我在用户空间使用内核链表,但是编译不过?(我用的是别人的一个程序实例。。)
gcc -D__KERNEL__ -I /usr/src/linux/include -o kernellink kernellink.c
In file included from /usr/src/linux/include/linux/prefetch.h:14,
                 from /usr/src/linux/include/linux/list.h:8,
                 from kernellink.c:32:
/usr/src/linux/include/asm/processor.h:83: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:83: error: requested alignment is not a constant
kernellink.c: In function ‘main’:
kernellink.c:57: warning: incompatible implicit declaration of built-in function ‘malloc’



gcc -D__KERNEL__ -I /usr/src/linux-2.6.22.14/include -c kernellink.c
In file included from /usr/src/linux-2.6.22.14/include/linux/prefetch.h:14,
                 from /usr/src/linux-2.6.22.14/include/linux/list.h:8,
                 from kernellink.c:32:
/usr/src/linux-2.6.22.14/include/asm/processor.h:83: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/usr/src/linux-2.6.22.14/include/asm/processor.h:83: error: requested alignment is not a constant
kernellink.c: In function ‘main’:
kernellink.c:57: warning: incompatible implicit declaration of built-in function ‘malloc’

/usr/src/linux-2.6.22.14/include/asm/processor.h:83: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)  这个都是内核文件呀,不知道怎么回事,高手帮看看???

[ 本帖最后由 gaochang2008 于 2008-8-4 10:42 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-08-04 09:57 |只看该作者
大虾们 帮看看呀,,如果搞不定,就要自己些了,,

论坛徽章:
0
3 [报告]
发表于 2008-08-04 10:02 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
4 [报告]
发表于 2008-08-04 10:02 |只看该作者
再顶,,,帮忙看看

论坛徽章:
0
5 [报告]
发表于 2008-08-04 10:04 |只看该作者
原帖由 jamesr 于 2008-8-4 10:02 发表
看不懂英文吗?

要把内核链表用到用户空间,就得把与内核有关的内容剥离。


问题是内核怎么多,怎么剥离,剥离哪些东西?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP