嵌入式技术论坛
直播中

王志强

12年用户 13经验值
擅长:可编程逻辑 嵌入式技术
私信 关注
[问答]

内核模块编译出现的问题drivers/scsi/advansys.c:72:2: warning: #warn...

drivers/scsi/advansys.c:72:2: warning: #warning this driver is still not properly converted to the DMA API
drivers/scsi/advansys.c: In function 'advansys_get_sense_buffer_dma':
drivers/scsi/advansys.c:8376:2: error: implicit declaration of function 'dma_cache_sync'
make[2]: *** [drivers/scsi/advansys.o] 错误 1
make[1]: *** [drivers/scsi] 错误 2
make: *** [drivers] 错误 2

从网上也搜索到解决方法,但是找不到其中的asm文件夹,连接如下:
implicit declaration of function `dma_cache_sync'表示隐式声明错误,可能有几个原因:
1   没有把函数所在的c文件生成.o目标文件
2   在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明
reference:http://hi.baidu.com/caosicong/blog/item/17e3f8d6f4d1862a06088b79.html

查找archarmincludeasmdma-mapping.h下没有这个函数声明,但有如下注释:

/*
* Dummy noncoherent implementation.  We don't provide a dma_cache_sync
* function so drivers using this API are highlighted with build warnings.
*/

晕了,不用为什么还在程序里有这个函数?直接在advansys.c中把
dma_cache_sync(board->dev, scp->sense_buffer,
               SCSI_SENSE_BUFFERSIZE, DMA_FROM_DEVICE);
注释掉,编译就OK了,这个也算是bug了。上面注释说会是warning 但在我这边是error,                                                                                                                                    

已退回1积分

回帖(2)

那年我十七_

2014-9-27 11:19:05
在/usr/src/linux-2.6.30.4/include/linux/dma-mapping.h的最后endif之前添加
static inline void
dma_cache_sync(struct device *dev,void *vaddr,size_t size,
               enum dma_data_direction direction);
{
     BUG();   
}
举报

王志强

2014-9-27 16:25:53
引用: 那年我十七_ 发表于 2014-9-27 11:19
在/usr/src/linux-2.6.30.4/include/linux/dma-mapping.h的最后endif之前添加
static inline void
dma_cach ...

我是交叉编译用来产生ARM内核的,用的2.6.36,你给出的目录是系统目录吧?
举报

更多回帖

发帖
×
20
完善资料,
赚取积分