From a0b3e2b11b44dbc1715b7ce91769de444bd32d48 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Fri, 30 Jun 2000 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2000-06-30 --- pc/memory.c | 8 ++++---- pc/sd53c8xx.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pc/memory.c b/pc/memory.c index a33d8f0bed18b5f95d1b14c4c3067180a4996c7e..4f88147dec107a2a7d129e47e75ec88717762a8f 100644 --- a/pc/memory.c +++ b/pc/memory.c @@ -171,9 +171,9 @@ mapalloc(RMap* rmap, ulong addr, int size, int align) */ if(maddr > addr) break; - if(maddr+mp->size < addr) + if(mp->size < addr - maddr) /* maddr+mp->size < addr, but no overflow */ continue; - if(addr+size > maddr+mp->size) + if(addr - maddr > mp->size - size) /* addr+size > maddr+mp->size, but no overflow */ break; maddr = addr; } @@ -400,9 +400,9 @@ ramscan(ulong maxmem) if(pa < maxmem) mapfree(&rmapupa, pa, maxmem-pa); if(maxmem < 0xFFE00000) - mapfree(&rmapupa, maxmem, 0xFFE00000-maxmem); + mapfree(&rmapupa, maxmem, 0x00000000-maxmem); if(MEMDEBUG) - print("maxmem %luX %luX\n", maxmem, 0xFFE00000-maxmem); + print("maxmem %luX %luX\n", maxmem, 0x00000000-maxmem); *k0 = kzero; } diff --git a/pc/sd53c8xx.c b/pc/sd53c8xx.c index 856f6b8a6e2fe34761cd03c140ca6690e0449c5f..c9a1dc2058761fa2d9a220884f01e95349ee7545 100644 --- a/pc/sd53c8xx.c +++ b/pc/sd53c8xx.c @@ -1807,12 +1807,17 @@ cribbios(Controller *c) { c->bios.scntl3 = c->n->scntl3; c->bios.stest2 = c->n->stest2; - print("sd53c8xx: bios scntl3(%.2x) stest2(%.2x)\n", c->bios.scntl3, c->bios.stest2); + KPRINT("sd53c8xx: bios scntl3(%.2x) stest2(%.2x)\n", + c->bios.scntl3, c->bios.stest2); } static int bios_set_differential(Controller *c) { + /* rsc: this fails on the 825 */ + if(strcmp(c->v->name, "NCR53C825") == 0) + return 0; + /* Concept lifted from FreeBSD - thanks Gerard */ /* basically, if clock conversion factors are set, then there is * evidence the bios had a go at the chip, and if so, it would @@ -1961,8 +1966,11 @@ sympnp(void) ba++; } regpa = upamalloc(regpa & ~0x0F, p->mem[1].size, 0); - if(regpa == 0) + if(regpa == 0) { + print("sd53c8xx: failed to allocate register space (%d bytes at %.8lux)\n", + p->mem[1].size, regpa & ~0x0F); continue; + } script = nil; scriptpa = 0;