Changeset 3759681 in mainline for kernel/arch/ppc32/include/barrier.h
- Timestamp:
- 2008-06-14T16:26:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0af4f9e
- Parents:
- 62cd66f
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.