PERFORCE change 45187 for review
Warner Losh
imp at FreeBSD.org
Sun Jan 11 19:19:44 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=45187
Change 45187 by imp at 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) {
More information about the p4-projects
mailing list