Annotation of sys/arch/mvmeppc/isa/isa_machdep.c, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: isa_machdep.c,v 1.6 2003/06/02 23:27:53 millert Exp $ */
! 2: /* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
! 3:
! 4: #define ISA_DMA_STATS
! 5:
! 6: /*-
! 7: * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
! 8: * All rights reserved.
! 9: *
! 10: * This code is derived from software contributed to The NetBSD Foundation
! 11: * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
! 12: * NASA Ames Research Center.
! 13: *
! 14: * Redistribution and use in source and binary forms, with or without
! 15: * modification, are permitted provided that the following conditions
! 16: * are met:
! 17: * 1. Redistributions of source code must retain the above copyright
! 18: * notice, this list of conditions and the following disclaimer.
! 19: * 2. Redistributions in binary form must reproduce the above copyright
! 20: * notice, this list of conditions and the following disclaimer in the
! 21: * documentation and/or other materials provided with the distribution.
! 22: * 3. All advertising materials mentioning features or use of this software
! 23: * must display the following acknowledgement:
! 24: * This product includes software developed by the NetBSD
! 25: * Foundation, Inc. and its contributors.
! 26: * 4. Neither the name of The NetBSD Foundation nor the names of its
! 27: * contributors may be used to endorse or promote products derived
! 28: * from this software without specific prior written permission.
! 29: *
! 30: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
! 31: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! 32: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! 33: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
! 34: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! 35: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! 36: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! 37: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! 38: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! 39: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! 40: * POSSIBILITY OF SUCH DAMAGE.
! 41: */
! 42:
! 43: /*-
! 44: * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
! 45: * All rights reserved.
! 46: *
! 47: * This code is derived from software contributed to The NetBSD Foundation
! 48: * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
! 49: * NASA Ames Research Center.
! 50: *
! 51: * Redistribution and use in source and binary forms, with or without
! 52: * modification, are permitted provided that the following conditions
! 53: * are met:
! 54: * 1. Redistributions of source code must retain the above copyright
! 55: * notice, this list of conditions and the following disclaimer.
! 56: * 2. Redistributions in binary form must reproduce the above copyright
! 57: * notice, this list of conditions and the following disclaimer in the
! 58: * documentation and/or other materials provided with the distribution.
! 59: * 3. All advertising materials mentioning features or use of this software
! 60: * must display the following acknowledgement:
! 61: * This product includes software developed by the NetBSD
! 62: * Foundation, Inc. and its contributors.
! 63: * 4. Neither the name of The NetBSD Foundation nor the names of its
! 64: * contributors may be used to endorse or promote products derived
! 65: * from this software without specific prior written permission.
! 66: *
! 67: * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
! 68: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! 69: * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! 70: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
! 71: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! 72: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! 73: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! 74: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! 75: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! 76: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! 77: * POSSIBILITY OF SUCH DAMAGE.
! 78: */
! 79:
! 80: /*-
! 81: * Copyright (c) 1993, 1994, 1996, 1997
! 82: * Charles M. Hannum. All rights reserved.
! 83: * Copyright (c) 1991 The Regents of the University of California.
! 84: * All rights reserved.
! 85: *
! 86: * This code is derived from software contributed to Berkeley by
! 87: * William Jolitz.
! 88: *
! 89: * Redistribution and use in source and binary forms, with or without
! 90: * modification, are permitted provided that the following conditions
! 91: * are met:
! 92: * 1. Redistributions of source code must retain the above copyright
! 93: * notice, this list of conditions and the following disclaimer.
! 94: * 2. Redistributions in binary form must reproduce the above copyright
! 95: * notice, this list of conditions and the following disclaimer in the
! 96: * documentation and/or other materials provided with the distribution.
! 97: * 3. Neither the name of the University nor the names of its contributors
! 98: * may be used to endorse or promote products derived from this software
! 99: * without specific prior written permission.
! 100: *
! 101: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
! 102: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
! 103: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 104: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
! 105: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 106: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 107: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 108: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 109: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 110: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 111: * SUCH DAMAGE.
! 112: *
! 113: * @(#)isa.c 7.2 (Berkeley) 5/13/91
! 114: */
! 115:
! 116: #include <sys/param.h>
! 117: #include <sys/systm.h>
! 118: #include <sys/syslog.h>
! 119: #include <sys/device.h>
! 120: #include <sys/malloc.h>
! 121: #include <sys/proc.h>
! 122:
! 123: #include <uvm/uvm_extern.h>
! 124:
! 125: #include <machine/bus.h>
! 126:
! 127: #include <machine/pio.h>
! 128:
! 129: #include <dev/isa/isareg.h>
! 130: #include <dev/isa/isavar.h>
! 131: #include <dev/isa/isadmavar.h>
! 132: #include <mvmeppc/isa/isa_machdep.h>
! 133:
! 134: void *i8259_intr_establish( void * lcv, int irq, int type, int level,
! 135: int (*ih_fun)(void *), void *ih_arg, char *name);
! 136: void openpic_intr_disestablish(void *, void *);
! 137:
! 138: int isa_has_been_seen = 0;
! 139:
! 140: /*
! 141: * Set up an interrupt handler to start being called.
! 142: * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM.
! 143: */
! 144: void *
! 145: isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
! 146: isa_chipset_tag_t ic;
! 147: int irq;
! 148: int type;
! 149: int level;
! 150: int (*ih_fun)(void *);
! 151: void *ih_arg;
! 152: char *ih_what;
! 153: {
! 154: return(i8259_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what));
! 155: }
! 156:
! 157: /*
! 158: * Deregister an interrupt handler.
! 159: */
! 160: void
! 161: isa_intr_disestablish(ic, arg)
! 162: isa_chipset_tag_t ic;
! 163: void *arg;
! 164: {
! 165: openpic_intr_disestablish(ic, arg);
! 166: }
! 167:
! 168: void
! 169: isa_attach_hook(parent, self, iba)
! 170: struct device *parent, *self;
! 171: struct isabus_attach_args *iba;
! 172: {
! 173:
! 174: /*
! 175: * Notify others that might need to know that the ISA bus
! 176: * has now been attached.
! 177: */
! 178: if (isa_has_been_seen)
! 179: panic("isaattach: ISA bus already seen!");
! 180: isa_has_been_seen = 1;
! 181: }
! 182:
CVSweb