From 483ea68bc5dbef07905ee0d3216e6815d695697e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 3 May 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-05-03 --- carrera/dat.h | 1 + carrera/kbd.c | 52 +++++++++++++++++-------------------------------- pc/dat.h | 1 + pc/devvga.c | 53 +++++++++++++++++++++++++++++++++++++------------- pc/kbd.c | 51 ++++++++++++++++-------------------------------- port/devpipe.c | 12 +++++++++--- port/portfns.h | 3 +-- power/dat.h | 1 + 8 files changed, 88 insertions(+), 86 deletions(-) diff --git a/carrera/dat.h b/carrera/dat.h index 56b66c70bc65dd348bc923c76754aff755cbaf71..65c7b2b789a1febd52201778c2b91d77f2925d66 100644 --- a/carrera/dat.h +++ b/carrera/dat.h @@ -48,6 +48,7 @@ struct Conf ulong copymode; /* 0 is copy on write, 1 is copy on reference */ int monitor; ulong ialloc; /* bytes available for interrupt time allocation */ + ulong pipeqsize; /* size in bytes of pipe queues */ }; /* diff --git a/carrera/kbd.c b/carrera/kbd.c index 76282160022b8a74679334de21ccc641405f8f54..4dfefd2101f69d922dbd4d2fbdf0a9453f569bf7 100644 --- a/carrera/kbd.c +++ b/carrera/kbd.c @@ -190,12 +190,12 @@ mouseintr(void) void kbdintr(void) { - int c, i, nk; + int c, i; static int esc1, esc2; static int caps; static int ctl; static int num; - static int lstate; + static int collecting, nk; static uchar kc[5]; static int shift; int keyup; @@ -257,39 +257,21 @@ kbdintr(void) if(!(c & Spec)){ if(ctl) c &= 0x1f; - switch(lstate){ - case 1: - kc[0] = c; - lstate = 2; - if(c == 'X') - lstate = 3; - break; - case 2: - kc[1] = c; - c = latin1(kc); - nk = 2; - putit: - lstate = 0; - if(c != -1) - kbdputc(kbdq, c); - else for(i=0; i= sizeof(cbuf)) + error(Ebadarg); + memmove(cbuf, buf, n); + cbuf[n] = 0; + if(strncmp(cbuf, "hwcursor", 8) == 0) + hwcursor = 1; + break; case Qvgasize: if(offset != 0 || n >= sizeof(cbuf)) error(Ebadarg); @@ -675,7 +689,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock) if(!rectclip(&r, gscreen.r) || tl<=0) return; - if(dolock) + if(dolock && hwcursor == 0) cursorlock(r); lock(&loadlock); @@ -758,7 +772,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock) } unlock(&loadlock); - if(dolock) + if(dolock && hwcursor == 0) cursorunlock(); } @@ -831,7 +845,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock) if(!rectclip(&r, gscreen.r) || tl<=0) return; - if(dolock) + if(dolock && hwcursor == 0) cursorlock(r); lock(&loadlock); @@ -914,7 +928,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock) } unlock(&loadlock); - if(dolock) + if(dolock && hwcursor == 0) cursorunlock(); } @@ -1063,6 +1077,15 @@ s3page(int page) crout(0x35, (page<<2) & 0x0C); } +/* + * hardware cursor routines + */ +static void +nomvcursor(Point p) +{ + USED(p.x); +} + /* * character mode console */ @@ -1321,7 +1344,9 @@ cursoron(int dolock) if(dolock) lock(&cursor); - if(cursor.visible++ == 0){ + if(hwcursor) + (*vgacard->mvcursor)(mousexy()); + else if(cursor.visible++ == 0){ cursor.r.min = mousexy(); cursor.r.max = add(cursor.r.min, Pt(16, 16)); cursor.r = raddp(cursor.r, cursor.offset); @@ -1374,6 +1399,8 @@ cursoron(int dolock) void cursoroff(int dolock) { + if(hwcursor) + return; if(cursor.disable) return; if(dolock) diff --git a/pc/kbd.c b/pc/kbd.c index 65d5bc5410af362d0e01a0c3acb4e37dea7dde47..d85b5a8483a3fb86f56b75e13764831e921c901e 100644 --- a/pc/kbd.c +++ b/pc/kbd.c @@ -359,12 +359,12 @@ ct82c710(void) static void kbdintr(Ureg *ur, void *arg) { - int s, c, i, nk; + int s, c, i; static int esc1, esc2; static int caps; static int ctl; static int num; - static int lstate; + static int collecting, nk; static uchar kc[5]; int keyup; @@ -444,39 +444,21 @@ kbdintr(Ureg *ur, void *arg) if(!(c & Spec)){ if(ctl) c &= 0x1f; - switch(lstate){ - case 1: - kc[0] = c; - lstate = 2; - if(c == 'X') - lstate = 3; - break; - case 2: - kc[1] = c; - c = latin1(kc); - nk = 2; - putit: - lstate = 0; - if(c != -1) - kbdputc(kbdq, c); - else for(i=0; i 1) + conf.pipeqsize = 256*1024; + else + conf.pipeqsize = 32*1024; + } } void @@ -65,12 +71,12 @@ pipeattach(char *spec) exhausted("memory"); p->ref = 1; - p->q[0] = qopen(32*1024, 0, 0, 0); + p->q[0] = qopen(conf.pipeqsize, 0, 0, 0); if(p->q[0] == 0){ free(p); exhausted("memory"); } - p->q[1] = qopen(32*1024, 0, 0, 0); + p->q[1] = qopen(conf.pipeqsize, 0, 0, 0); if(p->q[1] == 0){ free(p->q[0]); free(p); diff --git a/port/portfns.h b/port/portfns.h index 54ceea9400782baee50ce2c179bdd37c84778279..74137f88282f88c1384ae42f5be4e0b2cf4a065e 100644 --- a/port/portfns.h +++ b/port/portfns.h @@ -115,7 +115,7 @@ void kproc(char*, void(*)(void*), void*); void kprocchild(Proc*, void (*)(void*), void*); void kproftimer(ulong); void ksetenv(char*, char*); -long latin1(uchar*); +long latin1(uchar*, int); void lights(int); void links(void); void lock(Lock*); @@ -244,7 +244,6 @@ void swapinit(void); void tsleep(Rendez*, int (*)(void*), void*, int); void unbreak(Proc*); void uncachepage(Page*); -long unicode(uchar*); long unionread(Chan*, void*, long); void unlock(Lock*); void unmount(Chan*, Chan*); diff --git a/power/dat.h b/power/dat.h index defef91792df0905b8df3d5000914a845f2f5609..7f773ec0e1a728fa6b9c8067c89729c294c45a1a 100644 --- a/power/dat.h +++ b/power/dat.h @@ -52,6 +52,7 @@ struct Conf ulong frag; /* Ip fragment assemble queue size */ ulong debugger; /* use processor 1 as a kernel debugger */ ulong ialloc; /* bytes available for interrupt time allocation */ + ulong pipeqsize; /* size in bytes of pipe queues */ }; /*