x86: fix xchg() and cmpxchg() macros

Change-Id: I6faf0fff8a8595734fca6247634cdae6b86483b3
This commit is contained in:
Balazs Gerofi
2019-04-02 23:05:53 +09:00
parent 9b6a88eeeb
commit 0d902872a1
2 changed files with 119 additions and 35 deletions

View File

@@ -34,4 +34,12 @@ static inline unsigned long read_tsc(void)
return (low | ((unsigned long)high << 32));
}
#define smp_load_acquire(p) \
({ \
typeof(*p) ___p1 = ACCESS_ONCE(*p); \
compiletime_assert_atomic_type(*p); \
barrier(); \
___p1; \
})
#endif /* ARCH_CPU_H */