matos/core/process.h

26 lines
885 B
C
Raw Permalink Normal View History

2021-10-30 15:30:19 +02:00
#pragma once
2024-02-15 18:40:45 +01:00
#include "types.h"
2021-10-30 15:30:19 +02:00
#define PROCESS_NAME_MAX_LENGTH 32
2024-02-15 18:40:45 +01:00
typedef unsigned long int pid_t;
2021-10-30 15:30:19 +02:00
struct process;
2024-02-15 18:40:45 +01:00
struct thread;
2021-10-30 15:30:19 +02:00
int processSetup();
struct process *processCreate(char *name);
int processCountThread(struct process *proc);
void processListPrint();
int processRef(struct process *proc);
int processUnref(struct process *proc);
int processSetName(struct process *proc, char *name);
2024-01-26 22:23:58 +01:00
char *processGetName(struct process *proc);
2021-10-30 15:30:19 +02:00
int processAddThread(struct process *proc, struct thread *th);
2021-10-30 15:43:40 +02:00
int processRemoveThread(struct thread *th);
2021-11-02 21:24:12 +01:00
struct mmu_context *processGetMMUContext(struct process *th);
2022-08-09 16:15:00 +02:00
struct uAddrSpace *processGetAddrSpace(struct process *proc);
int processInitHeap(struct process *proc, uaddr_t lastUserAddr);
2024-02-15 18:40:45 +01:00
pid_t processGetId(struct process *proc);
pid_t processGetNextTid(struct process *proc);
int processJoinThread(struct process *proc, pid_t tid);