Annotation of sys/arch/mvmeppc/include/autoconf.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: autoconf.h,v 1.4 2003/06/09 16:34:22 deraadt Exp $ */
! 2:
! 3: /*
! 4: * Copyright (c) 1997 Per Fogelstrom
! 5: *
! 6: * Redistribution and use in source and binary forms, with or without
! 7: * modification, are permitted provided that the following conditions
! 8: * are met:
! 9: * 1. Redistributions of source code must retain the above copyright
! 10: * notice, this list of conditions and the following disclaimer.
! 11: * 2. Redistributions in binary form must reproduce the above copyright
! 12: * notice, this list of conditions and the following disclaimer in the
! 13: * documentation and/or other materials provided with the distribution.
! 14: *
! 15: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
! 16: * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
! 18: * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
! 19: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! 20: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
! 21: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
! 22: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! 23: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
! 24: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
! 25: * SUCH DAMAGE.
! 26: *
! 27: */
! 28: /*
! 29: * Machine-dependent structures of autoconfiguration
! 30: */
! 31:
! 32: #ifndef _MACHINE_AUTOCONF_H_
! 33: #define _MACHINE_AUTOCONF_H_
! 34:
! 35: #include <machine/bus.h>
! 36:
! 37: /*
! 38: * System types.
! 39: */
! 40: #define OFWMACH 0 /* Openfirmware drivers */
! 41: #define POWER4e 1 /* V.I Power.4e board */
! 42: #define PWRSTK 2 /* Motorola Powerstack series */
! 43: #define APPL 3 /* Apple PowerMac machines (OFW?) */
! 44: #define MVME 4 /* Motorola MVME SBCs */
! 45:
! 46: extern int system_type;
! 47:
! 48: /**/
! 49: struct confargs;
! 50:
! 51: typedef int (*intr_handler_t)(void *);
! 52:
! 53: typedef struct bushook {
! 54: struct device *bh_dv;
! 55: int bh_type;
! 56: void (*bh_intr_establish)(struct confargs *, intr_handler_t, void *);
! 57: void (*bh_intr_disestablish)(struct confargs *);
! 58: int (*bh_matchname)(struct confargs *, char *);
! 59: } bushook_t;
! 60:
! 61: #define BUS_MAIN 1 /* mainbus */
! 62: #define BUS_ISABR 2 /* ISA Bridge Bus */
! 63: #define BUS_PCIBR 3 /* PCI bridge */
! 64: #define BUS_VMEBR 4 /* VME bridge */
! 65:
! 66: #define BUS_INTR_ESTABLISH(ca, handler, val) \
! 67: (*(ca)->ca_bus->bh_intr_establish)((ca), (handler), (val))
! 68: #define BUS_INTR_DISESTABLISH(ca) \
! 69: (*(ca)->ca_bus->bh_intr_establish)(ca)
! 70: #define BUS_CVTADDR(ca) \
! 71: (*(ca)->ca_bus->bh_cvtaddr)(ca)
! 72: #define BUS_MATCHNAME(ca, name) \
! 73: (*(ca)->ca_bus->bh_matchname)((ca), (name))
! 74:
! 75: struct confargs {
! 76: char *ca_name; /* Device name. */
! 77: bushook_t *ca_bus; /* bus device resides on. */
! 78: /* macobio hooks ?? */
! 79: bus_space_tag_t ca_iot;
! 80: bus_space_tag_t ca_memt; /* XXX */
! 81: u_int32_t ca_node;
! 82: int ca_nreg;
! 83: u_int32_t *ca_reg;
! 84: int ca_nintr;
! 85: int32_t *ca_intr;
! 86: u_int ca_baseaddr;
! 87:
! 88: };
! 89:
! 90: void set_clockintr(void (*)(struct clockframe *));
! 91: void set_iointr(void (*)(void *, int));
! 92: int badaddr(void *, u_int32_t);
! 93:
! 94: #endif /* _MACHINE_AUTOCONF_H_ */
CVSweb