#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>
#include <linux/tty.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/task.h>
#if BITS_PER_LONG == 64
#define LDSEM_ACTIVE_MASK …
#else
#define LDSEM_ACTIVE_MASK …
#endif
#define LDSEM_UNLOCKED …
#define LDSEM_ACTIVE_BIAS …
#define LDSEM_WAIT_BIAS …
#define LDSEM_READ_BIAS …
#define LDSEM_WRITE_BIAS …
struct ldsem_waiter { … };
void __init_ldsem(struct ld_semaphore *sem, const char *name,
struct lock_class_key *key)
{ … }
static void __ldsem_wake_readers(struct ld_semaphore *sem)
{ … }
static inline int writer_trylock(struct ld_semaphore *sem)
{ … }
static void __ldsem_wake_writer(struct ld_semaphore *sem)
{ … }
static void __ldsem_wake(struct ld_semaphore *sem)
{ … }
static void ldsem_wake(struct ld_semaphore *sem)
{ … }
static struct ld_semaphore __sched *
down_read_failed(struct ld_semaphore *sem, long count, long timeout)
{ … }
static struct ld_semaphore __sched *
down_write_failed(struct ld_semaphore *sem, long count, long timeout)
{ … }
static int __ldsem_down_read_nested(struct ld_semaphore *sem,
int subclass, long timeout)
{ … }
static int __ldsem_down_write_nested(struct ld_semaphore *sem,
int subclass, long timeout)
{ … }
int __sched ldsem_down_read(struct ld_semaphore *sem, long timeout)
{ … }
int ldsem_down_read_trylock(struct ld_semaphore *sem)
{ … }
int __sched ldsem_down_write(struct ld_semaphore *sem, long timeout)
{ … }
int ldsem_down_write_trylock(struct ld_semaphore *sem)
{ … }
void ldsem_up_read(struct ld_semaphore *sem)
{ … }
void ldsem_up_write(struct ld_semaphore *sem)
{ … }
#ifdef CONFIG_DEBUG_LOCK_ALLOC
int ldsem_down_read_nested(struct ld_semaphore *sem, int subclass, long timeout)
{ … }
int ldsem_down_write_nested(struct ld_semaphore *sem, int subclass,
long timeout)
{ … }
#endif