From owner-svn-src-all@freebsd.org Mon Sep 21 22:18:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38C073FEB2F; Mon, 21 Sep 2020 22:18:10 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BwJjZ0mChz40xH; Mon, 21 Sep 2020 22:18:10 +0000 (UTC) (envelope-from scottph@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F19EB14FF4; Mon, 21 Sep 2020 22:18:09 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08LMI9YV052812; Mon, 21 Sep 2020 22:18:09 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08LMI9eG052810; Mon, 21 Sep 2020 22:18:09 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202009212218.08LMI9eG052810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Mon, 21 Sep 2020 22:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365974 - head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/sys/contrib/vchiq/interface/vchiq_arm X-SVN-Commit-Revision: 365974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 22:18:10 -0000 Author: scottph Date: Mon Sep 21 22:18:09 2020 New Revision: 365974 URL: https://svnweb.freebsd.org/changeset/base/365974 Log: vchi: rename bitset macros to avoid collision with bitset(9) An upcoming change to include bitset(9) macros from vm_page.h causes a macro name collision with vchi's custom bitset macros. This change was performed mechanically by: sed -i .orig s/BITSET/VCHI_BITSET/g $(grep -rl BITSET sys/contrib/vchiq) Reviewed by: andrew Approved by: scottl (implicit) MFC after: 1 week Sponsored by: Ampere Computing, Inc. Differential Revision: https://reviews.freebsd.org/D26177 Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Mon Sep 21 20:02:26 2020 (r365973) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c Mon Sep 21 22:18:09 2020 (r365974) @@ -619,7 +619,7 @@ static void process_free_queue(VCHIQ_STATE_T *state) { VCHIQ_SHARED_STATE_T *local = state->local; - BITSET_T service_found[BITSET_SIZE(VCHIQ_MAX_SERVICES)]; + VCHI_BITSET_T service_found[VCHI_BITSET_SIZE(VCHIQ_MAX_SERVICES)]; int slot_queue_available; /* Find slots which have been freed by the other side, and return them @@ -646,7 +646,7 @@ process_free_queue(VCHIQ_STATE_T *state) /* Initialise the bitmask for services which have used this ** slot */ - BITSET_ZERO(service_found); + VCHI_BITSET_ZERO(service_found); pos = 0; @@ -686,9 +686,9 @@ process_free_queue(VCHIQ_STATE_T *state) header->size); WARN(1, "invalid message use count\n"); } - if (!BITSET_IS_SET(service_found, port)) { + if (!VCHI_BITSET_IS_SET(service_found, port)) { /* Set the found bit for this service */ - BITSET_SET(service_found, port); + VCHI_BITSET_SET(service_found, port); spin_lock("a_spinlock); count = service_quota->slot_use_count; @@ -1276,7 +1276,7 @@ poll_services(VCHIQ_STATE_T *state) { int group, i; - for (group = 0; group < BITSET_SIZE(state->unused_service); group++) { + for (group = 0; group < VCHI_BITSET_SIZE(state->unused_service); group++) { uint32_t flags; flags = atomic_xchg(&state->poll_services[group], 0); for (i = 0; flags; i++) { Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Sep 21 20:02:26 2020 (r365973) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.h Mon Sep 21 22:18:09 2020 (r365974) @@ -141,17 +141,17 @@ vchiq_static_assert((unsigned int)VCHIQ_PORT_MAX < #define VCHIQ_BULK_ACTUAL_ABORTED -1 -typedef uint32_t BITSET_T; +typedef uint32_t VCHI_BITSET_T; -vchiq_static_assert((sizeof(BITSET_T) * 8) == 32); +vchiq_static_assert((sizeof(VCHI_BITSET_T) * 8) == 32); -#define BITSET_SIZE(b) ((b + 31) >> 5) -#define BITSET_WORD(b) (b >> 5) -#define BITSET_BIT(b) (1 << (b & 31)) -#define BITSET_ZERO(bs) memset(bs, 0, sizeof(bs)) -#define BITSET_IS_SET(bs, b) (bs[BITSET_WORD(b)] & BITSET_BIT(b)) -#define BITSET_SET(bs, b) (bs[BITSET_WORD(b)] |= BITSET_BIT(b)) -#define BITSET_CLR(bs, b) (bs[BITSET_WORD(b)] &= ~BITSET_BIT(b)) +#define VCHI_BITSET_SIZE(b) ((b + 31) >> 5) +#define VCHI_BITSET_WORD(b) (b >> 5) +#define VCHI_BITSET_BIT(b) (1 << (b & 31)) +#define VCHI_BITSET_ZERO(bs) memset(bs, 0, sizeof(bs)) +#define VCHI_BITSET_IS_SET(bs, b) (bs[VCHI_BITSET_WORD(b)] & VCHI_BITSET_BIT(b)) +#define VCHI_BITSET_SET(bs, b) (bs[VCHI_BITSET_WORD(b)] |= VCHI_BITSET_BIT(b)) +#define VCHI_BITSET_CLR(bs, b) (bs[VCHI_BITSET_WORD(b)] &= ~VCHI_BITSET_BIT(b)) #if VCHIQ_ENABLE_STATS #define VCHIQ_STATS_INC(state, stat) (state->stats. stat++) @@ -478,7 +478,7 @@ struct vchiq_state_struct { unsigned short data_quota; /* An array of bit sets indicating which services must be polled. */ - atomic_t poll_services[BITSET_SIZE(VCHIQ_MAX_SERVICES)]; + atomic_t poll_services[VCHI_BITSET_SIZE(VCHIQ_MAX_SERVICES)]; /* The number of the first unused service */ int unused_service;