opnsense-src/sys/arm/include
Olivier Certner 1fc5db8e9f
atomics: Constify loads
In order to match reality, allow using these functions with pointers on
const objects, and bring us closer to C11.

Remove the '+' modifier in the atomic_load_acq_64_i586()'s inline asm
statement's constraint for '*p' (the value to load).  CMPXCHG8B always
writes back some value, even when the value exchange does not happen in
which case what was read is written back.  atomic_load_acq_64_i586()
further takes care of the operation atomically writing back the same
value that was read in any case.  All in all, this makes the inline
asm's write back undetectable by any other code, whether executing on
other CPUs or code on the same CPU before and after the call to
atomic_load_acq_64_i586(), except for the fact that CMPXCHG8B will
trigger a #GP(0) if the memory address is part of a read-only mapping.
This unfortunate property is however out of scope of the C abstract
machine, and in particular independent of whether the 'uint64_t' pointed
to is declared 'const' or not.

Approved by:    markj (mentor)
MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D46887

(cherry picked from commit 5e9a82e898d55816c366cfa3ffbca84f02569fe5)
2025-01-16 19:06:53 +01:00
..
_align.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
_bus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
_inttypes.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
_limits.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
_stdint.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
_types.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
acle-compat.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
armreg.h arm: Remove duplicate definitions in armreg.h 2024-05-08 09:06:16 -04:00
asm.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
asmacros.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
atags.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
atomic.h atomics: Constify loads 2025-01-16 19:06:53 +01:00
blockio.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bus.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bus_dma.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
clock.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
counter.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
cpu.h arm: Move contents of cpu-v6.h into cpu.h 2023-07-24 17:58:14 +01:00
cpufunc.h arm: Update declarations for arm_dcache_align{,_mask} 2023-11-16 10:07:27 -05:00
cpuinfo.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
db_machdep.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
debug_monitor.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
disassem.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
dump.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
efi.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
elf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
endian.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
exec.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fdt.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
fiq.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
float.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
floatingpoint.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
fpu.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
frame.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
gdb_machdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieeefp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
in_cksum.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
intr.h intrng: Extract arm/arm64 IPI->PIC glue code 2024-09-07 00:58:28 +01:00
kdb.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
limits.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
machdep.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
md_var.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
memdev.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
metadata.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
minidump.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
ofw_machdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
param.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
pcb.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pcpu.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
pcpu_aux.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pl310.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
platform.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
platformvar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pmap.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pmap_var.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pmc_mdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
proc.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
procctl.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
profile.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
psl.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
pte.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ptrace.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
reg.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
reloc.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
resource.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
runq.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sc_machdep.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
setjmp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
sf_buf.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sigframe.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
signal.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
smp.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
stack.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
stdarg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sysarch.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
sysreg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
tls.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
trap.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
ucontext.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
undefined.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vdso.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vfp.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
vm.h arm: switch the BUSDMA buffers to normal uncached memory 2024-12-08 11:36:37 +01:00
vmparam.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00