1#include "sync/rwlock_internal.h"
2#include <sync/lock_chk.h>
3#include <sync/mutex.h>
4#include <sync/qspinlock.h>
5#include <sync/raw_spinlock.h>
6#include <sync/rwlock.h>
7#include <sync/spinlock.h>
8#include <test/static_assert.h>
9
10/* verification of lock word sizes and bitfield not overlapping */
11static_assert_size(struct raw_spinlock, 1);
12#ifndef DEBUG_LOCK_CHK
13static_assert_size(struct qspinlock, 4);
14static_assert_size(struct spinlock, 1);
15static_assert_size(struct mutex, 8);
16static_assert_size(struct rwlock, 8);
17#endif
18
19static_assert(LOCK_UNCHKD == 0);
20static_assert(LOCK_CHKD_FULL == (LOCK_CHKD_ORDER | LOCK_CHKD_THREAD));
21
22static_assert_disjoint_masks(Q_SPIN_LOCKED_MASK, Q_SPIN_PENDING_MASK);
23static_assert_disjoint_masks(Q_SPIN_TAIL_MASK, Q_SPIN_LOCKED_PENDING_MASK);
24
25static_assert_disjoint_masks(RWLOCK_OWNER_MASK,
26 (uintptr_t) (RWLOCK_WRITER_HELD_BIT |
27 RWLOCK_PRIO_CEIL_MASK |
28 RWLOCK_WAITER_BIT |
29 RWLOCK_WRITER_WANT_BIT));
30