| plan 9 kernel history: overview | file list | diff list |
1993/0217/pc/trap.c (diff list | history)
| 1993/0216/sys/src/9/pc/trap.c:32,37 – 1993/0217/sys/src/9/pc/trap.c:32,39 (short | long | prev | next) | ||
| 1991/0709 | Int1aux= 0xA1, /* everything else (ICW2, ICW3, ICW4, OCW1) */ EOI= 0x20, /* non-specific end of interrupt */ | |
| 1993/0217 | Maxhandler= 128, /* max number of interrupt handlers */ | |
| 1991/0709 | }; | |
| 1991/1001 | int int0mask = 0xff; /* interrupts enabled for first 8259 */ | |
| 1993/0216/sys/src/9/pc/trap.c:41,48 – 1993/0217/sys/src/9/pc/trap.c:43,64 | ||
| 1991/0614 | * trap/interrupt gates | |
| 1991/0613 | */ | |
| 1991/0703 | Segdesc ilt[256]; | |
| 1993/0217 | typedef struct Handler Handler; struct Handler { void (*r)(void*); Handler *next; }; struct { Lock; Handler *ivec[256]; Handler h[Maxhandler]; int free; } halloc; | |
| 1991/0703 | void | |
| 1991/0710 | sethvec(int v, void (*r)(void), int type, int pri) | |
| 1991/0613 | { | |
| 1993/0216/sys/src/9/pc/trap.c:53,60 – 1993/0217/sys/src/9/pc/trap.c:69,85 | ||
| 1991/0703 | void | |
| 1991/0716 | setvec(int v, void (*r)(Ureg*)) | |
| 1991/0703 | { | |
| 1993/0217 | Handler *h; | |
| 1991/0709 | ||
| 1993/0217 | lock(&halloc); if(halloc.free >= Maxhandler) panic("out of interrupt handlers"); h = &halloc.h[halloc.free++]; h->next = halloc.ivec[v]; h->r = r; halloc.ivec[v] = h; unlock(&halloc); | |
| 1991/0709 | /* * enable corresponding interrupt in 8259 */ | |
| 1993/0216/sys/src/9/pc/trap.c:201,206 – 1993/0217/sys/src/9/pc/trap.c:226,232 | ||
| 1991/1112 | int v, user; | |
| 1991/0731 | int c; | |
| 1991/1113 | char buf[ERRLEN]; | |
| 1993/0217 | Handler *h; | |
| 1991/0703 | ||
| 1991/0731 | v = ur->trap; | |
| 1993/0216/sys/src/9/pc/trap.c:222,228 – 1993/0217/sys/src/9/pc/trap.c:248,254 | ||
| 1991/0823 | uartintr0(ur); | |
| 1991/1113 | } | |
| 1993/0217 | if(v>=256 || (h = halloc.ivec[v]) == 0){ | |
| 1991/1214 | if(v == 13) return; | |
| 1991/1113 | if(v <= 16){ | |
| 1993/0216/sys/src/9/pc/trap.c:239,245 – 1993/0217/sys/src/9/pc/trap.c:265,274 | ||
| 1992/0918 | return; | |
| 1991/0731 | } | |
| 1991/0801 |
| |
| 1993/0217 | do { (*h->r)(ur); h = h->next; } while(h); | |
| 1991/0910 | ||
| 1991/0913 | /* | |
| 1992/0108 | * check user since syscall does its own notifying | |