diff options
Diffstat (limited to 'arch/sparc/mm/sun4c.c')
-rw-r--r-- | arch/sparc/mm/sun4c.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 2ffacd67c424..a89baf0d875a 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/seq_file.h> | 18 | #include <linux/seq_file.h> |
19 | #include <linux/scatterlist.h> | 19 | #include <linux/scatterlist.h> |
20 | #include <linux/bitmap.h> | ||
20 | 21 | ||
21 | #include <asm/sections.h> | 22 | #include <asm/sections.h> |
22 | #include <asm/page.h> | 23 | #include <asm/page.h> |
@@ -1021,20 +1022,12 @@ static char *sun4c_lockarea(char *vaddr, unsigned long size) | |||
1021 | npages = (((unsigned long)vaddr & ~PAGE_MASK) + | 1022 | npages = (((unsigned long)vaddr & ~PAGE_MASK) + |
1022 | size + (PAGE_SIZE-1)) >> PAGE_SHIFT; | 1023 | size + (PAGE_SIZE-1)) >> PAGE_SHIFT; |
1023 | 1024 | ||
1024 | scan = 0; | ||
1025 | local_irq_save(flags); | 1025 | local_irq_save(flags); |
1026 | for (;;) { | 1026 | base = bitmap_find_next_zero_area(sun4c_iobuffer_map, iobuffer_map_size, |
1027 | scan = find_next_zero_bit(sun4c_iobuffer_map, | 1027 | 0, npages, 0); |
1028 | iobuffer_map_size, scan); | 1028 | if (base >= iobuffer_map_size) |
1029 | if ((base = scan) + npages > iobuffer_map_size) goto abend; | 1029 | goto abend; |
1030 | for (;;) { | ||
1031 | if (scan >= base + npages) goto found; | ||
1032 | if (test_bit(scan, sun4c_iobuffer_map)) break; | ||
1033 | scan++; | ||
1034 | } | ||
1035 | } | ||
1036 | 1030 | ||
1037 | found: | ||
1038 | high = ((base + npages) << PAGE_SHIFT) + sun4c_iobuffer_start; | 1031 | high = ((base + npages) << PAGE_SHIFT) + sun4c_iobuffer_start; |
1039 | high = SUN4C_REAL_PGDIR_ALIGN(high); | 1032 | high = SUN4C_REAL_PGDIR_ALIGN(high); |
1040 | while (high > sun4c_iobuffer_high) { | 1033 | while (high > sun4c_iobuffer_high) { |