]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/asm-generic/qrwlock_types.h
macvlan: do not assume mac_header is set in macvlan_broadcast()
[mirror_ubuntu-bionic-kernel.git] / include / asm-generic / qrwlock_types.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
70af2f8a
WL
2#ifndef __ASM_GENERIC_QRWLOCK_TYPES_H
3#define __ASM_GENERIC_QRWLOCK_TYPES_H
4
5#include <linux/types.h>
6#include <asm/spinlock_types.h>
7
8/*
9 * The queue read/write lock data structure
10 */
11
12typedef struct qrwlock {
e0d02285
WD
13 union {
14 atomic_t cnts;
15 struct {
16#ifdef __LITTLE_ENDIAN
d1331661
WD
17 u8 wlocked; /* Locked for write? */
18 u8 __lstate[3];
e0d02285 19#else
d1331661
WD
20 u8 __lstate[3];
21 u8 wlocked; /* Locked for write? */
e0d02285
WD
22#endif
23 };
24 };
6e1e5196 25 arch_spinlock_t wait_lock;
70af2f8a
WL
26} arch_rwlock_t;
27
28#define __ARCH_RW_LOCK_UNLOCKED { \
e0d02285 29 { .cnts = ATOMIC_INIT(0), }, \
6e1e5196 30 .wait_lock = __ARCH_SPIN_LOCK_UNLOCKED, \
70af2f8a
WL
31}
32
33#endif /* __ASM_GENERIC_QRWLOCK_TYPES_H */