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
This commit is contained in:
D Scott Phillips 2020-09-21 22:18:09 +00:00
parent 2259a03020
commit 191dad8b0a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=365974
2 changed files with 15 additions and 15 deletions

View File

@ -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(&quota_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++) {

View File

@ -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;