30 asm volatile(
"pause");
35 panic(
NULL,
"Deadlock in rwlock_read_acquire detected");
46 panic(
NULL,
"Deadlock in rwlock_read_acquire detected");
49 asm volatile(
"pause");
81 panic(
NULL,
"Deadlock in rwlock_write_acquire detected");
84 asm volatile(
"pause");
93 panic(
NULL,
"Deadlock in rwlock_write_acquire detected");
96 asm volatile(
"pause");
99 bool expected =
false;
106 panic(
NULL,
"Deadlock in rwlock_write_acquire detected");
110 asm volatile(
"pause");
void interrupt_disable(void)
Disable interrupts and increment the disableDepth.
void interrupt_enable(void)
Decrement the CLI depth and enable interrupts if depth reaches zero and interrupts were previously en...
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
void rwlock_write_acquire(rwlock_t *lock)
Acquires a rwlock for writing, blocking until it is available.
void rwlock_read_acquire(rwlock_t *lock)
Acquires a rwlock for reading, blocking until it is available.
#define RWLOCK_DEADLOCK_TIMEOUT
Maximum time before we consider a deadlock to have occurred.
void rwlock_read_release(rwlock_t *lock)
Releases a rwlock from reading.
void rwlock_write_release(rwlock_t *lock)
Releases a rwlock from writing.
void rwlock_init(rwlock_t *lock)
Initializes a rwlock.
clock_t timer_uptime(void)
Time since boot.
#define NULL
Pointer error value.
__UINT64_TYPE__ clock_t
A nanosecond time.
#define atomic_store(object, desired)
#define atomic_compare_exchange_weak(object, expected, desired)
#define atomic_fetch_sub(object, operand)
#define atomic_thread_fence(order)
#define atomic_load(object)
#define atomic_fetch_add(object, operand)
#define atomic_init(obj, value)
__UINT_FAST16_TYPE__ uint_fast16_t
Read-Write Ticket Lock structure.
atomic_uint_fast16_t readTicket
atomic_uint_fast16_t writeServe
atomic_uint_fast16_t readServe
atomic_uint_fast16_t activeReaders
atomic_uint_fast16_t writeTicket