~kris/9p

9hist

bd97cea9c50060b869940bf1cdcfd6c00a757d79 — David du Colombier 28 years ago f4708ce
Plan 9 from Bell Labs 1998-09-03
2 files changed, 16 insertions(+), 1 deletions(-)

M pc/i8253.c
M port/sysproc.c
M pc/i8253.c => pc/i8253.c +15 -0
@@ 40,6 40,21 @@ i8253init(int aalcycles)
		outb(Tmode, Load0|Square);
		outb(T0cntr, (Freq/HZ));	/* low byte */
		outb(T0cntr, (Freq/HZ)>>8);	/* high byte */

		/*
		 * Introduce a little delay to make sure the count is
		 * latched and the timer is counting down; with a fast
		 * enough processor this may not be the case.
		 * The i8254 (which this probably is) has a read-back
		 * command which can be used to make sure the counting
		 * register has been written into the counting element.
		 */
		x = (Freq/HZ);
		for(loops = 0; loops < 100000 && x >= (Freq/HZ); loops++){
			outb(Tmode, Latch0);
			x = inb(T0cntr);
			x |= inb(T0cntr)<<8;
		}
	}

	/* find biggest loop that doesn't wrap */

M port/sysproc.c => port/sysproc.c +1 -1
@@ 650,7 650,7 @@ sysbrk_(ulong *arg)
long
sysrendezvous(ulong *arg)
{
	int tag;
	ulong tag;
	ulong val;
	Proc *p, **l;