CS350 COS
COS
|
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/kassert.h>
#include <sys/kconfig.h>
#include <sys/kdebug.h>
#include <sys/ktime.h>
#include <sys/mp.h>
#include <sys/spinlock.h>
#include <machine/atomic.h>
#include <machine/amd64.h>
#include <machine/amd64op.h>
Go to the source code of this file.
Functions | |
LIST_HEAD (LockListHead, Spinlock) | |
void | Spinlock_Init (Spinlock *lock, const char *name, uint64_t type) |
void | Spinlock_Destroy (Spinlock *lock) |
void | Spinlock_Lock (Spinlock *lock) __NO_LOCK_ANALYSIS |
void | Spinlock_Unlock (Spinlock *lock) __NO_LOCK_ANALYSIS |
bool | Spinlock_IsHeld (Spinlock *lock) |
void | Debug_Spinlocks (int argc, const char *argv[]) |
REGISTER_DBGCMD (spinlocks, "Display list of spinlocks", Debug_Spinlocks) | |
void | Debug_LockStack (int argc, const char *argv[]) |
REGISTER_DBGCMD (lockstack, "Display stack of held spinlocks", Debug_LockStack) | |
Variables | |
Spinlock | lockListLock |
void Debug_LockStack | ( | int | argc, |
const char * | argv[] | ||
) |
Definition at line 152 of file spinlock.c.
void Debug_Spinlocks | ( | int | argc, |
const char * | argv[] | ||
) |
Definition at line 132 of file spinlock.c.
LIST_HEAD | ( | LockListHead | , |
Spinlock | |||
) |
Definition at line 26 of file spinlock.c.
REGISTER_DBGCMD | ( | lockstack | , |
"Display stack of held spinlocks" | , | ||
Debug_LockStack | |||
) |
REGISTER_DBGCMD | ( | spinlocks | , |
"Display list of spinlocks" | , | ||
Debug_Spinlocks | |||
) |
void Spinlock_Destroy | ( | Spinlock * | lock | ) |
Definition at line 61 of file spinlock.c.
Definition at line 43 of file spinlock.c.
void Spinlock_Lock | ( | Spinlock * | lock | ) |
Spinlock_Lock –
Spin until we acquire the spinlock. This will also disable interrupts to prevent deadlocking with interrupt handlers.
Definition at line 75 of file spinlock.c.
void Spinlock_Unlock | ( | Spinlock * | lock | ) |
Spinlock_Unlock –
Release the spinlock. This will re-enable interrupts.
Definition at line 109 of file spinlock.c.
Spinlock lockListLock |
Definition at line 21 of file spinlock.c.