mips: implement MB and WMB
The MIPS architecture has weak memory ordering and therefore requires sutible memory barriers when doing lock free programming with multiple threads (just like ARM does). This commit implements those barriers for MIPS and MIPS64 using GCC bultins which is probably easiest way.
This commit is contained in:
parent
bba6676803
commit
67836c2ab4
|
@ -33,8 +33,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef COMMON_MIPS
|
||||
#define COMMON_MIPS
|
||||
|
||||
#define MB
|
||||
#define WMB
|
||||
#define MB __sync_synchronize()
|
||||
#define WMB __sync_synchronize()
|
||||
|
||||
#define INLINE inline
|
||||
|
||||
|
|
|
@ -71,8 +71,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef COMMON_MIPS64
|
||||
#define COMMON_MIPS64
|
||||
|
||||
#define MB
|
||||
#define WMB
|
||||
#define MB __sync_synchronize()
|
||||
#define WMB __sync_synchronize()
|
||||
|
||||
#define INLINE inline
|
||||
|
||||
|
|
Loading…
Reference in New Issue