| plan 9 kernel history: overview | file list | diff list |
1991/1214/gnot/devduart.c (diff list | history)
| 1991/1115/sys/src/9/gnot/devduart.c:324,332 – 1991/1214/sys/src/9/gnot/devduart.c:324,333 (short | long | prev | next) | ||
| 1991/0605 | void duartintr(Ureg *ur) { | |
| 1991/1214 | int cause, status, ch, i, nk; | |
| 1991/0605 | Duart *duart; | |
| 1991/1214 | static int lstate; static uchar kc[5]; | |
| 1991/0605 | duart = DUARTREG; cause = duart->is_imr; | |
| 1991/1115/sys/src/9/gnot/devduart.c:339,350 – 1991/1214/sys/src/9/gnot/devduart.c:340,351 | ||
| 1991/0605 | if(cause & IM_CRDY){ if(kprofp) (*kprofp)(ur->pc); | |
| 1991/1214 | ch = duart[1].scc_ropbc; USED(ch); | |
| 1991/0605 | duart[0].ctur = (Kptime)>>8; duart[0].ctlr = (Kptime)&255; | |
| 1991/1214 | ch = duart[1].scc_sopbc; USED(ch); | |
| 1991/0605 | return; } /* | |
| 1991/1115/sys/src/9/gnot/devduart.c:352,386 – 1991/1214/sys/src/9/gnot/devduart.c:353,403 | ||
| 1991/0605 | */ if(cause & IM_RRDYA){ /* keyboard input */ status = duart->sr_csr; | |
| 1991/1214 | ch = duart->data; | |
| 1991/0605 | if(status & (FRM_ERR|OVR_ERR|PAR_ERR)) duart->cmnd = RESET_ERR; if(status & PAR_ERR) /* control word: caps lock (0x4) or repeat (0x10) */ | |
| 1991/1214 | kbdrepeat((ch&0x10) == 0); | |
| 1991/0605 | else{ | |
| 1991/1214 | if(ch == 0x7F) /* VIEW key (bizarre) */ ch = 0xFF; if(ch == 0xB6) /* NUM PAD */ lstate = 1; | |
| 1991/0605 | else{ | |
| 1991/1214 | if(ch & 0x80) ch = keymap[ch&0x7F]; switch(lstate){ | |
| 1991/0605 | case 1: | |
| 1991/1214 | kc[0] = ch; lstate = 2; if(ch == 'X') lstate = 3; | |
| 1991/0605 | break; case 2: | |
| 1991/1214 | kc[1] = ch; ch = latin1(kc); nk = 2; putit: lstate = 0; if(ch != -1) kbdputc(&kbdq, ch); else for(i=0; i<nk; i++) kbdputc(&kbdq, kc[i]); break; case 3: case 4: case 5: kc[lstate-2] = ch; lstate++; break; case 6: kc[4] = ch; ch = unicode(kc); nk = 5; goto putit; | |
| 1991/0605 | default: | |
| 1991/1214 | kbdputc(&kbdq, ch); break; | |
| 1991/0605 | } } } | |
| 1991/1115/sys/src/9/gnot/devduart.c:390,400 – 1991/1214/sys/src/9/gnot/devduart.c:407,417 | ||
| 1991/0605 | */ while(cause & IM_RRDYB){ /* duart input */ status = duart[1].sr_csr; | |
| 1991/1214 | ch = duart[1].data; | |
| 1991/0605 | if(status & (FRM_ERR|OVR_ERR|PAR_ERR)) duart[1].cmnd = RESET_ERR; else | |
| 1991/1214 | duartrintr(ch); | |
| 1991/0605 | cause = duart->is_imr; } /* | |