aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/mm
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2005-10-04 18:23:20 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-10-04 18:23:20 -0400
commit0835ae0f27c0bfde67613d189ef6c537e004a6de (patch)
treead5cad209eeb11bd1bf49a3b5cffa49618c717c8 /arch/sparc64/mm
parentdd7205ed0f022a2a5e60eb7404e6c9f49d2301c3 (diff)
[SPARC64]: Replace cheetah+ code patching with variables.
Instead of code patching to handle the page size fields in the context registers, just use variables from which we get the proper values. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r--arch/sparc64/mm/init.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 5db50524f20d..4e2f71e0abc8 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -133,6 +133,12 @@ extern unsigned int sparc_ramdisk_size;
133 133
134struct page *mem_map_zero __read_mostly; 134struct page *mem_map_zero __read_mostly;
135 135
136unsigned int sparc64_highest_unlocked_tlb_ent __read_mostly;
137
138unsigned long sparc64_kern_pri_context __read_mostly;
139unsigned long sparc64_kern_pri_nuc_bits __read_mostly;
140unsigned long sparc64_kern_sec_context __read_mostly;
141
136int bigkernel = 0; 142int bigkernel = 0;
137 143
138/* XXX Tune this... */ 144/* XXX Tune this... */
@@ -582,13 +588,21 @@ static void __init remap_kernel(void)
582 prom_dtlb_load(tlb_ent, tte_data, tte_vaddr); 588 prom_dtlb_load(tlb_ent, tte_data, tte_vaddr);
583 prom_itlb_load(tlb_ent, tte_data, tte_vaddr); 589 prom_itlb_load(tlb_ent, tte_data, tte_vaddr);
584 if (bigkernel) { 590 if (bigkernel) {
585 prom_dtlb_load(tlb_ent - 1, 591 tlb_ent -= 1;
592 prom_dtlb_load(tlb_ent,
586 tte_data + 0x400000, 593 tte_data + 0x400000,
587 tte_vaddr + 0x400000); 594 tte_vaddr + 0x400000);
588 prom_itlb_load(tlb_ent - 1, 595 prom_itlb_load(tlb_ent,
589 tte_data + 0x400000, 596 tte_data + 0x400000,
590 tte_vaddr + 0x400000); 597 tte_vaddr + 0x400000);
591 } 598 }
599 sparc64_highest_unlocked_tlb_ent = tlb_ent - 1;
600 if (tlb_type == cheetah_plus) {
601 sparc64_kern_pri_context = (CTX_CHEETAH_PLUS_CTX0 |
602 CTX_CHEETAH_PLUS_NUC);
603 sparc64_kern_pri_nuc_bits = CTX_CHEETAH_PLUS_NUC;
604 sparc64_kern_sec_context = CTX_CHEETAH_PLUS_CTX0;
605 }
592} 606}
593 607
594static void __init inherit_prom_mappings(void) 608static void __init inherit_prom_mappings(void)
@@ -788,8 +802,8 @@ void inherit_locked_prom_mappings(int save_p)
788 } 802 }
789 } 803 }
790 if (tlb_type == spitfire) { 804 if (tlb_type == spitfire) {
791 int high = SPITFIRE_HIGHEST_LOCKED_TLBENT - bigkernel; 805 int high = sparc64_highest_unlocked_tlb_ent;
792 for (i = 0; i < high; i++) { 806 for (i = 0; i <= high; i++) {
793 unsigned long data; 807 unsigned long data;
794 808
795 /* Spitfire Errata #32 workaround */ 809 /* Spitfire Errata #32 workaround */
@@ -877,9 +891,9 @@ void inherit_locked_prom_mappings(int save_p)
877 } 891 }
878 } 892 }
879 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) { 893 } else if (tlb_type == cheetah || tlb_type == cheetah_plus) {
880 int high = CHEETAH_HIGHEST_LOCKED_TLBENT - bigkernel; 894 int high = sparc64_highest_unlocked_tlb_ent;
881 895
882 for (i = 0; i < high; i++) { 896 for (i = 0; i <= high; i++) {
883 unsigned long data; 897 unsigned long data;
884 898
885 data = cheetah_get_ldtlb_data(i); 899 data = cheetah_get_ldtlb_data(i);