Browse Source

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.
tags/v0.2.20^2
James Cowgill 8 years ago
parent
commit
67836c2ab4
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      common_mips.h
  2. +2
    -2
      common_mips64.h

+ 2
- 2
common_mips.h View File

@@ -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



+ 2
- 2
common_mips64.h View File

@@ -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…
Cancel
Save