CS350 COS
COS
|
Go to the source code of this file.
Data Structures | |
struct | Spinlock |
Macros | |
#define | SPINLOCK_NAMELEN 32 |
#define | SPINLOCK_TYPE_NORMAL 1 |
#define | SPINLOCK_TYPE_RECURSIVE 2 |
Typedefs | |
typedef struct Spinlock | Spinlock |
Functions | |
void | Critical_Init () |
void | Critical_Enter () |
void | Critical_Exit () |
uint32_t | Critical_Level () |
void | Spinlock_EarlyInit () |
void | Spinlock_Init (Spinlock *lock, const char *name, uint64_t type) |
void | Spinlock_Destroy (Spinlock *lock) |
void | Spinlock_Lock (Spinlock *lock) __LOCK_EX(*lock) |
void | Spinlock_Unlock (Spinlock *lock) __UNLOCK_EX(*lock) |
bool | Spinlock_IsHeld (Spinlock *lock) __LOCK_EX_ASSERT(*lock) |
#define SPINLOCK_NAMELEN 32 |
Definition at line 10 of file spinlock.h.
#define SPINLOCK_TYPE_NORMAL 1 |
Definition at line 12 of file spinlock.h.
#define SPINLOCK_TYPE_RECURSIVE 2 |
Definition at line 13 of file spinlock.h.
void Critical_Enter | ( | ) |
Definition at line 28 of file critical.c.
void Critical_Exit | ( | ) |
Definition at line 35 of file critical.c.
void Critical_Init | ( | ) |
Definition at line 17 of file critical.c.
uint32_t Critical_Level | ( | ) |
void Spinlock_Destroy | ( | Spinlock * | lock | ) |
Definition at line 61 of file spinlock.c.
void Spinlock_EarlyInit | ( | ) |
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.