当前位置: 技术问答>linux和unix
中断服务程序不能写HPIC
来源: 互联网 发布时间:2016-04-07
本文导语: void DSPClearHInt(unsigned int DSPx) //写HPIC清除中断 { char Status; char lowbyte; Status=DSPHostRead(DSPx,HPIC,FIRST); lowbyte=DSPHostRead(DSPx,HPIC,SECOND); printk (KERN_ALERT "high byte is %02x low byte is %02xn",Status,lowbyte ); DSPHostWrite(DSPx,(Status...
void DSPClearHInt(unsigned int DSPx) //写HPIC清除中断
{
char Status;
char lowbyte;
Status=DSPHostRead(DSPx,HPIC,FIRST);
lowbyte=DSPHostRead(DSPx,HPIC,SECOND);
printk (KERN_ALERT "high byte is %02x low byte is %02xn",Status,lowbyte );
DSPHostWrite(DSPx,(Status|CLEAR_HINT),HPIC,FIRST);
DSPHostWrite(DSPx,(Status|CLEAR_HINT),HPIC,SECOND);
}
static irqreturn_t dsp5416_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long flag=0;
int i;
local_irq_save(flag);
DSPClearHInt(dev->dspx); //写HPIC清除中断
printk( "interrupt number is %dn",irq);
local_irq_restore(flag);
return IRQ_HANDLED;
}
我是arm9200,linux2.6.13,与dsp5416连接的是外部中断IRQ3,中断号28
问题1:我在中断服务函数中清HPIC,也就是dsp的中断标志,清除不掉,但是我在write方法中调用DSPClearHInt(dev->dspx);就可以清除中断,为什么?
问题2:我在open中request_irq,在release中free_irq。为什么每次open会有一次中断?即使dsp不产生中断
|
关于问题2: 你的dsp中断 没有一个中断控制寄存器来控制是不是要触发中断--也就是中断使能?