Changeset c52ed6b in mainline
- Timestamp:
- 2005-12-12T23:55:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5bb8e45
- Parents:
- 0bd4f56d
- Location:
- arch/sparc64
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/sparc64/include/asm.h
r0bd4f56d rc52ed6b 132 132 static inline void asi_u64_write(asi_t asi, __address va, __u64 v) 133 133 { 134 __asm__ volatile ("stxa %0, [%1] %2\n" : : "r" (v), "r" (va), "i" (asi) );134 __asm__ volatile ("stxa %0, [%1] %2\n" : : "r" (v), "r" (va), "i" (asi) : "memory"); 135 135 } 136 137 136 138 137 void cpu_halt(void); -
arch/sparc64/include/barrier.h
r0bd4f56d rc52ed6b 40 40 #define write_barrier() 41 41 42 #define flush() __asm__ volatile ("flush\n" ::: "memory") 42 /** Flush Instruction Memory. */ 43 static inline void flush(void) 44 { 45 /* 46 * The FLUSH instruction takes address parameter, 47 * but JPS1 implementations are free to ignore it. 48 * The only requirement is that it is a valid address 49 * as it is passed to D-MMU. 50 */ 51 __asm__ volatile ("flush %sp\n"); /* %sp is guaranteed to reference mapped memory */ 52 } 43 53 44 54 #endif -
arch/sparc64/include/mm/tlb.h
r0bd4f56d rc52ed6b 32 32 #include <arch/mm/tte.h> 33 33 #include <arch/asm.h> 34 #include <arch/barrier.h> 34 35 #include <arch/types.h> 35 36 #include <typedefs.h> … … 98 99 }; 99 100 typedef union tlb_tag_read_reg tlb_tag_read_reg_t; 101 typedef union tlb_tag_read_reg tlb_tag_access_reg_t; 100 102 101 103 /** Read IMMU TLB Data Access Register. … … 135 137 * @return Current value of specified IMMU TLB Tag Read Register. 136 138 */ 137 static inline __u64 itlb_tag_read (index_t entry)139 static inline __u64 itlb_tag_read_read(index_t entry) 138 140 { 139 141 tlb_tag_read_addr_t tag; … … 150 152 * @return Current value of specified DMMU TLB Tag Read Register. 151 153 */ 152 static inline __u64 dtlb_tag_read (index_t entry)154 static inline __u64 dtlb_tag_read_read(index_t entry) 153 155 { 154 156 tlb_tag_read_addr_t tag; … … 159 161 } 160 162 163 /** Write IMMU TLB Tag Access Register. 164 * 165 * @param v Value to be written. 166 */ 167 static inline void itlb_tag_access_write(__u64 v) 168 { 169 asi_u64_write(ASI_IMMU, VA_IMMU_TAG_ACCESS, v); 170 flush(); 171 } 172 173 /** Write DMMU TLB Tag Access Register. 174 * 175 * @param v Value to be written. 176 */ 177 static inline void dtlb_tag_access_write(__u64 v) 178 { 179 asi_u64_write(ASI_DMMU, VA_DMMU_TAG_ACCESS, v); 180 flush(); 181 } 182 183 /** Write IMMU TLB Data in Register. 184 * 185 * @param v Value to be written. 186 */ 187 static inline void itlb_data_in_write(__u64 v) 188 { 189 asi_u64_write(ASI_ITLB_DATA_IN_REG, 0, v); 190 flush(); 191 } 192 193 /** Write DMMU TLB Data in Register. 194 * 195 * @param v Value to be written. 196 */ 197 static inline void dtlb_data_in_write(__u64 v) 198 { 199 asi_u64_write(ASI_DTLB_DATA_IN_REG, 0, v); 200 flush(); 201 } 202 161 203 #endif -
arch/sparc64/src/mm/tlb.c
r0bd4f56d rc52ed6b 45 45 for (i = 0; i < ITLB_ENTRY_COUNT; i++) { 46 46 d.value = itlb_data_access_read(i); 47 t.value = itlb_tag_read (i);47 t.value = itlb_tag_read_read(i); 48 48 49 printf("%d: va=% X, context=%d, v=%d, size=%X, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",49 printf("%d: va=%Q, context=%d, v=%d, size=%d, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n", 50 50 i, t.va, t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, d.pa, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g); 51 51 } … … 54 54 for (i = 0; i < DTLB_ENTRY_COUNT; i++) { 55 55 d.value = dtlb_data_access_read(i); 56 t.value = dtlb_tag_read (i);56 t.value = dtlb_tag_read_read(i); 57 57 58 printf("%d: va=% X, context=%d, v=%d, size=%X, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",58 printf("%d: va=%Q, context=%d, v=%d, size=%d, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n", 59 59 i, t.va, t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, d.pa, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g); 60 60 }
Note:
See TracChangeset
for help on using the changeset viewer.