Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2012 20:24:50 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235930 - head/sys/dev/fdt
Message-ID:  <201205242024.q4OKOoFQ058472@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Thu May 24 20:24:49 2012
New Revision: 235930
URL: http://svn.freebsd.org/changeset/base/235930

Log:
  Preset (clear) the ranges we're supposed to fill from the FDT. If a
  particular range (either I/O memory or I/O port) is not defined in
  the FDT, we're not handing uninitialized structures back to our caller.

Modified:
  head/sys/dev/fdt/fdt_pci.c

Modified: head/sys/dev/fdt/fdt_pci.c
==============================================================================
--- head/sys/dev/fdt/fdt_pci.c	Thu May 24 20:12:46 2012	(r235929)
+++ head/sys/dev/fdt/fdt_pci.c	Thu May 24 20:24:49 2012	(r235930)
@@ -100,6 +100,14 @@ fdt_pci_ranges_decode(phandle_t node, st
 	    size_cells);
 	tuples = len / tuple_size;
 
+	/*
+	 * Initialize the ranges so that we don't have to worry about
+	 * having them all defined in the FDT. In particular, it is
+	 * perfectly fine not to want I/O space on PCI busses.
+	 */
+	bzero(io_space, sizeof(*io_space));
+	bzero(mem_space, sizeof(*mem_space));
+
 	rangesptr = &ranges[0];
 	offset_cells = 0;
 	for (i = 0; i < tuples; i++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205242024.q4OKOoFQ058472>