Deleted Added
full compact
psycho.c (178279) psycho.c (178443)
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * Copyright (c) 2005 - 2006 Marius Strobl <marius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * Copyright (c) 2005 - 2006 Marius Strobl <marius@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/sparc64/pci/psycho.c 178279 2008-04-17 12:38:00Z marius $");
34__FBSDID("$FreeBSD: head/sys/sparc64/pci/psycho.c 178443 2008-04-23 20:04:38Z marius $");
35
36/*
37 * Support for `Hummingbird' (UltraSPARC IIe), `Psycho' and `Psycho+'
38 * (UltraSPARC II) and `Sabre' (UltraSPARC IIi) UPA to PCI bridges.
39 */
40
41#include "opt_ofw_pci.h"
42#include "opt_psycho.h"

--- 39 unchanged lines hidden (view full) ---

82static const struct psycho_desc *psycho_get_desc(device_t);
83static void psycho_set_intr(struct psycho_softc *, u_int, bus_addr_t,
84 driver_filter_t, driver_intr_t);
85static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *,
86 bus_addr_t *, u_long *);
87static driver_filter_t psycho_dmasync;
88static void psycho_intr_enable(void *);
89static void psycho_intr_disable(void *);
35
36/*
37 * Support for `Hummingbird' (UltraSPARC IIe), `Psycho' and `Psycho+'
38 * (UltraSPARC II) and `Sabre' (UltraSPARC IIi) UPA to PCI bridges.
39 */
40
41#include "opt_ofw_pci.h"
42#include "opt_psycho.h"

--- 39 unchanged lines hidden (view full) ---

82static const struct psycho_desc *psycho_get_desc(device_t);
83static void psycho_set_intr(struct psycho_softc *, u_int, bus_addr_t,
84 driver_filter_t, driver_intr_t);
85static int psycho_find_intrmap(struct psycho_softc *, u_int, bus_addr_t *,
86 bus_addr_t *, u_long *);
87static driver_filter_t psycho_dmasync;
88static void psycho_intr_enable(void *);
89static void psycho_intr_disable(void *);
90static void psycho_intr_eoi(void *);
90static void psycho_intr_assign(void *);
91static void psycho_intr_clear(void *);
91static bus_space_tag_t psycho_alloc_bus_tag(struct psycho_softc *, int);
92
93/* Interrupt handlers */
94static driver_filter_t psycho_ue;
95static driver_filter_t psycho_ce;
96static driver_filter_t psycho_pci_bus;
97static driver_filter_t psycho_powerfail;
98static driver_intr_t psycho_overtemp;

--- 65 unchanged lines hidden (view full) ---

164DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0);
165
166static SLIST_HEAD(, psycho_softc) psycho_softcs =
167 SLIST_HEAD_INITIALIZER(psycho_softcs);
168
169static const struct intr_controller psycho_ic = {
170 psycho_intr_enable,
171 psycho_intr_disable,
92static bus_space_tag_t psycho_alloc_bus_tag(struct psycho_softc *, int);
93
94/* Interrupt handlers */
95static driver_filter_t psycho_ue;
96static driver_filter_t psycho_ce;
97static driver_filter_t psycho_pci_bus;
98static driver_filter_t psycho_powerfail;
99static driver_intr_t psycho_overtemp;

--- 65 unchanged lines hidden (view full) ---

165DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0);
166
167static SLIST_HEAD(, psycho_softc) psycho_softcs =
168 SLIST_HEAD_INITIALIZER(psycho_softcs);
169
170static const struct intr_controller psycho_ic = {
171 psycho_intr_enable,
172 psycho_intr_disable,
172 psycho_intr_eoi
173 psycho_intr_assign,
174 psycho_intr_clear
173};
174
175struct psycho_icarg {
176 struct psycho_softc *pica_sc;
177 bus_addr_t pica_map;
178 bus_addr_t pica_clr;
179};
180

--- 913 unchanged lines hidden (view full) ---

1094{
1095 struct intr_vector *iv = arg;
1096 struct psycho_icarg *pica = iv->iv_icarg;
1097
1098 PSYCHO_WRITE8(pica->pica_sc, pica->pica_map, iv->iv_vec);
1099}
1100
1101static void
175};
176
177struct psycho_icarg {
178 struct psycho_softc *pica_sc;
179 bus_addr_t pica_map;
180 bus_addr_t pica_clr;
181};
182

--- 913 unchanged lines hidden (view full) ---

1096{
1097 struct intr_vector *iv = arg;
1098 struct psycho_icarg *pica = iv->iv_icarg;
1099
1100 PSYCHO_WRITE8(pica->pica_sc, pica->pica_map, iv->iv_vec);
1101}
1102
1103static void
1102psycho_intr_eoi(void *arg)
1104psycho_intr_assign(void *arg)
1103{
1104 struct intr_vector *iv = arg;
1105 struct psycho_icarg *pica = iv->iv_icarg;
1106
1105{
1106 struct intr_vector *iv = arg;
1107 struct psycho_icarg *pica = iv->iv_icarg;
1108
1109 PSYCHO_WRITE8(pica->pica_sc, pica->pica_map, INTMAP_TID(
1110 PSYCHO_READ8(pica->pica_sc, pica->pica_map), iv->iv_mid));
1111}
1112
1113static void
1114psycho_intr_clear(void *arg)
1115{
1116 struct intr_vector *iv = arg;
1117 struct psycho_icarg *pica = iv->iv_icarg;
1118
1107 PSYCHO_WRITE8(pica->pica_sc, pica->pica_clr, 0);
1108}
1109
1110static int
1111psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
1112 int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
1113 void **cookiep)
1114{

--- 288 unchanged lines hidden ---
1119 PSYCHO_WRITE8(pica->pica_sc, pica->pica_clr, 0);
1120}
1121
1122static int
1123psycho_setup_intr(device_t dev, device_t child, struct resource *ires,
1124 int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
1125 void **cookiep)
1126{

--- 288 unchanged lines hidden ---