feat: added cross compiler and moved headers to include dir

This commit is contained in:
2021-03-09 19:45:20 +01:00
parent cefdb8ed90
commit dc4bf71b5a
77 changed files with 180 additions and 45 deletions

40
include/tasks/locking.h Normal file
View File

@@ -0,0 +1,40 @@
//
// Created by rick on 27-02-21.
//
#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(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/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 <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