Experimental patch to try to properly clip the range of the memory

request to one that's supported by the bridge.  I'm not 100% sure this
is correct, but it makes it easier for the cardbus bridge to allocate
its memory.

Similar code is needed for the I/O range.  Also, I'm not sure if I
should be doing this based on memory or pmemory (but likely should do
it based on some flag that tells us to prefetch or not).

Talked about a long time ago with: msmith
This commit is contained in:
Warner Losh 2001-11-26 07:12:35 +00:00
parent 1c8653816e
commit 7eea743ef8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86906

View file

@ -302,6 +302,10 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
* flag as the request bubbles up?
*/
case SYS_RES_MEMORY:
if (start < sc->membase && end > sc->membase)
start = sc->membase;
if (end > sc->memlimit && start < end)
end = sc->memlimit;
if (((start < sc->membase) || (end > sc->memlimit)) &&
((start < sc->pmembase) || (end > sc->pmemlimit))) {
device_printf(dev, "device %s%d requested unsupported memory range 0x%lx-0x%lx"