MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / SysKernelObjectWaitOne

Function SysKernelObjectWaitOne

Kernel/src/arch/x86_64/syscalls.cpp:2543–2558  ·  view source on GitHub ↗

//////////////////////// \brief SysKernelObjectWaitOne (object) Wait on one KernelObject \param object (handle_t) Object to wait on \return negative error code on failure ////////////////////////

Source from the content-addressed store, hash-verified

2541/// \return negative error code on failure
2542/////////////////////////////
2543long SysKernelObjectWaitOne(regs64_t* r){
2544 process_t* currentProcess = Scheduler::GetCurrentProcess();
2545
2546 Handle* handle;
2547 if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &handle)){
2548 Log::Warning("SysKernelObjectWaitOne: Invalid handle ID %d", SC_ARG0(r));
2549 return -EINVAL;
2550 }
2551
2552 KernelObjectWatcher watcher;
2553
2554 watcher.WatchObject(handle->ko, 0);
2555 watcher.Wait();
2556
2557 return 0;
2558}
2559
2560/////////////////////////////
2561/// \brief SysKernelObjectWait (objects, count)

Callers

nothing calls this directly

Calls 5

GetCurrentProcessFunction · 0.85
FindHandleFunction · 0.85
WarningFunction · 0.85
WatchObjectMethod · 0.80
WaitMethod · 0.45

Tested by

no test coverage detected