puc.c (245471) | puc.c (263109) |
---|---|
1/*- 2 * Copyright (c) 2006 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 245471 2013-01-15 20:13:25Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/dev/puc/puc.c 263109 2014-03-13 15:57:25Z rstone $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/bus.h> 34#include <sys/conf.h> 35#include <sys/malloc.h> 36#include <sys/mutex.h> | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/bus.h> 34#include <sys/conf.h> 35#include <sys/malloc.h> 36#include <sys/mutex.h> |
37#include <sys/sysctl.h> |
|
37 38#include <machine/bus.h> 39#include <machine/resource.h> 40#include <sys/rman.h> 41 42#include <dev/pci/pcireg.h> 43#include <dev/pci/pcivar.h> 44 --- 20 unchanged lines hidden (view full) --- 65 int p_ipend; 66}; 67 68devclass_t puc_devclass; 69const char puc_driver_name[] = "puc"; 70 71static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); 72 | 38 39#include <machine/bus.h> 40#include <machine/resource.h> 41#include <sys/rman.h> 42 43#include <dev/pci/pcireg.h> 44#include <dev/pci/pcivar.h> 45 --- 20 unchanged lines hidden (view full) --- 66 int p_ipend; 67}; 68 69devclass_t puc_devclass; 70const char puc_driver_name[] = "puc"; 71 72static MALLOC_DEFINE(M_PUC, "PUC", "PUC driver"); 73 |
74SYSCTL_NODE(_hw, OID_AUTO, puc, CTLFLAG_RD, 0, "puc(9) driver configuration"); 75 |
|
73struct puc_bar * 74puc_get_bar(struct puc_softc *sc, int rid) 75{ 76 struct puc_bar *bar; 77 struct rman *rm; 78 u_long end, start; 79 int error, i; 80 --- 238 unchanged lines hidden (view full) --- 319 320 error = puc_config(sc, PUC_CFG_GET_ILR, 0, &res); 321 if (error) 322 goto fail; 323 sc->sc_ilr = res; 324 if (bootverbose && sc->sc_ilr != 0) 325 device_printf(dev, "using interrupt latch register\n"); 326 | 76struct puc_bar * 77puc_get_bar(struct puc_softc *sc, int rid) 78{ 79 struct puc_bar *bar; 80 struct rman *rm; 81 u_long end, start; 82 int error, i; 83 --- 238 unchanged lines hidden (view full) --- 322 323 error = puc_config(sc, PUC_CFG_GET_ILR, 0, &res); 324 if (error) 325 goto fail; 326 sc->sc_ilr = res; 327 if (bootverbose && sc->sc_ilr != 0) 328 device_printf(dev, "using interrupt latch register\n"); 329 |
327 sc->sc_irid = 0; | |
328 sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, 329 RF_ACTIVE|RF_SHAREABLE); 330 if (sc->sc_ires != NULL) { 331 error = bus_setup_intr(dev, sc->sc_ires, 332 INTR_TYPE_TTY, puc_intr, NULL, sc, &sc->sc_icookie); 333 if (error) 334 error = bus_setup_intr(dev, sc->sc_ires, 335 INTR_TYPE_TTY | INTR_MPSAFE, NULL, --- 431 unchanged lines hidden --- | 330 sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irid, 331 RF_ACTIVE|RF_SHAREABLE); 332 if (sc->sc_ires != NULL) { 333 error = bus_setup_intr(dev, sc->sc_ires, 334 INTR_TYPE_TTY, puc_intr, NULL, sc, &sc->sc_icookie); 335 if (error) 336 error = bus_setup_intr(dev, sc->sc_ires, 337 INTR_TYPE_TTY | INTR_MPSAFE, NULL, --- 431 unchanged lines hidden --- |