当前位置: 技术问答>linux和unix
2.6内核下定时器中断问题
来源: 互联网 发布时间:2016-04-27
本文导语: 功能:用定时器中断 使LED每隔1s闪烁 问题:加载驱动后能够进入中断函数 但是总是出现下面的错误 请问是什么原因呢?? timer0 interrupt 10 test OK! irq26: nobody cared PC is at default_idle+0x48/0x50 LR is at default_idle...
功能:用定时器中断 使LED每隔1s闪烁
问题:加载驱动后能够进入中断函数 但是总是出现下面的错误 请问是什么原因呢??
timer0 interrupt 10 test OK!
irq26: nobody cared
PC is at default_idle+0x48/0x50
LR is at default_idle+0x3c/0x50
pc : [] lr : [] Not tainted
sp : c0239fb0 ip : c0239fb0 fp : c0239fbc
r10: 3001acf8 r9 : 41129200 r8 : c023aed8
r7 : c027d4dc r6 : c023b1a8 r5 : c0238000 r4 : c002cbcc
r3 : 60000013 r2 : f0e00014 r1 : 00000000 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: C000717F Table: 32568000 DAC: 0000001D
handlers:
[] (leds_interrupt+0x0/0x100 [led])
问题:加载驱动后能够进入中断函数 但是总是出现下面的错误 请问是什么原因呢??
timer0 interrupt 10 test OK!
irq26: nobody cared
PC is at default_idle+0x48/0x50
LR is at default_idle+0x3c/0x50
pc : [] lr : [] Not tainted
sp : c0239fb0 ip : c0239fb0 fp : c0239fbc
r10: 3001acf8 r9 : 41129200 r8 : c023aed8
r7 : c027d4dc r6 : c023b1a8 r5 : c0238000 r4 : c002cbcc
r3 : 60000013 r2 : f0e00014 r1 : 00000000 r0 : 00000000
Flags: nZCv IRQs on FIQs on Mode SVC_32 Segment kernel
Control: C000717F Table: 32568000 DAC: 0000001D
handlers:
[] (leds_interrupt+0x0/0x100 [led])
|
有可能是指向了非法地址:在下面的代码上加入一些显示信息看看在哪个地方出错:
static void leds_interrupt(int irq,void *dev_id,struct pt_regs *regs)
{
outl(0x00000400,S3C2410_SRCPND);
outl(0xffffffff,S3C2410_INTMSK);
outl(0x00000000,S3C2410_PRIORITY);
outl(0x00000400,S3C2410_INTPND);
disable_irq(IRQ_TIMER0);
flag++;
printk("timer0 interrupt %d test OK!n",flag);
if(sign==0)
{
printk("sign==0n");
outl(0x7fffff,S3C2410_GPADAT);
sign=1;
}
else
printk("sign!=0n");
{outl(0x7ecfff,S3C2410_GPADAT);
sign=0;
}
if(flag
static void leds_interrupt(int irq,void *dev_id,struct pt_regs *regs)
{
outl(0x00000400,S3C2410_SRCPND);
outl(0xffffffff,S3C2410_INTMSK);
outl(0x00000000,S3C2410_PRIORITY);
outl(0x00000400,S3C2410_INTPND);
disable_irq(IRQ_TIMER0);
flag++;
printk("timer0 interrupt %d test OK!n",flag);
if(sign==0)
{
printk("sign==0n");
outl(0x7fffff,S3C2410_GPADAT);
sign=1;
}
else
printk("sign!=0n");
{outl(0x7ecfff,S3C2410_GPADAT);
sign=0;
}
if(flag