QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3153|回复: 1

问题:有关申请irq问题

[复制链接]
发表于 2008-5-9 21:44:04 | 显示全部楼层 |阅读模式
编译驱动遇到的问题
在代码中有包含以下头文件:
#include <asm/irq.h>
#include <linux/interrupt.h>
#include <asm-arm/arch-s3c2410/irqs.h>
#include <linux/irq.h>


相关代码:  
set_external_irq(HPI_INT,EXT_LOWLEVEL,GPIO_PULLUP_DIS);
if(0!=request_irq(HPI_INT,&hpi_interrupt,SA_SHIRQ,"hpi",hpi_dev)){
        printk("hpi request_irq failed...");
        goto fail_request_irq;

为什么编译的时候还会出现如下问题:
337: error: implicit declaration of function ‘set_external_irq’
337: error: ‘EXT_LOWLEVEL’ undeclared (first use in this function)
337: error: (Each undeclared identifier is reported only once
337: error: for each function it appears in.)
337: error: ‘GPIO_PULLUP_DIS’ undeclared (first use in this function)
338: error: ‘SA_SHIRQ’ undeclared (first use in this function)
338: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type


还有
unsigned char a1,a2;
outb(a1,hpi_dev->hpi_vbase+0x1c);
outb(a2,hpi_dev->hpi_vbase+0x1e);

会出现如下警告:
warning: passing argument 2 of ‘outb’ makes integer from pointer without a cast

希望各位大牛能帮帮忙哈,感激不尽
发表于 2008-5-14 15:27:50 | 显示全部楼层
set_external_irq 不是kernel标准函数,你需要在其他文件里面找。
其他错误也一样。

SA_SHIRQ 已经不支持了,用 IRQF_SHARED

GenIRQ 被 merge 以后,中断处理函数不需要接受 struct pt_regs *
作为参数了,所以 hpi_interrupt 要修改

outb() 第二个参数是指针,检查 hpi_dev->hpi_vbase 的类型!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-29 22:52 , Processed in 0.147776 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表