1__TEST_AND_CLEAR_BIT(9)    Basic C Library Functions   __TEST_AND_CLEAR_BIT(9)
2
3
4

NAME

6       __test_and_clear_bit - Clear a bit and return its old value
7

SYNOPSIS

9       int __test_and_clear_bit(int nr, volatile unsigned long * addr);
10

ARGUMENTS

12       nr
13           Bit to clear
14
15       addr
16           Address to count from
17

DESCRIPTION

19       This operation is non-atomic and can be reordered. If two examples of
20       this operation race, one can appear to succeed but actually fail. You
21       must protect multiple accesses with a lock.
22

NOTE

24       the operation is performed atomically with respect to the local CPU,
25       but not other CPUs. Portable code should not rely on this behaviour.
26       KVM relies on this behaviour on x86 for modifying memory that is also
27

ACCESSED FROM A HYPERVISOR ON THE SAME CPU IF RUNNING IN A VM

29       donĀ“t change this without also updating arch/x86/kernel/kvm.c
30
32Kernel Hackers Manual 2.6.         June 2019           __TEST_AND_CLEAR_BIT(9)
Impressum