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

Function KernelMapVirtualMemory4K

Kernel/src/arch/x86_64/paging.cpp:520–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518 }
519
520 void KernelMapVirtualMemory4K(uint64_t phys, uint64_t virt, uint64_t amount, uint64_t flags){
521 uint64_t pageDirIndex, pageIndex;
522
523 while(amount--){
524 pageDirIndex = PAGE_DIR_GET_INDEX(virt);
525 pageIndex = PAGE_TABLE_GET_INDEX(virt);
526 SetPageFrame(&(kernelHeapDirTables[pageDirIndex][pageIndex]), phys);
527 kernelHeapDirTables[pageDirIndex][pageIndex] |= flags;
528 invlpg(virt);
529 phys += PAGE_SIZE_4K;
530 virt += PAGE_SIZE_4K;
531 }
532 }
533
534 void KernelMapVirtualMemory4K(uint64_t phys, uint64_t virt, uint64_t amount){
535 KernelMapVirtualMemory4K(phys, virt, amount, PAGE_WRITABLE | PAGE_PRESENT);

Callers 15

CreateProcessFunction · 0.85
CreateChildThreadFunction · 0.85
laihost_mapFunction · 0.85
SMPEntryFunction · 0.85
InitializeCPUFunction · 0.85
InitCoreFunction · 0.85
InitializeTSSFunction · 0.85
CreateAddressSpaceFunction · 0.85
AllocatePageTableFunction · 0.85
ControllerMethod · 0.85
IdentifyControllerMethod · 0.85

Calls 2

SetPageFrameFunction · 0.85
invlpgFunction · 0.85

Tested by

no test coverage detected