freebsd-skq/sys/arm64/include
Conrad Meyer ca0ec73c11 Expand generic subword atomic primitives
The goal of this change is to make the atomic_load_acq_{8,16},
atomic_testandset{,_acq}_long, and atomic_testandclear_long primitives
available in MI-namespace.

The second goal is to get this draft out of my local tree, as anything that
requires a full tinderbox is a big burden out of tree.  MD specifics can be
refined individually afterwards.

The generic implementations may not be ideal for your architecture; feel
free to implement better versions.  If no subword_atomic definitions are
needed, the include can be removed from your arch's machine/atomic.h.
Generic definitions are guarded by defined macros of the same name.  To
avoid picking up conflicting generic definitions, some macro defines are
added to various MD machine/atomic.h to register an existing implementation.

Include _atomic_subword.h in arm and arm64 machine/atomic.h.

For some odd reason, KCSAN only generates some versions of primitives.
Generate the _acq variants of atomic_load.*_8, atomic_load.*_16, and
atomic_testandset.*_long.  There are other questionably disabled primitives,
but I didn't run into them, so I left them alone.  KCSAN is only built for
amd64 in tinderbox for now.

Add atomic_subword implementations of atomic_load_acq_{8,16} implemented
using masking and atomic_load_acq_32.

Add generic atomic_subword implementations of atomic_testandset_long(),
atomic_testandclear_long(), and atomic_testandset_acq_long(), using
atomic_fcmpset_long() and atomic_fcmpset_acq_long().

On x86, add atomic_testandset_acq_long as an alias for
atomic_testandset_long.

Reviewed by:	kevans, rlibby (previous versions both)
Differential Revision:	https://reviews.freebsd.org/D22963
2020-03-25 23:12:43 +00:00
..
_align.h
_bus.h Regularize my copyright notice 2019-12-04 16:56:11 +00:00
_inttypes.h
_limits.h
_stdint.h
_types.h Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
acpica_machdep.h
armreg.h Add more are64 special register fields 2020-03-06 16:00:35 +00:00
asm.h Stop speculation past an eret instruction 2019-12-19 08:52:16 +00:00
atomic.h Expand generic subword atomic primitives 2020-03-25 23:12:43 +00:00
bus_dma_impl.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
bus_dma.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
bus.h Port the NetBSD KCSAN runtime to FreeBSD. 2019-11-21 11:22:08 +00:00
clock.h
counter.h Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
cpu.h Move the arm64 cache identification to identcpu.c 2020-03-03 15:25:01 +00:00
cpufunc.h Fix the spelling of aliasing. 2020-03-03 15:31:40 +00:00
csan.h Add kcsan_md_unsupported from NetBSD. 2019-11-21 13:22:23 +00:00
db_machdep.h
debug_monitor.h Move the struct debug_monitor_state out of _KERNEL. 2019-11-03 22:17:49 +00:00
disassem.h
dump.h
efi.h Catch exceptions during EFI RT calls on amd64. 2018-09-02 21:37:05 +00:00
elf.h gcore: Add aarch64 32-bit core support 2019-10-11 14:15:50 +00:00
endian.h Add parentheses missed in r320388 2017-06-27 16:30:01 +00:00
exec.h
float.h
floatingpoint.h
fpu.h Add machine/fpu.h on arm64 for compatibility with amd64. 2017-10-10 13:02:58 +00:00
frame.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
hypervisor.h Update the hypervisor registers 2020-03-06 14:46:50 +00:00
ieeefp.h
ifunc.h Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
in_cksum.h
intr.h Create macros for the ACPI interrupt cross references. This is considered a 2018-03-07 13:16:03 +00:00
iodev.h
kdb.h
machdep.h Mark the arm64 machdep.h as kernel only 2020-03-05 10:52:16 +00:00
md_var.h
memdev.h
metadata.h loader.efi: Make framebuffer commands available for arm64 2017-10-25 18:55:04 +00:00
minidump.h
ofw_machdep.h
param.h Define MAXCPU consistently between the kernel and KLDs. 2020-02-05 19:08:21 +00:00
pcb.h Add support for setting hardware breakpoints from ptrace on arm64. 2019-11-03 15:42:08 +00:00
pci_cfgreg.h
pcpu_aux.h Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
pcpu.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
pmap.h Generalise the arm64 ASID allocator. 2020-02-26 11:50:24 +00:00
pmc_mdep.h
proc.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
psl.h
pte.h Split out the stage 1 pte bits and add the stage 2 bits 2020-02-24 16:45:31 +00:00
ptrace.h
reg.h Add support for setting hardware breakpoints from ptrace on arm64. 2019-11-03 15:42:08 +00:00
reloc.h
resource.h
runq.h
setjmp.h
sf_buf.h
sigframe.h Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling 2019-01-29 20:10:27 +00:00
signal.h
smp.h
stack.h
stdarg.h Introduce an architecture-agnostic <sys/_stdarg.h> to reduce 2017-12-25 20:54:00 +00:00
sysarch.h
trap.h
ucontext.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
undefined.h Allow the userspace ID register fields to be read from the kernel 2019-10-30 13:45:40 +00:00
vdso.h Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32. 2017-11-24 13:50:53 +00:00
vfp.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
vm.h
vmparam.h Eliminate an unused declaration. The variable in question is only defined 2019-10-07 04:22:03 +00:00