summaryrefslogtreecommitdiff
path: root/include/asm-generic/rqspinlock.h
blob: 5dd4dd8aee69e8742f95a9115b6d42f7dd700ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Resilient Queued Spin Lock
 *
 * (C) Copyright 2024-2025 Meta Platforms, Inc. and affiliates.
 *
 * Authors: Kumar Kartikeya Dwivedi <memxor@gmail.com>
 */
#ifndef __ASM_GENERIC_RQSPINLOCK_H
#define __ASM_GENERIC_RQSPINLOCK_H

#include <linux/types.h>
#include <vdso/time64.h>

struct qspinlock;
typedef struct qspinlock rqspinlock_t;

extern void resilient_queued_spin_lock_slowpath(rqspinlock_t *lock, u32 val);

/*
 * Default timeout for waiting loops is 0.25 seconds
 */
#define RES_DEF_TIMEOUT (NSEC_PER_SEC / 4)

#endif /* __ASM_GENERIC_RQSPINLOCK_H */