10#include <sys/kassert.h>
11#include <sys/kconfig.h>
12#include <sys/kdebug.h>
15#include <sys/spinlock.h>
17#include <machine/atomic.h>
18#include <machine/amd64.h>
19#include <machine/amd64op.h>
87 kprintf(
"Spinlock_Lock(%s): waiting for over a second!\n", lock->name);
97 if (lock->rCount == 1)
116 if (lock->rCount == 0) {
128 return (lock->
cpu ==
CPU()) && (lock->
lock == 1);
138 kprintf(
"%-36s Locked CPU Count WaitTime LockTime\n",
"Lock Name");
141 kprintf(
"%-36s %6llu %3llu %8llu %12llu %12llu\n", lock->
name,
static INLINE void breakpoint()
static INLINE uint64_t atomic_swap_uint64(volatile uint64_t *dst, uint64_t newval)
static void atomic_set_uint64(volatile uint64_t *dst, uint64_t newval)
#define __NO_LOCK_ANALYSIS
int kprintf(const char *fmt,...)
#define REGISTER_DBGCMD(_NAME, _DESC, _FUNC)
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_HEAD(name, type)
#define LIST_REMOVE(elm, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define LIST_HEAD_INITIALIZER(head)
#define TAILQ_REMOVE(head, elm, field)
#define LIST_FOREACH(var, head, field)
#define LIST_INSERT_HEAD(head, elm, field)
#define LIST_HEAD(name, type)
void Debug_Spinlocks(int argc, const char *argv[])
bool Spinlock_IsHeld(Spinlock *lock)
void Spinlock_Destroy(Spinlock *lock)
void Spinlock_Unlock(Spinlock *lock) __NO_LOCK_ANALYSIS
void Debug_LockStack(int argc, const char *argv[])
void Spinlock_Init(Spinlock *lock, const char *name, uint64_t type)
void Spinlock_Lock(Spinlock *lock) __NO_LOCK_ANALYSIS
#define SPINLOCK_TYPE_NORMAL
void Spinlock_EarlyInit()
#define SPINLOCK_TYPE_RECURSIVE
char * strncpy(char *to, const char *from, size_t len)
char name[SPINLOCK_NAMELEN]