From c407d684036694b10ba922a6f6d5abca41e66400 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 5 May 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-05-05 --- carrera/l.s | 5 ++--- pc/devhard.c | 3 +++ pc/main.c | 29 +++++++++++++++++++++++++---- port/qio.c | 6 +++--- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/carrera/l.s b/carrera/l.s index aba6f945a3983ebf0f42224a1b58ff6d672cb04a..ea07a3e4611695c8302adffd0f0ae3d10ef59968 100644 --- a/carrera/l.s +++ b/carrera/l.s @@ -344,7 +344,6 @@ utlbcom: TLBWR ERET utlindex: - MOVW R0,(R0) TLBWI ERET @@ -443,7 +442,7 @@ TEXT saveregs(SB), $-4 MOVW R2, 0x98(SP) /* save R5, R6 as 64 bits */ ADDU $(UREGSIZE-16), SP, R1 - MOVW $~7, R2 /* don't let him use R28 */ + MOVW $~7, R2 /* don't let him use R28 */ AND R2, R1 STD (5, 0,(1)) STD (6, 8,(1)) @@ -536,7 +535,7 @@ TEXT restregs(SB), $-4 MOVW R1, HI /* restore 64-bit R5, R6 */ ADDU $(UREGSIZE-16), SP, R1 - MOVW $~7, R2 /* don't let him use R28 */ + MOVW $~7, R2 /* don't let him use R28 */ AND R2, R1 LD (0,(1), 5) LD (8,(1), 6) diff --git a/pc/devhard.c b/pc/devhard.c index 66d9d14cbf481c2a2a0037c28f3f5573c371c857..89e85975d675c49358f0f5de1d24e4fda1ab72a1 100644 --- a/pc/devhard.c +++ b/pc/devhard.c @@ -1036,6 +1036,9 @@ hardintr(Ureg *ur, void *arg) break; case Cinitparam: case Csetbuf: + case Cidle: + case Cstandby: + case Cpowerdown: cp->lastcmd = cp->cmd; cp->cmd = 0; wakeup(&cp->r); diff --git a/pc/main.c b/pc/main.c index 5ae9a3efa09731e7a949901349f2b222a71b020a..0ae525f1ad596b5a569aef1602c38410300413d0 100644 --- a/pc/main.c +++ b/pc/main.c @@ -286,9 +286,10 @@ getconf(char *name) void confinit(void) { - long x, i, j, n; + long x, y, i, j, n; int pcnt; ulong ktop; + long *lp; char *cp; char *line[MAXCONF]; @@ -345,10 +346,30 @@ confinit(void) mmap[i] = 'x'; /* * zero memory to set ECC but skip over the kernel + * do a quick memory test also */ - if(i != 1) - for(j = 0; j < MB/BY2PG; j += BY2PG) - memset(mapaddr(KZERO|(i*MB+j)), 0, BY2PG); + if(i != 1){ + for(j = 0; j < MB/BY2PG; j += BY2PG){ + lp = mapaddr(KZERO|(i*MB+j)); + for(n = 0; n < BY2PG/BY2WD; n++) + lp[n] = x + n; + } + for(j = 0; j < MB/BY2PG; j += BY2PG){ + lp = mapaddr(KZERO|(i*MB+j)); + for(n = 0; n < BY2PG/(2*BY2WD); n++){ + y = lp[n]; + lp[n] = ~lp[n^((BY2PG/BY2WD)-1)]; + lp[n^((BY2PG/BY2WD)-1)] = ~y; + } + } + for(j = 0; j < MB/BY2PG; j += BY2PG){ + lp = mapaddr(KZERO|(i*MB+j)); + for(n = 0; n < BY2PG/BY2WD; n++) + if(lp[n] != ~(x + (n^((BY2PG/BY2WD)-1)))) + mmap[i] = ' '; + memset(lp, 0, BY2PG); + } + } } x += 0x3141526; } diff --git a/port/qio.c b/port/qio.c index 6fe42d398dd5f181b4e9578ac84d9ef258614f3e..c5777c96eb412f5d8ee3a47bca847453dea96089 100644 --- a/port/qio.c +++ b/port/qio.c @@ -80,12 +80,12 @@ iallocb(int size) size = sizeof(Block) + size + (BY2V-1); if(ialloc.bytes > conf.ialloc){ -iprint("whoops %d/%d\n", ialloc.bytes, conf.ialloc); + iprint("ialloc limit exceeded %d/%d\n", ialloc.bytes, conf.ialloc); return 0; } b = mallocz(size, 0); if(b == 0){ -iprint("malloc %d/%d\n", ialloc.bytes, conf.ialloc); + iprint("iallocb: no memory %d/%d\n", ialloc.bytes, conf.ialloc); return 0; } memset(b, 0, sizeof(Block)); @@ -108,7 +108,7 @@ iprint("malloc %d/%d\n", ialloc.bytes, conf.ialloc); void freeb(Block *b) { - if(b->intr){ + if(b->intr) { ilock(&ialloc); ialloc.bytes -= b->lim - b->base; iunlock(&ialloc);