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

Function SysKernelObjectDestroy

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

//////////////////////// \brief SysKernelObjectDestroy (object) Destroy a KernelObject \param object (handle_t) Object to destroy \return negative error code on failure ////////////////////////

Source from the content-addressed store, hash-verified

2604/// \return negative error code on failure
2605/////////////////////////////
2606long SysKernelObjectDestroy(regs64_t* r){
2607 process_t* currentProcess = Scheduler::GetCurrentProcess();
2608
2609 Handle* h;
2610 if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &h)){
2611 Log::Warning("SysKernelObjectDestroy: Invalid handle ID %d", SC_ARG0(r));
2612
2613 IF_DEBUG(debugLevelSyscalls >= DebugLevelVerbose, {
2614 Log::Info("Process %s (PID: %d), Stack Trace:", currentProcess->name, currentProcess->pid);
2615 Log::Info("%x", r->rip);
2616 UserPrintStackTrace(r->rbp, currentProcess->addressSpace);
2617 });
2618 return -EINVAL;
2619 }
2620
2621 h->ko->Destroy();
2622
2623 Scheduler::DestroyHandle(currentProcess, SC_ARG0(r));
2624 return 0;
2625}
2626
2627syscall_t syscalls[]{
2628 SysDebug,

Callers

nothing calls this directly

Calls 7

GetCurrentProcessFunction · 0.85
FindHandleFunction · 0.85
WarningFunction · 0.85
InfoFunction · 0.85
UserPrintStackTraceFunction · 0.85
DestroyHandleFunction · 0.85
DestroyMethod · 0.45

Tested by

no test coverage detected