Kernel: Add SYS_SLEEP
This commit is contained in:
@@ -106,6 +106,12 @@ namespace Kernel
|
||||
return ret.value()->pid();
|
||||
}
|
||||
|
||||
long sys_sleep(unsigned int seconds)
|
||||
{
|
||||
PIT::sleep(seconds * 1000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" long sys_fork_trampoline();
|
||||
|
||||
extern "C" long cpp_syscall_handler(int syscall, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5)
|
||||
@@ -162,6 +168,9 @@ namespace Kernel
|
||||
case SYS_FORK:
|
||||
ret = sys_fork_trampoline();
|
||||
break;
|
||||
case SYS_SLEEP:
|
||||
ret = sys_sleep((unsigned int)arg1);
|
||||
break;
|
||||
default:
|
||||
Kernel::panic("Unknown syscall {}", syscall);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user