linux/include/asm-generic/qspinlock_types.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Queued spinlock
 *
 * (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
 *
 * Authors: Waiman Long <[email protected]>
 */
#ifndef __ASM_GENERIC_QSPINLOCK_TYPES_H
#define __ASM_GENERIC_QSPINLOCK_TYPES_H

#include <linux/types.h>

arch_spinlock_t;

/*
 * Initializier
 */
#define __ARCH_SPIN_LOCK_UNLOCKED

/*
 * Bitfields in the atomic value:
 *
 * When NR_CPUS < 16K
 *  0- 7: locked byte
 *     8: pending
 *  9-15: not used
 * 16-17: tail index
 * 18-31: tail cpu (+1)
 *
 * When NR_CPUS >= 16K
 *  0- 7: locked byte
 *     8: pending
 *  9-10: tail index
 * 11-31: tail cpu (+1)
 */
#define _Q_SET_MASK(type)
#define _Q_LOCKED_OFFSET
#define _Q_LOCKED_BITS
#define _Q_LOCKED_MASK

#define _Q_PENDING_OFFSET
#if CONFIG_NR_CPUS < (1U << 14)
#define _Q_PENDING_BITS
#else
#define _Q_PENDING_BITS
#endif
#define _Q_PENDING_MASK

#define _Q_TAIL_IDX_OFFSET
#define _Q_TAIL_IDX_BITS
#define _Q_TAIL_IDX_MASK

#define _Q_TAIL_CPU_OFFSET
#define _Q_TAIL_CPU_BITS
#define _Q_TAIL_CPU_MASK

#define _Q_TAIL_OFFSET
#define _Q_TAIL_MASK

#define _Q_LOCKED_VAL
#define _Q_PENDING_VAL

#endif /* __ASM_GENERIC_QSPINLOCK_TYPES_H */