sparc32: Use CAS for atomic support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | sparc32: Add support for specifying -mcpuarch/ arch/ | +29 | 1 reply | |
| 2/4 | sparc32: Add cmpxchg support using CASarch/ arch/ | +42 | 0 replies | |
| 3/4 | sparc32: Add atomic bitops support using CASarch/ arch/ arch/ | +125 | 0 replies | |
| 4/4 | sparc32: Add atomic support using CASarch/ arch/ arch/ | +100 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] sparc32: Use CAS for atomic support
With sparc limited to leon3 the next step was to address the atomic support which this patch set does.
Gaisler already had an implementation in their kernel patch stack, that co-existed with sparc v8 without CAS support.
As the sparc v8 without CAS is no longer supported this patch set takes a different approach. Using the current best practices the atomic support is implemented in three steps.
The cmpxchg is updated to use casa/swap.
The atomic bitops are implemented in their own file and uses a minimal of inline assembly.
The atomic operations are implemented based on the template found in asm-generic.
Some notes:
- The code uses __always_inlin almost everywhere, where inline could be enough. Not sure what is best here.
- The new (and replaced) files uses the SPDX tag: GPL-2.0
No sure if this is best practice today, I am happy to change the license.
- Build tested and booted using qemu.
The patches are on top of the sun4m and sun4d sunset patches.
Review feedback appreciated!
Sam
---
Sam Ravnborg (4):
sparc32: Add support for specifying -mcpu
sparc32: Add cmpxchg support using CAS
sparc32: Add atomic bitops support using CAS
sparc32: Add atomic support using CAS
arch/sparc/Kconfig | 24 +++++++++++ arch/sparc/Makefile | 13 +++--- arch/sparc/include/asm/atomic_32.h | 151 ++++++++++++++++++++++++++++++++++++++++++++----------------------- arch/sparc/include/asm/bitops/atomic_32.h | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/sparc/include/asm/bitops_32.h | 71 +------------------------------- arch/sparc/include/asm/cmpxchg_32.h | 72 ++++++++++++++++++-------------- arch/sparc/lib/Makefile | 2 +- arch/sparc/lib/atomic32.c | 202 ------------------------------------------------------------------------------------------ 8 files changed, 296 insertions(+), 363 deletions(-)