xref: /netbsd-src/sys/arch/arc/pci/necpbvar.h (revision 0f31d9dee9b3e30aac94db76ac0ef139dce60f46)
1*0f31d9deStsutsui /*	$NetBSD: necpbvar.h,v 1.7 2008/07/05 08:46:25 tsutsui Exp $	*/
21258a246Ssoda 
31258a246Ssoda /*-
41258a246Ssoda  * Copyright (C) 2000 Shuichiro URATA.  All rights reserved.
51258a246Ssoda  *
61258a246Ssoda  * Redistribution and use in source and binary forms, with or without
71258a246Ssoda  * modification, are permitted provided that the following conditions
81258a246Ssoda  * are met:
91258a246Ssoda  * 1. Redistributions of source code must retain the above copyright
101258a246Ssoda  *    notice, this list of conditions and the following disclaimer.
111258a246Ssoda  * 2. Redistributions in binary form must reproduce the above copyright
121258a246Ssoda  *    notice, this list of conditions and the following disclaimer in the
131258a246Ssoda  *    documentation and/or other materials provided with the distribution.
141258a246Ssoda  * 3. The name of the author may not be used to endorse or promote products
151258a246Ssoda  *    derived from this software without specific prior written permission.
161258a246Ssoda  *
171258a246Ssoda  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
181258a246Ssoda  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
191258a246Ssoda  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
201258a246Ssoda  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
211258a246Ssoda  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
221258a246Ssoda  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231258a246Ssoda  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241258a246Ssoda  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251258a246Ssoda  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
261258a246Ssoda  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271258a246Ssoda  */
281258a246Ssoda 
29eab4fd5eSsoda struct necpb_context {
3049e5e093Ssoda 	int	nc_initialized;
3149e5e093Ssoda 	struct arc_bus_space nc_memt;
3249e5e093Ssoda 	struct arc_bus_space nc_iot;
3349e5e093Ssoda 	struct arc_bus_dma_tag nc_dmat;
3449e5e093Ssoda 	struct arc_pci_chipset nc_pc;
3549e5e093Ssoda };
3649e5e093Ssoda 
371258a246Ssoda struct necpb_softc {
38*0f31d9deStsutsui 	device_t sc_dev;
39eab4fd5eSsoda 	struct necpb_context *sc_ncp;
401258a246Ssoda };
411258a246Ssoda 
421258a246Ssoda struct necpb_intrhand {
437fe2a5a0Stsutsui 	int	(*ih_func)(void *);		/* interrupt handler */
44c747a937Stsutsui 	void	*ih_arg;			/* arg for handler */
45c747a937Stsutsui 	struct	necpb_intrhand *ih_next;	/* next intrhand chain */
46c747a937Stsutsui 	int	ih_intn;			/* interrupt channel */
47c747a937Stsutsui 	struct evcnt ih_evcnt;			/* interrupt counter */
48c747a937Stsutsui 	char ih_evname[32];			/* event counter name */
491258a246Ssoda };
5049e5e093Ssoda 
517fe2a5a0Stsutsui void	necpb_init(struct necpb_context *ncp);
5249e5e093Ssoda 
5349e5e093Ssoda /* for console initialization */
54eab4fd5eSsoda extern struct necpb_context necpb_main_context;
55