| 276 | } |
| 277 | |
| 278 | U32 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 | |
| 287 | bool KMemory::isPageAllocated(U32 page) { |
| 288 | return data->isPageAllocated(page); |
no test coverage detected