opnsense-src/sys/arm64
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
..
acpica pci_cfgreg: Add shims to preserve ABI of pci_cfgreg(read|write) 2024-01-18 15:19:11 -08:00
arm64 uio: Use switch statements when handling UIO_READ vs UIO_WRITE 2024-11-30 08:55:57 -05:00
broadcom if_genet: don't load DMA mapping when tx_queue is full 2024-07-04 10:31:54 -03:00
cavium cavium/thunder: Use device_set_desc() 2024-06-27 11:27:41 -04:00
conf Add an Armv8 rndr random number provider 2024-10-21 15:03:26 +00:00
coresight sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00
freescale/imx sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
include atomics: Constify loads 2025-01-16 19:06:53 +01:00
intel sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
iommu iommu: eliminate iommu_free_ctx() 2024-11-09 21:31:28 +02:00
linux linux64: Fix the build on arm64 with bti checking 2024-09-02 08:48:10 +00:00
nvidia/tegra210 sys: Use the new arm_smccc_invoke macros 2024-10-21 15:03:27 +00:00
qoriq arm64: Remove a double word in a source code comment 2024-04-23 07:23:53 +02:00
qualcomm sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
rockchip arm64: rockchip: Remove a stray semicolon 2024-10-31 12:40:17 +08:00