feat: initial locking etc.

This commit is contained in:
2021-03-01 21:07:53 +01:00
parent ebe006a8ba
commit 990b850c43
14 changed files with 427 additions and 14 deletions

View File

@@ -5,4 +5,36 @@
#ifndef NEW_KERNEL_LOCKING_H
#define NEW_KERNEL_LOCKING_H
#include <types.h>
typedef struct semaphore semaphore_t;
typedef struct mutex mutex_t;
typedef struct spinlock spinlock_t;
semaphore_t *semaphore_create();
void semaphore_wait(semaphore_t *semaphore);
void semaphore_signal(semaphore_t *semaphore);
void semaphore_free(semaphore_t *semaphore);
mutex_t *mutex_create();
void mutex_acquire(mutex_t *mutex);
void mutex_release(mutex_t *mutex);
void mutex_free(mutex_t *mutex);
spinlock_t *spinlock_create();
void spinlock_acquire(spinlock_t *spinlock);
void spinlock_release(spinlock_t *spinlock);
void spinlock_free(spinlock_t *spinlock);
#endif //NEW_KERNEL_LOCKING_H