mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Add Sleep syscall
This commit is contained in:
parent
ac0c9505f3
commit
ff214dc10b
@ -163,6 +163,14 @@ static int sys_file_status(SyscallsFrame *Frame)
|
||||
return SYSCALL_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
static int sys_sleep(SyscallsFrame *Frame, uint64_t Milliseconds)
|
||||
{
|
||||
if (!CheckTrust(TrustedByKernel | Trusted | Untrusted))
|
||||
return SYSCALL_ACCESS_DENIED;
|
||||
TaskManager->Sleep(Milliseconds);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int sys_wait(SyscallsFrame *Frame)
|
||||
{
|
||||
fixme("sys_wait: %#lx", Frame);
|
||||
@ -259,6 +267,7 @@ static void *NativeSyscallsTable[] = {
|
||||
[_FileSeek] = (void *)sys_file_seek,
|
||||
[_FileStatus] = (void *)sys_file_status,
|
||||
|
||||
[_Sleep] = (void *)sys_sleep,
|
||||
[_Wait] = (void *)sys_wait,
|
||||
[_Kill] = (void *)sys_kill,
|
||||
[_Spawn] = (void *)sys_spawn,
|
||||
|
@ -88,6 +88,12 @@ enum NativeSyscalls
|
||||
*/
|
||||
_FileStatus,
|
||||
|
||||
/** @brief Sleep for a specific amount of time
|
||||
* @fn int Sleep(uint64_t Milliseconds)
|
||||
* This syscall is used to sleep the current thread for a specific amount of time.
|
||||
*/
|
||||
_Sleep,
|
||||
|
||||
/** @brief Wait for a process or a thread
|
||||
* @fn
|
||||
* This syscall is used to wait for a specific process or thread to terminate. It returns the exit code of the process or thread.
|
||||
|
Loading…
x
Reference in New Issue
Block a user