opnsense-src/sys/powerpc
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
..
aim powerpc pmap: initialize kernel pmap radix trie 2023-09-19 21:09:37 -05:00
amigaone sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
booke Adjust comments referencing vm_mem_init() 2024-06-06 11:23:01 -03:00
conf sys: add conf/std.debug, generic debugging options 2024-10-09 10:44:35 +02:00
cpufreq sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
fpu 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
mambo sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mikrotik sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mpc85xx mpc85xx: Use device_set_desc() 2024-06-27 11:27:41 -04:00
ofw powerpc: Bump maximum number of FDT reserved mem entries 2024-04-01 22:09:57 -04:00
powermac powerpc: better handling of shutdown flags 2023-12-08 18:02:44 -04:00
powernv powerpc: better handling of shutdown flags 2023-12-08 18:02:44 -04:00
powerpc uio: Use switch statements when handling UIO_READ vs UIO_WRITE 2024-11-30 08:55:57 -05:00
ps3 ps3: add elfv2 support 2024-10-23 22:08:00 -04:00
pseries powerpc: better handling of shutdown flags 2023-12-08 18:02:44 -04:00
psim sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00