summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-04-06 22:50:50 +0000
committerimp <imp@FreeBSD.org>2004-04-06 22:50:50 +0000
commit361a4ffcb75f1a067cea29dde079fd33e39a3a43 (patch)
tree5bc6abb82c5be0a10c36a0dac670a365a286da71
parentad7ac7636e5bc35ba67d4084eb9d31d871b371f3 (diff)
downloadFreeBSD-src-361a4ffcb75f1a067cea29dde079fd33e39a3a43.zip
FreeBSD-src-361a4ffcb75f1a067cea29dde079fd33e39a3a43.tar.gz
Better checks to make sure that we get good alignment. This code is a
bit of a bandaide until I get better pci bus code committed to head from my p4 tree.
-rw-r--r--sys/dev/pccbb/pccbb.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index 560e2fc..75044ba 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -1638,14 +1638,13 @@ 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 (count < CBB_MEMALIGN)
- align = CBB_MEMALIGN;
- else
- align = count;
- flags = (flags & ~RF_ALIGNMENT_MASK) |
+ if (count < CBB_MEMALIGN)
+ align = CBB_MEMALIGN;
+ else
+ align = count;
+ if (align > (1 << RF_ALIGNMENT(flags)))
+ flags = (flags & ~RF_ALIGNMENT_MASK) |
rman_make_alignment_flags(align);
- }
break;
}
OpenPOWER on IntegriCloud