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
9 #define __TICKET_LOCK_INC 1
12 #if (CONFIG_NR_CPUS < (256 / __TICKET_LOCK_INC))
13 typedef u8 __ticket_t;
14 typedef u16 __ticketpair_t;
16 typedef u16 __ticket_t;
17 typedef u32 __ticketpair_t;
20 #define TICKET_LOCK_INC ((__ticket_t)__TICKET_LOCK_INC)
22 #define TICKET_SHIFT (sizeof(__ticket_t) * 8)
24 typedef struct arch_spinlock {
26 __ticketpair_t head_tail;
27 struct __raw_tickets {
28 __ticket_t head, tail;
33 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
35 #include <asm/rwlock.h>
37 #endif /* _ASM_X86_SPINLOCK_TYPES_H */