From 7eea743ef849119bac8a1c64c2adda933ce2ab10 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 26 Nov 2001 07:12:35 +0000 Subject: [PATCH] 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 --- sys/dev/pci/pci_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 9587622cf92..0a4be2decde 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -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" -- 2.45.2