Commit | Line | Data |
---|---|---|
1965aae3 PA |
1 | #ifndef _ASM_X86_SPINLOCK_TYPES_H |
2 | #define _ASM_X86_SPINLOCK_TYPES_H | |
fb1c8f93 IM |
3 | |
4 | #ifndef __LINUX_SPINLOCK_TYPES_H | |
5 | # error "please don't include this file directly" | |
6 | #endif | |
7 | ||
84eb950d JF |
8 | #include <linux/types.h> |
9 | ||
10 | #if (CONFIG_NR_CPUS < 256) | |
11 | typedef u8 __ticket_t; | |
229855d6 | 12 | typedef u16 __ticketpair_t; |
84eb950d JF |
13 | #else |
14 | typedef u16 __ticket_t; | |
229855d6 | 15 | typedef u32 __ticketpair_t; |
84eb950d JF |
16 | #endif |
17 | ||
18 | #define TICKET_SHIFT (sizeof(__ticket_t) * 8) | |
84eb950d | 19 | |
445c8951 | 20 | typedef struct arch_spinlock { |
84eb950d | 21 | union { |
229855d6 | 22 | __ticketpair_t head_tail; |
84eb950d JF |
23 | struct __raw_tickets { |
24 | __ticket_t head, tail; | |
25 | } tickets; | |
26 | }; | |
445c8951 | 27 | } arch_spinlock_t; |
fb1c8f93 | 28 | |
229855d6 | 29 | #define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } } |
fb1c8f93 | 30 | |
a750036f | 31 | #include <asm/rwlock.h> |
fb1c8f93 | 32 | |
1965aae3 | 33 | #endif /* _ASM_X86_SPINLOCK_TYPES_H */ |