Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/macppc/pci zero sc_iot and sc_memt before using them
details: https://anonhg.NetBSD.org/src/rev/65a1e9dfcf6a
branches: trunk
changeset: 786512:65a1e9dfcf6a
user: macallan <macallan%NetBSD.org@localhost>
date: Tue Apr 30 10:16:25 2013 +0000
description:
zero sc_iot and sc_memt before using them
from Phileas Fogg
while there, set sc_dev properly
diffstat:
sys/arch/macppc/pci/u3.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diffs (41 lines):
diff -r 844fa2c73b79 -r 65a1e9dfcf6a sys/arch/macppc/pci/u3.c
--- a/sys/arch/macppc/pci/u3.c Tue Apr 30 05:39:44 2013 +0000
+++ b/sys/arch/macppc/pci/u3.c Tue Apr 30 10:16:25 2013 +0000
@@ -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 @@
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 @@
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 @@
&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;
Home |
Main Index |
Thread Index |
Old Index