Changeset 3759681 in mainline
- Timestamp:
- 2008-06-14T16:26:14Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0af4f9e
- Parents:
- 62cd66f
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/barrier.h
r62cd66f r3759681 43 43 #define write_barrier() asm volatile ("eieio" ::: "memory") 44 44 45 #define smc_coherence(a) 46 #define smc_coherence_block(a, l) 45 /* 46 * The IMB sequence used here is valid for all possible cache models 47 * on uniprocessor. SMP might require a different sequence. 48 * See PowerPC Programming Environment for 32-Bit Microprocessors, 49 * chapter 5.1.5.2 50 */ 51 52 static inline void smc_coherence(void *addr) 53 { 54 asm volatile ( 55 "dcbst 0, %0\n" 56 "sync\n" 57 "icbi 0, %0\n" 58 "isync\n" 59 :: "r" (addr) 60 ); 61 } 62 63 #define COHERENCE_INVAL_MIN 4 64 65 static inline void smc_coherence_block(void *addr, unsigned long len) 66 { 67 unsigned long i; 68 69 for (i = 0; i < len; i += COHERENCE_INVAL_MIN) { 70 asm volatile ("dcbst 0, %0\n" :: "r" (addr + i)); 71 } 72 73 asm volatile ("sync"); 74 75 for (i = 0; i < len; i += COHERENCE_INVAL_MIN) { 76 asm volatile ("icbi 0, %0\n" :: "r" (addr + i)); 77 } 78 79 asm volatile ("isync"); 80 } 47 81 48 82 #endif -
kernel/generic/src/mm/backend_elf.c
r62cd66f r3759681 154 154 (void *) (base + i * FRAME_SIZE), FRAME_SIZE); 155 155 if (entry->p_flags & PF_X) { 156 smc_coherence_block(PA2KA(frame), FRAME_SIZE); 156 smc_coherence_block((void *) PA2KA(frame), 157 FRAME_SIZE); 157 158 } 158 159 dirty = true; … … 194 195 FRAME_SIZE - pad_lo - pad_hi); 195 196 if (entry->p_flags & PF_X) { 196 smc_coherence_block( PA2KA(frame) + pad_lo, FRAME_SIZE -197 pad_lo - pad_hi);197 smc_coherence_block((void *) (PA2KA(frame) + pad_lo), 198 FRAME_SIZE - pad_lo - pad_hi); 198 199 } 199 200 memsetb((void *) PA2KA(frame), pad_lo, 0);
Note:
See TracChangeset
for help on using the changeset viewer.