~kris/9p

9hist

a0b3e2b11b44dbc1715b7ce91769de444bd32d48 — David du Colombier 26 years ago b234d70
Plan 9 from Bell Labs 2000-06-30
2 files changed, 14 insertions(+), 6 deletions(-)

M pc/memory.c
M pc/sd53c8xx.c
M pc/memory.c => pc/memory.c +4 -4
@@ 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;
}


M pc/sd53c8xx.c => pc/sd53c8xx.c +10 -2
@@ 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;