1 #ifndef _ASM_X86_SPINLOCK_TYPES_H
2 #define _ASM_X86_SPINLOCK_TYPES_H
4 #ifndef __LINUX_SPINLOCK_TYPES_H
5 # error "please don't include this file directly"
8 #include <linux/types.h>
10 #if (CONFIG_NR_CPUS < 256)
11 typedef u8 __ticket_t;
12 typedef u16 __ticketpair_t;
14 typedef u16 __ticket_t;
15 typedef u32 __ticketpair_t;
18 #define TICKET_SHIFT (sizeof(__ticket_t) * 8)
19 #define TICKET_MASK ((__ticket_t)((1 << TICKET_SHIFT) - 1))
21 typedef struct arch_spinlock {
23 __ticketpair_t head_tail;
24 struct __raw_tickets {
25 __ticket_t head, tail;
30 #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
32 #include <asm/rwlock.h>
34 #endif /* _ASM_X86_SPINLOCK_TYPES_H */