Changeset 0abc2ae in mainline
- Timestamp:
- 2018-08-13T00:11:39Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f34d2be
- Parents:
- 05882233
- Location:
- kernel
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/arch/barrier.h
r05882233 r0abc2ae 49 49 #ifdef KERNEL 50 50 51 #define smc_coherence(addr) 52 #define smc_coherence_block(addr, size) 51 #define smc_coherence(addr, size) 53 52 54 53 #endif /* KERNEL*/ -
kernel/arch/arm32/include/arch/barrier.h
r05882233 r0abc2ae 117 117 */ 118 118 119 #if defined PROCESSOR_ARCH_armv7_a | defined PROCESSOR_ARCH_armv6 | defined KERNEL 120 //TODO might be PL1 only on armv5- 121 #define smc_coherence(a) \ 122 do { \ 123 dcache_clean_mva_pou(ALIGN_DOWN((uintptr_t) a, CP15_C7_MVA_ALIGN)); \ 124 write_barrier(); /* Wait for completion */\ 125 icache_invalidate();\ 126 inst_barrier(); /* Wait for Inst refetch */\ 127 } while (0) 119 #ifdef KERNEL 120 128 121 /* 129 122 * @note: Cache type register is not available in uspace. We would need 130 123 * to export the cache line value, or use syscall for uspace smc_coherence 131 124 */ 132 #define smc_coherence _block(a, l) \125 #define smc_coherence(a, l) \ 133 126 do { \ 134 127 for (uintptr_t addr = (uintptr_t) a; addr < (uintptr_t) a + l; \ 135 128 addr += CP15_C7_MVA_ALIGN) \ 136 smc_coherence(addr); \ 129 dcache_clean_mva_pou(ALIGN_DOWN((uintptr_t) a, CP15_C7_MVA_ALIGN)); \ 130 write_barrier(); /* Wait for completion */\ 131 icache_invalidate();\ 132 write_barrier();\ 133 inst_barrier(); /* Wait for Inst refetch */\ 137 134 } while (0) 138 #else 139 #define smc_coherence(a) 140 #define smc_coherence_block(a, l) 135 141 136 #endif 142 137 -
kernel/arch/arm32/src/exception.c
r05882233 r0abc2ae 75 75 /* Make it LDR instruction and store at exception vector */ 76 76 *vector = handler_address_ptr | LDR_OPCODE; 77 smc_coherence(vector );77 smc_coherence(vector, 4); 78 78 79 79 /* Store handler's address */ -
kernel/arch/ia32/include/arch/barrier.h
r05882233 r0abc2ae 106 106 * sufficient for them to drain to the D-cache). 107 107 */ 108 #define smc_coherence(a) write_barrier() 109 #define smc_coherence_block(a, l) write_barrier() 108 #define smc_coherence(a, l) write_barrier() 110 109 111 110 #endif /* KERNEL */ -
kernel/arch/ia64/include/arch/barrier.h
r05882233 r0abc2ae 58 58 #ifdef KERNEL 59 59 60 #define smc_coherence(a) \61 { \62 fc_i((a)); \63 sync_i(); \64 srlz_i(); \65 }66 67 60 #define FC_INVAL_MIN 32 68 #define smc_coherence _block(a, l) \61 #define smc_coherence(a, l) \ 69 62 { \ 70 63 unsigned long i; \ -
kernel/arch/mips32/include/arch/barrier.h
r05882233 r0abc2ae 48 48 #ifdef KERNEL 49 49 50 #define smc_coherence(a) 51 #define smc_coherence_block(a, l) 50 #define smc_coherence(a, l) 52 51 53 52 #endif /* KERNEL */ -
kernel/arch/mips32/src/debugger.c
r05882233 r0abc2ae 213 213 /* Set breakpoint */ 214 214 *((sysarg_t *) cur->address) = 0x0d; 215 smc_coherence(cur->address );215 smc_coherence(cur->address, 4); 216 216 217 217 irq_spinlock_unlock(&bkpoint_lock, true); … … 246 246 247 247 ((uint32_t *) cur->address)[0] = cur->instruction; 248 smc_coherence(((uint32_t *) cur->address)[0] );248 smc_coherence(((uint32_t *) cur->address)[0], 4); 249 249 ((uint32_t *) cur->address)[1] = cur->nextinstruction; 250 smc_coherence(((uint32_t *) cur->address)[1] );250 smc_coherence(((uint32_t *) cur->address)[1], 4); 251 251 252 252 cur->address = (uintptr_t) NULL; … … 358 358 /* Set breakpoint on first instruction */ 359 359 ((uint32_t *) cur->address)[0] = 0x0d; 360 smc_coherence(((uint32_t *)cur->address)[0] );360 smc_coherence(((uint32_t *)cur->address)[0], 4); 361 361 362 362 /* Return back the second */ 363 363 ((uint32_t *) cur->address)[1] = cur->nextinstruction; 364 smc_coherence(((uint32_t *) cur->address)[1] );364 smc_coherence(((uint32_t *) cur->address)[1], 4); 365 365 366 366 cur->flags &= ~BKPOINT_REINST; … … 380 380 /* Return first instruction back */ 381 381 ((uint32_t *)cur->address)[0] = cur->instruction; 382 smc_coherence(cur->address );382 smc_coherence(cur->address, 4); 383 383 384 384 if (!(cur->flags & BKPOINT_ONESHOT)) { -
kernel/arch/mips32/src/mips32.c
r05882233 r0abc2ae 121 121 /* Copy the exception vectors to the right places */ 122 122 memcpy(TLB_EXC, (char *) tlb_refill_entry, EXCEPTION_JUMP_SIZE); 123 smc_coherence _block(TLB_EXC, EXCEPTION_JUMP_SIZE);123 smc_coherence(TLB_EXC, EXCEPTION_JUMP_SIZE); 124 124 memcpy(NORM_EXC, (char *) exception_entry, EXCEPTION_JUMP_SIZE); 125 smc_coherence _block(NORM_EXC, EXCEPTION_JUMP_SIZE);125 smc_coherence(NORM_EXC, EXCEPTION_JUMP_SIZE); 126 126 memcpy(CACHE_EXC, (char *) cache_error_entry, EXCEPTION_JUMP_SIZE); 127 smc_coherence _block(CACHE_EXC, EXCEPTION_JUMP_SIZE);127 smc_coherence(CACHE_EXC, EXCEPTION_JUMP_SIZE); 128 128 129 129 /* -
kernel/arch/ppc32/include/arch/barrier.h
r05882233 r0abc2ae 62 62 */ 63 63 64 NO_TRACE static inline void smc_coherence(void *addr) 65 { 66 asm volatile ( 67 "dcbst 0, %[addr]\n" 68 "sync\n" 69 "icbi 0, %[addr]\n" 70 "sync\n" 71 "isync\n" 72 :: [addr] "r" (addr) 73 ); 74 } 75 76 NO_TRACE static inline void smc_coherence_block(void *addr, unsigned int len) 64 NO_TRACE static inline void smc_coherence(void *addr, unsigned int len) 77 65 { 78 66 unsigned int i; -
kernel/arch/riscv64/include/arch/barrier.h
r05882233 r0abc2ae 49 49 #ifdef KERNEL 50 50 51 #define smc_coherence(addr) 52 #define smc_coherence_block(addr, size) 51 #define smc_coherence(addr, size) 53 52 54 53 #endif /* KERNEL */ -
kernel/arch/sparc64/include/arch/barrier.h
r05882233 r0abc2ae 116 116 #define FLUSH_INVAL_MIN 4 117 117 118 #define smc_coherence(a) \ 119 do { \ 120 write_barrier(); \ 121 flush((a)); \ 122 } while (0) 123 124 #define smc_coherence_block(a, l) \ 118 #define smc_coherence(a, l) \ 125 119 do { \ 126 120 unsigned long i; \ … … 133 127 #elif defined (US3) 134 128 135 #define smc_coherence(a) \ 136 do { \ 137 write_barrier(); \ 138 flush_pipeline(); \ 139 } while (0) 140 141 #define smc_coherence_block(a, l) \ 129 #define smc_coherence(a, l) \ 142 130 do { \ 143 131 write_barrier(); \ -
kernel/generic/src/mm/backend_elf.c
r05882233 r0abc2ae 334 334 PAGE_SIZE); 335 335 if (entry->p_flags & PF_X) { 336 smc_coherence _block((void *) kpage, PAGE_SIZE);336 smc_coherence((void *) kpage, PAGE_SIZE); 337 337 } 338 338 km_temporary_page_put(kpage); … … 385 385 PAGE_SIZE - pad_lo - pad_hi); 386 386 if (entry->p_flags & PF_X) { 387 smc_coherence _block((void *) (kpage + pad_lo),387 smc_coherence((void *) (kpage + pad_lo), 388 388 PAGE_SIZE - pad_lo - pad_hi); 389 389 } -
kernel/generic/src/synch/smc.c
r05882233 r0abc2ae 54 54 } 55 55 56 smc_coherence _block((void *) va, size);56 smc_coherence((void *) va, size); 57 57 return 0; 58 58 }
Note:
See TracChangeset
for help on using the changeset viewer.