diff options
| author | Warner Losh <imp@FreeBSD.org> | 2006-10-30 22:46:33 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2006-10-30 22:46:33 +0000 |
| commit | a12fb4e6327bdad7511b6da3d97a2fd60b7821b1 (patch) | |
| tree | c8b5c7636a22e0f2267928601e1cece8790f14ef /sys/dev/pci | |
| parent | a1610d83b898cbd85caa57976bf6c972526c9d23 (diff) | |
Notes
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/pci.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index bbdff0f5c285..c6dedb95371c 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1315,13 +1315,6 @@ pci_add_map(device_t pcib, device_t bus, device_t dev, start = base; end = base + (1 << ln2size) - 1; } - if ((u_long)start != start) { - /* Wait a minute! this platform can't do this address. */ - device_printf(bus, - "pci%d.%d.%x bar %#x start %#jx, too many bits.", - b, s, f, reg, (uintmax_t)start); - return (barlen); - } resource_list_add(rl, type, reg, start, end, count); /* @@ -1330,11 +1323,19 @@ pci_add_map(device_t pcib, device_t bus, device_t dev, */ res = resource_list_alloc(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); + start = rman_get_start(res); + if ((u_long)start != start) { + /* Wait a minute! this platform can't do this address. */ + device_printf(bus, + "pci%d.%d.%x bar %#x start %#jx, too many bits.", + b, s, f, reg, (uintmax_t)start); + resource_list_release(rl, bus, dev, type, reg, res); + return (barlen); + } if (res != NULL) { - pci_write_config(dev, reg, rman_get_start(res), 4); + pci_write_config(dev, reg, start, 4); if (ln2range == 64) - pci_write_config(dev, reg + 4, - rman_get_start(res) >> 32, 4); + pci_write_config(dev, reg + 4, start >> 32, 4); } return (barlen); } |
