From owner-svn-src-head@freebsd.org Mon Apr 10 21:44:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BF38D3866D; Mon, 10 Apr 2017 21:44:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F0429AF0; Mon, 10 Apr 2017 21:44:14 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3ALiEQd061568; Mon, 10 Apr 2017 21:44:14 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3ALiExG061567; Mon, 10 Apr 2017 21:44:14 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704102144.v3ALiExG061567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 10 Apr 2017 21:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316691 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 21:44:15 -0000 Author: cognet Date: Mon Apr 10 21:44:13 2017 New Revision: 316691 URL: https://svnweb.freebsd.org/changeset/base/316691 Log: Provide some kind of __sync_bool_compare_and_swap_4(), as it is used by CK, and our gcc is too ancient to provide it. This should fix the build on mips. Modified: head/sys/mips/mips/stdatomic.c Modified: head/sys/mips/mips/stdatomic.c ============================================================================== --- head/sys/mips/mips/stdatomic.c Mon Apr 10 21:26:37 2017 (r316690) +++ head/sys/mips/mips/stdatomic.c Mon Apr 10 21:44:13 2017 (r316691) @@ -287,8 +287,8 @@ EMIT_BITWISE_FETCH_AND_OP_N(2, uint16_t, * 32-bit routines. */ -uint32_t -__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected, +static __inline uint32_t +do_compare_and_swap_4(uint32_t *mem, uint32_t expected, uint32_t desired) { uint32_t old, temp; @@ -307,6 +307,23 @@ __sync_val_compare_and_swap_4(uint32_t * return (old); } +uint32_t +__sync_val_compare_and_swap_4(uint32_t *mem, uint32_t expected, + uint32_t desired) +{ + + return (do_compare_and_swap_4(mem, expected, desired)); +} + +bool +__sync_bool_compare_and_swap_4(uint32_t *mem, uint32_t expected, + uint32_t desired) +{ + + return (do_compare_and_swap_4(mem, expected, desired) == + desired); +} + #define EMIT_FETCH_AND_OP_4(name, op) \ uint32_t \ __sync_##name##_4(uint32_t *mem, uint32_t val) \