X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_rwlock.h;h=8568404140ab62fc1260f48057c2f1a237edecef;hb=916e4f4f4e45a1d3cdd473cf9ef71c7212b83d40;hp=a0b5e01d9a559032d140bb6dd91d6a12186d5cdf;hpb=af75078fece3615088e561357c1e97603e43a5fe;p=dpdk.git diff --git a/lib/librte_eal/common/include/rte_rwlock.h b/lib/librte_eal/common/include/rte_rwlock.h index a0b5e01d9a..8568404140 100644 --- a/lib/librte_eal/common/include/rte_rwlock.h +++ b/lib/librte_eal/common/include/rte_rwlock.h @@ -30,7 +30,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * version: DPDK.L.1.2.3-3 */ #ifndef _RTE_RWLOCK_H_ @@ -114,14 +113,7 @@ rte_rwlock_read_lock(rte_rwlock_t *rwl) static inline void rte_rwlock_read_unlock(rte_rwlock_t *rwl) { - /* in debug mode, we should check that rwl->cnt is > 0 */ - - /* same than atomic32_dec */ - asm volatile(MPLOCKED - "decl %[cnt]" - : [cnt] "=m" (rwl->cnt) /* output (0) */ - : "m" (rwl->cnt) /* input (1) */ - ); /* no clobber-list */ + rte_atomic32_dec((rte_atomic32_t *)(intptr_t)&rwl->cnt); } /** @@ -157,14 +149,7 @@ rte_rwlock_write_lock(rte_rwlock_t *rwl) static inline void rte_rwlock_write_unlock(rte_rwlock_t *rwl) { - /* in debug mode, we should check that rwl->cnt is < 0 */ - - /* same than atomic32_inc */ - asm volatile(MPLOCKED - "incl %[cnt]" - : [cnt] "=m" (rwl->cnt) /* output (0) */ - : "m" (rwl->cnt) /* input (1) */ - ); /* no clobber-list */ + rte_atomic32_inc((rte_atomic32_t *)(intptr_t)&rwl->cnt); } #ifdef __cplusplus