From 9ff60ccc127f83cc6708661cb3edc5c111dc089c Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 15 Jul 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-07-15 --- boot/userpasswd.c | 8 -------- pc/clock.c | 2 +- pc/devvga.c | 9 ++++----- pc/ether509.c | 2 +- pc/ether8390.c | 2 +- pc/fns.h | 1 + pc/trap.c | 25 +++++++++++++------------ 7 files changed, 21 insertions(+), 28 deletions(-) diff --git a/boot/userpasswd.c b/boot/userpasswd.c index 08f88578d9b75d36f34eab9332d18c2553350632..f2b26ff8f42b1d239a173b6e4bdb2108bfb8e77a 100644 --- a/boot/userpasswd.c +++ b/boot/userpasswd.c @@ -34,14 +34,6 @@ userpasswd(int islocal, Method *mp) msg = checkkey(mp, username, hostkey); if(msg == 0) break; - /* try the old key algorithm till everyone has switched */ - opasstokey(hostkey, password); - msg = checkkey(mp, username, hostkey); - if(msg == 0){ - print("You have an old style key. Once you are up, please run 'aux/passwd'\n"); - print("and retype your key to convert.\n"); - break; - } fprint(2, "?%s\n", msg); outin("user", username, sizeof(username)); } diff --git a/pc/clock.c b/pc/clock.c index 75c63e1667663fced2d2f95074b21a49547bb5a6..488a3c909f9a86dd47d1264e387759a51d32278f 100644 --- a/pc/clock.c +++ b/pc/clock.c @@ -54,9 +54,9 @@ clock(Ureg *ur, void *arg) m->ticks++; - uartclock(); checkalarms(); hardclock(); + uartclock(); /* * process time accounting diff --git a/pc/devvga.c b/pc/devvga.c index c555edc49df5f82adacc6090cb161bab928f21a8..fe5c940d69376f2bdb2eb6bf4381b74208719fa2 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -24,7 +24,6 @@ Bitmap gscreen; /* vga screen */ static Lock screenlock; -static Lock loadlock; static ulong colormap[256][3]; Lock pallettelock; @@ -758,7 +757,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock) if(dolock && hwgc == 0) cursorlock(r); - lock(&loadlock); + lock(&pallettelock); q = byteaddr(&gscreen, r.min); mx = 7>>gscreen.ldepth; @@ -838,7 +837,7 @@ screenload(Rectangle r, uchar *data, int tl, int l, int dolock) data += l; } - unlock(&loadlock); + unlock(&pallettelock); if(dolock && hwgc == 0) cursorunlock(); } @@ -914,7 +913,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock) if(dolock && hwgc == 0) cursorlock(r); - lock(&loadlock); + lock(&pallettelock); q = byteaddr(&gscreen, r.min); mx = 7>>gscreen.ldepth; @@ -994,7 +993,7 @@ screenunload(Rectangle r, uchar *data, int tl, int l, int dolock) data += l; } - unlock(&loadlock); + unlock(&pallettelock); if(dolock && hwgc == 0) cursorunlock(); } diff --git a/pc/ether509.c b/pc/ether509.c index e38c0071d1ee9fdbd9f2a49581dca7fd542e1e7b..e4071c0b42782a8362b2e40f5bfafcc99f4e99fa 100644 --- a/pc/ether509.c +++ b/pc/ether509.c @@ -185,7 +185,7 @@ receive(Ether *ether) /* * Copy the packet to whoever wants it. */ - etherrloop(ether, ðer->rpkt, len); + etherrloop(ether, ðer->rpkt, len, 1); } /* diff --git a/pc/ether8390.c b/pc/ether8390.c index 67ce7094792dfe78af226b6ec233a00033a95b84..2c7bc7af1b3b36e6917da3ca4719b0c6277d648b 100644 --- a/pc/ether8390.c +++ b/pc/ether8390.c @@ -455,7 +455,7 @@ receive(Ether *ether) /* * Copy the packet to whoever wants it. */ - etherrloop(ether, ðer->rpkt, len); + etherrloop(ether, ðer->rpkt, len, 1); } /* diff --git a/pc/fns.h b/pc/fns.h index d201df41e2c63b95de4efbe9e20db5db40c10009..e645cb8a1a62f4cd327c18f8034c9a2c6bdd70be 100644 --- a/pc/fns.h +++ b/pc/fns.h @@ -85,6 +85,7 @@ void touser(void*); void trapinit(void); int tas(void*); void uartclock(void); +void uartpoll(void); void vgainit(void); int x86(void); diff --git a/pc/trap.c b/pc/trap.c index 0736bd80c5b78b46709a9fc32e142031ea7837ff..c725e81b61b8287ff8cedf672b1ad7ff6bcba18e 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -222,11 +222,10 @@ char *excname[] = [13] "general protection violation", }; - /* * All traps come here. It is slower to have all traps call trap() rather than * directly vectoring the handler. However, this avoids a lot of code duplication - * and possible bugs. + * and possible bugs. trap is called splhi(). */ void trap(Ureg *ur) @@ -297,9 +296,11 @@ trap(Ureg *ur) h = h->next; } while(h); - /* check user since syscall does its own notifying */ + /* + * check user since syscall does its own notifying + */ splhi(); - if(user && (up->procctl || up->nnote)) + if(v != Syscallvec && user && (up->procctl || up->nnote)) notify(ur); } @@ -374,7 +375,7 @@ dumpstack(void) #include "../port/systab.h" /* - * syscall is called spllo() + * syscall is called splhi() */ void syscall(Ureg *ur, void *arg) @@ -385,6 +386,7 @@ syscall(Ureg *ur, void *arg) USED(arg); + up->insyscall = 1; up->pc = ur->pc; up->dbgreg = ur; @@ -396,15 +398,17 @@ syscall(Ureg *ur, void *arg) if(up->scallnr == RFORK && up->fpstate == FPactive){ /* * so that the child starts out with the - * same registers as the parent + * same registers as the parent. + * this must be atomic relative to this CPU, hence + * the spl's. */ - splhi(); if(up->fpstate == FPactive){ fpsave(&up->fpsave); up->fpstate = FPinactive; } - spllo(); } + spllo(); + sp = ur->usp; up->nerrlab = 0; ret = -1; @@ -442,13 +446,10 @@ syscall(Ureg *ur, void *arg) */ ur->ax = ret; + splhi(); if(up->scallnr == NOTED) noted(ur, *(ulong*)(sp+BY2WD)); - if(up->nerrlab != 0) - panic("nerrlab = %d syscall = %d\n", up->nerrlab, up->scallnr); - - splhi(); /* avoid interrupts during the iret */ if(up->scallnr!=RFORK && (up->procctl || up->nnote)) notify(ur); }