| plan 9 kernel history: overview | file list | diff list |
1991/1112/pc/trap.c (diff list | history)
| 1991/1005/sys/src/9/pc/trap.c:68,73 – 1991/1112/sys/src/9/pc/trap.c:68,86 (short | long | prev | next) | ||
| 1991/0709 | } | |
| 1991/0703 | } | |
| 1991/1112 | void debugbpt(Ureg *ur) { char buf[ERRLEN]; if(u == 0) panic("kernel bpt"); /* restore pc to instruction that caused the trap */ ur->pc--; sprint(buf, "sys: breakpoint pc=0x%lux", ur->pc); postnote(u->p, 1, buf, NDebug); } | |
| 1991/0614 | /* | |
| 1991/0703 | * set up the interrupt/trap gates | |
| 1991/0614 | */ | |
| 1991/1005/sys/src/9/pc/trap.c:88,94 – 1991/1112/sys/src/9/pc/trap.c:101,106 | ||
| 1991/0823 | sethvec(0, intr0, SEGTG, 0); sethvec(1, intr1, SEGTG, 0); sethvec(2, intr2, SEGTG, 0); | |
| 1991/1005/sys/src/9/pc/trap.c:128,133 – 1991/1112/sys/src/9/pc/trap.c:140,147 | ||
| 1991/0710 | */ | |
| 1991/0910 | sethvec(Syscallvec, intr64, SEGTG, 3); setvec(Syscallvec, (void (*)(Ureg*))syscall); | |
| 1991/1112 | sethvec(Bptvec, intr3, SEGTG, 3); setvec(Bptvec, debugbpt); | |
| 1991/0710 | /* | |
| 1991/0703 | * tell the hardware where the table is (and how long) | |
| 1991/1005/sys/src/9/pc/trap.c:171,189 – 1991/1112/sys/src/9/pc/trap.c:185,203 | ||
| 1991/0710 | void | |
| 1991/0703 | trap(Ureg *ur) | |
| 1991/0614 | { | |
| 1991/0731 |
| |
| 1991/1112 | int v, user; | |
| 1991/0731 | int c; | |
| 1991/1005 | static int spuriousfloppy; | |
| 1991/0703 | ||
| 1991/0731 | v = ur->trap; | |
| 1991/0807 |
| |
| 1991/1005 |
| |
| 1991/0807 |
| |
| 1991/0731 | ||
| 1991/1112 | user = ((ur->cs)&0xffff)!=KESEL && v!=Syscallvec; if(user) u->dbgreg = ur; if(v>=256 || ivec[v] == 0) panic("bad trap type %d %lux %lux %lux\n", v, ur->pc, int0mask, int1mask); | |
| 1991/0709 | /* * tell the 8259 that we're done with the | |
| 1991/0801 | * highest level interrupt (interrupts are still | |
| 1991/1005/sys/src/9/pc/trap.c:203,209 – 1991/1112/sys/src/9/pc/trap.c:217,223 | ||
| 1991/0913 | /* * syscall does it's own notifying */ | |
| 1991/0910 |
| |
| 1991/1112 | if(user) | |
| 1991/0910 | notify(ur); | |
| 1991/0806 | } | |
| 1991/1005/sys/src/9/pc/trap.c:273,278 – 1991/1112/sys/src/9/pc/trap.c:287,293 | ||
| 1991/0720 | ||
| 1991/0718 | u->p->insyscall = 1; u->p->pc = ur->pc; | |
| 1991/1112 | u->dbgreg = ur; | |
| 1991/0720 | if((ur->cs)&0xffff == KESEL) panic("recursive system call"); | |
| 1991/0718 | ||
| 1991/1005/sys/src/9/pc/trap.c:307,313 – 1991/1112/sys/src/9/pc/trap.c:322,328 | ||
| 1991/0801 | ur->ax = ret; | |
| 1991/0802 | if(ax == NOTED){ | |
| 1991/0720 | noted(ur, *(ulong*)(sp+BY2WD)); | |
| 1991/0802 |
| |
| 1991/1112 | } else if(u->p->procctl || (u->nnote && ax!=FORK)){ | |
| 1991/0720 | notify(ur); } return ret; | |
| 1991/1005/sys/src/9/pc/trap.c:322,332 – 1991/1112/sys/src/9/pc/trap.c:337,347 | ||
| 1991/0710 | { | |
| 1991/0720 | ulong sp; | |
| 1991/1112 | if(u->p->procctl) procctl(u->p); if(u->nnote==0) | |
| 1991/0720 | return; | |
| 1991/1112 | lock(&u->p->debug); | |
| 1991/0727 | u->p->notepending = 0; | |
| 1991/0720 | if(u->note[0].flag!=NUser && (u->notified || u->notify==0)){ if(u->note[0].flag == NDebug) | |
| 1991/1005/sys/src/9/pc/trap.c:420,423 – 1991/1112/sys/src/9/pc/trap.c:435,457 | ||
| 1991/0720 | unlock(&u->p->debug); pexit(u->lastnote.msg, u->lastnote.flag!=NDebug); } | |
| 1991/1112 | } /* This routine must save the values of registers the user is not permitted to write * from devproc and the restore the saved values before returning */ void setregisters(Ureg *xp, char *pureg, char *uva, int n) { ulong flags; ulong cs; ulong ss; flags = xp->flags; cs = xp->cs; ss = xp->ss; memmove(pureg, uva, n); xp->flags = (xp->flags & 0xff) | (flags & 0xff00); xp->cs = cs; xp->ss = ss; | |
| 1991/0614 | } | |