Initial commit
This commit is contained in:
15
kernel/spinlock.h
Normal file
15
kernel/spinlock.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "kernel/lib.h"
|
||||
|
||||
struct Spinlock
|
||||
{
|
||||
volatile uint32_t next_ticket;
|
||||
volatile uint32_t serving;
|
||||
uint32_t locking;
|
||||
};
|
||||
typedef struct Spinlock Spinlock;
|
||||
|
||||
void spinlock_init(Spinlock* lock);
|
||||
void spinlock_acquire(Spinlock* lock);
|
||||
void spinlock_release(Spinlock* lock);
|
Reference in New Issue
Block a user