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

Function SysEndpointInfo

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

//////////////////////// \brief SysEndpointInfo (endpoint, info) Get endpoint information \param endpoint Endpoint handle \param info Pointer to endpoint info struct \return 0 on success, negative error code on failure ////////////////////////

Source from the content-addressed store, hash-verified

2506/// \return 0 on success, negative error code on failure
2507/////////////////////////////
2508long SysEndpointInfo(regs64_t* r){
2509 process_t* currentProcess = Scheduler::GetCurrentProcess();
2510
2511 MessageEndpointInfo* info = reinterpret_cast<MessageEndpointInfo*>(SC_ARG1(r));
2512
2513 if(!Memory::CheckUsermodePointer(SC_ARG1(r), sizeof(MessageEndpointInfo), currentProcess->addressSpace)){
2514 return -EFAULT; // Data greater than 8 and invalid pointer
2515 }
2516
2517 Handle* endpHandle;
2518 if(Scheduler::FindHandle(currentProcess, SC_ARG0(r), &endpHandle)){
2519 Log::Warning("SysEndpointQueue: Invalid handle ID %d", SC_ARG0(r));
2520 return -EINVAL;
2521 }
2522
2523 if(!endpHandle->ko->IsType(MessageEndpoint::TypeID())){
2524 Log::Warning("SysEndpointQueue: Invalid handle type (ID %d)", SC_ARG0(r));
2525 return -EINVAL;
2526 }
2527
2528 MessageEndpoint* endpoint = reinterpret_cast<MessageEndpoint*>(endpHandle->ko.get());
2529
2530 *info = { .msgSize = endpoint->GetMaxMessageSize() };
2531 return 0;
2532}
2533
2534/////////////////////////////
2535/// \brief SysKernelObjectWaitOne (object)

Callers

nothing calls this directly

Calls 7

GetCurrentProcessFunction · 0.85
CheckUsermodePointerFunction · 0.85
FindHandleFunction · 0.85
WarningFunction · 0.85
IsTypeMethod · 0.80
GetMaxMessageSizeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected