求助!!急!!EXPORT_SYMBOL_GPL 无效问题!!请各位高手入!!

cityofgod 2010-04-28 10:17:14
问题:移植spidriver时编译内核出现
ERROR: "s3c_gpio_setpull" [drivers/spi/spi_sam.ko] undefined!
ERROR: "s3c_gpio_cfgpin" [drivers/spi/spi_sam.ko] undefined!错误,请问如何解?


平台:s3c6410,Linux version 2.6.27,Android1.5
起因移植Samsung的SPIdriver spi_sam.c 和 spi_sam.h 过来时,将内核Meuconfig的SPIdriver配置成<M>,将要移植的spi_sam.c,spi_sam.h copy到/drivers/spi 下后,并在spi_sam.c 中添加#include <linux/module.h>
进行make
出现如下信息:
root@ubuntu:/usr/src/android-1.5# make
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
CHK include/linux/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 8 modules
ERROR: "s3c_gpio_setpull" [drivers/spi/spi_sam.ko] undefined!
ERROR: "s3c_gpio_cfgpin" [drivers/spi/spi_sam.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

请问以上两个错误是什么原因?

其中s3c_gpio_setpull,s3c_gpio_cfgpin,都在gpio-config.c中定义(编译时生成了.o档),并添加了代码
EXPORT_SYMBOL_GPL(s3c_gpio_setpull);
EXPORT_SYMBOL_GPL(s3c_gpio_cfgpin);
请各位帮忙看看是什么问题,多谢,多谢啦~~

menuconfig:

--- SPI support
  • Debug support for SPI drivers
    *** SPI Master Controller Drivers ***
    {M} Bitbanging SPI master
    <M> Parallel port adapter for AVR Butterfly
  • (DEVELOPMENT)
    <M> Parallel port adapter for LM70 eval board (DEVELOPMENT)
    <M> S3C6410 SPI Driver
    SPI Source Clock (PCLK) --->
    *** SPI Protocol Masters ***
    <M> SPI EEPROMs from most vendors
    <M> User mode SPI device driver support
    <M> Infineon TLE62X0 (for power switching)









...全文
991 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
Quietly 2011-07-21
  • 打赏
  • 举报
回复
学习了……
ouyangjinlin 2010-04-29
  • 打赏
  • 举报
回复
在迁移的过程中,比如接口不一致的情况,出现新接口的问题,还有循环include头文件的问题(这是一个关键问题,我用了一种很ugly的办法来解决,就是通过自己定义一个新的头文件比如asm/my_task.h, asm/my_dma.h, asm/my_percpu.h,然后直接调用这个新的头文件来避免循环调用的问题。
cityofgod 2010-04-29
  • 打赏
  • 举报
回复
ralphsage,说的对,EXPORT_SYMBOL_GPL需要#include <linux/module.h>头文件的支持
另外,在驱动中也同样需要添加#include <linux/module.h>(视情况定)
我的问题搞定了多谢ralphsage
ralphsage 2010-04-28
  • 打赏
  • 举报
回复
你看看gpio-config.c中是否有 #include <linus/module.h>
没有这个头文件,EXPORT_SYMBOL_GPL是没有定义的,但是编译不会报错,我前几天修改驱动的时候就是这样的情况
cityofgod 2010-04-28
  • 打赏
  • 举报
回复
是我问题描述的不清楚吗?请高手帮忙!!
安装说明:http://blog.csdn.net/love254443233/article/details/39056173 安装说明: 1:sudo apt-get install stardict 2:全部解压到temp文件夹中 3:sudo mv temp/* /usr/share/stardict/dic 3:重启星际译王 包含的词库zh_CN 简体中文词典.html中所有汉语+英汉词库 cdict-gb dictionary(en - zh_CN) tarbal GPL, 4.5M, 57510 words stardict1.3 dictionary(en - zh_CN) tarbal GPL, 1.1M, 51214 words Sun Dict(en - zh_CN) tarbal GPL, 1M, 33042 words xdict-ec-gb dictionary(en - zh_CN) tarbal GPL, 3.6M, 177817 words xdict-ce-gb dictionary(zh_CN - en) tarbal GPL, 2.4M, 160995 words. cedict-gb dictionary(zh_CN - en) tarbal CEDICT LICENCE, 0.7M, 31200 words. 推荐! langdao-ec-gb dictionary(en - zh_CN) 朗道英汉字典 tarbal GPL, 9.1M, 435468 words. 推荐! langdao-ce-gb dictionary(zh_CN - en) 朗道汉英字典 tarbal GPL, 7.8M, 405719 words. 推荐! lazyworm-ec dictionary(en - zh_CN) 懒虫简明英汉词典 tarbal GPL, 10M, 452185 words. lazyworm-ce dictionary(zh_CN - en) 懒虫简明汉英词典 tarbal GPL, 1.7M, 119592 words. 新华字典 tarbal GPL, 8.9M, 74025 words. ProECCE dictionary 英汉汉英专业词典 tarbal GPL, 8.6M, 571998 words. Hanzi Master (zh_CN - en) tarbal GPL, 427K, 25992 words XiangYa Medical dictionary 湘雅医学专业词典 tarbal GPL, 28M, 1479322 words Advance Chinese big dictionary (zh_CN - zh_CN) 高级汉语大词典 tarbal GPL, 6.3M, 51675 words Advance Chinese big dictionary (zh_CN - zh_CN) 高级汉语大词典(修正版) tarbal GPL, 6.3M, 51675 words International standard Chinese big dictionary (zh_CN - zh_CN) 国际标准汉字大辞典 tarbal GPL, 1.5M, 45053 words Chinese idiom dictionary (zh_CN - zh_CN) 汉语成语词典 tarbal GPL, 2M, 24702 words Chinese idiom dictionary (zh_CN - zh_CN) 汉语成语词典(修正版) tarbal GPL, 1.9M, 13001 words 汉语成语词典(美化版) tarbal GPL, 2.8M, 13305 words Modern Chinese dictionary (zh_CN - zh_CN) 现代汉语词典 tarbal GPL, 3.3M, 57643 words Modern Chinese dictionary (zh_CN - zh_CN) 现代汉语词典(修正版) tarbal GPL, 3.2M, 57691 words 21 century bidirectional dictionary 21世纪英汉汉英双向词典 tarbal GPL, 13M, 213723 words quick_eng-zh_CN 英汉专业词典 tarball GPL, 10.7M, 634008 words 21 century bidirectional science and technology dictionary 21世纪双语科技词典 tarball GPL, 15M, 809486 words nc

4,465

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧