From 70fc36e89c485febee952e33b2eb9d8f5f0f72f2 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 6 Apr 2004 22:41:14 +0000 Subject: [PATCH] Fix mis-merge from p4 by adding line getting sc. Attempt to deal with larger memory allocation better. --- sys/dev/pccbb/pccbb.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 2139e493069..560e2fc3071 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1346,6 +1346,7 @@ done:; static int cbb_do_power(device_t brdev) { + struct cbb_softc *sc = device_get_softc(brdev); int voltage; /* Don't enable OE */ @@ -1612,6 +1613,7 @@ cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type, struct cbb_softc *sc = device_get_softc(brdev); int tmp; struct resource *res; + u_long align; switch (type) { case SYS_RES_IRQ: @@ -1636,9 +1638,14 @@ cbb_cardbus_alloc_resource(device_t brdev, device_t child, int type, start = cbb_start_mem; if (end < start) end = start; - if (RF_ALIGNMENT(flags) < CBB_MEMALIGN_BITS) + if (RF_ALIGNMENT(flags) < CBB_MEMALIGN_BITS) { + if (count < CBB_MEMALIGN) + align = CBB_MEMALIGN; + else + align = count; flags = (flags & ~RF_ALIGNMENT_MASK) | - rman_make_alignment_flags(CBB_MEMALIGN); + rman_make_alignment_flags(align); + } break; }