Changeset a35b458 in mainline for kernel/arch/sparc64/include
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- kernel/arch/sparc64/include/arch
- Files:
-
- 10 edited
-
asm.h (modified) (18 diffs)
-
atomic.h (modified) (6 diffs)
-
barrier.h (modified) (2 diffs)
-
cpu_family.h (modified) (1 diff)
-
mm/sun4u/mmu.h (modified) (1 diff)
-
mm/sun4u/tlb.h (modified) (11 diffs)
-
mm/sun4v/mmu.h (modified) (1 diff)
-
sun4u/asm.h (modified) (1 diff)
-
sun4u/cpu.h (modified) (1 diff)
-
sun4v/hypercall.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch/asm.h
r3061bc1 ra35b458 91 91 { 92 92 uint64_t v; 93 93 94 94 asm volatile ( 95 95 "rdpr %%pstate, %[v]\n" 96 96 : [v] "=r" (v) 97 97 ); 98 98 99 99 return v; 100 100 } … … 122 122 { 123 123 uint64_t v; 124 124 125 125 asm volatile ( 126 126 "rd %%tick_cmpr, %[v]\n" 127 127 : [v] "=r" (v) 128 128 ); 129 129 130 130 return v; 131 131 } … … 153 153 { 154 154 uint64_t v; 155 155 156 156 asm volatile ( 157 157 "rd %%asr25, %[v]\n" 158 158 : [v] "=r" (v) 159 159 ); 160 160 161 161 return v; 162 162 } … … 184 184 { 185 185 uint64_t v; 186 186 187 187 asm volatile ( 188 188 "rdpr %%tick, %[v]\n" 189 189 : [v] "=r" (v) 190 190 ); 191 191 192 192 return v; 193 193 } … … 215 215 { 216 216 uint64_t v; 217 217 218 218 asm volatile ( 219 219 "rd %%fprs, %[v]\n" 220 220 : [v] "=r" (v) 221 221 ); 222 222 223 223 return v; 224 224 } … … 246 246 { 247 247 uint64_t v; 248 248 249 249 asm volatile ( 250 250 "rd %%softint, %[v]\n" 251 251 : [v] "=r" (v) 252 252 ); 253 253 254 254 return v; 255 255 } … … 312 312 pstate_reg_t pstate; 313 313 uint64_t value = pstate_read(); 314 314 315 315 pstate.value = value; 316 316 pstate.ie = true; 317 317 pstate_write(pstate.value); 318 318 319 319 return (ipl_t) value; 320 320 } … … 331 331 pstate_reg_t pstate; 332 332 uint64_t value = pstate_read(); 333 333 334 334 pstate.value = value; 335 335 pstate.ie = false; 336 336 pstate_write(pstate.value); 337 337 338 338 return (ipl_t) value; 339 339 } … … 348 348 NO_TRACE static inline void interrupts_restore(ipl_t ipl) { 349 349 pstate_reg_t pstate; 350 350 351 351 pstate.value = pstate_read(); 352 352 pstate.ie = ((pstate_reg_t)(uint64_t) ipl).ie; … … 373 373 { 374 374 pstate_reg_t pstate; 375 375 376 376 pstate.value = pstate_read(); 377 377 return !pstate.ie; … … 388 388 { 389 389 uintptr_t unbiased_sp; 390 390 391 391 asm volatile ( 392 392 "add %%sp, %[stack_bias], %[unbiased_sp]\n" … … 394 394 : [stack_bias] "i" (STACK_BIAS) 395 395 ); 396 396 397 397 return ALIGN_DOWN(unbiased_sp, STACK_SIZE); 398 398 } … … 406 406 { 407 407 uint64_t v; 408 408 409 409 asm volatile ( 410 410 "rdpr %%ver, %[v]\n" 411 411 : [v] "=r" (v) 412 412 ); 413 413 414 414 return v; 415 415 } … … 423 423 { 424 424 uint64_t v; 425 425 426 426 asm volatile ( 427 427 "rdpr %%tpc, %[v]\n" 428 428 : [v] "=r" (v) 429 429 ); 430 430 431 431 return v; 432 432 } … … 440 440 { 441 441 uint64_t v; 442 442 443 443 asm volatile ( 444 444 "rdpr %%tl, %[v]\n" 445 445 : [v] "=r" (v) 446 446 ); 447 447 448 448 return v; 449 449 } … … 457 457 { 458 458 uint64_t v; 459 459 460 460 asm volatile ( 461 461 "rdpr %%tba, %[v]\n" 462 462 : [v] "=r" (v) 463 463 ); 464 464 465 465 return v; 466 466 } … … 492 492 { 493 493 uint64_t v; 494 494 495 495 asm volatile ( 496 496 "ldxa [%[va]] %[asi], %[v]\n" … … 499 499 [asi] "i" ((unsigned int) asi) 500 500 ); 501 501 502 502 return v; 503 503 } -
kernel/arch/sparc64/include/arch/atomic.h
r3061bc1 ra35b458 56 56 atomic_count_t a; 57 57 atomic_count_t b; 58 58 59 59 do { 60 60 volatile uintptr_t ptr = (uintptr_t) &val->count; 61 61 62 62 a = *((atomic_count_t *) ptr); 63 63 b = a + i; 64 64 65 65 asm volatile ( 66 66 "casx %0, %2, %1\n" … … 70 70 ); 71 71 } while (a != b); 72 72 73 73 return a; 74 74 } … … 108 108 atomic_count_t v = 1; 109 109 volatile uintptr_t ptr = (uintptr_t) &val->count; 110 110 111 111 asm volatile ( 112 112 "casx %0, %2, %1\n" … … 115 115 : "r" (0) 116 116 ); 117 117 118 118 return v; 119 119 } … … 123 123 atomic_count_t tmp1 = 1; 124 124 atomic_count_t tmp2 = 0; 125 125 126 126 volatile uintptr_t ptr = (uintptr_t) &val->count; 127 127 128 128 preemption_disable(); 129 129 130 130 asm volatile ( 131 131 "0:\n" … … 144 144 : "r" (0) 145 145 ); 146 146 147 147 /* 148 148 * Prevent critical section code from bleeding out this way up. -
kernel/arch/sparc64/include/arch/barrier.h
r3061bc1 ra35b458 83 83 { 84 84 unsigned long pc; 85 85 86 86 /* 87 87 * The FLUSH instruction takes address parameter. … … 94 94 * 95 95 */ 96 96 97 97 asm volatile ( 98 98 "rd %%pc, %[pc]\n" -
kernel/arch/sparc64/include/arch/cpu_family.h
r3061bc1 ra35b458 76 76 return (impl == IMPL_ULTRASPARCIV) || (impl == IMPL_ULTRASPARCIV_PLUS); 77 77 } 78 78 79 79 #endif 80 80 -
kernel/arch/sparc64/include/arch/mm/sun4u/mmu.h
r3061bc1 ra35b458 111 111 unsigned dc : 1; /**< D-Cache enable. */ 112 112 unsigned ic : 1; /**< I-Cache enable. */ 113 113 114 114 } __attribute__ ((packed)); 115 115 } lsu_cr_reg_t; -
kernel/arch/sparc64/include/arch/mm/sun4u/tlb.h
r3061bc1 ra35b458 79 79 #define TLB_DBIG_0 2 80 80 #define TLB_DBIG_1 3 81 81 82 82 /* I-MMU: one small (16-entry) TLB and one big TLB */ 83 83 #define TLB_ISMALL 0 … … 327 327 { 328 328 itlb_data_access_addr_t reg; 329 329 330 330 reg.value = 0; 331 331 reg.tlb_entry = entry; … … 341 341 { 342 342 itlb_data_access_addr_t reg; 343 343 344 344 reg.value = 0; 345 345 reg.tlb_entry = entry; … … 358 358 { 359 359 dtlb_data_access_addr_t reg; 360 360 361 361 reg.value = 0; 362 362 reg.tlb_entry = entry; … … 372 372 { 373 373 dtlb_data_access_addr_t reg; 374 374 375 375 reg.value = 0; 376 376 reg.tlb_entry = entry; … … 423 423 { 424 424 itlb_data_access_addr_t reg; 425 425 426 426 reg.value = 0; 427 427 reg.tlb_number = tlb; … … 439 439 { 440 440 itlb_data_access_addr_t reg; 441 441 442 442 reg.value = 0; 443 443 reg.tlb_number = tlb; … … 458 458 { 459 459 dtlb_data_access_addr_t reg; 460 460 461 461 reg.value = 0; 462 462 reg.tlb_number = tlb; … … 475 475 { 476 476 dtlb_data_access_addr_t reg; 477 477 478 478 reg.value = 0; 479 479 reg.tlb_number = tlb; … … 638 638 tlb_demap_addr_t da; 639 639 page_address_t pg; 640 640 641 641 da.value = 0; 642 642 pg.address = page; 643 643 644 644 da.type = type; 645 645 da.context = context_encoding; 646 646 da.vpn = pg.vpn; 647 647 648 648 /* da.value is the address within the ASI */ 649 649 asi_u64_write(ASI_IMMU_DEMAP, da.value, 0); … … 664 664 tlb_demap_addr_t da; 665 665 page_address_t pg; 666 666 667 667 da.value = 0; 668 668 pg.address = page; 669 669 670 670 da.type = type; 671 671 da.context = context_encoding; 672 672 da.vpn = pg.vpn; 673 673 674 674 /* da.value is the address within the ASI */ 675 675 asi_u64_write(ASI_DMMU_DEMAP, da.value, 0); -
kernel/arch/sparc64/include/arch/mm/sun4v/mmu.h
r3061bc1 ra35b458 41 41 #define VA_PRIMARY_CONTEXT_REG 0x8 /**< primary context register VA. */ 42 42 #define ASI_PRIMARY_CONTEXT_REG 0x21 /**< primary context register ASI. */ 43 43 44 44 #define VA_SECONDARY_CONTEXT_REG 0x10 /**< secondary context register VA. */ 45 45 #define ASI_SECONDARY_CONTEXT_REG 0x21 /**< secondary context register ASI. */ -
kernel/arch/sparc64/include/arch/sun4u/asm.h
r3061bc1 ra35b458 46 46 { 47 47 uint64_t v; 48 48 49 49 asm volatile ( 50 50 "rdpr %%ver, %[v]\n" 51 51 : [v] "=r" (v) 52 52 ); 53 53 54 54 return v; 55 55 } -
kernel/arch/sparc64/include/arch/sun4u/cpu.h
r3061bc1 ra35b458 78 78 uint64_t icbus_config = asi_u64_read(ASI_ICBUS_CONFIG, 0); 79 79 icbus_config = icbus_config >> ICBUS_CONFIG_MID_SHIFT; 80 80 81 81 #if defined (US) 82 82 return icbus_config & 0x1f; -
kernel/arch/sparc64/include/arch/sun4v/hypercall.h
r3061bc1 ra35b458 105 105 set function_number, %o5; \ 106 106 ta FAST_TRAP; 107 107 108 108 /** 109 109 * Performs a fast hypervisor API call from the assembly language code. … … 197 197 register uint64_t a4 asm("o3") = p4; 198 198 register uint64_t a5 asm("o4") = p5; 199 199 200 200 asm volatile ( 201 201 "ta %8\n" … … 239 239 : "memory" 240 240 ); 241 241 242 242 return a1; 243 243 }
Note:
See TracChangeset
for help on using the changeset viewer.
