Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[deliverable/linux.git] / arch / x86 / include / asm / spinlock_types.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_SPINLOCK_TYPES_H
2#define _ASM_X86_SPINLOCK_TYPES_H
fb1c8f93 3
84eb950d
JF
4#include <linux/types.h>
5
4a1ed4ca
JF
6#ifdef CONFIG_PARAVIRT_SPINLOCKS
7#define __TICKET_LOCK_INC 2
96f853ea 8#define TICKET_SLOWPATH_FLAG ((__ticket_t)1)
4a1ed4ca
JF
9#else
10#define __TICKET_LOCK_INC 1
96f853ea 11#define TICKET_SLOWPATH_FLAG ((__ticket_t)0)
4a1ed4ca
JF
12#endif
13
14#if (CONFIG_NR_CPUS < (256 / __TICKET_LOCK_INC))
84eb950d 15typedef u8 __ticket_t;
229855d6 16typedef u16 __ticketpair_t;
84eb950d
JF
17#else
18typedef u16 __ticket_t;
229855d6 19typedef u32 __ticketpair_t;
84eb950d
JF
20#endif
21
4a1ed4ca
JF
22#define TICKET_LOCK_INC ((__ticket_t)__TICKET_LOCK_INC)
23
84eb950d 24#define TICKET_SHIFT (sizeof(__ticket_t) * 8)
84eb950d 25
62c7a1e9 26#ifdef CONFIG_QUEUED_SPINLOCKS
d73a3397
WL
27#include <asm-generic/qspinlock_types.h>
28#else
445c8951 29typedef struct arch_spinlock {
84eb950d 30 union {
229855d6 31 __ticketpair_t head_tail;
84eb950d
JF
32 struct __raw_tickets {
33 __ticket_t head, tail;
34 } tickets;
35 };
445c8951 36} arch_spinlock_t;
fb1c8f93 37
229855d6 38#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
62c7a1e9 39#endif /* CONFIG_QUEUED_SPINLOCKS */
fb1c8f93 40
bd01ec1a 41#include <asm-generic/qrwlock_types.h>
fb1c8f93 42
1965aae3 43#endif /* _ASM_X86_SPINLOCK_TYPES_H */
This page took 0.743518 seconds and 5 git commands to generate.