bcm: intrenable() can happen from any cpu in case of dma interrupts
This commit is contained in:
parent
b7aedbb366
commit
85afec4c2f
1 changed files with 8 additions and 5 deletions
|
@ -177,17 +177,20 @@ irqenable(int irq, void (*f)(Ureg*, void*), void* a)
|
||||||
Vctl *v;
|
Vctl *v;
|
||||||
Intregs *ip;
|
Intregs *ip;
|
||||||
u32int *enable;
|
u32int *enable;
|
||||||
|
int cpu;
|
||||||
|
|
||||||
ip = (Intregs*)INTREGS;
|
ip = (Intregs*)INTREGS;
|
||||||
if((v = xalloc(sizeof(Vctl))) == nil)
|
if((v = xalloc(sizeof(Vctl))) == nil)
|
||||||
panic("irqenable: no mem");
|
panic("irqenable: no mem");
|
||||||
|
cpu = 0;
|
||||||
v->irq = irq;
|
v->irq = irq;
|
||||||
if(irq >= IRQlocal){
|
if(irq >= IRQlocal){
|
||||||
v->reg = (u32int*)(ARMLOCAL + Localintpending) + m->machno;
|
cpu = m->machno;
|
||||||
|
v->reg = (u32int*)(ARMLOCAL + Localintpending) + cpu;
|
||||||
if(irq >= IRQmbox0)
|
if(irq >= IRQmbox0)
|
||||||
enable = (u32int*)(ARMLOCAL + Localmboxint) + m->machno;
|
enable = (u32int*)(ARMLOCAL + Localmboxint) + cpu;
|
||||||
else
|
else
|
||||||
enable = (u32int*)(ARMLOCAL + Localtimerint) + m->machno;
|
enable = (u32int*)(ARMLOCAL + Localtimerint) + cpu;
|
||||||
v->mask = 1 << (irq - IRQlocal);
|
v->mask = 1 << (irq - IRQlocal);
|
||||||
}else if(irq >= IRQbasic){
|
}else if(irq >= IRQbasic){
|
||||||
enable = &ip->ARMenable;
|
enable = &ip->ARMenable;
|
||||||
|
@ -207,8 +210,8 @@ irqenable(int irq, void (*f)(Ureg*, void*), void* a)
|
||||||
vfiq = v;
|
vfiq = v;
|
||||||
ip->FIQctl = Fiqenable | irq;
|
ip->FIQctl = Fiqenable | irq;
|
||||||
}else{
|
}else{
|
||||||
v->next = vctl[m->machno];
|
v->next = vctl[cpu];
|
||||||
vctl[m->machno] = v;
|
vctl[cpu] = v;
|
||||||
if(irq >= IRQmbox0){
|
if(irq >= IRQmbox0){
|
||||||
if(irq <= IRQmbox3)
|
if(irq <= IRQmbox3)
|
||||||
*enable |= 1 << (irq - IRQmbox0);
|
*enable |= 1 << (irq - IRQmbox0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue