version 1.2, 2007/11/04 23:18:46 |
version 1.3, 2007/12/16 23:24:59 |
|
|
/* |
/* |
* Add interrupt vector to irqtable. |
* Add interrupt vector to irqtable. |
*/ |
*/ |
struct intr_vector *ivp; |
struct intr_vector *ivp, *previvp; |
|
|
ivp = irqtable; |
ivp = irqtable; |
|
|
|
|
} |
} |
else { |
else { |
/* walk through the list */ |
/* walk through the list */ |
do { |
while(ivp->iv_next != NULL) { |
/* check if this interrupt line already binded */ |
|
if (ivp->iv_intrno == intrno) |
if (ivp->iv_intrno == intrno) |
panic("failed to establish interrupt (intrno %d already set by other device)\n", intrno); |
panic("failed to establish interrupt (intrno %d already set by other device)\n", intrno); |
|
|
/* become next element */ |
|
ivp = ivp->iv_next; |
ivp = ivp->iv_next; |
} while(ivp != NULL); |
} |
|
/* found last entry */ |
|
previvp = ivp; |
|
ivp = ivp->iv_next; |
|
|
/* allocate space */ |
/* allocate space */ |
ivp = kmalloc(sizeof(struct intr_vector)); |
ivp = kmalloc(sizeof(struct intr_vector)); |
|
|
ivp->iv_device = device; |
ivp->iv_device = device; |
ivp->iv_intrfunc = intrfunc; |
ivp->iv_intrfunc = intrfunc; |
ivp->iv_next = NULL; |
ivp->iv_next = NULL; |
|
|
|
/* link previous entry */ |
|
previvp->iv_next = ivp; |
} |
} |
|
|
} |
} |