linux/include/linux/local_lock_internal.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_LOCAL_LOCK_H
# error "Do not include directly, include linux/local_lock.h"
#endif

#include <linux/percpu-defs.h>
#include <linux/lockdep.h>

#ifndef CONFIG_PREEMPT_RT

local_lock_t;

#ifdef CONFIG_DEBUG_LOCK_ALLOC
#define LOCAL_LOCK_DEBUG_INIT(lockname)

static inline void local_lock_acquire(local_lock_t *l)
{}

static inline void local_lock_release(local_lock_t *l)
{}

static inline void local_lock_debug_init(local_lock_t *l)
{}
#else /* CONFIG_DEBUG_LOCK_ALLOC */
#define LOCAL_LOCK_DEBUG_INIT
static inline void local_lock_acquire(local_lock_t *l) { }
static inline void local_lock_release(local_lock_t *l) { }
static inline void local_lock_debug_init(local_lock_t *l) { }
#endif /* !CONFIG_DEBUG_LOCK_ALLOC */

#define INIT_LOCAL_LOCK(lockname)

#define __local_lock_init(lock)

#define __spinlock_nested_bh_init(lock)

#define __local_lock(lock)

#define __local_lock_irq(lock)

#define __local_lock_irqsave(lock, flags)

#define __local_unlock(lock)

#define __local_unlock_irq(lock)

#define __local_unlock_irqrestore(lock, flags)

#define __local_lock_nested_bh(lock)

#define __local_unlock_nested_bh(lock)

#else /* !CONFIG_PREEMPT_RT */

/*
 * On PREEMPT_RT local_lock maps to a per CPU spinlock, which protects the
 * critical section while staying preemptible.
 */
typedef spinlock_t local_lock_t;

#define INIT_LOCAL_LOCK

#define __local_lock_init

#define __local_lock

#define __local_lock_irq

#define __local_lock_irqsave

#define __local_unlock

#define __local_unlock_irq

#define __local_unlock_irqrestore

#define __local_lock_nested_bh

#define __local_unlock_nested_bh

#endif /* CONFIG_PREEMPT_RT */