diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-02-06 13:46:39 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-02-06 13:46:39 +0000 |
commit | 0c3c54da638464af719bb78cb908236b87fabe19 (patch) | |
tree | b7d7b0f2029f00a02738382ec1c9896806724b5e /sys/i386/isa | |
parent | 32b80354675e2fc4bfb4856d47e0d0b4fd31fb0b (diff) | |
download | src-0c3c54da638464af719bb78cb908236b87fabe19.tar.gz src-0c3c54da638464af719bb78cb908236b87fabe19.zip |
Since we are quite unlikely to ever face another platform which
uses the i8237 without trying to emulate the PC architecture move
the register definitions for the i8237 chip into the central include
file for the chip, except for the PC98 case which is magic.
Add new isa_dmatc() function which tells us as cheaply as possible
if the terminal count has been reached for a given channel.
Notes
Notes:
svn path=/head/; revision=141391
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/isa_dma.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/i386/isa/isa_dma.c b/sys/i386/isa/isa_dma.c index 1739871ecc34..074b7c65989a 100644 --- a/sys/i386/isa/isa_dma.c +++ b/sys/i386/isa/isa_dma.c @@ -61,22 +61,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ic/i8237.h> #include <isa/isavar.h> -/* -** Register definitions for DMA controller 1 (channels 0..3): -*/ -#define DMA1_CHN(c) (IO_DMA1 + 1*(2*(c))) /* addr reg for channel c */ -#define DMA1_SMSK (IO_DMA1 + 1*10) /* single mask register */ -#define DMA1_MODE (IO_DMA1 + 1*11) /* mode register */ -#define DMA1_FFC (IO_DMA1 + 1*12) /* clear first/last FF */ - -/* -** Register definitions for DMA controller 2 (channels 4..7): -*/ -#define DMA2_CHN(c) (IO_DMA2 + 2*(2*(c))) /* addr reg for channel c */ -#define DMA2_SMSK (IO_DMA2 + 2*10) /* single mask register */ -#define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ -#define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ - static int isa_dmarangecheck(caddr_t va, u_int length, int chan); static caddr_t dma_bouncebuf[8]; @@ -488,6 +472,19 @@ isa_dmastatus(int chan) } /* + * Reached terminal count yet ? + */ +int +isa_dmatc(int chan) +{ + + if (chan < 4) + return(inb(DMA1_STATUS) & (1 << chan)); + else + return(inb(DMA2_STATUS) & (1 << (chan & 3))); +} + +/* * Stop a DMA transfer currently in progress. */ int |