2023-03-03 19:23:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2023 Antifallobst <antifallobst@systemausfall.org>
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
* this software and associated documentation files (the “Software”), to deal in
|
|
|
|
* the Software without restriction, including without limitation the rights to use,
|
|
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
|
|
|
* Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
* subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NOX_PROCESS_H
|
|
|
|
#define NOX_PROCESS_H
|
|
|
|
|
|
|
|
#include "utils/stdtypes.h"
|
|
|
|
#include "utils/string.h"
|
2023-03-04 16:46:21 +00:00
|
|
|
#include "mm/page_map.h"
|
|
|
|
#include "drivers/elf/elf.h"
|
2023-03-03 19:23:19 +00:00
|
|
|
|
|
|
|
typedef uint32_t pid_t;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
PROCESS_NONE,
|
|
|
|
PROCESS_KERNEL
|
|
|
|
} processes_standard_E;
|
|
|
|
|
|
|
|
typedef struct process_T process_T;
|
2023-03-04 16:46:21 +00:00
|
|
|
struct process_T {
|
|
|
|
char name [128];
|
|
|
|
pid_t id;
|
|
|
|
void* chunk;
|
|
|
|
uint32_t chunk_id;
|
|
|
|
|
|
|
|
page_map_T* page_map;
|
|
|
|
elf_executable_T* executable;
|
|
|
|
|
|
|
|
uint32_t num_threads;
|
|
|
|
void* threads;
|
|
|
|
|
|
|
|
process_T* parent;
|
|
|
|
process_T* childs;
|
|
|
|
process_T* prev;
|
|
|
|
process_T* next;
|
2023-03-03 19:23:19 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 16:46:21 +00:00
|
|
|
void process_kernel_spawn (elf_executable_T* executable);
|
|
|
|
pid_t process_spawn (pid_t parent, string_t name, elf_executable_T* executable, void* buffer);
|
|
|
|
void process_kill_pid (pid_t pid);
|
|
|
|
void process_kill (process_T* process);
|
2023-03-03 19:23:19 +00:00
|
|
|
|
|
|
|
#endif //NOX_PROCESS_H
|