]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/include/asm/spinlock_types.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / spinlock_types.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1965aae3
PA
2#ifndef _ASM_X86_SPINLOCK_TYPES_H
3#define _ASM_X86_SPINLOCK_TYPES_H
fb1c8f93 4
84eb950d
JF
5#include <linux/types.h>
6
4a1ed4ca
JF
7#ifdef CONFIG_PARAVIRT_SPINLOCKS
8#define __TICKET_LOCK_INC 2
96f853ea 9#define TICKET_SLOWPATH_FLAG ((__ticket_t)1)
4a1ed4ca
JF
10#else
11#define __TICKET_LOCK_INC 1
96f853ea 12#define TICKET_SLOWPATH_FLAG ((__ticket_t)0)
4a1ed4ca
JF
13#endif
14
15#if (CONFIG_NR_CPUS < (256 / __TICKET_LOCK_INC))
84eb950d 16typedef u8 __ticket_t;
229855d6 17typedef u16 __ticketpair_t;
84eb950d
JF
18#else
19typedef u16 __ticket_t;
229855d6 20typedef u32 __ticketpair_t;
84eb950d
JF
21#endif
22
4a1ed4ca
JF
23#define TICKET_LOCK_INC ((__ticket_t)__TICKET_LOCK_INC)
24
84eb950d 25#define TICKET_SHIFT (sizeof(__ticket_t) * 8)
84eb950d 26
d73a3397 27#include <asm-generic/qspinlock_types.h>
fb1c8f93 28
bd01ec1a 29#include <asm-generic/qrwlock_types.h>
fb1c8f93 30
1965aae3 31#endif /* _ASM_X86_SPINLOCK_TYPES_H */