Subversion Repositories HelenOS

Rev

Rev 3134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3134 Rev 3143
Line 40... Line 40...
40
 
40
 
41
#define memory_barrier() asm volatile ("sync" ::: "memory")
41
#define memory_barrier() asm volatile ("sync" ::: "memory")
42
#define read_barrier() asm volatile ("sync" ::: "memory")
42
#define read_barrier() asm volatile ("sync" ::: "memory")
43
#define write_barrier() asm volatile ("eieio" ::: "memory")
43
#define write_barrier() asm volatile ("eieio" ::: "memory")
44
 
44
 
-
 
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
 
45
#define smc_coherence(a)
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
 
46
#define smc_coherence_block(a, l)
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
#endif
82
#endif
49
 
83
 
50
/** @}
84
/** @}
51
 */
85
 */