Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2004 19:19:42 -0800 (PST)
From:      Warner Losh <imp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 45187 for review
Message-ID:  <200401120319.i0C3JgK9099658@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=45187

Change 45187 by imp@imp_pacopaco on 2004/01/11 19:19:05

	integrate from newcard: fix the alignment issues.

Affected files ...

.. //depot/projects/power/sys/dev/pci/pci.c#9 integrate

Differences ...

==== //depot/projects/power/sys/dev/pci/pci.c#9 (text+ko) ====

@@ -1443,6 +1443,7 @@
 	struct resource_list_entry *rle;
 	struct resource *res;
 	uint32_t map, testval;
+	int mapsize;
 
 	/*
 	 * Weed out the bogons, and figure out how large the BAR/map is.
@@ -1467,7 +1468,10 @@
 	 * appropriate bar for that resource (this is the part
 	 * I'm not sure is good for 64-bit bars).
 	 */
-	count = 1 << pci_mapsize(testval);
+	mapsize = pci_mapsize(testval);
+	count = 1 << mapsize;
+	if (RF_ALIGNMENT(flags) < mapsize)
+	    flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
 	res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid,
 	    start, end, count, flags);
 	if (res == NULL) {



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