微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > Scull在2.6.35-30内核中的编译解决方案

Scull在2.6.35-30内核中的编译解决方案

时间:04-12 来源:互联网 点击:

/media/orientation/driver/ldd3/examples/scull/access.c:179: error: implicit declaration offunction ‘signal_pending’/media/orientation/driver/ldd3/examples/scull/access.c:179: error: implicit declaration offunction ‘schedule’/media/orientation/driver/ldd3/examples/scull/access.c:184: error: dereferencing pointer to incomplete type /media/orientation/driver/ldd3/examples/scull/access.c: In function ‘scull_w_release’:/media/orientation/driver/ldd3/examples/scull/access.c:205: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)

/media/orientation/driver/ldd3/examples/scull/access.c: In function ‘scull_c_open’:/media/orientation/driver/ldd3/examples/scull/access.c:277: error: dereferencing pointer to incomplete type /media/orientation/driver/ldd3/examples/scull/access.c:281: error: dereferencing pointer to incomplete type make[2]: *** [/media/orientation/driver/ldd3/examples/scull/access.o] Error 1 make[1]: *** [_module_/media/orientation/driver/ldd3/examples/scull] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-28-generic' make: *** [modules] Error 2 7、根据提示,同上所述,我们需要在access.c中加入头文件sched.h>,接着编译:

make -C /lib/modules/2.6.35-30-generic/build M=/media/orientation/driver/ldd3/examples/scull LDDINC=/media/orientation/driver/ldd3/examples/scull/……/include modules make[1]: Entering directory `/usr/src/linux-headers-2.6.32-28-generic' CC [M] /media/orientation/driver/ldd3/examples/scull/access.o /media/orientation/driver/ldd3/examples/scull/access.c: In function ‘scull_u_open’:/media/orientation/driver/ldd3/examples/scull/access.c:106: error: ‘struct task_struct’ has no member named ‘uid’/media/orientation/driver/ldd3/examples/scull/access.c:107: error: ‘struct task_struct’ has no member named ‘euid’/media/orientation/driver/ldd3/examples/scull/access.c:114: error: ‘struct task_struct’ has no member named ‘uid’/media/orientation/driver/ldd3/examples/scull/access.c: In function ‘scull_w_available’:/media/orientation/driver/ldd3/examples/scull/access.c:165: error: ‘struct task_struct’ has no member named ‘uid’/media/orientation/driver/ldd3/examples/scull/access.c:166: error: ‘struct task_struct’ has no member named ‘euid’/media/orientation/driver/ldd3/examples/scull/access.c: In function ‘scull_w_open’:/media/orientation/driver/ldd3/examples/scull/access.c:184: error: ‘struct task_struct’ has no member named ‘uid’make[2]: *** [/media/orientation/driver/ldd3/examples/scull/access.o] Error 1 make[1]: *** [_module_/media/orientation/driver/ldd3/examples/scull] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-28-generic' make: *** [modules] Error 2 8、根据提示,错误在于task_struct结构体没有uid,euid成员变量,查看源码发现struct task_struct定义在include/linux/sched.h中,确实没有这两个成员,逐个成员分析发现,这两个成员在2.6.35内核中放在const struct cred *cred成员中了,所以,我们尝试将所有出现错误的地方做如下改动:

current->uid 修改为 current->cred->uid current->euid 修改为 current->cred->euid 9、接着make,发现成功编译。

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top