From patchwork Sun Jul 20 08:26:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Klausner X-Patchwork-Id: 4590581 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A7188C0514 for ; Sun, 20 Jul 2014 08:26:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BFA3C2011D for ; Sun, 20 Jul 2014 08:26:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B4ED72010F for ; Sun, 20 Jul 2014 08:26:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B66D6E2ED; Sun, 20 Jul 2014 01:26:49 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F7EC6E2E7 for ; Sun, 20 Jul 2014 01:26:46 -0700 (PDT) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep15-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140720082644.RAKJ19410.viefep15-int.chello.at@edge01.upcmail.net>; Sun, 20 Jul 2014 10:26:44 +0200 Received: from yt.nih.at ([213.47.1.69]) by edge01.upcmail.net with edge id UYSk1o0131VKkul01YSkQM; Sun, 20 Jul 2014 10:26:44 +0200 X-SourceIP: 213.47.1.69 Received: by yt.nih.at (Postfix, from userid 1000) id AD2892AC0B7; Sun, 20 Jul 2014 10:26:44 +0200 (CEST) From: Thomas Klausner To: dri-devel@lists.freedesktop.org Subject: [PATCH:drm 4/4] Fix libdrm's atomic_dec_and_test on Solaris. Date: Sun, 20 Jul 2014 10:26:34 +0200 Message-Id: <1405844794-27210-4-git-send-email-wiz@NetBSD.org> X-Mailer: git-send-email 1.9.4 In-Reply-To: <1405844794-27210-1-git-send-email-wiz@NetBSD.org> References: <1405844794-27210-1-git-send-email-wiz@NetBSD.org> Cc: Thomas Klausner X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP _nv means new value, not old value! Signed-off-by: Thomas Klausner --- xf86atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xf86atomic.h b/xf86atomic.h index d0f85fc..4e7691f 100644 --- a/xf86atomic.h +++ b/xf86atomic.h @@ -85,7 +85,7 @@ typedef struct { uint_t atomic; } atomic_t; # define atomic_read(x) (int) ((x)->atomic) # define atomic_set(x, val) ((x)->atomic = (uint_t)(val)) # define atomic_inc(x) (atomic_inc_uint (&(x)->atomic)) -# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 1) +# define atomic_dec_and_test(x) (atomic_dec_uint_nv(&(x)->atomic) == 0) # define atomic_add(x, v) (atomic_add_int(&(x)->atomic, (v))) # define atomic_dec(x, v) (atomic_add_int(&(x)->atomic, -(v))) # define atomic_cmpxchg(x, oldv, newv) atomic_cas_uint (&(x)->atomic, oldv, newv)