1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

powerpc/atomic: Loosen the memory barrier on atomic_load_acq_*()

'sync' is pretty heavy-handed, and is unnecessary for this use case.  It's a
full barrier, which is applicable for all storage types.  However,
atomic_load_acq_*() is only expected to operate on physical memory, not
device memory, so lwsync is sufficient (lwsync provides access ordering on
memory that is marked as Coherency Required and is not Write Through nor
Cache Inhibited).  On 32-bit systems, this is a nop, since powerpc_lwsync()
is defined to use sync, as a workaround for a silicon bug in the Freescale
e500 core.
This commit is contained in:
Justin Hibbits 2018-11-07 01:42:00 +00:00
parent f8a222010f
commit 6a0fd1a51b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340209

View File

@ -510,7 +510,7 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \
u_##TYPE v; \
\
v = *p; \
mb(); \
powerpc_lwsync(); \
return (v); \
} \
\