Title: [7430] trunk/arch/blackfin/kernel/dma-mapping.c: [#2868] [LKML] use a proper bitmap for dma_page
- Revision
- 7430
- Author
- hennerich
- Date
- 2009-09-23 07:32:52 -0400 (Wed, 23 Sep 2009)
Log Message
[#2868] [LKML] use a proper bitmap for dma_page
Modified Paths
Diff
Modified: trunk/arch/blackfin/kernel/dma-mapping.c (7429 => 7430)
--- trunk/arch/blackfin/kernel/dma-mapping.c 2009-09-23 11:14:00 UTC (rev 7429)
+++ trunk/arch/blackfin/kernel/dma-mapping.c 2009-09-23 11:32:52 UTC (rev 7430)
@@ -40,7 +40,7 @@
#include <asm/bfin-global.h>
static spinlock_t dma_page_lock;
-static unsigned int *dma_page;
+static unsigned long *dma_page;
static unsigned int dma_pages;
static unsigned long dma_base;
static unsigned long dma_size;
@@ -51,7 +51,7 @@
spin_lock_init(&dma_page_lock);
dma_initialized = 0;
- dma_page = (unsigned int *)__get_free_page(GFP_KERNEL);
+ dma_page = (unsigned long *)__get_free_page(GFP_KERNEL);
memset(dma_page, 0, PAGE_SIZE);
dma_base = PAGE_ALIGN(start);
dma_size = PAGE_ALIGN(end) - PAGE_ALIGN(start);
@@ -79,10 +79,11 @@
spin_lock_irqsave(&dma_page_lock, flags);
for (i = 0; i < dma_pages;) {
- if (dma_page[i++] == 0) {
+ if (test_bit(i++, dma_page) == 0) {
if (++count == pages) {
while (count--)
- dma_page[--i] = 1;
+ __set_bit(--i, dma_page);
+
ret = dma_base + (i << PAGE_SHIFT);
break;
}
@@ -105,9 +106,9 @@
}
spin_lock_irqsave(&dma_page_lock, flags);
- for (i = page; i < page + pages; i++) {
- dma_page[i] = 0;
- }
+ for (i = page; i < page + pages; i++)
+ __clear_bit(i, dma_page);
+
spin_unlock_irqrestore(&dma_page_lock, flags);
}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits