summaryrefslogtreecommitdiffstats
path: root/Kbuild
diff options
context:
space:
mode:
authorMark Rutland2018-09-04 12:48:27 +0200
committerIngo Molnar2018-11-01 11:00:55 +0100
commitb5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb (patch)
tree4bd29d5a65797332263a9e47079e65cac101eafd /Kbuild
parentlocking/atomics: Switch to generated fallbacks (diff)
downloadkernel-qcow2-linux-b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb.tar.gz
kernel-qcow2-linux-b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb.tar.xz
kernel-qcow2-linux-b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb.zip
locking/atomics: Switch to generated atomic-long
As a step towards ensuring the atomic* APIs are consistent, let's switch to wrappers generated by gen-atomic-long.h, using the same table that gen-atomic-fallbacks.h uses to fill in gaps in the atomic_* and atomic64_* APIs. These are checked in rather than generated with Kbuild, since: * This allows inspection of the atomics with git grep and ctags on a pristine tree, which Linus strongly prefers being able to do. * The fallbacks are not affected by machine details or configuration options, so it is not necessary to regenerate them to take these into account. * These are included by files required *very* early in the build process (e.g. for generating bounds.h), and we'd rather not complicate the top-level Kbuild file with dependencies. Other than *_INIT() and *_cond_read_acquire(), all API functions are implemented as static inline C functions, ensuring consistent type promotion and/or truncation without requiring explicit casts to be applied to parameters or return values. Since we typedef atomic_long_t to either atomic_t or atomic64_t, we know these types are equivalent, and don't require explicit casts between them. However, as the try_cmpxchg*() functions take a pointer for the 'old' parameter, which may be an int or s64, an explicit cast is generated for this. There should be no functional change as a result of this patch (i.e. existing code should not be affected). However, this introduces a number of functions into the atomic_long_* API, bringing it into line with the atomic_* and atomic64_* APIs. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Will Deacon <will.deacon@arm.com> Cc: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com Cc: linuxdrivers@attotech.com Cc: dvyukov@google.com Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: aryabinin@virtuozzo.com Cc: glider@google.com Link: http://lkml.kernel.org/r/20180904104830.2975-4-mark.rutland@arm.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions