编译 musb module

修改了Kconfig 和Makefile文件,要编译musb module模块,但编译的结果是:系统提示这样的错误:

drivers/usb/musb/musb_io.h: In function ‘readsl’:
drivers/usb/musb/musb_io.h:44: error: implicit declaration of function ‘insl’
drivers/usb/musb/musb_io.h: In function ‘readsw’:
drivers/usb/musb/musb_io.h:46: error: implicit declaration of function ‘insw’
drivers/usb/musb/musb_io.h: In function ‘readsb’:
drivers/usb/musb/musb_io.h:48: error: implicit declaration of function ‘insb’
drivers/usb/musb/musb_io.h: In function ‘writesl’:
drivers/usb/musb/musb_io.h:51: error: implicit declaration of function ‘outsl’
drivers/usb/musb/musb_io.h: In function ‘writesw’:
drivers/usb/musb/musb_io.h:53: error: implicit declaration of function ‘outsw’
drivers/usb/musb/musb_io.h: In function ‘writesb’:
drivers/usb/musb/musb_io.h:55: error: implicit declaration of function ‘outsb’

google了半天也没有解决问题,没办法了,打开musb_io.h看个究竟吧。

看的结果是:在readsl()函数中调用里insl(),但musb_io.h中没有insl()函数的定义,那就去它包含的头文件中看看。其中include<asm/io.h>比较有希望吧,打开/include/asm其中并没有什么io.h文件。这io.h文件在哪呢?去google上找找,最终在/arch/ba/include/asm中找到了io.h(我们用的平台是ba).在其中找了一下,没有发现insl等函数的定义。what should i do?去arm下看看,发现它的io.h中有这些函数的定义,关它三七二十一呢,先把让他编译过里再说,就模仿arm的做法在io.h加入了下面的语句:

 

#define __raw_readsb(p, d, l) do{*(int *)0 = 0;}while(0)
#define __raw_readsw(p, d, l) do{*(int *)0 = 0;}while(0)
#define __raw_readsl(p, d, l) do{*(int *)0 = 0;}while(0)
#define __raw_writesb(p, d, l) do{*(int *)0 = 0;}while(0)
#define __raw_writesw(p, d, l) do{*(int *)0 = 0;}while(0)
#define __raw_writesl(p, d, l) do{*(int *)0 = 0;}while(0)

#define __io(p)    0

#define outsb(p, d, l)    __raw_writesb(__io(p), d, 1)
#define outsw(p, d, l)  __raw_writesw(__io(p), d, 1)
#define outsl(p, d, l)  __raw_writesl(__io(p), d, 1)
#define insb(p, d, l)   __raw_readsb(__io(p), d, 1)
#define insw(p, d, l)   __raw_readsw(__io(p), d, 1)
#define insl(p, d, l)   __raw_readsl(__io(p), d, 1)

 

保存,再次make modules。OK编译过了,也生成了musb下的.o文件,但不知道是不是我想要的。因为修改Kconfig,Makefile都是瞎摸索的,也不知道修改的是否有道理,是否对,就一个目的,能musb驱动在可配置选项中,且能编译过。

 

到目前为止,好像目的达到了,但心里没底呀,下步该怎么做呢?

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值