Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68133 - trunk/boost/interprocess/detail
From: admin_at_[hidden]
Date: 2011-01-13 18:41:12


Author: wash
Date: 2011-01-13 18:41:10 EST (Thu, 13 Jan 2011)
New Revision: 68133
URL: http://svn.boost.org/trac/boost/changeset/68133

Log:
Some of the inline asm here had incorrect constraints.

Text files modified:
   trunk/boost/interprocess/detail/atomic.hpp | 12 +++++++++++-
   1 files changed, 11 insertions(+), 1 deletions(-)

Modified: trunk/boost/interprocess/detail/atomic.hpp
==============================================================================
--- trunk/boost/interprocess/detail/atomic.hpp (original)
+++ trunk/boost/interprocess/detail/atomic.hpp 2011-01-13 18:41:10 EST (Thu, 13 Jan 2011)
@@ -2,6 +2,7 @@
 //
 // (C) Copyright Ion Gaztanaga 2006-2009
 // (C) Copyright Markus Schoepflin 2007
+// (C) Copyright Bryce Lelbach 2010
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -108,12 +109,21 @@
    (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t cmp)
 {
    boost::uint32_t prev = cmp;
+ // This version by Mans Rullgard of Pathscale
+ __asm__ __volatile__ ( "lock\n\t"
+ "cmpxchg %2,%0"
+ : "+m"(*mem), "+a"(prev)
+ : "r"(with)
+ : "cc");
+
+ return prev;
+/*
    asm volatile( "lock\n\t"
                  "cmpxchg %3,%1"
                : "=a" (prev), "=m" (*(mem))
                : "0" (prev), "r" (with)
                : "memory", "cc");
- return prev;
+*/
 /*
    boost::uint32_t prev;
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk