Initial commit

This commit is contained in:
2024-06-02 00:26:57 +02:00
commit 45f420a338
21 changed files with 889 additions and 0 deletions

15
kernel/spinlock.h Normal file
View 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);