| plan 9 kernel history: overview | file list | diff list |
1991/1218/gnot/trap.c (diff list | history)
| 1991/12171/sys/src/9/gnot/trap.c:40,52 – 1991/1218/sys/src/9/gnot/trap.c:40,52 (short | long | prev | next) | ||
| 1990/03091 | "illegal instruction", "zero divide", "chk, chk2 instruction", | |
| 1991/12171 |
| |
| 1991/1218 | "trapcc instruction", | |
| 1990/03091 | "privilege violation", "trace", "line 1010 emulator", "line 1111 emulator", "reserved", | |
| 1991/12171 |
| |
| 1991/1218 | "coprocessor protocol violation", | |
| 1990/03091 | "format error", "uninitialized interrupt", "unassigned 0x40", | |
| 1991/12171/sys/src/9/gnot/trap.c:68,79 – 1991/1218/sys/src/9/gnot/trap.c:68,79 | ||
| 1990/03091 | }; | |
| 1991/12171 | char *fptrapname[]={ | |
| 1991/1218 | [49-49] "inexact result", [50-49] "divide by zero", [51-49] "underflow", [52-49] "operand error", [53-49] "overflow", [54-49] "signaling NaN", | |
| 1991/12171 | }; | |
| 1990/03091 | char* | |
| 1991/12171/sys/src/9/gnot/trap.c:87,96 – 1991/1218/sys/src/9/gnot/trap.c:87,99 | ||
| 1991/1113 | /* special case, and pc will be o.k. */ if(vo==4 && *(ushort*)pc==0x4848) return "breakpoint"; | |
| 1990/03091 |
| |
| 1991/1218 | sprint(buf, "trap: %s", trapname[vo]); return buf; | |
| 1991/1113 | } | |
| 1991/12171 |
| |
| 1991/1218 | if(49<=vo && vo<=54){ sprint(buf, "fp: %s", fptrapname[vo-49]); return buf; } | |
| 1990/03091 | sprint(buf, "offset 0x%ux", vo<<2); return buf; } | |
| 1991/12171/sys/src/9/gnot/trap.c:108,114 – 1991/1218/sys/src/9/gnot/trap.c:111,117 | ||
| 1991/1112 | u->dbgreg = ur; } | |
| 1990/03091 | if(user){ | |
| 1991/1113 |
| |
| 1991/1218 | sprint(buf, "sys: %s", excname(ur->vo, ur->pc)); | |
| 1990/03091 | postnote(u->p, 1, buf, NDebug); }else{ | |
| 1991/1113 | print("kernel trap %s pc=0x%lux\n", excname(ur->vo, ur->pc), ur->pc); | |
| 1991/12171/sys/src/9/gnot/trap.c:156,162 – 1991/1218/sys/src/9/gnot/trap.c:159,167 | ||
| 1990/03091 | void notify(Ureg *ur) { | |
| 1991/1218 | int l; | |
| 1991/1114 | ulong s, sp; | |
| 1991/1218 | Note *n; | |
| 1990/03091 | ||
| 1991/1112 | if(u->p->procctl) procctl(u->p); | |
| 1991/12171/sys/src/9/gnot/trap.c:166,177 – 1991/1218/sys/src/9/gnot/trap.c:171,189 | ||
| 1991/1114 | s = spllo(); | |
| 1991/1216 | qlock(&u->p->debug); | |
| 1991/0727 | u->p->notepending = 0; | |
| 1990/03091 |
| |
| 1991/1218 | n = &u->note[0]; if(strncmp(n->msg, "sys:", 4) == 0){ l = strlen(n->msg); if(l > ERRLEN-15) /* " pc=0x12345678\0" */ l = ERRLEN-15; sprint(n->msg+l, " pc=0x%.8lux", ur->pc); } if(n->flag!=NUser && (u->notified || u->notify==0)){ | |
| 1990/03091 | if(u->note[0].flag == NDebug) | |
| 1991/1218 | pprint("suicide: %s\n", n->msg); | |
| 1990/03091 | Die: | |
| 1991/1216 | qunlock(&u->p->debug); | |
| 1990/03091 |
| |
| 1991/1218 | pexit(n->msg, n->flag!=NDebug); | |
| 1990/03091 | } if(!u->notified){ if(!u->notify) | |