Merge tag 'sunxi-dt-for-3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[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
445c8951 26typedef struct arch_spinlock {
84eb950d 27 union {
229855d6 28 __ticketpair_t head_tail;
84eb950d
JF
29 struct __raw_tickets {
30 __ticket_t head, tail;
31 } tickets;
32 };
445c8951 33} arch_spinlock_t;
fb1c8f93 34
229855d6 35#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
fb1c8f93 36
bd01ec1a
WL
37#ifdef CONFIG_QUEUE_RWLOCK
38#include <asm-generic/qrwlock_types.h>
39#else
a750036f 40#include <asm/rwlock.h>
bd01ec1a 41#endif
fb1c8f93 42
1965aae3 43#endif /* _ASM_X86_SPINLOCK_TYPES_H */
This page took 0.794073 seconds and 5 git commands to generate.