mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
i386: simplify pte_read_atomic()
There's no need for a loop here: if the value to be compared against
and the value to be stored are equal, cmpxchg{,8b} act just like a
load anyway.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
This commit is contained in:
1 parent
f0ad21c499
commit
61c7ab294f
1 file changed
+1
-5
@@ -84,11 +84,7 @@ extern unsigned int PAGE_HYPERVISOR_NOCACHE;
|
||||
|
||||
#endif
|
||||
|
||||
#define pte_read_atomic(ptep) ({ \
|
||||
intpte_t __pte = *(ptep), __npte; \
|
||||
while ( (__npte = cmpxchg(ptep, __pte, __pte)) != __pte ) \
|
||||
__pte = __npte; \
|
||||
__pte; })
|
||||
#define pte_read_atomic(ptep) cmpxchg(ptep, 0, 0)
|
||||
#define pte_write_atomic(ptep, pte) do { \
|
||||
intpte_t __pte = *(ptep), __npte; \
|
||||
while ( (__npte = cmpxchg(ptep, __pte, (pte))) != __pte ) \
|
||||
|
||||