]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/asm-generic/qrwlock_types.h
locking/qrwlock, arm64: Move rwlock implementation over to qrwlocks
[mirror_ubuntu-bionic-kernel.git] / include / asm-generic / qrwlock_types.h
CommitLineData
70af2f8a
WL
1#ifndef __ASM_GENERIC_QRWLOCK_TYPES_H
2#define __ASM_GENERIC_QRWLOCK_TYPES_H
3
4#include <linux/types.h>
5#include <asm/spinlock_types.h>
6
7/*
8 * The queue read/write lock data structure
9 */
10
11typedef struct qrwlock {
e0d02285
WD
12 union {
13 atomic_t cnts;
14 struct {
15#ifdef __LITTLE_ENDIAN
16 u8 wmode; /* Writer mode */
17 u8 rcnts[3]; /* Reader counts */
18#else
19 u8 rcnts[3]; /* Reader counts */
20 u8 wmode; /* Writer mode */
21#endif
22 };
23 };
6e1e5196 24 arch_spinlock_t wait_lock;
70af2f8a
WL
25} arch_rwlock_t;
26
27#define __ARCH_RW_LOCK_UNLOCKED { \
e0d02285 28 { .cnts = ATOMIC_INIT(0), }, \
6e1e5196 29 .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
70af2f8a
WL
30}
31
32#endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */