Move headers to include/

This commit is contained in:
2026-03-18 11:48:33 +01:00
parent a1e8aacd01
commit f7735eb3a4
45 changed files with 89 additions and 88 deletions

39
include/sched/process.h Normal file
View File

@@ -0,0 +1,39 @@
/*
* @author xamidev <xamidev@riseup.net>
* @brief Process definition
* @license GPL-3.0-only
*/
#ifndef PROCESS_H
#define PROCESS_H
#include <stddef.h>
#include <config.h>
#include <stdint.h>
typedef enum {
READY,
RUNNING,
DEAD
} status_t;
struct process_t {
size_t pid;
char name[PROCESS_NAME_MAX];
status_t status;
struct cpu_status_t* context;
void* root_page_table; // Process PML4 (should contain kernel PML4 in higher half [256-511]
struct process_t* next;
};
void process_init(void);
struct process_t* process_create(char* name, void(*function)(void*), void* arg);
void process_add(struct process_t** processes_list, struct process_t* process);
void process_delete(struct process_t** processes_list, struct process_t* process);
struct process_t* process_get_next(struct process_t* process);
void process_exit(void);
void process_display_list(struct process_t* processes_list);
#endif

13
include/sched/scheduler.h Normal file
View File

@@ -0,0 +1,13 @@
/*
* @author xamidev <xamidev@riseup.net>
* @brief Round-robin scheduler
* @license GPL-3.0-only
*/
#ifndef SCHEDULER_H
#define SCHEDULER_H
struct cpu_status_t* scheduler_schedule(struct cpu_status_t* context);
void scheduler_init(void);
#endif

22
include/sched/spinlock.h Normal file
View File

@@ -0,0 +1,22 @@
/*
* @author xamidev <xamidev@riseup.net>
* @brief Spinlock implementation
* @license GPL-3.0-only
*/
#ifndef SPINLOCK_H
#define SPINLOCK_H
#include <stdbool.h>
#include <stdint.h>
struct spinlock_t
{
bool locked;
uint64_t rflags;
};
void spinlock_acquire(struct spinlock_t* lock);
void spinlock_release(struct spinlock_t* lock);
#endif