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

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

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 */
34
35#include <sys/cdefs.h>
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

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

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 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/x86/isa/isa_dma.c 204309 2010-02-25 14:13:39Z attilio $");
36__FBSDID("$FreeBSD: head/sys/x86/isa/isa_dma.c 233675 2012-03-29 18:58:02Z jhb $");
37
38/*
39 * code to manage AT bus
40 *
41 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com):
42 * Fixed uninitialized variable problem and added code to deal
43 * with DMA page boundaries in isa_dmarangecheck(). Fixed word
44 * mode DMA count compution and reorganized DMA setup code in

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

232void
233isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
234{
235 vm_paddr_t phys;
236 int waport;
237 caddr_t newaddr;
238 int dma_range_checked;
239
37
38/*
39 * code to manage AT bus
40 *
41 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com):
42 * Fixed uninitialized variable problem and added code to deal
43 * with DMA page boundaries in isa_dmarangecheck(). Fixed word
44 * mode DMA count compution and reorganized DMA setup code in

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

232void
233isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
234{
235 vm_paddr_t phys;
236 int waport;
237 caddr_t newaddr;
238 int dma_range_checked;
239
240 /* translate to physical */
241 phys = pmap_extract(kernel_pmap, (vm_offset_t)addr);
242 dma_range_checked = isa_dmarangecheck(addr, nbytes, chan);
243
244#ifdef DIAGNOSTIC
245 if (chan & ~VALID_DMA_MASK)
246 panic("isa_dmastart: channel out of range");
247
248 if ((chan < 4 && nbytes > (1<<16))
249 || (chan >= 4 && (nbytes > (1<<17) || (uintptr_t)addr & 1)))

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

276 newaddr = dma_bouncebuf[chan];
277
278 /* copy bounce buffer on write */
279 if (!(flags & ISADMA_READ))
280 bcopy(addr, newaddr, nbytes);
281 addr = newaddr;
282 }
283
240 dma_range_checked = isa_dmarangecheck(addr, nbytes, chan);
241
242#ifdef DIAGNOSTIC
243 if (chan & ~VALID_DMA_MASK)
244 panic("isa_dmastart: channel out of range");
245
246 if ((chan < 4 && nbytes > (1<<16))
247 || (chan >= 4 && (nbytes > (1<<17) || (uintptr_t)addr & 1)))

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

274 newaddr = dma_bouncebuf[chan];
275
276 /* copy bounce buffer on write */
277 if (!(flags & ISADMA_READ))
278 bcopy(addr, newaddr, nbytes);
279 addr = newaddr;
280 }
281
282 /* translate to physical */
283 phys = pmap_extract(kernel_pmap, (vm_offset_t)addr);
284
284 if (flags & ISADMA_RAW) {
285 dma_auto_mode |= (1 << chan);
286 } else {
287 dma_auto_mode &= ~(1 << chan);
288 }
289
290 if ((chan & 4) == 0) {
291 /*

--- 320 unchanged lines hidden ---
285 if (flags & ISADMA_RAW) {
286 dma_auto_mode |= (1 << chan);
287 } else {
288 dma_auto_mode &= ~(1 << chan);
289 }
290
291 if ((chan & 4) == 0) {
292 /*

--- 320 unchanged lines hidden ---