LinuxKPI: Add smp_store_release and smp_load_acquire functions

Sponsored by:	Serenity Cyber Security, LLC
MFC after:	1 week
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D45611
This commit is contained in:
Vladimir Kondratyev 2024-06-26 23:44:37 +03:00
parent 460908ea55
commit 597ffdc1d3

View File

@ -58,4 +58,7 @@
#define smp_mb__before_atomic() barrier()
#define smp_mb__after_atomic() barrier()
#define smp_store_release(p, v) do { smp_mb(); WRITE_ONCE(*p, v); } while (0)
#define smp_load_acquire(p) ({ typeof(*p) _v = READ_ONCE(*p); smp_mb(); _v; })
#endif /* _LINUXKPI_ASM_BARRIER_H_ */