diff options
Diffstat (limited to 'arch/sparc/mm/sun4c.c')
-rw-r--r-- | arch/sparc/mm/sun4c.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 2ffacd67c424..cf38846753dd 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
@@ -12,11 +12,13 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/slab.h> | ||
15 | #include <linux/bootmem.h> | 16 | #include <linux/bootmem.h> |
16 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
17 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
18 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
19 | #include <linux/scatterlist.h> | 20 | #include <linux/scatterlist.h> |
21 | #include <linux/bitmap.h> | ||
20 | 22 | ||
21 | #include <asm/sections.h> | 23 | #include <asm/sections.h> |
22 | #include <asm/page.h> | 24 | #include <asm/page.h> |
@@ -1021,20 +1023,12 @@ static char *sun4c_lockarea(char *vaddr, unsigned long size) | |||
1021 | npages = (((unsigned long)vaddr & ~PAGE_MASK) + | 1023 | npages = (((unsigned long)vaddr & ~PAGE_MASK) + |
1022 | size + (PAGE_SIZE-1)) >> PAGE_SHIFT; | 1024 | size + (PAGE_SIZE-1)) >> PAGE_SHIFT; |
1023 | 1025 | ||
1024 | scan = 0; | ||
1025 | local_irq_save(flags); | 1026 | local_irq_save(flags); |
1026 | for (;;) { | 1027 | base = bitmap_find_next_zero_area(sun4c_iobuffer_map, iobuffer_map_size, |
1027 | scan = find_next_zero_bit(sun4c_iobuffer_map, | 1028 | 0, npages, 0); |
1028 | iobuffer_map_size, scan); | 1029 | if (base >= iobuffer_map_size) |
1029 | if ((base = scan) + npages > iobuffer_map_size) goto abend; | 1030 | 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 | 1031 | ||
1037 | found: | ||
1038 | high = ((base + npages) << PAGE_SHIFT) + sun4c_iobuffer_start; | 1032 | high = ((base + npages) << PAGE_SHIFT) + sun4c_iobuffer_start; |
1039 | high = SUN4C_REAL_PGDIR_ALIGN(high); | 1033 | high = SUN4C_REAL_PGDIR_ALIGN(high); |
1040 | while (high > sun4c_iobuffer_high) { | 1034 | while (high > sun4c_iobuffer_high) { |
@@ -1894,7 +1888,7 @@ static void sun4c_check_pgt_cache(int low, int high) | |||
1894 | /* An experiment, turn off by default for now... -DaveM */ | 1888 | /* An experiment, turn off by default for now... -DaveM */ |
1895 | #define SUN4C_PRELOAD_PSEG | 1889 | #define SUN4C_PRELOAD_PSEG |
1896 | 1890 | ||
1897 | void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | 1891 | void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) |
1898 | { | 1892 | { |
1899 | unsigned long flags; | 1893 | unsigned long flags; |
1900 | int pseg; | 1894 | int pseg; |
@@ -1936,7 +1930,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p | |||
1936 | start += PAGE_SIZE; | 1930 | start += PAGE_SIZE; |
1937 | } | 1931 | } |
1938 | #ifndef SUN4C_PRELOAD_PSEG | 1932 | #ifndef SUN4C_PRELOAD_PSEG |
1939 | sun4c_put_pte(address, pte_val(pte)); | 1933 | sun4c_put_pte(address, pte_val(*ptep)); |
1940 | #endif | 1934 | #endif |
1941 | local_irq_restore(flags); | 1935 | local_irq_restore(flags); |
1942 | return; | 1936 | return; |
@@ -1947,7 +1941,7 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p | |||
1947 | add_lru(entry); | 1941 | add_lru(entry); |
1948 | } | 1942 | } |
1949 | 1943 | ||
1950 | sun4c_put_pte(address, pte_val(pte)); | 1944 | sun4c_put_pte(address, pte_val(*ptep)); |
1951 | local_irq_restore(flags); | 1945 | local_irq_restore(flags); |
1952 | } | 1946 | } |
1953 | 1947 | ||