Module Name: src
Committed By: macallan
Date: Tue Apr 30 10:16:26 UTC 2013
Modified Files:
src/sys/arch/macppc/pci: u3.c
Log Message:
zero sc_iot and sc_memt before using them
from Phileas Fogg
while there, set sc_dev properly
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/macppc/pci/u3.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/macppc/pci/u3.c
diff -u src/sys/arch/macppc/pci/u3.c:1.6 src/sys/arch/macppc/pci/u3.c:1.7
--- src/sys/arch/macppc/pci/u3.c:1.6 Sat Oct 27 17:18:01 2012
+++ src/sys/arch/macppc/pci/u3.c Tue Apr 30 10:16:25 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: u3.c,v 1.6 2012/10/27 17:18:01 chs Exp $ */
+/* $NetBSD: u3.c,v 1.7 2013/04/30 10:16:25 macallan Exp $ */
/*
* Copyright 2006 Kyma Systems LLC.
@@ -50,6 +50,7 @@
struct ibmcpc_softc
{
+ device_t sc_dev;
struct genppc_pci_chipset sc_pc[8];
struct powerpc_bus_space sc_iot;
struct powerpc_bus_space sc_memt;
@@ -97,6 +98,7 @@ ibmcpc_attach(device_t parent, device_t
char name[32];
aprint_normal("\n");
+ sc->sc_dev = self;
/* u3 address */
if (OF_getprop(node, "reg", reg, sizeof(reg)) < 24) {
@@ -120,6 +122,7 @@ ibmcpc_attach(device_t parent, device_t
if (OF_getprop(child, "bus-range", busrange, 8) < 8)
continue;
+ memset(&sc->sc_iot, 0, sizeof(sc->sc_iot));
sc->sc_iot.pbs_flags = _BUS_SPACE_LITTLE_ENDIAN |
_BUS_SPACE_IO_TYPE;
sc->sc_iot.pbs_base = 0x00000000;
@@ -127,6 +130,7 @@ ibmcpc_attach(device_t parent, device_t
&sc->sc_iot, "ibmcpc io") != 0)
panic("Can't init ibmcpc io tag");
+ memset(&sc->sc_memt, 0, sizeof(sc->sc_memt));
sc->sc_memt.pbs_flags = _BUS_SPACE_LITTLE_ENDIAN |
_BUS_SPACE_MEM_TYPE;
sc->sc_memt.pbs_base = 0x00000000;