opnsense-src/sys/amd64
Olivier Certner 5e9a82e898
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
2024-12-16 15:42:26 +01:00
..
acpica Replace calls to bus_generic_attach with bus_attach_children 2024-12-06 17:26:16 -05:00
amd64 x86: Add routines for querying XSAVE feature information 2024-12-15 16:39:36 +01:00
conf Revert "nvme: Separate total failures from I/O failures" 2024-08-15 21:29:53 -06:00
ia32 freebsd32: struct siginfo32 -> struct __siginfo32 2024-03-19 23:13:26 +00:00
include atomics: Constify loads 2024-12-16 15:42:26 +01:00
linux sysent: regen for typo fix 2024-10-22 19:21:26 +01:00
linux32 sysent: regen for typo fix 2024-10-22 19:21:26 +01:00
pci Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
sgx Remove stray whitespaces from sys/amd64/ 2024-09-21 07:05:46 -06:00
vmm vmcb.h: fix typo in the comment, try two 2024-12-10 10:48:55 +02:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00