Deleted Added
full compact
isa_dma.c (57973) isa_dma.c (61994)
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 57973 2000-03-13 10:19:32Z phk $
37 * $FreeBSD: head/sys/i386/isa/isa_dma.c 61994 2000-06-23 07:44:33Z msmith $
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
46 * mode DMA count compution and reorganized DMA setup code in
47 * isa_dmastart()
48 */
49
50#include <sys/param.h>
51#include <sys/systm.h>
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
46 * mode DMA count compution and reorganized DMA setup code in
47 * isa_dmastart()
48 */
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/bus.h>
53#include <sys/kernel.h>
52#include <sys/malloc.h>
54#include <sys/malloc.h>
55#include <sys/module.h>
53#include <vm/vm.h>
54#include <vm/vm_param.h>
55#include <vm/pmap.h>
56#include <i386/isa/isa.h>
56#include <vm/vm.h>
57#include <vm/vm_param.h>
58#include <vm/pmap.h>
59#include <i386/isa/isa.h>
57#include <i386/isa/isa_dma.h>
58#include <i386/isa/ic/i8237.h>
60#include <i386/isa/ic/i8237.h>
61#include <isa/isavar.h>
59
60/*
61** Register definitions for DMA controller 1 (channels 0..3):
62*/
63#define DMA1_CHN(c) (IO_DMA1 + 1*(2*(c))) /* addr reg for channel c */
64#define DMA1_SMSK (IO_DMA1 + 1*10) /* single mask register */
65#define DMA1_MODE (IO_DMA1 + 1*11) /* mode register */
66#define DMA1_FFC (IO_DMA1 + 1*12) /* clear first/last FF */

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

489
490 if ((chan & 4) == 0) {
491 outb(DMA1_SMSK, (chan & 3) | 4 /* disable mask */);
492 } else {
493 outb(DMA2_SMSK, (chan & 3) | 4 /* disable mask */);
494 }
495 return(isa_dmastatus(chan));
496}
62
63/*
64** Register definitions for DMA controller 1 (channels 0..3):
65*/
66#define DMA1_CHN(c) (IO_DMA1 + 1*(2*(c))) /* addr reg for channel c */
67#define DMA1_SMSK (IO_DMA1 + 1*10) /* single mask register */
68#define DMA1_MODE (IO_DMA1 + 1*11) /* mode register */
69#define DMA1_FFC (IO_DMA1 + 1*12) /* clear first/last FF */

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

492
493 if ((chan & 4) == 0) {
494 outb(DMA1_SMSK, (chan & 3) | 4 /* disable mask */);
495 } else {
496 outb(DMA2_SMSK, (chan & 3) | 4 /* disable mask */);
497 }
498 return(isa_dmastatus(chan));
499}
500
501/*
502 * Attach to the ISA PnP descriptor for the AT DMA controller
503 */
504static struct isa_pnp_id atdma_ids[] = {
505 { 0x0002d041 /* PNP0200 */, "AT DMA controller" },
506 { 0 }
507};
508
509static int
510atdma_probe(device_t dev)
511{
512 int result;
513
514 if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, atdma_ids)) <= 0)
515 device_quiet(dev);
516 return(result);
517}
518
519static int
520atdma_attach(device_t dev)
521{
522 return(0);
523}
524
525static device_method_t atdma_methods[] = {
526 /* Device interface */
527 DEVMETHOD(device_probe, atdma_probe),
528 DEVMETHOD(device_attach, atdma_attach),
529 DEVMETHOD(device_detach, bus_generic_detach),
530 DEVMETHOD(device_shutdown, bus_generic_shutdown),
531 DEVMETHOD(device_suspend, bus_generic_suspend),
532 DEVMETHOD(device_resume, bus_generic_resume),
533 { 0, 0 }
534};
535
536static driver_t atdma_driver = {
537 "atdma",
538 atdma_methods,
539 1, /* no softc */
540};
541
542static devclass_t atdma_devclass;
543
544DRIVER_MODULE(atdma, isa, atdma_driver, atdma_devclass, 0, 0);