| plan 9 kernel history: overview | file list | diff list |
1990/0914/gnot/stasync.c (diff list | history)
| 1990/0911/sys/src/9/gnot/stasync.c:11,18 – 1990/0914/sys/src/9/gnot/stasync.c:11,17 (short | long | prev | next) | ||
| 1990/0911 | * configuration */ enum { | |
| 1990/0914 | MAXFRAME= 256, /* also known to tsm8 code */ | |
| 1990/0911 | }; /* input states */ | |
| 1990/0911/sys/src/9/gnot/stasync.c:98,113 – 1990/0914/sys/src/9/gnot/stasync.c:97,113 | ||
| 1990/0905 | ||
| 1990/0911 | DPRINT("asyncopen %d\n", s->dev); | |
| 1990/0905 |
| |
| 1990/0914 | for(ap = async; ap < &async[conf.nasync]; ap++){ | |
| 1990/0905 | qlock(ap); if(ap->inuse == 0) break; qunlock(ap); } | |
| 1990/0914 | if(ap == &async[conf.nasync]) | |
| 1990/0905 | error(0, Enoasync); q->ptr = q->other->ptr = ap; | |
| 1990/0914 | ap->inuse = 1; | |
| 1990/0911 | ap->bp = 0; | |
| 1990/0905 | ap->chan = -1; ap->count = 0; | |
| 1990/0911/sys/src/9/gnot/stasync.c:120,125 – 1990/0914/sys/src/9/gnot/stasync.c:120,126 | ||
| 1990/0905 | ap->out = 0; | |
| 1990/0911 | ap->wq = WR(q); ap->state = Hunt; | |
| 1990/0914 | qunlock(ap); | |
| 1990/0905 | } static void | |
| 1990/0911/sys/src/9/gnot/stasync.c:329,340 – 1990/0914/sys/src/9/gnot/stasync.c:330,341 | ||
| 1990/0911 | asdeliver(Queue *q, Async *ap) | |
| 1990/0905 | { int chan, c; | |
| 1990/0911 |
| |
| 1990/0914 | Block *bp = 0; | |
| 1990/0911 | uchar *p = ap->buf; int n = ap->icount; | |
| 1990/0905 | ||
| 1990/0911 |
| |
| 1990/0914 | chan = *p++ & 0x7e; chan = (chan<<5)|((*p++ & 0x7e)>>1); | |
| 1990/0911 | if(chan==0) { | |
| 1990/0905 | DPRINT("a%d deliver chan 0\n", ap-async); ap->chan0++; | |