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

Function SysMunmap

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

* SysMunmap - Unmap memory (addr, count) * * On success - return 0 * On failure - return -1 */

Source from the content-addressed store, hash-verified

1044 * On failure - return -1
1045 */
1046long SysMunmap(regs64_t* r){
1047 uint64_t address = SC_ARG0(r);
1048 size_t count = SC_ARG1(r);
1049
1050 if(Memory::CheckRegion(address, count * PAGE_SIZE_4K, Scheduler::GetCurrentProcess()->addressSpace) /*Check availibilty of the requested map*/){
1051 //Memory::Free4KPages((void*)address, count, Scheduler::GetCurrentProcess()->addressSpace);
1052 } else {
1053 return -1;
1054 }
1055
1056 return 0;
1057}
1058
1059/*
1060 * SysCreateSharedMemory (key, size, flags, recipient) - Create Shared Memory

Callers

nothing calls this directly

Calls 2

CheckRegionFunction · 0.85
GetCurrentProcessFunction · 0.85

Tested by

no test coverage detected