MCPcopy Create free account
hub / github.com/YatSenOS/YatSenOS-Tutorial-Volume-1 / allocatePhysicalPages

Method allocatePhysicalPages

lab8/src/2/src/kernel/memory.cpp:84–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84int MemoryManager::allocatePhysicalPages(enum AddressPoolType type, const int count)
85{
86 int start = -1;
87
88 if (type == AddressPoolType::KERNEL)
89 {
90 start = kernelPhysical.allocate(count);
91 }
92 else if (type == AddressPoolType::USER)
93 {
94 start = userPhysical.allocate(count);
95 }
96
97 return (start == -1) ? 0 : start;
98}
99
100void MemoryManager::releasePhysicalPages(enum AddressPoolType type, const int paddr, const int count)
101{

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected