Deleted Added
full compact
isa_dma.c (95710) isa_dma.c (112569)
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

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91
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

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91
37 * $FreeBSD: head/sys/i386/isa/isa_dma.c 95710 2002-04-29 07:43:16Z peter $
37 * $FreeBSD: head/sys/i386/isa/isa_dma.c 112569 2003-03-25 00:07:06Z jake $
38 */
39
40/*
41 * code to manage AT bus
42 *
43 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com):
44 * Fixed uninitialized variable problem and added code to deal
45 * with DMA page boundaries in isa_dmarangecheck(). Fixed word

--- 162 unchanged lines hidden (view full) ---

208
209/*
210 * isa_dmastart(): program 8237 DMA controller channel, avoid page alignment
211 * problems by using a bounce buffer.
212 */
213void
214isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
215{
38 */
39
40/*
41 * code to manage AT bus
42 *
43 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com):
44 * Fixed uninitialized variable problem and added code to deal
45 * with DMA page boundaries in isa_dmarangecheck(). Fixed word

--- 162 unchanged lines hidden (view full) ---

208
209/*
210 * isa_dmastart(): program 8237 DMA controller channel, avoid page alignment
211 * problems by using a bounce buffer.
212 */
213void
214isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
215{
216 vm_offset_t phys;
216 vm_paddr_t phys;
217 int waport;
218 caddr_t newaddr;
219
220 GIANT_REQUIRED;
221
222#ifdef DIAGNOSTIC
223 if (chan & ~VALID_DMA_MASK)
224 panic("isa_dmastart: channel out of range");

--- 143 unchanged lines hidden (view full) ---

368 * (non-contiguous physical pages, outside of bus address space,
369 * crossing DMA page boundaries).
370 * Return true if special handling needed.
371 */
372
373static int
374isa_dmarangecheck(caddr_t va, u_int length, int chan)
375{
217 int waport;
218 caddr_t newaddr;
219
220 GIANT_REQUIRED;
221
222#ifdef DIAGNOSTIC
223 if (chan & ~VALID_DMA_MASK)
224 panic("isa_dmastart: channel out of range");

--- 143 unchanged lines hidden (view full) ---

368 * (non-contiguous physical pages, outside of bus address space,
369 * crossing DMA page boundaries).
370 * Return true if special handling needed.
371 */
372
373static int
374isa_dmarangecheck(caddr_t va, u_int length, int chan)
375{
376 vm_offset_t phys, priorpage = 0, endva;
376 vm_paddr_t phys, priorpage = 0;
377 vm_offset_t endva;
377 u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1);
378
379 GIANT_REQUIRED;
380
381 endva = (vm_offset_t)round_page((vm_offset_t)va + length);
382 for (; va < (caddr_t) endva ; va += PAGE_SIZE) {
383 phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va));
384#define ISARAM_END RAM_END

--- 168 unchanged lines hidden ---
378 u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1);
379
380 GIANT_REQUIRED;
381
382 endva = (vm_offset_t)round_page((vm_offset_t)va + length);
383 for (; va < (caddr_t) endva ; va += PAGE_SIZE) {
384 phys = trunc_page(pmap_extract(kernel_pmap, (vm_offset_t)va));
385#define ISARAM_END RAM_END

--- 168 unchanged lines hidden ---