aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2011-03-03 20:13:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2011-03-03 20:13:44 +0000
commit98baa7ba20ac4d85072368ea2f39e99b4377ceaf (patch)
treeeb68ae4dbcee41451a6aab0005335bd8e36a246e /sys/dev/pci
parente0f0220985500a5e17a5f267db0a3c5796bc33bb (diff)
Notes
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index ae3d3c556a16..b94ef4427fe5 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -2499,13 +2499,13 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl,
return (barlen);
}
- count = 1 << mapsize;
+ count = (pci_addr_t)1 << mapsize;
if (basezero || base == pci_mapbase(testval)) {
start = 0; /* Let the parent decide. */
end = ~0ULL;
} else {
start = base;
- end = base + (1 << mapsize) - 1;
+ end = base + count - 1;
}
resource_list_add(rl, type, reg, start, end, count);
@@ -3680,7 +3680,7 @@ pci_alloc_map(device_t dev, device_t child, int type, int *rid,
* another driver, which won't work.
*/
mapsize = pci_mapsize(testval);
- count = 1UL << mapsize;
+ count = (pci_addr_t)1 << mapsize;
if (RF_ALIGNMENT(flags) < mapsize)
flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))