about summary refs log tree commit diff
path: root/arch/aarch64/atomic_arch.h
Commit message (Collapse)AuthorAgeFilesLines
* make aarch64 atomic_arch.h report that it defines pointer-sized ll/scRich Felker2016-02-231-0/+2
| | | | | | | | at present this is done only for consistency, since this file defines its own a_cas_p rather than using the new generic one from atomic.h added in commit 225f6a6b5b7173b6655e4f5d49b5b9fea70bf3bb. these definitions may however be useful if we ever need to add other pointer-sized atomic operations.
* better a_sc inline asm constraint on aarch64 and armSzabolcs Nagy2016-01-311-2/+2
| | | | | | | | | | "Q" input constraint was used for the written object, instead of "=Q" output constraint. this should not cause problems because "memory" is on the clobber list, but "=Q" better documents the intent and more consistent with the actual asm code. this changes the generated code, because different registers are used, but other than the register names nothing should change.
* fix aarch64 atomics to load/store 32bit onlySzabolcs Nagy2016-01-241-2/+2
| | | | | | a_ll/a_sc inline asm used 64bit register operands (%0) instead of 32bit ones (%w0), this at least broke a_and_64 (which always cleared the top 32bit, leaking memory in malloc).
* improve aarch64 atomicsRich Felker2016-01-231-16/+36
| | | | | | | | | | | | | | | | | aarch64 provides ll/sc variants with acquire/release memory order, freeing us from the need to have full barriers both before and after the ll/sc operation. previously they were not used because the a_cas can fail without performing a_sc, in which case half of the barrier would be omitted. instead, define a custom version of a_cas for aarch64 which uses a_barrier explicitly when aborting the cas operation. aside from cas, other operations built on top of ll/sc are not affected since they never abort but rather loop until they succeed. a split ll/sc version of the pointer-sized a_cas_p is also introduced using the same technique. patch by Szabolcs Nagy.
* overhaul aarch64 atomics for new atomics frameworkRich Felker2016-01-211-174/+25
|
* refactor internal atomic.hRich Felker2016-01-211-0/+202
rather than having each arch provide its own atomic.h, there is a new shared atomic.h in src/internal which pulls arch-specific definitions from arc/$(ARCH)/atomic_arch.h. the latter can be extremely minimal, defining only a_cas or new ll/sc type primitives which the shared atomic.h will use to construct everything else. this commit avoids making heavy changes to the individual archs' atomic implementations. definitions which are identical or near-identical to what the new shared atomic.h would produce have been removed, but otherwise the changes made are just hooking up the arch-specific files to the new infrastructure. major changes to take advantage of the new system will come in subsequent commits.