apbvar.h revision 199497
1193323Sed/*-
2193323Sed * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org>
3193323Sed * All rights reserved.
4193323Sed *
5193323Sed * Redistribution and use in source and binary forms, with or without
6193323Sed * modification, are permitted provided that the following conditions
7193323Sed * are met:
8193323Sed * 1. Redistributions of source code must retain the above copyright
9193323Sed *    notice unmodified, this list of conditions, and the following
10193323Sed *    disclaimer.
11193323Sed * 2. Redistributions in binary form must reproduce the above copyright
12193323Sed *    notice, this list of conditions and the following disclaimer in the
13193323Sed *    documentation and/or other materials provided with the distribution.
14193323Sed *
15193323Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16193323Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17193323Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18193323Sed * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19193323Sed * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20193323Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21193323Sed * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22193323Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23193323Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24193323Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25193323Sed * SUCH DAMAGE.
26193323Sed */
27193323Sed
28193323Sed#ifndef _APBVAR_H_
29193323Sed#define _APBVAR_H_
30193323Sed
31193323Sed#define	APB_IRQ_BASE		0
32193323Sed#define	APB_IRQ_END		7
33193323Sed#define	APB_NIRQS		8
34193323Sed
35193323Sedstruct apb_softc {
36193323Sed	struct rman		apb_irq_rman;
37193323Sed	struct rman		apb_mem_rman;
38193323Sed	/* IRQ events structs for child devices */
39193323Sed	struct intr_event	*sc_eventstab[APB_NIRQS];
40193323Sed	mips_intrcnt_t		sc_intr_counter[APB_NIRQS];
41193323Sed	/* Resources and cookies for MIPS CPU INTs */
42193323Sed	struct resource		*sc_misc_irq;
43193323Sed	void			*sc_misc_ih;
44193323Sed};
45193323Sed
46193323Sedstruct apb_ivar {
47193323Sed	struct resource_list	resources;
48193323Sed};
49193323Sed
50193323Sed#endif /* _APBVAR_H_ */
51193323Sed