Changeset 965dc18 in mainline for kernel/arch/sparc64/include
- Timestamp:
- 2008-12-05T19:59:03Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 49093a4
- Parents:
- 0258e67
- Location:
- kernel/arch/sparc64/include
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch.h
r0258e67 r965dc18 42 42 #define ASI_NUCLEUS_QUAD_LDD 0x24 /** ASI for 16-byte atomic loads. */ 43 43 #define ASI_DCACHE_TAG 0x47 /** ASI D-Cache Tag. */ 44 #define ASI_ UPA_CONFIG 0x4a /** ASI of the UPA_CONFIG register. */44 #define ASI_ICBUS_CONFIG 0x4a /** ASI of the UPA_CONFIG/FIREPLANE_CONFIG register. */ 45 45 46 46 #define NWINDOWS 8 /** Number of register window sets. */ -
kernel/arch/sparc64/include/asm.h
r0258e67 r965dc18 137 137 } 138 138 139 /** Read STICK_compare Register. 140 * 141 * @return Value of STICK_compare register. 142 */ 143 static inline uint64_t stick_compare_read(void) 144 { 145 uint64_t v; 146 147 asm volatile ("rd %%asr25, %0\n" : "=r" (v)); 148 149 return v; 150 } 151 152 /** Write STICK_compare Register. 153 * 154 * @param v New value of STICK_comapre register. 155 */ 156 static inline void stick_compare_write(uint64_t v) 157 { 158 asm volatile ("wr %0, %1, %%asr25\n" : : "r" (v), "i" (0)); 159 } 160 139 161 /** Read TICK Register. 140 162 * … … 408 430 } 409 431 410 /** Read UPA_CONFIG register.411 *412 * @return Value of the UPA_CONFIG register.413 */414 static inline uint64_t upa_config_read(void)415 {416 return asi_u64_read(ASI_UPA_CONFIG, 0);417 }418 419 432 extern void cpu_halt(void); 420 433 extern void cpu_sleep(void); -
kernel/arch/sparc64/include/cpu.h
r0258e67 r965dc18 36 36 #define KERN_sparc64_CPU_H_ 37 37 38 #include <arch/types.h>39 #include <typedefs.h>40 #include <arch/register.h>41 #include <arch/asm.h>42 43 #ifdef CONFIG_SMP44 #include <arch/mm/cache.h>45 #endif46 47 38 #define MANUF_FUJITSU 0x04 48 39 #define MANUF_ULTRASPARC 0x17 /**< UltraSPARC I, UltraSPARC II */ … … 53 44 #define IMPL_ULTRASPARCII_I 0x12 54 45 #define IMPL_ULTRASPARCII_E 0x13 55 #define IMPL_ULTRASPARCIII 0x15 46 #define IMPL_ULTRASPARCIII 0x14 47 #define IMPL_ULTRASPARCIII_PLUS 0x15 48 #define IMPL_ULTRASPARCIII_I 0x16 49 #define IMPL_ULTRASPARCIV 0x18 56 50 #define IMPL_ULTRASPARCIV_PLUS 0x19 57 51 58 52 #define IMPL_SPARC64V 0x5 59 53 54 #ifndef __ASM__ 55 56 #include <arch/types.h> 57 #include <typedefs.h> 58 #include <arch/register.h> 59 #include <arch/regdef.h> 60 #include <arch/asm.h> 61 62 #ifdef CONFIG_SMP 63 #include <arch/mm/cache.h> 64 #endif 65 60 66 typedef struct { 61 67 uint32_t mid; /**< Processor ID as read from 62 UPA_CONFIG . */68 UPA_CONFIG/FIREPLANE_CONFIG. */ 63 69 ver_reg_t ver; 64 70 uint32_t clock_frequency; /**< Processor frequency in Hz. */ … … 67 73 matches this value. */ 68 74 } cpu_arch_t; 69 75 76 77 /** 78 * Reads the module ID (agent ID/CPUID) of the current CPU. 79 */ 80 static inline uint32_t read_mid(void) 81 { 82 uint64_t icbus_config = asi_u64_read(ASI_ICBUS_CONFIG, 0); 83 icbus_config = icbus_config >> ICBUS_CONFIG_MID_SHIFT; 84 #if defined (US) 85 return icbus_config & 0x1f; 86 #elif defined (US3) 87 if (((ver_reg_t) ver_read()).impl == IMPL_ULTRASPARCIII_I) 88 return icbus_config & 0x1f; 89 else 90 return icbus_config & 0x3ff; 91 #endif 92 } 93 94 #endif 95 70 96 #endif 71 97 -
kernel/arch/sparc64/include/drivers/kbd.h
r0258e67 r965dc18 42 42 KBD_UNKNOWN, 43 43 KBD_Z8530, 44 KBD_NS16550 44 KBD_NS16550, 45 KBD_SGCN 45 46 } kbd_type_t; 46 47 -
kernel/arch/sparc64/include/drivers/scr.h
r0258e67 r965dc18 43 43 SCR_ATYFB, 44 44 SCR_FFB, 45 SCR_CGSIX 45 SCR_CGSIX, 46 SCR_XVR 46 47 } scr_type_t; 47 48 -
kernel/arch/sparc64/include/mm/cache.h
r0258e67 r965dc18 39 39 #include <mm/frame.h> 40 40 41 #define dcache_flush_page(p) \42 dcache_flush_color(PAGE_COLOR((p)))43 #define dcache_flush_frame(p, f) \44 dcache_flush_tag(PAGE_COLOR((p)), ADDR2PFN((f)));45 46 extern void dcache_flush(void);47 extern void dcache_flush_color(int c);48 extern void dcache_flush_tag(int c, pfn_t tag);49 50 41 #endif 51 42 -
kernel/arch/sparc64/include/mm/cache_spec.h
r0258e67 r965dc18 39 39 * The following macros are valid for the following processors: 40 40 * 41 * UltraSPARC, UltraSPARC II, UltraSPARC IIi 41 * UltraSPARC, UltraSPARC II, UltraSPARC IIi, UltraSPARC III, 42 * UltraSPARC III+, UltraSPARC IV, UltraSPARC IV+ 42 43 * 43 44 * Should we support other UltraSPARC processors, we need to make sure that 44 45 * the macros are defined correctly for them. 45 46 */ 46 47 48 #if defined (US) 47 49 #define DCACHE_SIZE (16 * 1024) 50 #elif defined (US3) 51 #define DCACHE_SIZE (64 * 1024) 52 #endif 48 53 #define DCACHE_LINE_SIZE 32 49 50 #define ICACHE_SIZE (16 * 1024)51 #define ICACHE_WAYS 252 #define ICACHE_LINE_SIZE 3253 54 54 55 #endif -
kernel/arch/sparc64/include/mm/frame.h
r0258e67 r965dc18 60 60 uintptr_t address; 61 61 struct { 62 #if defined (US) 62 63 unsigned : 23; 63 64 uint64_t pfn : 28; /**< Physical Frame Number. */ 65 #elif defined (US3) 66 unsigned : 21; 67 uint64_t pfn : 30; /**< Physical Frame Number. */ 68 #endif 64 69 unsigned offset : 13; /**< Offset. */ 65 70 } __attribute__ ((packed)); -
kernel/arch/sparc64/include/mm/mmu.h
r0258e67 r965dc18 36 36 #define KERN_sparc64_MMU_H_ 37 37 38 #if defined(US) 38 39 /* LSU Control Register ASI. */ 39 40 #define ASI_LSU_CONTROL_REG 0x45 /**< Load/Store Unit Control Register. */ 41 #endif 40 42 41 43 /* I-MMU ASIs. */ … … 53 55 #define VA_IMMU_TSB_BASE 0x28 /**< IMMU TSB base register. */ 54 56 #define VA_IMMU_TAG_ACCESS 0x30 /**< IMMU TLB tag access register. */ 57 #if defined (US3) 58 #define VA_IMMU_PRIMARY_EXTENSION 0x48 /**< IMMU TSB primary extension register */ 59 #define VA_IMMU_NUCLEUS_EXTENSION 0x58 /**< IMMU TSB nucleus extension register */ 60 #endif 61 55 62 56 63 /* D-MMU ASIs. */ … … 74 81 #define VA_DMMU_VA_WATCHPOINT_REG 0x38 /**< DMMU VA data watchpoint register. */ 75 82 #define VA_DMMU_PA_WATCHPOINT_REG 0x40 /**< DMMU PA data watchpoint register. */ 83 #if defined (US3) 84 #define VA_DMMU_PRIMARY_EXTENSION 0x48 /**< DMMU TSB primary extension register */ 85 #define VA_DMMU_SECONDARY_EXTENSION 0x50 /**< DMMU TSB secondary extension register */ 86 #define VA_DMMU_NUCLEUS_EXTENSION 0x58 /**< DMMU TSB nucleus extension register */ 87 #endif 76 88 77 89 #ifndef __ASM__ … … 81 93 #include <arch/types.h> 82 94 95 #if defined(US) 83 96 /** LSU Control Register. */ 84 97 typedef union { … … 101 114 } __attribute__ ((packed)); 102 115 } lsu_cr_reg_t; 116 #endif /* US */ 103 117 104 118 #endif /* !def __ASM__ */ -
kernel/arch/sparc64/include/mm/tlb.h
r0258e67 r965dc18 36 36 #define KERN_sparc64_TLB_H_ 37 37 38 #if defined (US) 38 39 #define ITLB_ENTRY_COUNT 64 39 40 #define DTLB_ENTRY_COUNT 64 41 #define DTLB_MAX_LOCKED_ENTRIES DTLB_ENTRY_COUNT 42 #endif 43 44 /** TLB_DSMALL is the only of the three DMMUs that can hold locked entries. */ 45 #if defined (US3) 46 #define DTLB_MAX_LOCKED_ENTRIES 16 47 #endif 40 48 41 49 #define MEM_CONTEXT_KERNEL 0 … … 54 62 #define TLB_DEMAP_PAGE 0 55 63 #define TLB_DEMAP_CONTEXT 1 64 #if defined (US3) 65 #define TLB_DEMAP_ALL 2 66 #endif 56 67 57 68 #define TLB_DEMAP_TYPE_SHIFT 6 … … 61 72 #define TLB_DEMAP_SECONDARY 1 62 73 #define TLB_DEMAP_NUCLEUS 2 74 75 /* There are more TLBs in one MMU in US3, their codes are defined here. */ 76 #if defined (US3) 77 /* D-MMU: one small (16-entry) TLB and two big (512-entry) TLBs */ 78 #define TLB_DSMALL 0 79 #define TLB_DBIG_0 2 80 #define TLB_DBIG_1 3 81 82 /* I-MMU: one small (16-entry) TLB and one big TLB */ 83 #define TLB_ISMALL 0 84 #define TLB_IBIG 2 85 #endif 63 86 64 87 #define TLB_DEMAP_CONTEXT_SHIFT 4 … … 77 100 #include <arch/barrier.h> 78 101 #include <arch/types.h> 102 #include <arch/register.h> 103 #include <arch/cpu.h> 79 104 80 105 union tlb_context_reg { … … 91 116 92 117 /** I-/D-TLB Data Access Address in Alternate Space. */ 118 119 #if defined (US) 120 93 121 union tlb_data_access_addr { 94 122 uint64_t value; … … 99 127 } __attribute__ ((packed)); 100 128 }; 101 typedef union tlb_data_access_addr tlb_data_access_addr_t; 102 typedef union tlb_data_access_addr tlb_tag_read_addr_t; 129 typedef union tlb_data_access_addr dtlb_data_access_addr_t; 130 typedef union tlb_data_access_addr dtlb_tag_read_addr_t; 131 typedef union tlb_data_access_addr itlb_data_access_addr_t; 132 typedef union tlb_data_access_addr itlb_tag_read_addr_t; 133 134 #elif defined (US3) 135 136 /* 137 * In US3, I-MMU and D-MMU have different formats of the data 138 * access register virtual address. In the corresponding 139 * structures the member variable for the entry number is 140 * called "local_tlb_entry" - it contrasts with the "tlb_entry" 141 * for the US data access register VA structure. The rationale 142 * behind this is to prevent careless mistakes in the code 143 * caused by setting only the entry number and not the TLB 144 * number in the US3 code (when taking the code from US). 145 */ 146 147 union dtlb_data_access_addr { 148 uint64_t value; 149 struct { 150 uint64_t : 45; 151 unsigned : 1; 152 unsigned tlb_number : 2; 153 unsigned : 4; 154 unsigned local_tlb_entry : 9; 155 unsigned : 3; 156 } __attribute__ ((packed)); 157 }; 158 typedef union dtlb_data_access_addr dtlb_data_access_addr_t; 159 typedef union dtlb_data_access_addr dtlb_tag_read_addr_t; 160 161 union itlb_data_access_addr { 162 uint64_t value; 163 struct { 164 uint64_t : 45; 165 unsigned : 1; 166 unsigned tlb_number : 2; 167 unsigned : 6; 168 unsigned local_tlb_entry : 7; 169 unsigned : 3; 170 } __attribute__ ((packed)); 171 }; 172 typedef union itlb_data_access_addr itlb_data_access_addr_t; 173 typedef union itlb_data_access_addr itlb_tag_read_addr_t; 174 175 #endif 103 176 104 177 /** I-/D-TLB Tag Read Register. */ … … 119 192 struct { 120 193 uint64_t vpn: 51; /**< Virtual Address bits 63:13. */ 194 #if defined (US) 121 195 unsigned : 6; /**< Ignored. */ 122 196 unsigned type : 1; /**< The type of demap operation. */ 197 #elif defined (US3) 198 unsigned : 5; /**< Ignored. */ 199 unsigned type: 2; /**< The type of demap operation. */ 200 #endif 123 201 unsigned context : 2; /**< Context register selection. */ 124 202 unsigned : 4; /**< Zero. */ … … 131 209 uint64_t value; 132 210 struct { 211 #if defined (US) 133 212 unsigned long : 40; /**< Implementation dependent. */ 134 213 unsigned asi : 8; /**< ASI. */ 135 214 unsigned : 2; 136 215 unsigned ft : 7; /**< Fault type. */ 216 #elif defined (US3) 217 unsigned long : 39; /**< Implementation dependent. */ 218 unsigned nf : 1; /**< Non-faulting load. */ 219 unsigned asi : 8; /**< ASI. */ 220 unsigned tm : 1; /**< I-TLB miss. */ 221 unsigned : 3; /**< Reserved. */ 222 unsigned ft : 5; /**< Fault type. */ 223 #endif 137 224 unsigned e : 1; /**< Side-effect bit. */ 138 225 unsigned ct : 2; /**< Context Register selection. */ … … 145 232 typedef union tlb_sfsr_reg tlb_sfsr_reg_t; 146 233 234 #if defined (US3) 235 236 /* 237 * Functions for determining the number of entries in TLBs. They either return 238 * a constant value or a value based on the CPU autodetection. 239 */ 240 241 /** 242 * Determine the number of entries in the DMMU's small TLB. 243 */ 244 static inline uint16_t tlb_dsmall_size(void) 245 { 246 return 16; 247 } 248 249 /** 250 * Determine the number of entries in each DMMU's big TLB. 251 */ 252 static inline uint16_t tlb_dbig_size(void) 253 { 254 return 512; 255 } 256 257 /** 258 * Determine the number of entries in the IMMU's small TLB. 259 */ 260 static inline uint16_t tlb_ismall_size(void) 261 { 262 return 16; 263 } 264 265 /** 266 * Determine the number of entries in the IMMU's big TLB. 267 */ 268 static inline uint16_t tlb_ibig_size(void) 269 { 270 if (((ver_reg_t) ver_read()).impl == IMPL_ULTRASPARCIV_PLUS) 271 return 512; 272 else 273 return 128; 274 } 275 276 #endif 277 147 278 /** Read MMU Primary Context Register. 148 279 * 149 * @return 280 * @return Current value of Primary Context Register. 150 281 */ 151 282 static inline uint64_t mmu_primary_context_read(void) … … 156 287 /** Write MMU Primary Context Register. 157 288 * 158 * @param v 289 * @param v New value of Primary Context Register. 159 290 */ 160 291 static inline void mmu_primary_context_write(uint64_t v) … … 166 297 /** Read MMU Secondary Context Register. 167 298 * 168 * @return 299 * @return Current value of Secondary Context Register. 169 300 */ 170 301 static inline uint64_t mmu_secondary_context_read(void) … … 175 306 /** Write MMU Primary Context Register. 176 307 * 177 * @param v 308 * @param v New value of Primary Context Register. 178 309 */ 179 310 static inline void mmu_secondary_context_write(uint64_t v) … … 183 314 } 184 315 316 #if defined (US) 317 185 318 /** Read IMMU TLB Data Access Register. 186 319 * 187 * @param entry TLB Entry index. 188 * 189 * @return Current value of specified IMMU TLB Data Access Register. 320 * @param entry TLB Entry index. 321 * 322 * @return Current value of specified IMMU TLB Data Access 323 * Register. 190 324 */ 191 325 static inline uint64_t itlb_data_access_read(index_t entry) 192 326 { 193 tlb_data_access_addr_t reg;327 itlb_data_access_addr_t reg; 194 328 195 329 reg.value = 0; … … 200 334 /** Write IMMU TLB Data Access Register. 201 335 * 202 * @param entry 203 * @param value 336 * @param entry TLB Entry index. 337 * @param value Value to be written. 204 338 */ 205 339 static inline void itlb_data_access_write(index_t entry, uint64_t value) 206 340 { 207 tlb_data_access_addr_t reg;341 itlb_data_access_addr_t reg; 208 342 209 343 reg.value = 0; … … 215 349 /** Read DMMU TLB Data Access Register. 216 350 * 217 * @param entry TLB Entry index. 218 * 219 * @return Current value of specified DMMU TLB Data Access Register. 351 * @param entry TLB Entry index. 352 * 353 * @return Current value of specified DMMU TLB Data Access 354 * Register. 220 355 */ 221 356 static inline uint64_t dtlb_data_access_read(index_t entry) 222 357 { 223 tlb_data_access_addr_t reg;358 dtlb_data_access_addr_t reg; 224 359 225 360 reg.value = 0; … … 230 365 /** Write DMMU TLB Data Access Register. 231 366 * 232 * @param entry 233 * @param value 367 * @param entry TLB Entry index. 368 * @param value Value to be written. 234 369 */ 235 370 static inline void dtlb_data_access_write(index_t entry, uint64_t value) 236 371 { 237 tlb_data_access_addr_t reg;372 dtlb_data_access_addr_t reg; 238 373 239 374 reg.value = 0; … … 245 380 /** Read IMMU TLB Tag Read Register. 246 381 * 247 * @param entry 248 * 249 * @return 382 * @param entry TLB Entry index. 383 * 384 * @return Current value of specified IMMU TLB Tag Read Register. 250 385 */ 251 386 static inline uint64_t itlb_tag_read_read(index_t entry) 252 387 { 253 tlb_tag_read_addr_t tag;388 itlb_tag_read_addr_t tag; 254 389 255 390 tag.value = 0; … … 260 395 /** Read DMMU TLB Tag Read Register. 261 396 * 262 * @param entry 263 * 264 * @return 397 * @param entry TLB Entry index. 398 * 399 * @return Current value of specified DMMU TLB Tag Read Register. 265 400 */ 266 401 static inline uint64_t dtlb_tag_read_read(index_t entry) 267 402 { 268 tlb_tag_read_addr_t tag;403 dtlb_tag_read_addr_t tag; 269 404 270 405 tag.value = 0; … … 273 408 } 274 409 410 #elif defined (US3) 411 412 413 /** Read IMMU TLB Data Access Register. 414 * 415 * @param tlb TLB number (one of TLB_ISMALL or TLB_IBIG) 416 * @param entry TLB Entry index. 417 * 418 * @return Current value of specified IMMU TLB Data Access 419 * Register. 420 */ 421 static inline uint64_t itlb_data_access_read(int tlb, index_t entry) 422 { 423 itlb_data_access_addr_t reg; 424 425 reg.value = 0; 426 reg.tlb_number = tlb; 427 reg.local_tlb_entry = entry; 428 return asi_u64_read(ASI_ITLB_DATA_ACCESS_REG, reg.value); 429 } 430 431 /** Write IMMU TLB Data Access Register. 432 * @param tlb TLB number (one of TLB_ISMALL or TLB_IBIG) 433 * @param entry TLB Entry index. 434 * @param value Value to be written. 435 */ 436 static inline void itlb_data_access_write(int tlb, index_t entry, 437 uint64_t value) 438 { 439 itlb_data_access_addr_t reg; 440 441 reg.value = 0; 442 reg.tlb_number = tlb; 443 reg.local_tlb_entry = entry; 444 asi_u64_write(ASI_ITLB_DATA_ACCESS_REG, reg.value, value); 445 flush_pipeline(); 446 } 447 448 /** Read DMMU TLB Data Access Register. 449 * 450 * @param tlb TLB number (one of TLB_DSMALL, TLB_DBIG, TLB_DBIG) 451 * @param entry TLB Entry index. 452 * 453 * @return Current value of specified DMMU TLB Data Access 454 * Register. 455 */ 456 static inline uint64_t dtlb_data_access_read(int tlb, index_t entry) 457 { 458 dtlb_data_access_addr_t reg; 459 460 reg.value = 0; 461 reg.tlb_number = tlb; 462 reg.local_tlb_entry = entry; 463 return asi_u64_read(ASI_DTLB_DATA_ACCESS_REG, reg.value); 464 } 465 466 /** Write DMMU TLB Data Access Register. 467 * 468 * @param tlb TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1) 469 * @param entry TLB Entry index. 470 * @param value Value to be written. 471 */ 472 static inline void dtlb_data_access_write(int tlb, index_t entry, 473 uint64_t value) 474 { 475 dtlb_data_access_addr_t reg; 476 477 reg.value = 0; 478 reg.tlb_number = tlb; 479 reg.local_tlb_entry = entry; 480 asi_u64_write(ASI_DTLB_DATA_ACCESS_REG, reg.value, value); 481 membar(); 482 } 483 484 /** Read IMMU TLB Tag Read Register. 485 * 486 * @param tlb TLB number (one of TLB_ISMALL or TLB_IBIG) 487 * @param entry TLB Entry index. 488 * 489 * @return Current value of specified IMMU TLB Tag Read Register. 490 */ 491 static inline uint64_t itlb_tag_read_read(int tlb, index_t entry) 492 { 493 itlb_tag_read_addr_t tag; 494 495 tag.value = 0; 496 tag.tlb_number = tlb; 497 tag.local_tlb_entry = entry; 498 return asi_u64_read(ASI_ITLB_TAG_READ_REG, tag.value); 499 } 500 501 /** Read DMMU TLB Tag Read Register. 502 * 503 * @param tlb TLB number (one of TLB_DSMALL, TLB_DBIG_0, TLB_DBIG_1) 504 * @param entry TLB Entry index. 505 * 506 * @return Current value of specified DMMU TLB Tag Read Register. 507 */ 508 static inline uint64_t dtlb_tag_read_read(int tlb, index_t entry) 509 { 510 dtlb_tag_read_addr_t tag; 511 512 tag.value = 0; 513 tag.tlb_number = tlb; 514 tag.local_tlb_entry = entry; 515 return asi_u64_read(ASI_DTLB_TAG_READ_REG, tag.value); 516 } 517 518 #endif 519 520 275 521 /** Write IMMU TLB Tag Access Register. 276 522 * 277 * @param v 523 * @param v Value to be written. 278 524 */ 279 525 static inline void itlb_tag_access_write(uint64_t v) … … 285 531 /** Read IMMU TLB Tag Access Register. 286 532 * 287 * @return 533 * @return Current value of IMMU TLB Tag Access Register. 288 534 */ 289 535 static inline uint64_t itlb_tag_access_read(void) … … 294 540 /** Write DMMU TLB Tag Access Register. 295 541 * 296 * @param v 542 * @param v Value to be written. 297 543 */ 298 544 static inline void dtlb_tag_access_write(uint64_t v) … … 304 550 /** Read DMMU TLB Tag Access Register. 305 551 * 306 * @return Current value of DMMU TLB Tag Access Register.552 * @return Current value of DMMU TLB Tag Access Register. 307 553 */ 308 554 static inline uint64_t dtlb_tag_access_read(void) … … 314 560 /** Write IMMU TLB Data in Register. 315 561 * 316 * @param v 562 * @param v Value to be written. 317 563 */ 318 564 static inline void itlb_data_in_write(uint64_t v) … … 324 570 /** Write DMMU TLB Data in Register. 325 571 * 326 * @param v 572 * @param v Value to be written. 327 573 */ 328 574 static inline void dtlb_data_in_write(uint64_t v) … … 334 580 /** Read ITLB Synchronous Fault Status Register. 335 581 * 336 * @return 582 * @return Current content of I-SFSR register. 337 583 */ 338 584 static inline uint64_t itlb_sfsr_read(void) … … 343 589 /** Write ITLB Synchronous Fault Status Register. 344 590 * 345 * @param v 591 * @param v New value of I-SFSR register. 346 592 */ 347 593 static inline void itlb_sfsr_write(uint64_t v) … … 353 599 /** Read DTLB Synchronous Fault Status Register. 354 600 * 355 * @return 601 * @return Current content of D-SFSR register. 356 602 */ 357 603 static inline uint64_t dtlb_sfsr_read(void) … … 362 608 /** Write DTLB Synchronous Fault Status Register. 363 609 * 364 * @param v 610 * @param v New value of D-SFSR register. 365 611 */ 366 612 static inline void dtlb_sfsr_write(uint64_t v) … … 372 618 /** Read DTLB Synchronous Fault Address Register. 373 619 * 374 * @return 620 * @return Current content of D-SFAR register. 375 621 */ 376 622 static inline uint64_t dtlb_sfar_read(void) … … 381 627 /** Perform IMMU TLB Demap Operation. 382 628 * 383 * @param type Selects between context and page demap. 629 * @param type Selects between context and page demap (and entire MMU 630 * demap on US3). 384 631 * @param context_encoding Specifies which Context register has Context ID for 385 * demap.386 * @param page 632 * demap. 633 * @param page Address which is on the page to be demapped. 387 634 */ 388 635 static inline void itlb_demap(int type, int context_encoding, uintptr_t page) … … 398 645 da.vpn = pg.vpn; 399 646 400 asi_u64_write(ASI_IMMU_DEMAP, da.value, 0); /* da.value is the401 * address within the402 * ASI */ 647 /* da.value is the address within the ASI */ 648 asi_u64_write(ASI_IMMU_DEMAP, da.value, 0); 649 403 650 flush_pipeline(); 404 651 } … … 406 653 /** Perform DMMU TLB Demap Operation. 407 654 * 408 * @param type Selects between context and page demap. 655 * @param type Selects between context and page demap (and entire MMU 656 * demap on US3). 409 657 * @param context_encoding Specifies which Context register has Context ID for 410 * 411 * @param page 658 * demap. 659 * @param page Address which is on the page to be demapped. 412 660 */ 413 661 static inline void dtlb_demap(int type, int context_encoding, uintptr_t page) … … 423 671 da.vpn = pg.vpn; 424 672 425 asi_u64_write(ASI_DMMU_DEMAP, da.value, 0); /* da.value is the426 * address within the427 * ASI */ 673 /* da.value is the address within the ASI */ 674 asi_u64_write(ASI_DMMU_DEMAP, da.value, 0); 675 428 676 membar(); 429 677 } 430 678 431 extern void fast_instruction_access_mmu_miss(unative_t unused, istate_t *istate);432 extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t tag, istate_t *istate);433 extern void fast_data_access_protection(tlb_tag_access_reg_t tag , istate_t *istate);434 435 extern void dtlb_insert_mapping(uintptr_t page, uintptr_t frame, int pagesize, bool locked, bool cacheable);679 extern void fast_instruction_access_mmu_miss(unative_t, istate_t *); 680 extern void fast_data_access_mmu_miss(tlb_tag_access_reg_t, istate_t *); 681 extern void fast_data_access_protection(tlb_tag_access_reg_t , istate_t *); 682 683 extern void dtlb_insert_mapping(uintptr_t, uintptr_t, int, bool, bool); 436 684 437 685 extern void dump_sfsr_and_sfar(void); -
kernel/arch/sparc64/include/mm/tsb.h
r0258e67 r965dc18 108 108 } 109 109 110 #if defined (US3) 111 112 /** Write DTSB Primary Extension register. 113 * 114 * @param v New content of the DTSB Primary Extension register. 115 */ 116 static inline void dtsb_primary_extension_write(uint64_t v) 117 { 118 asi_u64_write(ASI_DMMU, VA_DMMU_PRIMARY_EXTENSION, v); 119 } 120 121 /** Write DTSB Secondary Extension register. 122 * 123 * @param v New content of the DTSB Secondary Extension register. 124 */ 125 static inline void dtsb_secondary_extension_write(uint64_t v) 126 { 127 asi_u64_write(ASI_DMMU, VA_DMMU_SECONDARY_EXTENSION, v); 128 } 129 130 /** Write DTSB Nucleus Extension register. 131 * 132 * @param v New content of the DTSB Nucleus Extension register. 133 */ 134 static inline void dtsb_nucleus_extension_write(uint64_t v) 135 { 136 asi_u64_write(ASI_DMMU, VA_DMMU_NUCLEUS_EXTENSION, v); 137 } 138 139 /** Write ITSB Primary Extension register. 140 * 141 * @param v New content of the ITSB Primary Extension register. 142 */ 143 static inline void itsb_primary_extension_write(uint64_t v) 144 { 145 asi_u64_write(ASI_IMMU, VA_IMMU_PRIMARY_EXTENSION, v); 146 } 147 148 /** Write ITSB Nucleus Extension register. 149 * 150 * @param v New content of the ITSB Nucleus Extension register. 151 */ 152 static inline void itsb_nucleus_extension_write(uint64_t v) 153 { 154 asi_u64_write(ASI_IMMU, VA_IMMU_NUCLEUS_EXTENSION, v); 155 } 156 157 #endif 158 110 159 /* Forward declarations. */ 111 160 struct as; -
kernel/arch/sparc64/include/mm/tte.h
r0258e67 r965dc18 51 51 #include <arch/types.h> 52 52 53 /* TTE tag's VA_tag field contains bits <63:VA_TAG_PAGE_SHIFT> of the VA */ 53 54 #define VA_TAG_PAGE_SHIFT 22 54 55 … … 76 77 unsigned ie : 1; /**< Invert Endianness. */ 77 78 unsigned soft2 : 9; /**< Software defined field. */ 79 #if defined (US) 78 80 unsigned diag : 9; /**< Diagnostic data. */ 79 81 unsigned pfn : 28; /**< Physical Address bits, bits 40:13. */ 82 #elif defined (US3) 83 unsigned : 7; /**< Reserved. */ 84 unsigned pfn : 30; /**< Physical Address bits, bits 42:13 */ 85 #endif 80 86 unsigned soft : 6; /**< Software defined field. */ 81 87 unsigned l : 1; /**< Lock. */ -
kernel/arch/sparc64/include/regdef.h
r0258e67 r965dc18 56 56 #define WSTATE_OTHER(n) ((n) << 3) 57 57 58 #define UPA_CONFIG_MID_SHIFT 17 59 #define UPA_CONFIG_MID_MASK 0x1f 58 /* 59 * The following definitions concern the UPA_CONFIG register on US and the 60 * FIREPLANE_CONFIG register on US3. 61 */ 62 #define ICBUS_CONFIG_MID_SHIFT 17 60 63 61 64 #endif -
kernel/arch/sparc64/include/register.h
r0258e67 r965dc18 118 118 typedef union fprs_reg fprs_reg_t; 119 119 120 /** UPA_CONFIG register.121 *122 * Note that format of this register differs significantly from123 * processor version to version. The format defined here124 * is the common subset for all supported processor versions.125 */126 union upa_config {127 uint64_t value;128 struct {129 uint64_t : 34;130 unsigned pcon : 8; /**< Processor configuration. */131 unsigned mid : 5; /**< Module (processor) ID register. */132 unsigned pcap : 17; /**< Processor capabilities. */133 } __attribute__ ((packed));134 };135 typedef union upa_config upa_config_t;136 137 120 #endif 138 121 -
kernel/arch/sparc64/include/trap/interrupt.h
r0258e67 r965dc18 50 50 51 51 /* Interrupt ASI registers. */ 52 #define ASI_ UDB_INTR_W 0x7752 #define ASI_INTR_W 0x77 53 53 #define ASI_INTR_DISPATCH_STATUS 0x48 54 #define ASI_ UDB_INTR_R 0x7f54 #define ASI_INTR_R 0x7f 55 55 #define ASI_INTR_RECEIVE 0x49 56 56 57 /* VA's used with ASI_UDB_INTR_W register. */ 57 /* VA's used with ASI_INTR_W register. */ 58 #if defined (US) 58 59 #define ASI_UDB_INTR_W_DATA_0 0x40 59 60 #define ASI_UDB_INTR_W_DATA_1 0x50 60 61 #define ASI_UDB_INTR_W_DATA_2 0x60 61 #define ASI_UDB_INTR_W_DISPATCH 0x70 62 #elif defined (US3) 63 #define VA_INTR_W_DATA_0 0x40 64 #define VA_INTR_W_DATA_1 0x48 65 #define VA_INTR_W_DATA_2 0x50 66 #define VA_INTR_W_DATA_3 0x58 67 #define VA_INTR_W_DATA_4 0x60 68 #define VA_INTR_W_DATA_5 0x68 69 #define VA_INTR_W_DATA_6 0x80 70 #define VA_INTR_W_DATA_7 0x88 71 #endif 72 #define VA_INTR_W_DISPATCH 0x70 62 73 63 /* VA's used with ASI_UDB_INTR_R register. */ 74 /* VA's used with ASI_INTR_R register. */ 75 #if defined(US) 64 76 #define ASI_UDB_INTR_R_DATA_0 0x40 65 77 #define ASI_UDB_INTR_R_DATA_1 0x50 66 78 #define ASI_UDB_INTR_R_DATA_2 0x60 79 #elif defined (US3) 80 #define VA_INTR_R_DATA_0 0x40 81 #define VA_INTR_R_DATA_1 0x48 82 #define VA_INTR_R_DATA_2 0x50 83 #define VA_INTR_R_DATA_3 0x58 84 #define VA_INTR_R_DATA_4 0x60 85 #define VA_INTR_R_DATA_5 0x68 86 #define VA_INTR_R_DATA_6 0x80 87 #define VA_INTR_R_DATA_7 0x88 88 #endif 67 89 68 90 /* Shifts in the Interrupt Vector Dispatch virtual address. */
Note:
See TracChangeset
for help on using the changeset viewer.