Subversion Repositories Kolibri OS

Rev

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

Rev 6934 Rev 6936
Line 51... Line 51...
51
/*
51
/*
52
 * For this option x86 doesn't have a strong TSO memory
52
 * For this option x86 doesn't have a strong TSO memory
53
 * model and we should fall back to full barriers.
53
 * model and we should fall back to full barriers.
54
 */
54
 */
Line 55... Line 55...
55
 
55
 
56
#define smp_store_release(p, v)						\
56
#define __smp_store_release(p, v)					\
57
do {									\
57
do {									\
58
	compiletime_assert_atomic_type(*p);				\
58
	compiletime_assert_atomic_type(*p);				\
59
	smp_mb();							\
59
	__smp_mb();							\
60
	WRITE_ONCE(*p, v);						\
60
	WRITE_ONCE(*p, v);						\
Line 61... Line 61...
61
} while (0)
61
} while (0)
62
 
62
 
63
#define smp_load_acquire(p)						\
63
#define __smp_load_acquire(p)						\
64
({									\
64
({									\
65
	typeof(*p) ___p1 = READ_ONCE(*p);				\
65
	typeof(*p) ___p1 = READ_ONCE(*p);				\
66
	compiletime_assert_atomic_type(*p);				\
66
	compiletime_assert_atomic_type(*p);				\
67
	smp_mb();							\
67
	__smp_mb();							\
Line 68... Line 68...
68
	___p1;								\
68
	___p1;								\
Line 69... Line 69...
69
})
69
})
70
 
70
 
71
#else /* regular x86 TSO memory ordering */
71
#else /* regular x86 TSO memory ordering */
72
 
72
 
73
#define smp_store_release(p, v)						\
73
#define __smp_store_release(p, v)					\
74
do {									\
74
do {									\
Line 75... Line 75...
75
	compiletime_assert_atomic_type(*p);				\
75
	compiletime_assert_atomic_type(*p);				\
76
	barrier();							\
76
	barrier();							\
77
	WRITE_ONCE(*p, v);						\
77
	WRITE_ONCE(*p, v);						\
78
} while (0)
78
} while (0)
79
 
79
 
80
#define smp_load_acquire(p)						\
80
#define __smp_load_acquire(p)						\
81
({									\
81
({									\
Line 82... Line 82...
82
	typeof(*p) ___p1 = READ_ONCE(*p);				\
82
	typeof(*p) ___p1 = READ_ONCE(*p);				\
Line 83... Line 83...
83
	compiletime_assert_atomic_type(*p);				\
83
	compiletime_assert_atomic_type(*p);				\
84
	barrier();							\
84
	barrier();							\
85
	___p1;								\
85
	___p1;								\
-
 
86
})
-
 
87
 
Line 86... Line 88...
86
})
88
#endif