打印
[嵌入式linux]

linux找不到mach/regs-gpio.h

[复制链接]
1608|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
leifukes|  楼主 | 2014-3-12 15:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我把TQ2440开发板的linux源代码放到了虚拟机上面,用的是redhat 4 企业版,并且把EABI编译器安装上了,编译内核的时候没有问题,能生成zImage,可我编写驱动程序的时候,linux/下的文件都能找到,比如 #include <linux/fs.h>,但是mach下的却找不到,#include <mach/regs-gpio.h> 就会出现 No directory。。。。,但是涉及硬件必须要用啊,郁闷,我想知道,编译器是怎么寻找头文件的,这种情况到底是怎么回事,一概不知啊,恳请哪路大神帮小弟一把!


Makefile的内容



ifneq ($(KERNELRELEASE),)
        obj-m :=EmbedSky_gpio.o
ARCH =arm
CROSS_COMPILE =arm-linux-
else
        KERNELDIR =/opt/EmbedSky/linux-2.6.30.4/
        #KERNELDIR=/lib/modules/$(shell uname -r)/build
        #KERNELDIR=/usr/src/kernels/2.6.21-1.3194.fc7-i686
        PWD := $(shell pwd)
default:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c
endif




结果:

[root@vm-dev led]# make
make -C /opt/EmbedSky/linux-2.6.30.4/ M=/lifuxing/led modules
make[1]: Entering directory `/opt/EmbedSky/linux-2.6.30.4'
  CC [M]  /lifuxing/led/EmbedSky_gpio.o
/led/EmbedSky_gpio.c:11:28: error: mach/regs-gpio.h: No such file or directory
/led/EmbedSky_gpio.c:42: error: 'S3C2410_GPB5' undeclared here (not in a function)
/led/EmbedSky_gpio.c:43: error: 'S3C2410_GPB6' undeclared here (not in a function)
/led/EmbedSky_gpio.c:44: error: 'S3C2410_GPB7' undeclared here (not in a function)
/led/EmbedSky_gpio.c:45: error: 'S3C2410_GPB8' undeclared here (not in a function)
/led/EmbedSky_gpio.c:51: error: 'S3C2410_GPB5_OUTP' undeclared here (not in a function)
/led/EmbedSky_gpio.c:51: error: initializer element is not constant
/led/EmbedSky_gpio.c:51: error: (near initialization for 'gpio_cfg_table[0]')
/led/EmbedSky_gpio.c:52: error: 'S3C2410_GPB6_OUTP' undeclared here (not in a function)
/led/EmbedSky_gpio.c:52: error: initializer element is not constant
/led/EmbedSky_gpio.c:52: error: (near initialization for 'gpio_cfg_table[1]')
/led/EmbedSky_gpio.c:53: error: 'S3C2410_GPB7_OUTP' undeclared here (not in a function)
/led/EmbedSky_gpio.c:53: error: initializer element is not constant
/led/EmbedSky_gpio.c:53: error: (near initialization for 'gpio_cfg_table[2]')
/led/EmbedSky_gpio.c:54: error: 'S3C2410_GPB8_OUTP' undeclared here (not in a function)
/led/EmbedSky_gpio.c:54: error: initializer element is not constant
/led/EmbedSky_gpio.c:54: error: (near initialization for 'gpio_cfg_table[3]')
/led/EmbedSky_gpio.c: In function 'tq2440_gpio_ioctl':
/led/EmbedSky_gpio.c:72: error: implicit declaration of function 's3c2410_gpio_setpin'
/led/EmbedSky_gpio.c: In function 'dev_init':
/led/EmbedSky_gpio.c:104: error: implicit declaration of function 's3c2410_gpio_cfgpin'
make[2]: *** [/led/EmbedSky_gpio.o] 错误 1
make[1]: *** [_module_/led] 错误 2
make[1]: Leaving directory `/opt/EmbedSky/linux-2.6.30.4'
make: *** [default] 错误 2
[root@vm-dev led]#                                            








相关帖子

沙发
leifukes|  楼主 | 2014-3-12 16:50 | 只看该作者
我把这个文件单独放到所在驱动的目录下,依然不好使。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

24

主题

46

帖子

0

粉丝