MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / mapPages

Method mapPages

source/kernel/kmemory.cpp:278–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278U32 KMemory::mapPages(KThread* thread, U32 startPage, const std::vector<RamPage>& pages, U32 permissions) {
279 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(mutex);
280 if (startPage == 0 && !data->reserveAddress(ADDRESS_PROCESS_MMAP_START, (U32)pages.size(), &startPage, false, false, PAGE_MAPPED)) {
281 return 0;
282 }
283 this->data->allocPages(thread, startPage, (U32)pages.size(), permissions | PAGE_MAPPED, 0, 0, nullptr, pages.data());
284 return startPage << K_PAGE_SHIFT;
285}
286
287bool KMemory::isPageAllocated(U32 page) {
288 return data->isPageAllocated(page);

Callers 1

shmatMethod · 0.80

Calls 4

reserveAddressMethod · 0.80
allocPagesMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected