feat: reformatted code base to be more standard

This commit is contained in:
2021-03-10 22:01:13 +01:00
parent dc4bf71b5a
commit 586b8191b4
81 changed files with 431 additions and 338 deletions

View File

@@ -0,0 +1,40 @@
//
// Created by rick on 27-02-21.
//
#ifndef NEW_KERNEL_LOCKING_H
#define NEW_KERNEL_LOCKING_H
#include <sys/types.h>
typedef struct semaphore semaphore_t;
typedef struct mutex mutex_t;
typedef struct spinlock spinlock_t;
semaphore_t *semaphore_create(int32_t start);
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

38
include/myke/tasks/task.h Normal file
View File

@@ -0,0 +1,38 @@
//
// Created by rick on 22-02-21.
//
#ifndef NEW_KERNEL_TASK_H
#define NEW_KERNEL_TASK_H
#include <myke/cpu/cpu.h>
typedef void (*task_entrypoint)(void *entry_data);
void task_notify_irq(uint8_t irq_no);
void task_wait_irq(uint16_t irq_bits);
void task_init();
void task_start_first();
void task_switch_next();
uint32_t task_spawn(task_entrypoint, void *entry_data);
void task_end(uint32_t tid);
void task_suspend();
uint32_t task_get_current_tid();
void task_signal(uint32_t tid);
void task_lock_acquire();
void task_ensure_enabled();
void task_lock_free();
#endif //NEW_KERNEL_TASK_H