diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/mm/init.c | 71 |
1 files changed, 6 insertions, 65 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index da068f6b2595..936ae1a594ac 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -145,6 +145,10 @@ int bigkernel = 0; | |||
145 | #define PGT_CACHE_LOW 25 | 145 | #define PGT_CACHE_LOW 25 |
146 | #define PGT_CACHE_HIGH 50 | 146 | #define PGT_CACHE_HIGH 50 |
147 | 147 | ||
148 | #ifndef CONFIG_SMP | ||
149 | struct pgtable_cache_struct pgt_quicklists; | ||
150 | #endif | ||
151 | |||
148 | void check_pgt_cache(void) | 152 | void check_pgt_cache(void) |
149 | { | 153 | { |
150 | preempt_disable(); | 154 | preempt_disable(); |
@@ -152,10 +156,8 @@ void check_pgt_cache(void) | |||
152 | do { | 156 | do { |
153 | if (pgd_quicklist) | 157 | if (pgd_quicklist) |
154 | free_pgd_slow(get_pgd_fast()); | 158 | free_pgd_slow(get_pgd_fast()); |
155 | if (pte_quicklist[0]) | 159 | if (pte_quicklist) |
156 | free_pte_slow(pte_alloc_one_fast(NULL, 0)); | 160 | free_pte_slow(pte_alloc_one_fast()); |
157 | if (pte_quicklist[1]) | ||
158 | free_pte_slow(pte_alloc_one_fast(NULL, 1 << (PAGE_SHIFT + 10))); | ||
159 | } while (pgtable_cache_size > PGT_CACHE_LOW); | 161 | } while (pgtable_cache_size > PGT_CACHE_LOW); |
160 | } | 162 | } |
161 | preempt_enable(); | 163 | preempt_enable(); |
@@ -962,67 +964,6 @@ out: | |||
962 | spin_unlock(&ctx_alloc_lock); | 964 | spin_unlock(&ctx_alloc_lock); |
963 | } | 965 | } |
964 | 966 | ||
965 | #ifndef CONFIG_SMP | ||
966 | struct pgtable_cache_struct pgt_quicklists; | ||
967 | #endif | ||
968 | |||
969 | /* XXX We don't need to color these things in the D-cache any longer. */ | ||
970 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
971 | #define DC_ALIAS_SHIFT 1 | ||
972 | #else | ||
973 | #define DC_ALIAS_SHIFT 0 | ||
974 | #endif | ||
975 | pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | ||
976 | { | ||
977 | struct page *page; | ||
978 | unsigned long color; | ||
979 | |||
980 | { | ||
981 | pte_t *ptep = pte_alloc_one_fast(mm, address); | ||
982 | |||
983 | if (ptep) | ||
984 | return ptep; | ||
985 | } | ||
986 | |||
987 | color = VPTE_COLOR(address); | ||
988 | page = alloc_pages(GFP_KERNEL|__GFP_REPEAT, DC_ALIAS_SHIFT); | ||
989 | if (page) { | ||
990 | unsigned long *to_free; | ||
991 | unsigned long paddr; | ||
992 | pte_t *pte; | ||
993 | |||
994 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
995 | set_page_count(page, 1); | ||
996 | ClearPageCompound(page); | ||
997 | |||
998 | set_page_count((page + 1), 1); | ||
999 | ClearPageCompound(page + 1); | ||
1000 | #endif | ||
1001 | paddr = (unsigned long) page_address(page); | ||
1002 | memset((char *)paddr, 0, (PAGE_SIZE << DC_ALIAS_SHIFT)); | ||
1003 | |||
1004 | if (!color) { | ||
1005 | pte = (pte_t *) paddr; | ||
1006 | to_free = (unsigned long *) (paddr + PAGE_SIZE); | ||
1007 | } else { | ||
1008 | pte = (pte_t *) (paddr + PAGE_SIZE); | ||
1009 | to_free = (unsigned long *) paddr; | ||
1010 | } | ||
1011 | |||
1012 | #ifdef DCACHE_ALIASING_POSSIBLE | ||
1013 | /* Now free the other one up, adjust cache size. */ | ||
1014 | preempt_disable(); | ||
1015 | *to_free = (unsigned long) pte_quicklist[color ^ 0x1]; | ||
1016 | pte_quicklist[color ^ 0x1] = to_free; | ||
1017 | pgtable_cache_size++; | ||
1018 | preempt_enable(); | ||
1019 | #endif | ||
1020 | |||
1021 | return pte; | ||
1022 | } | ||
1023 | return NULL; | ||
1024 | } | ||
1025 | |||
1026 | void sparc_ultra_dump_itlb(void) | 967 | void sparc_ultra_dump_itlb(void) |
1027 | { | 968 | { |
1028 | int slot; | 969 | int slot; |