diff options
author | imp <imp@FreeBSD.org> | 2003-08-09 20:38:53 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-08-09 20:38:53 +0000 |
commit | 28a1a9c3f29d8e5a2149244cea778bfc56a63e98 (patch) | |
tree | 705957adca2c81ea588eb190645684f3df9a8622 | |
parent | 28b45f597c794692b8be8c059fb43bc8fe3fe942 (diff) | |
download | FreeBSD-src-28a1a9c3f29d8e5a2149244cea778bfc56a63e98.zip FreeBSD-src-28a1a9c3f29d8e5a2149244cea778bfc56a63e98.tar.gz |
When allocating memory, align it to the minimum alignment required for
cardbus bridges if the alignment requirements were less restrictive.
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 3 | ||||
-rw-r--r-- | sys/dev/pccbb/pccbbreg.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 706f1bc..81b8b4e 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1551,6 +1551,9 @@ 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) + flags = (flags & ~RF_ALIGNMENT_MASK) | + rman_make_alignment_flags(CBB_MEMALIGN); break; } diff --git a/sys/dev/pccbb/pccbbreg.h b/sys/dev/pccbb/pccbbreg.h index d41cdeb..ef1f21d 100644 --- a/sys/dev/pccbb/pccbbreg.h +++ b/sys/dev/pccbb/pccbbreg.h @@ -75,7 +75,9 @@ #define CBBR_IOBASE1 0x34 /* len=4 */ #define CBBR_IOLIMIT1 0x38 /* len=4 */ #define CBB_MEMALIGN 4096 +#define CBB_MEMALIGN_BITS 12 #define CBB_IOALIGN 4 +#define CBB_IOALIGN_BITS 2 #define CBBR_INTRLINE 0x3c /* len=1 */ #define CBBR_INTRPIN 0x3d /* len=1 */ |