undefined reference to `s3c_dma_get_ops'

来源:互联网 发布:外汇 交易系统测试软件 编辑:程序博客网 时间:2024/05/01 18:49

出错记录如下:

sound/built-in.o: In function `__samsung_dma_get_ops':/home/anzyelay/Desktop/arm/linux-3.6.6-gcc.4.9.4/arch/arm/plat-samsung/include/plat/dma-ops.h:60: undefined reference to `s3c_dma_get_ops'sound/built-in.o: In function `s3c24xx_i2s_trigger':/home/anzyelay/Desktop/arm/linux-3.6.6-gcc.4.9.4/sound/soc/samsung/s3c24xx-i2s.c:291: undefined reference to `s3c2410_dma_ctrl'make: *** [vmlinux] Error 1

在移植内核蜂鸣器时配置好后出现上述现象
解决思路:
打开dma-ops.h文件如下:

extern void *samsung_dmadev_get_ops(void);extern void *s3c_dma_get_ops(void);static inline void *__samsung_dma_get_ops(void){    if (samsung_dma_is_dmadev())        return samsung_dmadev_get_ops();    else        return s3c_dma_get_ops();}

发现其是引用外部申明的 extern void *s3c_dma_get_ops(void);
samsung_dmadev_get_ops函数是一致的,应该不可能是函数定义有问题,同时我也在内核中找到了它的定义文件:
s3c-dma-ops.c

static struct samsung_dma_ops s3c_dma_ops = {    .request    = s3c_dma_request,    .release    = s3c_dma_release,    .config     = s3c_dma_config,    .prepare    = s3c_dma_prepare,    .trigger    = s3c_dma_trigger,    .started    = s3c_dma_started,    .flush      = s3c_dma_flush,    .stop       = s3c_dma_stop,};void *s3c_dma_get_ops(void){    return &s3c_dma_ops;}EXPORT_SYMBOL(s3c_dma_get_ops);

看到EXPORT_SYMBOL,立马怀疑是不是没有将这个文件加入编译,那应该是make menuconfig没有配置了,打开配置查找了下S3C_DMA,果然是
这里写图片描述

找到S3C24XX_DMA勾上就好了.重新再次编译正常了

0 0
原创粉丝点击