blob: 47663fcb10ad7aad7e3bc87f31636a7a77342e36 [file] [log] [blame]
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07001#ifndef __ASM_SPINLOCK_TYPES_H
2#define __ASM_SPINLOCK_TYPES_H
3
4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly"
6#endif
7
Will Deacon546c2892012-07-06 15:43:41 +01008#define TICKET_SHIFT 16
9
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070010typedef struct {
Will Deacon546c2892012-07-06 15:43:41 +010011 union {
12 u32 slock;
13 struct __raw_tickets {
14#ifdef __ARMEB__
15 u16 next;
16 u16 owner;
17#else
18 u16 owner;
19 u16 next;
20#endif
21 } tickets;
22 };
Thomas Gleixner445c8952009-12-02 19:49:50 +010023} arch_spinlock_t;
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070024
Will Deacon546c2892012-07-06 15:43:41 +010025#define __ARCH_SPIN_LOCK_UNLOCKED { { 0 } }
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070026
27typedef struct {
Will Deacon9bb17be2013-07-02 14:54:33 +010028 u32 lock;
Thomas Gleixnerfb3a6bb2009-12-03 20:01:19 +010029} arch_rwlock_t;
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070030
Thomas Gleixnerfb3a6bb2009-12-03 20:01:19 +010031#define __ARCH_RW_LOCK_UNLOCKED { 0 }
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070032
33#endif