Changeset 92778f2 in mainline for kernel/arch/sparc64
- Timestamp:
- 2006-12-04T21:14:07Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b43f86
- Parents:
- 3d76996
- Location:
- kernel/arch/sparc64
- Files:
-
- 1 added
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
r3d76996 r92778f2 85 85 arch/$(ARCH)/src/mm/as.c \ 86 86 arch/$(ARCH)/src/mm/cache.c \ 87 arch/$(ARCH)/src/mm/cache_asm.S \ 87 88 arch/$(ARCH)/src/mm/frame.c \ 88 89 arch/$(ARCH)/src/mm/page.c \ -
kernel/arch/sparc64/include/cpu.h
r3d76996 r92778f2 56 56 ver_reg_t ver; 57 57 uint32_t clock_frequency; /**< Processor frequency in MHz. */ 58 int dcache_active; /**< When non-zero, the D-cache is not being shot down. */ 58 59 }; 59 60 -
kernel/arch/sparc64/include/interrupt.h
r3d76996 r92778f2 44 44 #define IVT_FIRST 1 45 45 46 /* This needs to be defined for inter-architecture API portability. */ 46 47 #define VECTOR_TLB_SHOOTDOWN_IPI 0 47 #define IPI_TLB_SHOOTDOWN VECTOR_TLB_SHOOTDOWN_IPI 48 49 enum { 50 IPI_TLB_SHOOTDOWN = VECTOR_TLB_SHOOTDOWN_IPI, 51 IPI_DCACHE_SHOOTDOWN 52 }; 48 53 49 54 struct istate { -
kernel/arch/sparc64/include/mm/as.h
r3d76996 r92778f2 53 53 tsb_entry_t *itsb; 54 54 tsb_entry_t *dtsb; 55 #endif 55 #endif /* CONFIG_TSB */ 56 56 } as_arch_t; 57 57 -
kernel/arch/sparc64/include/mm/cache.h
r3d76996 r92778f2 36 36 #define KERN_sparc64_CACHE_H_ 37 37 38 #ifdef CONFIG_SMP 39 extern void dcache_shootdown_start(void); 40 extern void dcache_shootdown_finalize(void); 41 extern void dcache_shootdown_ipi_recv(void); 42 #else /* CONFIG_SMP */ 43 #define dcache_shootdown_start(); 44 #define dcache_shootdown_finalize(); 45 #define dcache_shootdown_ipi_recv(); 46 #endif /* CONFIG_SMP */ 47 38 48 extern void dcache_flush(void); 39 49 -
kernel/arch/sparc64/src/cpu/cpu.c
r3d76996 r92778f2 93 93 } 94 94 95 /* 96 * Set the D-cache active flag. 97 * Needed for the D-cache to work. 98 */ 99 CPU->arch.dcache_active = 1; 95 100 } 96 101 -
kernel/arch/sparc64/src/mm/as.c
r3d76996 r92778f2 48 48 #include <bitops.h> 49 49 #include <macros.h> 50 #endif 50 #endif /* CONFIG_TSB */ 51 52 #ifdef CONFIG_VIRT_IDX_DCACHE 53 #include <arch/mm/cache.h> 54 #endif /* CONFIG_VIRT_IDX_DCACHE */ 51 55 52 56 /** Architecture dependent address space init. */ … … 159 163 dtsb_base_write(tsb_base.value); 160 164 #endif 165 #ifdef CONFIG_VIRT_IDX_DCACHE 166 if (as->dcache_flush_on_install) { 167 /* 168 * Some mappings in this address space are illegal address 169 * aliases. Upon their creation, the flush_dcache_on_install 170 * flag was set. 171 * 172 * We are now obliged to flush the D-cache in order to guarantee 173 * that there will be at most one cache line for each address 174 * alias. 175 * 176 * This flush performs a cleanup after another address space in 177 * which the alias might have existed. 178 */ 179 dcache_flush(); 180 } 181 #endif /* CONFIG_VIRT_IDX_DCACHE */ 161 182 } 162 183 … … 193 214 } 194 215 #endif 216 #ifdef CONFIG_VIRT_IDX_DCACHE 217 if (as->dcache_flush_on_deinstall) { 218 /* 219 * Some mappings in this address space are illegal address 220 * aliases. Upon their creation, the flush_dcache_on_deinstall 221 * flag was set. 222 * 223 * We are now obliged to flush the D-cache in order to guarantee 224 * that there will be at most one cache line for each address 225 * alias. 226 * 227 * This flush performs a cleanup after this address space. It is 228 * necessary because other address spaces that contain the same 229 * alias are not necessarily aware of the need to carry out the 230 * cache flush. The only address spaces that are aware of it are 231 * those that created the illegal alias. 232 */ 233 dcache_flush(); 234 } 235 #endif /* CONFIG_VIRT_IDX_DCACHE */ 195 236 } 196 237 -
kernel/arch/sparc64/src/mm/tlb.c
r3d76996 r92778f2 112 112 data.l = locked; 113 113 data.cp = cacheable; 114 #ifdef CONFIG_VIRT_IDX_ CACHE114 #ifdef CONFIG_VIRT_IDX_DCACHE 115 115 data.cv = cacheable; 116 #endif /* CONFIG_VIRT_IDX_ CACHE */116 #endif /* CONFIG_VIRT_IDX_DCACHE */ 117 117 data.p = true; 118 118 data.w = true; … … 149 149 data.l = false; 150 150 data.cp = t->c; 151 #ifdef CONFIG_VIRT_IDX_ CACHE151 #ifdef CONFIG_VIRT_IDX_DCACHE 152 152 data.cv = t->c; 153 #endif /* CONFIG_VIRT_IDX_ CACHE */153 #endif /* CONFIG_VIRT_IDX_DCACHE */ 154 154 data.p = t->k; /* p like privileged */ 155 155 data.w = ro ? false : t->w; … … 185 185 data.l = false; 186 186 data.cp = t->c; 187 #ifdef CONFIG_VIRT_IDX_CACHE188 data.cv = t->c;189 #endif /* CONFIG_VIRT_IDX_CACHE */190 187 data.p = t->k; /* p like privileged */ 191 188 data.w = false; -
kernel/arch/sparc64/src/mm/tsb.c
r3d76996 r92778f2 101 101 tsb->data.pfn = t->frame >> FRAME_WIDTH; 102 102 tsb->data.cp = t->c; 103 #ifdef CONFIG_VIRT_IDX_CACHE104 tsb->data.cv = t->c;105 #endif /* CONFIG_VIRT_IDX_CACHE */106 103 tsb->data.p = t->k; /* p as privileged */ 107 104 tsb->data.v = t->p; … … 143 140 tsb->data.pfn = t->frame >> FRAME_WIDTH; 144 141 tsb->data.cp = t->c; 145 #ifdef CONFIG_VIRT_IDX_ CACHE142 #ifdef CONFIG_VIRT_IDX_DCACHE 146 143 tsb->data.cv = t->c; 147 #endif /* CONFIG_VIRT_IDX_ CACHE */144 #endif /* CONFIG_VIRT_IDX_DCACHE */ 148 145 tsb->data.p = t->k; /* p as privileged */ 149 146 tsb->data.w = ro ? false : t->w; -
kernel/arch/sparc64/src/smp/ipi.c
r3d76996 r92778f2 39 39 #include <config.h> 40 40 #include <mm/tlb.h> 41 #include <arch/mm/cache.h> 41 42 #include <arch/interrupt.h> 42 43 #include <arch/trap/interrupt.h> … … 121 122 func = tlb_shootdown_ipi_recv; 122 123 break; 124 case IPI_DCACHE_SHOOTDOWN: 125 func = dcache_shootdown_ipi_recv; 126 break; 123 127 default: 124 128 panic("Unknown IPI (%d).\n", ipi); -
kernel/arch/sparc64/src/start.S
r3d76996 r92778f2 123 123 membar #Sync 124 124 125 #ifdef CONFIG_VIRT_IDX_ CACHE125 #ifdef CONFIG_VIRT_IDX_DCACHE 126 126 #define TTE_LOW_DATA(imm) (TTE_CP | TTE_CV | TTE_P | LMA | (imm)) 127 #else /* CONFIG_VIRT_IDX_ CACHE */127 #else /* CONFIG_VIRT_IDX_DCACHE */ 128 128 #define TTE_LOW_DATA(imm) (TTE_CP | TTE_P | LMA | (imm)) 129 #endif /* CONFIG_VIRT_IDX_ CACHE */129 #endif /* CONFIG_VIRT_IDX_DCACHE */ 130 130 131 131 #define SET_TLB_DATA(r1, r2, imm) \ … … 361 361 .global kernel_8k_tlb_data_template 362 362 kernel_8k_tlb_data_template: 363 #ifdef CONFIG_VIRT_IDX_ CACHE363 #ifdef CONFIG_VIRT_IDX_DCACHE 364 364 .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | TTE_CV | TTE_P | TTE_W) 365 #else /* CONFIG_VIRT_IDX_ CACHE */365 #else /* CONFIG_VIRT_IDX_DCACHE */ 366 366 .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | TTE_P | TTE_W) 367 #endif /* CONFIG_VIRT_IDX_ CACHE */367 #endif /* CONFIG_VIRT_IDX_DCACHE */ -
kernel/arch/sparc64/src/trap/interrupt.c
r3d76996 r92778f2 45 45 #include <arch.h> 46 46 #include <mm/tlb.h> 47 #include <arch/mm/cache.h> 47 48 #include <config.h> 48 49 #include <synch/spinlock.h> … … 91 92 if (data0 == (uintptr_t) tlb_shootdown_ipi_recv) { 92 93 tlb_shootdown_ipi_recv(); 94 } else if (data0 == (uintptr_t) dcache_shootdown_ipi_recv) { 95 dcache_shootdown_ipi_recv(); 93 96 } 94 97 #endif
Note:
See TracChangeset
for help on using the changeset viewer.