1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00
freebsd/sys/powerpc/include
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
..
_align.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
_bus.h _bus.h: Use standard licnese text 2023-11-13 12:25:30 -07:00
_inttypes.h
_limits.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
_stdint.h
_types.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
altivec.h powerpc: Implement fpu_kern_enter/fpu_kern_leave 2023-09-17 13:21:04 -04:00
asm.h
atomic.h atomics: Constify loads 2024-12-16 15:42:26 +01:00
bat.h
bus_dma.h
bus.h powerpc: Fix bus_space_unmap 2024-01-23 09:37:53 -08:00
clock.h
counter.h sys: Avoid relying on pollution from refcount.h 2024-11-05 18:22:20 +00:00
cpu.h powerpc: Add nominal support for POWER10 and POWER11 2024-10-11 17:17:43 -04:00
cpufunc.h
db_machdep.h
dbdma.h
dump.h
efi.h
elf.h
endian.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
exec.h
float.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
floatingpoint.h
fpu.h powerpc: Implement fpu_kern_enter/fpu_kern_leave 2023-09-17 13:21:04 -04:00
frame.h
gdb_machdep.h
hid.h
ieee.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ieeefp.h
ifunc.h
in_cksum.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
intr_machdep.h
kdb.h
limits.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
machdep.h
md_var.h
memdev.h
metadata.h
minidump.h
mmuvar.h pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
ofw_machdep.h ofw: convert boolean_t to bool 2024-06-26 11:14:36 -03:00
openpicreg.h
openpicvar.h
param.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pcb.h powerpc: Implement fpu_kern_enter/fpu_kern_leave 2023-09-17 13:21:04 -04:00
pcpu_aux.h
pcpu.h
pio.h
platform.h
platformvar.h
pmap.h pmap: Convert boolean_t to bool. 2024-01-31 14:48:26 -08:00
pmc_mdep.h
proc.h
procctl.h
profile.h
psl.h
pte.h
ptrace.h sys: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
reg.h
reloc.h
resource.h powerpc: Add RF_LITTLEENDIAN resource flag 2024-01-23 09:38:36 -08:00
rtas.h sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
runq.h
sc_machdep.h
sdt_machdep.h sdt: Implement SDT probes using hot-patching 2024-06-19 16:57:41 -04:00
setjmp.h
sigframe.h
signal.h
slb.h
smp.h
spr.h powerpc: Add nominal support for POWER10 and POWER11 2024-10-11 17:17:43 -04:00
sr.h
stack.h
stdarg.h
sysarch.h
tlb.h
tls.h
trap.h
ucontext.h
vdso.h
vm.h
vmparam.h vm: Simplify startup page dumping conditional 2024-05-25 19:24:55 +02:00