summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/pci
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2005-12-03 18:11:26 +0000
committermarius <marius@FreeBSD.org>2005-12-03 18:11:26 +0000
commit1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932 (patch)
tree40e0c87be96fddaf2b7db76031fd15927225832e /sys/sparc64/pci
parent865e779b5d6ed4275a000576a9d4af4bf4b52706 (diff)
downloadFreeBSD-src-1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932.zip
FreeBSD-src-1ae8104ca4cc5d5cf71ea4c34ee21fa30a7e1932.tar.gz
- Adhere style(9) (don't use function calls in initializers, use uintXX_t
instead of u_intXX_t). - Use FBSDID.
Diffstat (limited to 'sys/sparc64/pci')
-rw-r--r--sys/sparc64/pci/apb.c13
-rw-r--r--sys/sparc64/pci/ofw_pci.c11
-rw-r--r--sys/sparc64/pci/ofw_pcib_subr.c32
-rw-r--r--sys/sparc64/pci/ofw_pcibus.c4
4 files changed, 35 insertions, 25 deletions
diff --git a/sys/sparc64/pci/apb.c b/sys/sparc64/pci/apb.c
index 2dbe7d0..0e743b4 100644
--- a/sys/sparc64/pci/apb.c
+++ b/sys/sparc64/pci/apb.c
@@ -29,10 +29,11 @@
* SUCH DAMAGE.
*
* from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
/*
* Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge.
* This bridge does not fully comply to the PCI bridge specification, and is
@@ -69,8 +70,8 @@
*/
struct apb_softc {
struct ofw_pcib_gen_softc sc_bsc;
- u_int8_t sc_iomap;
- u_int8_t sc_memmap;
+ uint8_t sc_iomap;
+ uint8_t sc_memmap;
};
static device_probe_t apb_probe;
@@ -143,7 +144,7 @@ apb_probe(device_t dev)
}
static void
-apb_map_print(u_int8_t map, u_long scale)
+apb_map_print(uint8_t map, u_long scale)
{
int i, first;
@@ -157,7 +158,7 @@ apb_map_print(u_int8_t map, u_long scale)
}
static int
-apb_checkrange(u_int8_t map, u_long scale, u_long start, u_long end)
+apb_checkrange(uint8_t map, u_long scale, u_long start, u_long end)
{
int i, ei;
diff --git a/sys/sparc64/pci/ofw_pci.c b/sys/sparc64/pci/ofw_pci.c
index 764c362..998b498 100644
--- a/sys/sparc64/pci/ofw_pci.c
+++ b/sys/sparc64/pci/ofw_pci.c
@@ -27,10 +27,11 @@
* SUCH DAMAGE.
*
* from: NetBSD: psycho.c,v 1.35 2001/09/10 16:17:06 eeh Exp
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "opt_ofw_pci.h"
#include <sys/param.h>
@@ -44,18 +45,18 @@
#include <sparc64/pci/ofw_pci.h>
-static u_int8_t pci_bus_cnt;
+static uint8_t pci_bus_cnt;
static phandle_t *pci_bus_map;
static int pci_bus_map_sz;
#define PCI_BUS_MAP_INC 10
-u_int8_t
+uint8_t
ofw_pci_alloc_busno(phandle_t node)
{
phandle_t *om;
int osz;
- u_int8_t n;
+ uint8_t n;
n = pci_bus_cnt++;
/* Establish a mapping between bus numbers and device nodes. */
diff --git a/sys/sparc64/pci/ofw_pcib_subr.c b/sys/sparc64/pci/ofw_pcib_subr.c
index b297d34..80f6d5f 100644
--- a/sys/sparc64/pci/ofw_pcib_subr.c
+++ b/sys/sparc64/pci/ofw_pcib_subr.c
@@ -21,10 +21,11 @@
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "opt_ofw_pci.h"
#include <sys/param.h>
@@ -50,9 +51,10 @@
void
ofw_pcib_gen_setup(device_t bridge)
{
- struct ofw_pcib_gen_softc *sc = device_get_softc(bridge);
+ struct ofw_pcib_gen_softc *sc;
u_int secbus;
+ sc = device_get_softc(bridge);
sc->ops_pcib_sc.dev = bridge;
sc->ops_node = ofw_bus_get_node(bridge);
KASSERT(sc->ops_node != 0,
@@ -78,18 +80,19 @@ ofw_pcib_gen_setup(device_t bridge)
int
ofw_pcib_gen_route_interrupt(device_t bridge, device_t dev, int intpin)
{
- struct ofw_pcib_gen_softc *sc = device_get_softc(bridge);
- struct ofw_bus_iinfo *ii = &sc->ops_iinfo;
+ struct ofw_pcib_gen_softc *sc;
+ struct ofw_bus_iinfo *ii;
struct ofw_pci_register reg;
- device_t pbridge = device_get_parent(device_get_parent(bridge));
- phandle_t node = ofw_bus_get_node(dev);
ofw_pci_intr_t pintr, mintr;
- u_int8_t maskbuf[sizeof(reg) + sizeof(pintr)];
+ uint8_t maskbuf[sizeof(reg) + sizeof(pintr)];
+ sc = device_get_softc(bridge);
+ ii = &sc->ops_iinfo;
if (ii->opi_imapsz > 0) {
pintr = intpin;
- if (ofw_bus_lookup_imap(node, ii, &reg, sizeof(reg), &pintr,
- sizeof(pintr), &mintr, sizeof(mintr), maskbuf)) {
+ if (ofw_bus_lookup_imap(ofw_bus_get_node(dev), ii, &reg,
+ sizeof(reg), &pintr, sizeof(pintr), &mintr, sizeof(mintr),
+ maskbuf)) {
/*
* If we've found a mapping, return it and don't map
* it again on higher levels - that causes problems
@@ -105,22 +108,25 @@ ofw_pcib_gen_route_interrupt(device_t bridge, device_t dev, int intpin)
return (pcib_route_interrupt(bridge, dev, intpin));
}
/* Try at the parent. */
- return (PCIB_ROUTE_INTERRUPT(pbridge, bridge, intpin));
+ return (PCIB_ROUTE_INTERRUPT(device_get_parent(bridge), bridge,
+ intpin));
}
phandle_t
ofw_pcib_gen_get_node(device_t bridge, device_t dev)
{
- struct ofw_pcib_gen_softc *sc = device_get_softc(bridge);
+ struct ofw_pcib_gen_softc *sc;
+ sc = device_get_softc(bridge);
return (sc->ops_node);
}
void
ofw_pcib_gen_adjust_busrange(device_t bridge, u_int subbus)
{
- struct ofw_pcib_gen_softc *sc = device_get_softc(bridge);
+ struct ofw_pcib_gen_softc *sc;
+ sc = device_get_softc(bridge);
if (subbus > sc->ops_pcib_sc.subbus) {
#ifdef OFW_PCI_DEBUG
device_printf(bridge,
diff --git a/sys/sparc64/pci/ofw_pcibus.c b/sys/sparc64/pci/ofw_pcibus.c
index 6928de6..0ee2456 100644
--- a/sys/sparc64/pci/ofw_pcibus.c
+++ b/sys/sparc64/pci/ofw_pcibus.c
@@ -200,12 +200,14 @@ ofw_pcibus_setup_device(device_t bridge, u_int busno, u_int slot, u_int func)
static int
ofw_pcibus_attach(device_t dev)
{
- device_t pcib = device_get_parent(dev);
+ device_t pcib;
struct ofw_pci_register pcir;
struct ofw_pcibus_devinfo *dinfo;
phandle_t node, child;
u_int slot, busno, func;
+ pcib = device_get_parent(dev);
+
/*
* Ask the bridge for the bus number - in some cases, we need to
* renumber buses, so the firmware information cannot be trusted.
OpenPOWER on IntegriCloud