__insn_barrier(3) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
__INSN_BARRIER(3)       NetBSD Library Functions Manual      __INSN_BARRIER(3)

__insn_barrier -- compiler reorder barrier
#include <sys/cdefs.h> void __insn_barrier();
The __insn_barrier() macro prevents GCC from moving code across the bar- rier. In other words, the compiler is not allowed to reorder read and write commands below the barrier with the code preceding the barrier. Like with the volatile type qualifier, __insn_barrier() may be necessary in some corner cases to prevent the compiler from misoptimizing.
gcc(1), cdefs(3), membar_ops(3) Paul E. McKenney, Memory Barriers: a Hardware View for Software Hackers, http://www.rdrop.com/users/paulmck/scalability/paper/whymb.2010.06.07c.pdf, June 7, 2010.
The __insn_barrier() macro first appeared in NetBSD 2.0. NetBSD 9.99 January 2, 2011 NetBSD 9.99
Powered by man-cgi (2021-03-02). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.