1 #ifndef _ASM_X86_SPINLOCK_TYPES_H 2 #define _ASM_X86_SPINLOCK_TYPES_H 3 4 #include <linux/types.h> 5 6 #if (CONFIG_NR_CPUS < 256) 7 typedef u8 __ticket_t; 8 typedef u16 __ticketpair_t; 9 #else 10 typedef u16 __ticket_t; 11 typedef u32 __ticketpair_t; 12 #endif 13 14 #define TICKET_SHIFT (sizeof(__ticket_t) * 8) 15 16 typedef struct arch_spinlock { 17 union { 18 __ticketpair_t head_tail; 19 struct __raw_tickets { 20 __ticket_t head, tail; 21 } tickets; 22 }; 23 } arch_spinlock_t; 24 25 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } 26 27 #include <asm/rwlock.h> 28 29 #endif /* _ASM_X86_SPINLOCK_TYPES_H */ 30