170af2f8aSWaiman Long #ifndef __ASM_GENERIC_QRWLOCK_TYPES_H
270af2f8aSWaiman Long #define __ASM_GENERIC_QRWLOCK_TYPES_H
370af2f8aSWaiman Long 
470af2f8aSWaiman Long #include <linux/types.h>
570af2f8aSWaiman Long #include <asm/spinlock_types.h>
670af2f8aSWaiman Long 
770af2f8aSWaiman Long /*
870af2f8aSWaiman Long  * The queue read/write lock data structure
970af2f8aSWaiman Long  */
1070af2f8aSWaiman Long 
1170af2f8aSWaiman Long typedef struct qrwlock {
12e0d02285SWill Deacon 	union {
1370af2f8aSWaiman Long 		atomic_t cnts;
14e0d02285SWill Deacon 		struct {
15e0d02285SWill Deacon #ifdef __LITTLE_ENDIAN
16e0d02285SWill Deacon 			u8 wmode;	/* Writer mode   */
17e0d02285SWill Deacon 			u8 rcnts[3];	/* Reader counts */
18e0d02285SWill Deacon #else
19e0d02285SWill Deacon 			u8 rcnts[3];	/* Reader counts */
20e0d02285SWill Deacon 			u8 wmode;	/* Writer mode   */
21e0d02285SWill Deacon #endif
22e0d02285SWill Deacon 		};
23e0d02285SWill Deacon 	};
246e1e5196SDavidlohr Bueso 	arch_spinlock_t		wait_lock;
2570af2f8aSWaiman Long } arch_rwlock_t;
2670af2f8aSWaiman Long 
2770af2f8aSWaiman Long #define	__ARCH_RW_LOCK_UNLOCKED {		\
28e0d02285SWill Deacon 	{ .cnts = ATOMIC_INIT(0), },		\
296e1e5196SDavidlohr Bueso 	.wait_lock = __ARCH_SPIN_LOCK_UNLOCKED,	\
3070af2f8aSWaiman Long }
3170af2f8aSWaiman Long 
3270af2f8aSWaiman Long #endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */
33