Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_SYNC_BITOPS_H__
0003 #define __ASM_SYNC_BITOPS_H__
0004 
0005 #include <asm/bitops.h>
0006 #include <asm/cmpxchg.h>
0007 
0008 /* sync_bitops functions are equivalent to the SMP implementation of the
0009  * original functions, independently from CONFIG_SMP being defined.
0010  *
0011  * We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
0012  * under Xen you might be communicating with a completely external entity
0013  * who might be on another CPU (e.g. two uniprocessor guests communicating
0014  * via event channels and grant tables). So we need a variant of the bit
0015  * ops which are SMP safe even on a UP kernel.
0016  */
0017 
0018 #define sync_set_bit(nr, p)         set_bit(nr, p)
0019 #define sync_clear_bit(nr, p)           clear_bit(nr, p)
0020 #define sync_change_bit(nr, p)          change_bit(nr, p)
0021 #define sync_test_and_set_bit(nr, p)        test_and_set_bit(nr, p)
0022 #define sync_test_and_clear_bit(nr, p)      test_and_clear_bit(nr, p)
0023 #define sync_test_and_change_bit(nr, p)     test_and_change_bit(nr, p)
0024 #define sync_test_bit(nr, addr)         test_bit(nr, addr)
0025 #define arch_sync_cmpxchg           arch_cmpxchg
0026 
0027 #endif