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:
Keir Fraser committed 2010-10-29 18:43:01 +01:00
1 parent f0ad21c499
commit 61c7ab294f
1 file changed
+1 -5
+1 -5
View File
@@ -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 ) \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.