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 
0007 /* sync_bitops functions are equivalent to the SMP implementation of the
0008  * original functions, independently from CONFIG_SMP being defined.
0009  *
0010  * We need them because _set_bit etc are not SMP safe if !CONFIG_SMP. But
0011  * under Xen you might be communicating with a completely external entity
0012  * who might be on another CPU (e.g. two uniprocessor guests communicating
0013  * via event channels and grant tables). So we need a variant of the bit
0014  * ops which are SMP safe even on a UP kernel.
0015  */
0016 
0017 #define sync_set_bit(nr, p)     _set_bit(nr, p)
0018 #define sync_clear_bit(nr, p)       _clear_bit(nr, p)
0019 #define sync_change_bit(nr, p)      _change_bit(nr, p)
0020 #define sync_test_and_set_bit(nr, p)    _test_and_set_bit(nr, p)
0021 #define sync_test_and_clear_bit(nr, p)  _test_and_clear_bit(nr, p)
0022 #define sync_test_and_change_bit(nr, p) _test_and_change_bit(nr, p)
0023 #define sync_test_bit(nr, addr)     test_bit(nr, addr)
0024 #define arch_sync_cmpxchg       arch_cmpxchg
0025 
0026 
0027 #endif