Home | History | Annotate | Line # | Download | only in include
isa_machdep.h revision 1.1.1.2
      1  1.1  soda /*      $OpenBSD: isa_machdep.h,v 1.5 1997/04/19 17:20:00 pefo Exp $  */
      2  1.1  soda 
      3  1.1  soda /*
      4  1.1  soda  * Copyright (c) 1996 Per Fogelstrom
      5  1.1  soda  * All rights reserved.
      6  1.1  soda  *
      7  1.1  soda  * Redistribution and use in source and binary forms, with or without
      8  1.1  soda  * modification, are permitted provided that the following conditions
      9  1.1  soda  * are met:
     10  1.1  soda  * 1. Redistributions of source code must retain the above copyright
     11  1.1  soda  *    notice, this list of conditions and the following disclaimer.
     12  1.1  soda  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  soda  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  soda  *    documentation and/or other materials provided with the distribution.
     15  1.1  soda  * 3. All advertising materials mentioning features or use of this software
     16  1.1  soda  *    must display the following acknowledgement:
     17  1.1  soda  *      This product includes software developed by Per Fogelstrom
     18  1.1  soda  * 4. The name of the author may not be used to endorse or promote products
     19  1.1  soda  *    derived from this software without specific prior written permission
     20  1.1  soda  *
     21  1.1  soda  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  1.1  soda  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  1.1  soda  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  1.1  soda  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  1.1  soda  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  1.1  soda  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  1.1  soda  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  1.1  soda  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  1.1  soda  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  1.1  soda  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  1.1  soda  */
     32  1.1  soda #ifndef _ISA_MACHDEP_H_
     33  1.1  soda #define _ISA_MACHDEP_H_
     34  1.1  soda 
     35  1.1  soda typedef struct arc_isa_bus *isa_chipset_tag_t;
     36  1.1  soda 
     37  1.1  soda /*
     38  1.1  soda  *      I/O macros to access isa bus ports/memory.
     39  1.1  soda  *      At the first glance theese macros may seem inefficient.
     40  1.1  soda  *      However, the cpu executes an instruction every 7.5ns
     41  1.1  soda  *      so the bus is much slower so it doesn't matter, really.
     42  1.1  soda  */
     43  1.1  soda #define isa_outb(x,y)   outb(arc_bus_io.bus_base + (x), y)
     44  1.1  soda #define isa_inb(x)      inb(arc_bus_io.bus_base + (x))
     45  1.1  soda 
     46  1.1  soda struct arc_isa_bus {
     47  1.1  soda         void    *ic_data;
     48  1.1  soda 
     49  1.1  soda         void    (*ic_attach_hook) __P((struct device *, struct device *,
     50  1.1  soda                     struct isabus_attach_args *));
     51  1.1  soda         void    *(*ic_intr_establish) __P((isa_chipset_tag_t, int, int, int,
     52  1.1  soda                     int (*)(void *), void *, char *));
     53  1.1  soda         void    (*ic_intr_disestablish) __P((isa_chipset_tag_t, void *));
     54  1.1  soda };
     55  1.1  soda 
     56  1.1  soda 
     57  1.1  soda /*
     58  1.1  soda  * Functions provided to machine-independent ISA code.
     59  1.1  soda  */
     60  1.1  soda #define isa_attach_hook(p, s, a)                             /*           \
     61  1.1  soda     (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) */
     62  1.1  soda #define isa_intr_establish(c, i, t, l, f, a, w)                         \
     63  1.1  soda     (*(c)->ic_intr_establish)((c)->ic_data, (i), (t), (l), (f), (a), (w))
     64  1.1  soda #define isa_intr_disestablish(c, h)                                     \
     65  1.1  soda     (*(c)->ic_intr_disestablish)((c)->ic_data, (h))
     66  1.1  soda 
     67  1.1  soda void sysbeepstop __P((void *));
     68  1.1  soda void sysbeep __P((int, int));
     69  1.1  soda 
     70  1.1  soda 
     71  1.1  soda /*
     72  1.1  soda  *	Interrupt control struct used to control the ICU setup.
     73  1.1  soda  */
     74  1.1  soda 
     75  1.1  soda struct intrhand {
     76  1.1  soda 	struct	intrhand *ih_next;
     77  1.1  soda 	int	(*ih_fun) __P((void *));
     78  1.1  soda 	void    *ih_arg;
     79  1.1  soda 	u_long  ih_count;
     80  1.1  soda 	int     ih_level;
     81  1.1  soda 	int     ih_irq;
     82  1.1  soda 	char    *ih_what;
     83  1.1  soda };
     84  1.1  soda 
     85  1.1  soda #endif /* _ISA_MACHDEP_H_ */
     86