中断的问题请教

我在弄S3C2410的CS8900网卡驱动,中断用的是外部中断EINT9,我的中断向量表的设置如下:
const static struct startup_intrinfo intrs[] = {
{ _NTO_INTR_CLASS_EXTERNAL, // vector base
32, // number of vectors
_NTO_INTR_SPARE, // cascade vector
0, // CPU vector base
0, // CPU vector stride
0, // flags

{ INTR_GENFLAG_LOAD_SYSPAGE, 0, &interrupt_id_s3c2410 },
{ INTR_GENFLAG_LOAD_SYSPAGE | INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_s3c2410 },
&interrupt_mask_s3c2410, // mask callout
&interrupt_unmask_s3c2410, // unmask callout
0, // config callout
&s3c2410_int_base,
},
// EINT interrupt (4-7)
{ 32, // vector base
4, // number of vectors
4, // cascade vector
0, // CPU vector base
0, // CPU vector stride
0, // flags

{ 0, 0, &interrupt_id_s3c2410_ext_4_7 },
{ INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_s3c2410_ext_4_7 },
&interrupt_mask_s3c2410_ext_4_7, // mask callout
&interrupt_unmask_s3c2410_ext_4_7, // unmask callout
0, // config callout
&s3c2410_eint_base,
},
// EINT interrupt (8-23)
{ 36, // vector base
16, // number of vectors
5, // cascade vector
0, // CPU vector base
0, // CPU vector stride
0, // flags

{ 0, 0, &interrupt_id_s3c2410_ext_8_23 },
{ INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_s3c2410_ext_8_23 },
&interrupt_mask_s3c2410_ext_8_23, // mask callout
&interrupt_unmask_s3c2410_ext_8_23, // unmask callout
0, // config callout
&s3c2410_eint_base,
},
};
我加载网卡驱动的命令是:
io-net -dcrys8900 iorange=0x19000000,irq=37,mac=00e02991234e -ptcpip
加载以后,可以用ifconfig配置网卡,但是ping不通,不知道我的中断号设置的是不是对的,irq=37,请指点。

按你的设置,37应该是对的.

  1. 试试 iorange=0x19000300,0x300为cs8900缺省IO基地址.
  2. 检查一下外部中断callout

QNX在cstart.S中关闭了IRQ中断:
_start:
/*

  • Turn off interrupts and make sure we are in SVC mode
    */
    mrs lr, cpsr
    bic lr, lr, #0x1f
    orr lr, lr, #0xd3
    msr cpsr, lr
    那它又是在哪里把中断打开的呢?

InterruptAttachEvent()/InterruptAttach会调用interrupt_unmask callout.

系统中断在内核起来后回被打开.

我的板子EINT19上有一个按键,外接上拉电阻,我在startup中配置EINT19为下降沿触发,我的中断应用程序如下:
int interrupt_id;
struct sigevent event;

const struct sigevent *isr_handler (void *arg, int id)
{
InterruptMask(47, interrupt_id);//47 EINT19
InterruptUnmask(47, interrupt_id);
return (&event);
}

void *int_thread (void *arg)
{
ThreadCtl(_NTO_TCTL_IO, 0);
interrupt_id = InterruptAttach (47, isr_handler, NULL, 0, 0);
while(1)
{
InterruptWait(NULL, NULL);
printf(“Eint19 Interrupt\n”);
}
return NULL;
}

int main(int argc, char *argv[])
{
event.sigev_notify = SIGEV_INTR;
printf(“Welcome to the Momentics IDE\n”);

pthread_create(NULL, NULL, int_thread, NULL);
while(1);
return EXIT_SUCCESS;
}
结果是中断不响应,EINT0上也有一个这样的按键,把程序中相应的中断号改为0,就可以响应中断,中断向量表就是上面帖子的设置,请问如上所设置的中断向量表对不对,谢谢!

EINT19的设置是否正确?这只脚可为GPIO/外部中断源19/TCLK1.