Move headers to include/
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include "process.h"
|
||||
#include "mem/heap/kheap.h"
|
||||
#include "kernel.h"
|
||||
#include "string/string.h"
|
||||
#include "mem/gdt/gdt.h"
|
||||
#include "config.h"
|
||||
#include "io/serial/serial.h"
|
||||
#include <sched/process.h>
|
||||
#include <mem/kheap.h>
|
||||
#include <kernel.h>
|
||||
#include <string/string.h>
|
||||
#include <mem/gdt.h>
|
||||
#include <config.h>
|
||||
#include <io/serial/serial.h>
|
||||
|
||||
#include "io/term/flanterm.h"
|
||||
#include <io/term/flanterm.h>
|
||||
extern struct flanterm_context* ft_ctx;
|
||||
|
||||
struct process_t* processes_list;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
@@ -4,11 +4,11 @@
|
||||
* @license GPL-3.0-only
|
||||
*/
|
||||
|
||||
#include "kernel.h"
|
||||
#include "process.h"
|
||||
#include "mem/paging/paging.h"
|
||||
#include <kernel.h>
|
||||
#include <sched/process.h>
|
||||
#include <mem/paging.h>
|
||||
#include <stdint.h>
|
||||
#include "io/serial/serial.h"
|
||||
#include <io/serial/serial.h>
|
||||
|
||||
extern struct process_t* processes_list;
|
||||
extern struct process_t* current_process;
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
#include <stdatomic.h>
|
||||
#include <stdbool.h>
|
||||
#include "kernel.h"
|
||||
#include "spinlock.h"
|
||||
#include <kernel.h>
|
||||
#include <sched/spinlock.h>
|
||||
|
||||
/*
|
||||
* spinlock_acquire - Lock a lock
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* @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
|
||||
Reference in New Issue
Block a user