~kris/9p

9hist

da74fafce944e865ee9885118149217506a919d5 — David du Colombier 31 years ago 738ede0
Plan 9 from Bell Labs 1995-05-02
3 files changed, 13 insertions(+), 1 deletions(-)

M pc/dma.c
M pc/fns.h
M pc/trap.c
M pc/dma.c => pc/dma.c +11 -0
@@ 162,6 162,17 @@ dmasetup(int chan, void *va, long len, int isread)
	return len;
}

int
dmadone(int chan)
{
	DMA *dp;

	dp = &dma[(chan>>2)&1];
	chan = chan & 3;

	return inb(dp->cmd) & (1<<chan);
}

/*
 *  this must be called after a dma has been completed.
 *

M pc/fns.h => pc/fns.h +1 -0
@@ 12,6 12,7 @@ void	clockinit(void);
void	config(int);
int	cpuspeed(int);
void	delay(int);
int	dmadone(int);
void	dmaend(int);
void	dmainit(void);
long	dmasetup(int, void*, long, int);

M pc/trap.c => pc/trap.c +1 -1
@@ 202,7 202,7 @@ trapinit(void)
	 *  Set the 8259 as master with level triggered
	 *  input with fully nested interrupts.
	 */
	outb(Int1ctl, (1<<4)|(1<<3)|(1<<0));	/* ICW1 - master, level triggered,
	outb(Int1ctl, (1<<4)|(0<<3)|(1<<0));	/* ICW1 - master, level triggered,
					  	 ICW4 will be sent */
	outb(Int1aux, Int1vec);		/* ICW2 - interrupt vector offset */
	outb(Int1aux, 0x02);		/* ICW3 - I am a slave on level 2 */