isa_dma.c (135262) | isa_dma.c (141391) |
---|---|
1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 33 * from: isa_dma.c,v 1.3 1999/05/09 23:56:00 peter Exp $ | 1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 33 * from: isa_dma.c,v 1.3 1999/05/09 23:56:00 peter Exp $ |
34 * $FreeBSD: head/sys/ia64/isa/isa_dma.c 135262 2004-09-15 12:09:50Z phk $ | 34 * $FreeBSD: head/sys/ia64/isa/isa_dma.c 141391 2005-02-06 13:46:39Z phk $ |
35 */ 36 37/* 38 * code to manage AT bus 39 * 40 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com): 41 * Fixed uninitialized variable problem and added code to deal 42 * with DMA page boundaries in isa_dmarangecheck(). Fixed word --- 10 unchanged lines hidden (view full) --- 53#include <vm/vm.h> 54#include <vm/vm_param.h> 55#include <vm/pmap.h> 56#include <isa/isareg.h> 57#include <isa/isavar.h> 58#include <dev/ic/i8237.h> 59#include <machine/bus.h> 60 | 35 */ 36 37/* 38 * code to manage AT bus 39 * 40 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com): 41 * Fixed uninitialized variable problem and added code to deal 42 * with DMA page boundaries in isa_dmarangecheck(). Fixed word --- 10 unchanged lines hidden (view full) --- 53#include <vm/vm.h> 54#include <vm/vm_param.h> 55#include <vm/pmap.h> 56#include <isa/isareg.h> 57#include <isa/isavar.h> 58#include <dev/ic/i8237.h> 59#include <machine/bus.h> 60 |
61/* 62** Register definitions for DMA controller 1 (channels 0..3): 63*/ 64#define DMA1_CHN(c) (IO_DMA1 + 1*(2*(c))) /* addr reg for channel c */ 65#define DMA1_SMSK (IO_DMA1 + 1*10) /* single mask register */ 66#define DMA1_MODE (IO_DMA1 + 1*11) /* mode register */ 67#define DMA1_FFC (IO_DMA1 + 1*12) /* clear first/last FF */ 68#define DMA1_RESET (IO_DMA1 + 1*13) /* reset */ 69 70/* 71** Register definitions for DMA controller 2 (channels 4..7): 72*/ 73#define DMA2_CHN(c) (IO_DMA2 + 2*(2*(c))) /* addr reg for channel c */ 74#define DMA2_SMSK (IO_DMA2 + 2*10) /* single mask register */ 75#define DMA2_MODE (IO_DMA2 + 2*11) /* mode register */ 76#define DMA2_FFC (IO_DMA2 + 2*12) /* clear first/last FF */ 77#define DMA2_RESET (IO_DMA2 + 2*13) /* reset */ 78 | |
79static bus_dma_tag_t dma_tag[8]; 80static bus_dmamap_t dma_map[8]; 81static u_int8_t dma_busy = 0; /* Used in isa_dmastart() */ 82static u_int8_t dma_inuse = 0; /* User for acquire/release */ 83static u_int8_t dma_auto_mode = 0; 84static u_int8_t dma_bounced = 0; 85 86#define VALID_DMA_MASK (7) --- 398 unchanged lines hidden (view full) --- 485 } 486 487 if (chan >= 4) /* high channels move words */ 488 cnt *= 2; 489 return(cnt); 490} 491 492/* | 61static bus_dma_tag_t dma_tag[8]; 62static bus_dmamap_t dma_map[8]; 63static u_int8_t dma_busy = 0; /* Used in isa_dmastart() */ 64static u_int8_t dma_inuse = 0; /* User for acquire/release */ 65static u_int8_t dma_auto_mode = 0; 66static u_int8_t dma_bounced = 0; 67 68#define VALID_DMA_MASK (7) --- 398 unchanged lines hidden (view full) --- 467 } 468 469 if (chan >= 4) /* high channels move words */ 470 cnt *= 2; 471 return(cnt); 472} 473 474/* |
475 * Reached terminal count yet ? 476 */ 477int 478isa_dmatc(int chan) 479{ 480 481 if (chan < 4) 482 return(inb(DMA1_STATUS) & (1 << chan)); 483 else 484 return(inb(DMA2_STATUS) & (1 << (chan & 3))); 485} 486 487/* |
|
493 * Stop a DMA transfer currently in progress. 494 */ 495int 496isa_dmastop(int chan) 497{ 498 if ((dma_inuse & (1 << chan)) == 0) 499 printf("isa_dmastop: channel %d not acquired\n", chan); 500 --- 13 unchanged lines hidden --- | 488 * Stop a DMA transfer currently in progress. 489 */ 490int 491isa_dmastop(int chan) 492{ 493 if ((dma_inuse & (1 << chan)) == 0) 494 printf("isa_dmastop: channel %d not acquired\n", chan); 495 --- 13 unchanged lines hidden --- |