1 #ifndef _ASM_X86_SPINLOCK_TYPES_H
2 #define _ASM_X86_SPINLOCK_TYPES_H
4 #include <linux/types.h>
6 #ifdef CONFIG_PARAVIRT_SPINLOCKS
7 #define __TICKET_LOCK_INC 2
8 #define TICKET_SLOWPATH_FLAG ((__ticket_t)1)
10 #define __TICKET_LOCK_INC 1
11 #define TICKET_SLOWPATH_FLAG ((__ticket_t)0)
14 #if (CONFIG_NR_CPUS < (256 / __TICKET_LOCK_INC))
15 typedef u8 __ticket_t;
16 typedef u16 __ticketpair_t;
18 typedef u16 __ticket_t;
19 typedef u32 __ticketpair_t;
22 #define TICKET_LOCK_INC ((__ticket_t)__TICKET_LOCK_INC)
24 #define TICKET_SHIFT (sizeof(__ticket_t) * 8)
26 #ifdef CONFIG_QUEUED_SPINLOCKS
27 #include <asm-generic/qspinlock_types.h>
29 typedef struct arch_spinlock {
31 __ticketpair_t head_tail;
32 struct __raw_tickets {
33 __ticket_t head, tail;
38 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
39 #endif /* CONFIG_QUEUED_SPINLOCKS */
41 #include <asm-generic/qrwlock_types.h>
43 #endif /* _ASM_X86_SPINLOCK_TYPES_H */