Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
process.h File Reference
#include "memory/vm_manager.h"
#include "spinlock.h"
#include <type.h>

Go to the source code of this file.

Data Structures

struct  process_head
 
struct  process_node
 
struct  process
 

Macros

#define MAX_PID_ALLOWED   4194304
 
#define INVALID_PID   ((pid_t)-1)
 

Typedefs

typedef uint32_t pid_t
 

Functions

struct process __attribute__ ((aligned(64))) process_t
 
pid_t alloc_pid ()
 
void free_pid (pid_t pid)
 
process_t * create_process (char *name, struct thread *main_thread)
 
int execve (const char *path, char *const argv[], char *const envp[])
 

Variables

pid_t pid
 
pid_t parent_pid
 
char name [64]
 
struct threadmain_thread
 
struct fdtable * fdtable
 
int exit_code
 
bool exited
 
struct process_node cache
 
uintptr_t heap_start
 
uintptr_t heap_end
 
spinlock_t vm_lock
 
struct virtual_memory_pagevm_page
 
struct processnext
 
struct processprev
 

Macro Definition Documentation

◆ INVALID_PID

#define INVALID_PID   ((pid_t)-1)

Definition at line 9 of file process.h.

Referenced by alloc_pid().

◆ MAX_PID_ALLOWED

#define MAX_PID_ALLOWED   4194304

Definition at line 8 of file process.h.

Referenced by alloc_pid(), and INIT().

Typedef Documentation

◆ pid_t

typedef uint32_t pid_t

Definition at line 11 of file process.h.

Function Documentation

◆ __attribute__()

struct process __attribute__ ( (aligned(64)) )

Definition at line 1 of file core.h.

◆ alloc_pid()

pid_t alloc_pid ( )

Definition at line 529 of file process.c.

References INVALID_PID, MAX_PID_ALLOWED, and pid_bitmap.

Referenced by create_process().

◆ create_process()

◆ execve()

int execve ( const char * path,
char *const argv[],
char *const envp[] )

References execve(), and path.

◆ free_pid()

void free_pid ( pid_t pid)

Definition at line 546 of file process.c.

References pid, and pid_bitmap.

Variable Documentation

◆ cache

◆ exit_code

int exit_code

Definition at line 7 of file process.h.

◆ exited

bool exited

Definition at line 8 of file process.h.

◆ fdtable

struct fdtable* fdtable

Definition at line 6 of file process.h.

◆ heap_end

uintptr_t heap_end

Definition at line 13 of file process.h.

◆ heap_start

uintptr_t heap_start

Definition at line 12 of file process.h.

Referenced by execve(), and syscall_brk().

◆ main_thread

struct thread* main_thread

Definition at line 5 of file process.h.

Referenced by create_process().

◆ name

char name[64]

Definition at line 3 of file process.h.

◆ next

struct process* next

Definition at line 18 of file process.h.

◆ parent_pid

pid_t parent_pid

Definition at line 1 of file process.h.

◆ pid

pid_t pid

Definition at line 0 of file process.h.

Referenced by free_pid().

◆ prev

struct process* prev

Definition at line 19 of file process.h.

Referenced by llist_add(), llist_del_init(), slab_free(), and VirtioGpu::virtq_add_buf().

◆ vm_lock

spinlock_t vm_lock

Definition at line 14 of file process.h.

◆ vm_page

struct virtual_memory_page* vm_page

Definition at line 15 of file process.h.

Referenced by mmap_resolve_virt_addr().