summaryrefslogtreecommitdiff
path: root/sys/src/9/xen
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-12-22 16:56:04 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-12-22 16:56:04 +0100
commit3ab80c9fe0fe4cfe91c0b6004db986f2e72bf5e6 (patch)
treef7f8fbbf694687f54a629dcc46158b55a30f239a /sys/src/9/xen
parentc404fd9d6f46f90e4420d0b268215ef719e25796 (diff)
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.
Diffstat (limited to 'sys/src/9/xen')
-rw-r--r--sys/src/9/xen/fns.h2
-rw-r--r--sys/src/9/xen/trap.c35
2 files changed, 14 insertions, 23 deletions
diff --git a/sys/src/9/xen/fns.h b/sys/src/9/xen/fns.h
index 71e64ac4c..5b39cfddb 100644
--- a/sys/src/9/xen/fns.h
+++ b/sys/src/9/xen/fns.h
@@ -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);
diff --git a/sys/src/9/xen/trap.c b/sys/src/9/xen/trap.c
index 9d572577b..a81182a8b 100644
--- a/sys/src/9/xen/trap.c
+++ b/sys/src/9/xen/trap.c
@@ -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);
-
- v = *pv;
- *pv = (*pv)->next; /* Link out the entry */
-
- if(vctl[vno] == nil && arch->intrdisable != nil)
- arch->intrdisable(irq);
+ 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);
+
+ if(vctl[vno] == nil && arch->intrdisable != nil)
+ arch->intrdisable(irq);
+ break;
+ }
+ }
iunlock(&vctllock);
- xfree(v);
- return 0;
}
static long