~kris/9p

9hist

abe914b63dae26f7168fdddf2491af9e67474117 — David du Colombier 26 years ago 2387d8e
Plan 9 from Bell Labs 2000-06-13
3 files changed, 29 insertions(+), 13 deletions(-)

M pc/ns16552.h
M pc/sdata.c
M pc/vgamach64xx.c
M pc/ns16552.h => pc/ns16552.h +26 -9
@@ 77,6 77,28 @@ mp008intr(Ureg* ureg, void* arg)
}

/*
 * install a default serial port on a PC unless 
 * name=disabled is set in plan9.ini
 */
void
ns16552default(char *name, int port, int irq)
{
	char *p;

	if((p = getconf(name)) && strncmp(p, "disabled", 8) == 0)
		return;

	if(ioalloc(port, 8, 0, name) < 0) {
		print("%s: port %x in use\n", name, port);
		return;
	}

	ns16552setup(port, UartFREQ, name, Ns550);
	intrenable(irq, ns16552intrx, (void*)(nuart-1), BUSUNKNOWN, name);
}


/*
 *  install the uarts (called by reset)
 */
void


@@ 92,15 114,10 @@ ns16552install(void)
		return;
	already = 1;

	/* first two ports are always there and always the normal frequency */
	if(ioalloc(0x3f8, 8, 0, "eia0") < 0)
		print("eia0: port %d in use\n", 0x3f8);
	ns16552setup(0x3F8, UartFREQ, "eia0", Ns550);
	intrenable(IrqUART0, ns16552intrx, (void*)0, BUSUNKNOWN, "eia0");
	if(ioalloc(0x2F8, 8, 0, "eia1") < 0)
		print("eia1: port %d in use\n", 0x2F8);
	ns16552setup(0x2F8, UartFREQ, "eia1", Ns550);
	intrenable(IrqUART1, ns16552intrx, (void*)1, BUSUNKNOWN, "eia1");
	/* first two ports are usually there and always the normal frequency */
	ns16552default("eia0", 0x3F8, IrqUART0);
	ns16552default("eia1", 0x2F8, IrqUART1);

	addclock0link(uartclock);

	/* set up a serial console */

M pc/sdata.c => pc/sdata.c +2 -3
@@ 606,11 606,10 @@ retry:
	if(DEBUG & DbgCONFIG){
		print("dev %2.2uX config %4.4uX capabilities %4.4uX",
			dev, drive->info[Iconfig], drive->info[Icapabilities]);
		print(" mwdma %4.4uX dma %8.8uX", 
			drive->info[Imwdma], drive->dma);
		print(" mwdma %4.4uX", drive->info[Imwdma]);
		if(drive->info[Ivalid] & 0x04)
			print(" udma %4.4uX", drive->info[Iudma]);
		print(" rwm %ud\n", drive->rwm);
		print(" dma %8.8uX rwm %ud\n", drive->dma, drive->rwm);
	}

	return drive;

M pc/vgamach64xx.c => pc/vgamach64xx.c +1 -1
@@ 122,7 122,7 @@ mach64xxlinear(VGAscr* scr, int* size, int* align)
	else
		scr->isupamem = 1;

	scr->mmio = (ulong*)(aperture+osize-0x400);
	scr->mmio = KADDR(aperture+osize-0x400);
	if(oaperture)
		print("warning (BUG): redefinition of aperture does not change mach64mmio segment\n");
	memset(&seg, 0, sizeof(seg));