diff options
author | hrs <hrs@FreeBSD.org> | 2011-06-11 06:56:26 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2011-06-11 06:56:26 +0000 |
commit | b2a6f5600367e61c439c79db2317d4619960e2ce (patch) | |
tree | b813a06aa0583761055c631f2a5c54ae5943b77b /sys/dev/pci/pci_pci.c | |
parent | d4f481b2900357dc1f0d48b9f4e052a920909b02 (diff) | |
parent | c8e3d11e24e29c032a1ed9d46c65d8f10e9f0030 (diff) | |
download | FreeBSD-src-b2a6f5600367e61c439c79db2317d4619960e2ce.zip FreeBSD-src-b2a6f5600367e61c439c79db2317d4619960e2ce.tar.gz |
Merge from HEAD@222975.
Diffstat (limited to 'sys/dev/pci/pci_pci.c')
-rw-r--r-- | sys/dev/pci/pci_pci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index f68973b..da8465c 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -916,7 +916,8 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, /* Move end_free down until it is properly aligned. */ end_free &= ~(align - 1); - front = end_free - count; + end_free--; + front = end_free - (count - 1); /* * The resource would now be allocated at (front, @@ -944,7 +945,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, /* Move start_free up until it is properly aligned. */ start_free = roundup2(start_free, align); - back = start_free + count; + back = start_free + count - 1; /* * The resource would now be allocated at (start_free, @@ -957,7 +958,7 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type, if (bootverbose) printf("\tback candidate range: %#lx-%#lx\n", start_free, back); - back = roundup2(back, w->step) - 1; + back = roundup2(back + 1, w->step) - 1; back -= rman_get_end(w->res); } else back = 0; |