在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
芯片精品文章合集(500篇!)    创芯人才网--重磅上线啦!
查看: 3801|回复: 1

请教一个linux下pci驱动的问题

[复制链接]
发表于 2005-8-3 11:37:36 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
在写一个pci的驱动,需要用到中断INTA;
我把pci配置空间的寄存器Interrupt Pin设为1,在open函数中申请中断,成功,申请函数如下,des_interrupt是中断处理程序!

static int des_open(struct inode *inode, struct file *file)
{
  if(error = request_irq(card->irq, &des_interrupt, SA_SHIRQ, DES_NAME , card)) //SA_SHIRQ: Interrupt is shared
     return error;
  printk("The request_irq is OK, card->irq:%x\n", card->irq);
  。。。
}
中断处理函数为:
static void des_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
printk("enter into des_interrupt!\n");
card = (struct des_card *)dev_id;
u32 status;
//spin_lock(&card->lock);
           status = readl(card->iobase0 + ISR);
if(!(status & INT_MASK))
{
//    spin_unlock(&card->lock);
    printk("<0>it's not des interrupt!\n");
    return;  /* not for us */
}
writel(0x0, card->iobase0 + ISR);
printk("ISR=%8x\n", readl(card->iobase0 + ISR));
//spin_unlock(&card->lock);
card->readsize = card->readsize + DMABlockSize;
printk("leave des_interrupt!\n");
}

但发现中断产生时(我把中断引出来点亮led灯了,所以可以确定中断产生了) ,并不进入des_interrupt函数,请问问题出在哪里啊?thx
初来乍到,请牛牛们多多关照^_^
发表于 2010-2-11 09:57:39 | 显示全部楼层
关注中,我也遇到类似的问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-29 11:50 , Processed in 0.025622 second(s), 11 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表