From: Paul E. McKenney Date: Sun, 19 Oct 2014 19:05:22 +0000 (-0700) Subject: documentation: Add atomic_long_t to atomic_ops.txt X-Git-Tag: Ubuntu-5.4-5.4.0-11.14~13299^2^2^3~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=1f7870dd8729c64b8472b42440811e7ff94d16a4;p=mirror_ubuntu-focal-kernel.git documentation: Add atomic_long_t to atomic_ops.txt Signed-off-by: Paul E. McKenney Reviewed-by: Pranith Kumar --- diff --git a/Documentation/atomic_ops.txt b/Documentation/atomic_ops.txt index 68542fe13b85..183e41bdcb69 100644 --- a/Documentation/atomic_ops.txt +++ b/Documentation/atomic_ops.txt @@ -7,12 +7,13 @@ maintainers on how to implement atomic counter, bitops, and spinlock interfaces properly. - The atomic_t type should be defined as a signed integer. -Also, it should be made opaque such that any kind of cast to a normal -C integer type will fail. Something like the following should -suffice: + The atomic_t type should be defined as a signed integer and +the atomic_long_t type as a signed long integer. Also, they should +be made opaque such that any kind of cast to a normal C integer type +will fail. Something like the following should suffice: typedef struct { int counter; } atomic_t; + typedef struct { long counter; } atomic_long_t; Historically, counter has been declared volatile. This is now discouraged. See Documentation/volatile-considered-harmful.txt for the complete rationale. @@ -37,6 +38,9 @@ initializer is used before runtime. If the initializer is used at runtime, a proper implicit or explicit read memory barrier is needed before reading the value with atomic_read from another thread. +As with all of the atomic_ interfaces, replace the leading "atomic_" +with "atomic_long_" to operate on atomic_long_t. + The second interface can be used at runtime, as in: struct foo { atomic_t counter; };