Home | History | Annotate | Line # | Download | only in isa
      1  1.7     matt /*	$NetBSD: isa_machdep_common.c,v 1.7 2011/06/18 06:41:43 matt Exp $	*/
      2  1.2  garbled 
      3  1.2  garbled /*-
      4  1.2  garbled  * Copyright (c) 2007 The NetBSD Foundation, Inc.
      5  1.2  garbled  * All rights reserved.
      6  1.2  garbled  *
      7  1.2  garbled  * This code is derived from software contributed to The NetBSD Foundation
      8  1.2  garbled  * by Tim Rightnour
      9  1.2  garbled  *
     10  1.2  garbled  * Redistribution and use in source and binary forms, with or without
     11  1.2  garbled  * modification, are permitted provided that the following conditions
     12  1.2  garbled  * are met:
     13  1.2  garbled  * 1. Redistributions of source code must retain the above copyright
     14  1.2  garbled  *    notice, this list of conditions and the following disclaimer.
     15  1.2  garbled  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.2  garbled  *    notice, this list of conditions and the following disclaimer in the
     17  1.2  garbled  *    documentation and/or other materials provided with the distribution.
     18  1.2  garbled  *
     19  1.2  garbled  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.2  garbled  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.2  garbled  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.2  garbled  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.2  garbled  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.2  garbled  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.2  garbled  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.2  garbled  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.2  garbled  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.2  garbled  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.2  garbled  * POSSIBILITY OF SUCH DAMAGE.
     30  1.2  garbled  */
     31  1.2  garbled 
     32  1.2  garbled #include <sys/cdefs.h>
     33  1.7     matt __KERNEL_RCSID(0, "$NetBSD: isa_machdep_common.c,v 1.7 2011/06/18 06:41:43 matt Exp $");
     34  1.2  garbled 
     35  1.2  garbled #include <sys/param.h>
     36  1.2  garbled #include <sys/systm.h>
     37  1.2  garbled #include <sys/syslog.h>
     38  1.2  garbled #include <sys/device.h>
     39  1.7     matt #include <sys/intr.h>
     40  1.2  garbled 
     41  1.2  garbled #include <machine/pio.h>
     42  1.2  garbled 
     43  1.2  garbled #include <dev/isa/isareg.h>
     44  1.2  garbled #include <dev/isa/isavar.h>
     45  1.2  garbled 
     46  1.2  garbled #define	IO_ELCR1	0x4d0
     47  1.2  garbled #define	IO_ELCR2	0x4d1
     48  1.2  garbled 
     49  1.2  garbled const struct evcnt *
     50  1.2  garbled genppc_isa_intr_evcnt(isa_chipset_tag_t ic, int irq)
     51  1.2  garbled {
     52  1.2  garbled 
     53  1.2  garbled 	/* XXX for now, no evcnt parent reported */
     54  1.2  garbled 	return NULL;
     55  1.2  garbled }
     56  1.2  garbled 
     57  1.2  garbled /*
     58  1.2  garbled  * Set up an interrupt handler to start being called.
     59  1.2  garbled  */
     60  1.2  garbled void *
     61  1.2  garbled genppc_isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level,
     62  1.2  garbled     int (*ih_fun)(void *), void *ih_arg)
     63  1.2  garbled {
     64  1.2  garbled 
     65  1.2  garbled 	return (void *)intr_establish(irq, type, level, ih_fun, ih_arg);
     66  1.2  garbled }
     67  1.2  garbled 
     68  1.2  garbled /*
     69  1.2  garbled  * Deregister an interrupt handler.
     70  1.2  garbled  */
     71  1.2  garbled void
     72  1.2  garbled genppc_isa_intr_disestablish(isa_chipset_tag_t ic, void *arg)
     73  1.2  garbled {
     74  1.2  garbled 
     75  1.2  garbled 	intr_disestablish(arg);
     76  1.2  garbled }
     77  1.2  garbled 
     78  1.2  garbled void
     79  1.6     matt genppc_isa_attach_hook(device_t parent, device_t self,
     80  1.2  garbled     struct isabus_attach_args *iba)
     81  1.2  garbled {
     82  1.2  garbled 
     83  1.2  garbled 	/* Nothing to do. */
     84  1.2  garbled }
     85  1.4   dyoung 
     86  1.4   dyoung void
     87  1.5   dyoung genppc_isa_detach_hook(isa_chipset_tag_t ic, device_t self)
     88  1.4   dyoung {
     89  1.4   dyoung 
     90  1.4   dyoung 	/* Nothing to do. */
     91  1.4   dyoung }
     92