openpic_iobus.c (124469) | openpic_iobus.c (127135) |
---|---|
1/* 2 * Copyright 2003 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * 27 */ 28 29/* 30 * The psim iobus attachment for the OpenPIC interrupt controller. 31 */ 32 33#include <sys/cdefs.h> | 1/* 2 * Copyright 2003 by Peter Grehan. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * 27 */ 28 29/* 30 * The psim iobus attachment for the OpenPIC interrupt controller. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/powerpc/psim/openpic_iobus.c 124469 2004-01-13 11:24:36Z grehan $"); | 34__FBSDID("$FreeBSD: head/sys/powerpc/psim/openpic_iobus.c 127135 2004-03-17 17:50:55Z njl $"); |
35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/bus.h> 39#include <sys/conf.h> 40#include <sys/kernel.h> 41 42#include <dev/ofw/openfirm.h> --- 152 unchanged lines hidden (view full) --- 195{ 196 struct openpic_iobus_softc *sc; 197 int rid; 198 199 sc = ppicsoftc; 200 KASSERT(sc != NULL, ("pic not nexus-probed\n")); 201 202 rid = 0; | 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/bus.h> 39#include <sys/conf.h> 40#include <sys/kernel.h> 41 42#include <dev/ofw/openfirm.h> --- 152 unchanged lines hidden (view full) --- 195{ 196 struct openpic_iobus_softc *sc; 197 int rid; 198 199 sc = ppicsoftc; 200 KASSERT(sc != NULL, ("pic not nexus-probed\n")); 201 202 rid = 0; |
203 sc->sc_memr = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, 0, ~0, 1, | 203 sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, |
204 RF_ACTIVE); 205 206 if (sc->sc_memr == NULL) { 207 device_printf(dev, "Could not alloc mem resource!\n"); 208 return (ENXIO); 209 } 210 211 sc->osc.sc_psim = 1; 212 sc->osc.sc_bt = rman_get_bustag(sc->sc_memr); 213 sc->osc.sc_bh = rman_get_bushandle(sc->sc_memr); 214 sc->osc.sc_altdev = dev; 215 216 return (openpic_attach(sc->sc_ndev)); 217} 218 219 | 204 RF_ACTIVE); 205 206 if (sc->sc_memr == NULL) { 207 device_printf(dev, "Could not alloc mem resource!\n"); 208 return (ENXIO); 209 } 210 211 sc->osc.sc_psim = 1; 212 sc->osc.sc_bt = rman_get_bustag(sc->sc_memr); 213 sc->osc.sc_bh = rman_get_bushandle(sc->sc_memr); 214 sc->osc.sc_altdev = dev; 215 216 return (openpic_attach(sc->sc_ndev)); 217} 218 219 |