Add GetCurrentProcess function and update KillThread signature

This commit is contained in:
EnderIce2
2024-03-02 00:51:37 +02:00
parent b8ba6cfb60
commit f85935f8f3
4 changed files with 20 additions and 5 deletions

View File

@ -182,6 +182,12 @@ extern "C"
pid_t CreateKernelThread(pid_t pId, const char *Name, void *EntryPoint,
void *Argument);
/**
* @brief Get the PID of the current process
* @return The PID of the current process
*/
pid_t GetCurrentProcess();
/**
* @brief Kill a process
* @param pId The PID of the process to kill
@ -193,10 +199,11 @@ extern "C"
/**
* @brief Kill a thread
* @param tId The TID of the thread to kill
* @param pId The PID of the process the thread is in
* @param ExitCode The exit code of the thread
* @return 0 on success, errno on failure
*/
int KillThread(pid_t tId, int ExitCode);
int KillThread(pid_t tId, pid_t pId, int ExitCode);
/**
* @brief Yield the current thread

View File

@ -298,8 +298,9 @@ typedef struct
/* Scheduling */
pid_t (*CreateKernelProcess)(dev_t MajorID, const char *Name);
pid_t (*CreateKernelThread)(dev_t MajorID, pid_t pId, const char *Name, void *EntryPoint, void *Argument);
pid_t (*GetCurrentProcess)(dev_t MajorID);
int (*KillProcess)(dev_t MajorID, pid_t pId, int ExitCode);
int (*KillThread)(dev_t MajorID, pid_t tId, int ExitCode);
int (*KillThread)(dev_t MajorID, pid_t tId, pid_t pId, int ExitCode);
void (*Yield)(dev_t MajorID);
void (*Sleep)(dev_t MajorID, uint64_t Milliseconds);