--- /sys/man/3/arch +++ /sys/man/3/arch @@ -114,9 +114,9 @@ last address, name of device. Reads from .I irqalloc return the enabled interrupts, one line per -interrupt. Each line contains three fields separated by white space: -the trap number, the IRQ it is assigned to, and the name of -the device using it. +interrupt. Each line contains four fields separated by white space: +the trap number, the IRQ it is assigned to, the type of interrupt, +and the name of the device using it. .PP Reads and writes to .IR iob , --- /sys/src/9k/k10/i8259.c +++ /sys/src/9k/k10/i8259.c @@ -195,6 +195,7 @@ i8259irqenable(Vctl* v) v->isr = i8259isr; iunlock(&i8259lock); + v->type = "8259"; return IdtPIC+irq; } --- /sys/src/9k/k10/io.h +++ /sys/src/9k/k10/io.h @@ -41,6 +41,7 @@ typedef struct Vctl { void* a; /* argument to call it with */ int tbdf; char name[KNAMELEN]; /* of driver */ + char *type; int (*isr)(int); /* get isr bit for this irq */ int (*eoi)(int); /* eoi */ --- /sys/src/9k/k10/ioapic.c +++ /sys/src/9k/k10/ioapic.c @@ -297,6 +297,7 @@ ioapicintrenable(Vctl* v) if(v->irq >= IdtLINT0 && v->irq <= IdtSPURIOUS){ if(v->irq != IdtSPURIOUS) v->isr = apiceoi; + v->type = "lapic"; return v->irq; } else{ @@ -402,6 +403,7 @@ ioapicintrenable(Vctl* v) v->isr = apicisr; v->eoi = apiceoi; v->vno = vecno; + v->type = "ioapic"; return vecno; } --- /sys/src/9k/k10/trap.c +++ /sys/src/9k/k10/trap.c @@ -105,7 +105,7 @@ intrdisable(void* vector) static long irqallocread(Chan*, void *vbuf, long n, vlong offset) { - char *buf, *p, str[2*(11+1)+KNAMELEN+1+1]; + char *buf, *p, str[2*(11+1)+(8+1)+KNAMELEN+1+1]; int ns, vno; long oldn; Vctl *v; @@ -117,7 +117,8 @@ irqallocread(Chan*, void *vbuf, long n, vlong offset) buf = vbuf; for(vno=0; vnonext){ - ns = snprint(str, sizeof str, "%11d %11d %.*s\n", vno, v->irq, KNAMELEN, v->name); + ns = snprint(str, sizeof str, "%11d %11d %-*.*s %.*s\n", + vno, v->irq, 8, 8, v->type, KNAMELEN, v->name); if(ns <= offset) /* if do not want this, skip entry */ offset -= ns; else{ @@ -149,6 +150,7 @@ trapenable(int vno, void (*f)(Ureg*, void*), void* a, char *name) if(vno < 0 || vno >= 256) panic("trapenable: vno %d", vno); v = malloc(sizeof(Vctl)); + v->type = "trap"; v->tbdf = BUSUNKNOWN; v->f = f; v->a = a;