| plan 9 kernel history: overview | file list | diff list |
1993/1124/pc/trap.c (diff list | history)
| 1993/1116/sys/src/9/pc/trap.c:48,54 – 1993/1124/sys/src/9/pc/trap.c:48,55 (short | long | prev | next) | ||
| 1993/0217 | typedef struct Handler Handler; struct Handler { | |
| 1993/1124 | void (*r)(Ureg*, void*); void *arg; | |
| 1993/0217 | Handler *next; }; | |
| 1993/1116/sys/src/9/pc/trap.c:68,74 – 1993/1124/sys/src/9/pc/trap.c:69,75 | ||
| 1991/0703 | } | |
| 1991/0614 | ||
| 1991/0703 | void | |
| 1991/0716 |
| |
| 1993/1124 | setvec(int v, void (*r)(Ureg*, void*), void *arg) | |
| 1991/0703 | { | |
| 1993/0217 | Handler *h; | |
| 1991/0709 | ||
| 1993/1116/sys/src/9/pc/trap.c:78,83 – 1993/1124/sys/src/9/pc/trap.c:79,85 | ||
| 1993/0217 | h = &halloc.h[halloc.free++]; h->next = halloc.ivec[v]; h->r = r; | |
| 1993/1124 | h->arg = arg; | |
| 1993/0217 | halloc.ivec[v] = h; unlock(&halloc); | |
| 1993/1116/sys/src/9/pc/trap.c:94,103 – 1993/1124/sys/src/9/pc/trap.c:96,107 | ||
| 1991/0703 | } | |
| 1991/1112 | void | |
| 1993/1124 | debugbpt(Ureg *ur, void *arg) | |
| 1991/1112 | { char buf[ERRLEN]; | |
| 1993/1124 | USED(arg); | |
| 1993/0915 | if(up == 0) | |
| 1991/1112 | panic("kernel bpt"); /* restore pc to instruction that caused the trap */ | |
| 1993/1116/sys/src/9/pc/trap.c:164,172 – 1993/1124/sys/src/9/pc/trap.c:168,176 | ||
| 1991/1214 | * system calls and break points | |
| 1991/0710 | */ | |
| 1993/1114 | sethvec(Syscallvec, intr64, SEGIG, 3); | |
| 1991/0910 |
| |
| 1993/1124 | setvec(Syscallvec, syscall, 0); | |
| 1993/1114 | sethvec(Bptvec, intr3, SEGIG, 3); | |
| 1991/1112 |
| |
| 1993/1124 | setvec(Bptvec, debugbpt, 0); | |
| 1991/0710 | /* | |
| 1991/0703 | * tell the hardware where the table is (and how long) | |
| 1993/1116/sys/src/9/pc/trap.c:223,229 – 1993/1124/sys/src/9/pc/trap.c:227,233 | ||
| 1993/0915 | ||
| 1991/0614 | /* | |
| 1993/1115 |
| |
| 1993/1124 | * All traps come here. It is slower to have all traps call trap() rather than | |
| 1993/1115 | * directly vectoring the handler. However, this avoids a lot of code duplication * and possible bugs. | |
| 1991/0614 | */ | |
| 1993/1116/sys/src/9/pc/trap.c:295,301 – 1993/1124/sys/src/9/pc/trap.c:299,305 | ||
| 1991/0801 | ||
| 1993/0224 | /* there may be multiple handlers on one interrupt level */ | |
| 1993/0217 | do { | |
| 1993/1124 | (*h->r)(ur, h->arg); | |
| 1993/0217 | h = h->next; } while(h); | |
| 1991/0910 | ||
| 1993/1116/sys/src/9/pc/trap.c:387,399 – 1993/1124/sys/src/9/pc/trap.c:391,405 | ||
| 1992/0103 | /* * syscall is called spllo() */ | |
| 1991/0710 |
| |
| 1993/1124 | void syscall(Ureg *ur, void *arg) | |
| 1991/0710 | { | |
| 1991/0720 | ulong sp; long ret; int i; | |
| 1993/1124 | USED(arg); | |
| 1993/0915 | up->insyscall = 1; up->pc = ur->pc; | |
| 1991/0720 | if((ur->cs)&0xffff == KESEL) | |
| 1993/1116/sys/src/9/pc/trap.c:455,462 – 1993/1124/sys/src/9/pc/trap.c:461,466 | ||
| 1992/0103 | splhi(); /* avoid interrupts during the iret */ | |
| 1993/0915 | if(up->scallnr!=RFORK && (up->procctl || up->nnote)) | |
| 1991/0720 | notify(ur); | |
| 1992/0804 | ||
| 1991/0720 |
| |
| 1991/0710 | } | |
| 1991/0720 | /* | |