pc, pc64, xen: change return type of intrdisable() to void

intrdisable() will always be able to unregister the interrupt
now, so there is no reason to have it return an error value.

all drivers except uart8250 already assumed it to never fail
and theres no need to maintain that complexity.
This commit is contained in:
cinap_lenrek 2014-12-22 16:56:04 +01:00
parent c404fd9d6f
commit 3ab80c9fe0
7 changed files with 19 additions and 30 deletions

View file

@ -83,7 +83,7 @@ ushort ins(int);
void inss(int, void*, int);
ulong inl(int);
void insl(int, void*, int);
int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
void introff(void);
void intron(void);

View file

@ -76,7 +76,7 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
iunlock(&vctllock);
}
int
void
intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
{
Vctl **pv, *v;
@ -116,7 +116,6 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
break;
}
iunlock(&vctllock);
return 0;
}
static long

View file

@ -542,8 +542,8 @@ i8250disable(Uart* uart)
csr8w(ctlr, Ier, ctlr->sticky[Ier]);
if(ctlr->iena != 0){
if(intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name) == 0)
ctlr->iena = 0;
ctlr->iena = 0;
intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name);
}
}

View file

@ -74,7 +74,7 @@ ushort ins(int);
void inss(int, void*, int);
ulong inl(int);
void insl(int, void*, int);
int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
void introff(void);
void intron(void);

View file

@ -76,7 +76,7 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
iunlock(&vctllock);
}
int
void
intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
{
Vctl **pv, *v;
@ -116,7 +116,6 @@ intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
break;
}
iunlock(&vctllock);
return 0;
}
static long

View file

@ -54,7 +54,7 @@ ushort ins(int);
void inss(int, void*, int);
ulong inl(int);
void insl(int, void*, int);
int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
int ioalloc(int, int, int, char*);
void ioinit(void);

View file

@ -90,36 +90,27 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name)
iunlock(&vctllock);
}
int
void
intrdisable(int irq, void (*f)(Ureg *, void *), void *a, int tbdf, char *name)
{
Vctl **pv, *v;
int vno;
/*
* For now, none of this will work with the APIC code,
* there is no mapping between irq and vector as the IRQ
* is pretty meaningless.
*/
if(arch->intrvecno == nil)
return -1;
vno = arch->intrvecno(irq);
ilock(&vctllock);
pv = &vctl[vno];
while (*pv &&
((*pv)->irq != irq || (*pv)->tbdf != tbdf || (*pv)->f != f || (*pv)->a != a ||
strcmp((*pv)->name, name)))
pv = &((*pv)->next);
assert(*pv);
for(pv = &vctl[vno]; (v = *pv) != nil; pv = &v->next){
if(v->isintr && v->irq == irq
&& v->tbdf == tbdf && v->f == f && v->a == a
&& strcmp(v->name, name) == 0){
*pv = v->next;
xfree(v);
v = *pv;
*pv = (*pv)->next; /* Link out the entry */
if(vctl[vno] == nil && arch->intrdisable != nil)
arch->intrdisable(irq);
if(vctl[vno] == nil && arch->intrdisable != nil)
arch->intrdisable(irq);
break;
}
}
iunlock(&vctllock);
xfree(v);
return 0;
}
static long