As mentioned at the start of this topic, the set of atomic_t integer operators we have dealt with so far all operate on traditional 32-bit integers (this discussion doesn't apply to the newer refcount_t interfaces; they anyway operate upon both 32 and 64-bit quantities). Obviously, with 64-bit systems becoming the norm rather than the exception nowadays, the kernel community provides an identical set of atomic integer operators for 64-bit integers. The difference is as follows:
- Declare the 64-bit atomic integer as a variable of type atomic64_t (that is, atomic_long_t).
- For all operators, in place of the atomic_ prefix, use the atomic64_ prefix.
So, take the following examples:
- In place of ATOMIC_INIT(), use ATOMIC64_INIT().
- In place of atomic_read(), use atomic64_read().
- In place of atomic64_dec_if_positive(), use atomic64_dec_if_positive().