forked from xamidev/pepperOS
39 lines
799 B
C
39 lines
799 B
C
/*
|
|
* @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"
|
|
|
|
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;
|
|
struct process_t* next;
|
|
};
|
|
|
|
void process_init();
|
|
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_display_list(struct process_t* processes_list);
|
|
|
|
#endif
|