FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_kdtrace.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/kdb.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/rmlock.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/turnstile.h>
#include <sys/lock_profile.h>
#include <machine/cpu.h>
Go to the source code of this file.
Macros | |
#define | RM_DESTROYED ((void *)0xdead) |
#define | rm_destroyed(rm) (LIST_FIRST(&(rm)->rm_activeReaders) == RM_DESTROYED) |
#define | RMPF_ONQUEUE 1 |
#define | RMPF_SIGNAL 2 |
#define | _rm_assert(c, what, file, line) |
Functions | |
__FBSDID ("$BSDSUniX$") | |
static void | assert_rm (struct lock_object *lock, int what) |
static void | lock_rm (struct lock_object *lock, int how) |
static int | unlock_rm (struct lock_object *lock) |
MTX_SYSINIT (rm_spinlock,&rm_spinlock,"rm_spinlock", MTX_SPIN) | |
static void | rm_tracker_add (struct pcpu *pc, struct rm_priotracker *tracker) |
static int | rm_trackers_present (const struct pcpu *pc, const struct rmlock *rm, const struct thread *td) |
static void | rm_tracker_remove (struct pcpu *pc, struct rm_priotracker *tracker) |
static void | rm_cleanIPI (void *arg) |
void | rm_init_flags (struct rmlock *rm, const char *name, int opts) |
void | rm_init (struct rmlock *rm, const char *name) |
void | rm_destroy (struct rmlock *rm) |
int | rm_wowned (struct rmlock *rm) |
void | rm_sysinit (void *arg) |
void | rm_sysinit_flags (void *arg) |
static int | _rm_rlock_hard (struct rmlock *rm, struct rm_priotracker *tracker, int trylock) |
int | _rm_rlock (struct rmlock *rm, struct rm_priotracker *tracker, int trylock) |
static void | _rm_unlock_hard (struct thread *td, struct rm_priotracker *tracker) |
void | _rm_runlock (struct rmlock *rm, struct rm_priotracker *tracker) |
void | _rm_wlock (struct rmlock *rm) |
void | _rm_wunlock (struct rmlock *rm) |
void | _rm_wlock_debug (struct rmlock *rm, const char *file, int line) |
void | _rm_wunlock_debug (struct rmlock *rm, const char *file, int line) |
int | _rm_rlock_debug (struct rmlock *rm, struct rm_priotracker *tracker, int trylock, const char *file, int line) |
void | _rm_runlock_debug (struct rmlock *rm, struct rm_priotracker *tracker, const char *file, int line) |
Variables | |
struct lock_class | lock_class_rm |
struct lock_class | lock_class_rm_sleepable |
static struct mtx | rm_spinlock |
#define _rm_assert | ( | c, | |
what, | |||
file, | |||
line | |||
) |
Definition at line 73 of file kern_rmlock.c.
#define RM_DESTROYED ((void *)0xdead) |
Definition at line 64 of file kern_rmlock.c.
Referenced by rm_destroy().
#define rm_destroyed | ( | rm | ) | (LIST_FIRST(&(rm)->rm_activeReaders) == RM_DESTROYED) |
Definition at line 66 of file kern_rmlock.c.
#define RMPF_ONQUEUE 1 |
Definition at line 69 of file kern_rmlock.c.
Referenced by _rm_rlock_hard(), _rm_wlock(), and rm_cleanIPI().
#define RMPF_SIGNAL 2 |
Definition at line 70 of file kern_rmlock.c.
Referenced by _rm_unlock_hard(), and _rm_wlock().
__FBSDID | ( | "$BSDSUniX$" | ) |
int _rm_rlock | ( | struct rmlock * | rm, |
struct rm_priotracker * | tracker, | ||
int | trylock | ||
) |
Definition at line 402 of file kern_rmlock.c.
References _rm_rlock_hard(), and rm_tracker_add().
Referenced by _rm_rlock_debug().
int _rm_rlock_debug | ( | struct rmlock * | rm, |
struct rm_priotracker * | tracker, | ||
int | trylock, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 685 of file kern_rmlock.c.
References _rm_rlock().
|
static |
Definition at line 321 of file kern_rmlock.c.
References critical_enter(), critical_exit(), pcpu_find(), rm_spinlock, rm_tracker_add(), rm_tracker_remove(), rm_trackers_present(), and RMPF_ONQUEUE.
Referenced by _rm_rlock().
void _rm_runlock | ( | struct rmlock * | rm, |
struct rm_priotracker * | tracker | ||
) |
Definition at line 474 of file kern_rmlock.c.
References _rm_unlock_hard(), and rm_tracker_remove().
Referenced by _rm_runlock_debug().
void _rm_runlock_debug | ( | struct rmlock * | rm, |
struct rm_priotracker * | tracker, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 693 of file kern_rmlock.c.
References _rm_runlock().
|
static |
Definition at line 441 of file kern_rmlock.c.
References critical_exit(), rm_spinlock, RMPF_SIGNAL, ts, turnstile_chain_lock(), turnstile_chain_unlock(), turnstile_lookup(), turnstile_signal(), and turnstile_unpend().
Referenced by _rm_runlock().
void _rm_wlock | ( | struct rmlock * | rm | ) |
Definition at line 495 of file kern_rmlock.c.
References all_cpus, rm_cleanIPI(), rm_spinlock, RMPF_ONQUEUE, RMPF_SIGNAL, smp_no_rendevous_barrier(), smp_rendezvous_cpus(), ts, turnstile_trywait(), and turnstile_wait().
Referenced by _rm_wlock_debug().
void _rm_wlock_debug | ( | struct rmlock * | rm, |
const char * | file, | ||
int | line | ||
) |
Definition at line 671 of file kern_rmlock.c.
References _rm_wlock().
void _rm_wunlock | ( | struct rmlock * | rm | ) |
Definition at line 544 of file kern_rmlock.c.
Referenced by _rm_wunlock_debug().
void _rm_wunlock_debug | ( | struct rmlock * | rm, |
const char * | file, | ||
int | line | ||
) |
Definition at line 678 of file kern_rmlock.c.
References _rm_wunlock().
|
static |
Definition at line 115 of file kern_rmlock.c.
|
static |
Definition at line 128 of file kern_rmlock.c.
References panic().
MTX_SYSINIT | ( | rm_spinlock | , |
& | rm_spinlock, | ||
"rm_spinlock" | , | ||
MTX_SPIN | |||
) |
|
static |
Definition at line 229 of file kern_rmlock.c.
References pcpu_find(), rm_spinlock, and RMPF_ONQUEUE.
Referenced by _rm_wlock().
void rm_destroy | ( | struct rmlock * | rm | ) |
Definition at line 282 of file kern_rmlock.c.
References lock_destroy(), mtx_destroy(), RM_DESTROYED, and sx_destroy().
void rm_init | ( | struct rmlock * | rm, |
const char * | name | ||
) |
Definition at line 275 of file kern_rmlock.c.
References rm_init_flags().
Referenced by osd_init(), and rm_sysinit().
void rm_init_flags | ( | struct rmlock * | rm, |
const char * | name, | ||
int | opts | ||
) |
Definition at line 251 of file kern_rmlock.c.
References all_cpus, lc, lock_class_rm, lock_class_rm_sleepable, lock_init(), mtx_init(), and sx_init_flags().
Referenced by rm_init(), and rm_sysinit_flags().
void rm_sysinit | ( | void * | arg | ) |
Definition at line 305 of file kern_rmlock.c.
References rm_init().
void rm_sysinit_flags | ( | void * | arg | ) |
Definition at line 313 of file kern_rmlock.c.
References rm_init_flags().
|
inlinestatic |
Definition at line 175 of file kern_rmlock.c.
Referenced by _rm_rlock(), and _rm_rlock_hard().
|
inlinestatic |
Definition at line 214 of file kern_rmlock.c.
Referenced by _rm_rlock_hard(), and _rm_runlock().
|
static |
Definition at line 196 of file kern_rmlock.c.
References count.
Referenced by _rm_rlock_hard().
int rm_wowned | ( | struct rmlock * | rm | ) |
Definition at line 295 of file kern_rmlock.c.
|
static |
Definition at line 142 of file kern_rmlock.c.
struct lock_class lock_class_rm |
Definition at line 86 of file kern_rmlock.c.
Referenced by rm_init_flags().
struct lock_class lock_class_rm_sleepable |
Definition at line 100 of file kern_rmlock.c.
Referenced by rm_init_flags().
|
static |
Definition at line 164 of file kern_rmlock.c.
Referenced by _rm_rlock_hard(), _rm_unlock_hard(), _rm_wlock(), and rm_cleanIPI().