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

Method allocatePhysicalPages

lab7/src/3/src/kernel/memory.cpp:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61int MemoryManager::allocatePhysicalPages(enum AddressPoolType type, const int count)
62{
63 int start = -1;
64
65 if (type == AddressPoolType::KERNEL)
66 {
67 start = kernelPhysical.allocate(count);
68 }
69 else if (type == AddressPoolType::USER)
70 {
71 start = userPhysical.allocate(count);
72 }
73
74 return (start == -1) ? 0 : start;
75}
76
77void MemoryManager::releasePhysicalPages(enum AddressPoolType type, const int paddr, const int count)
78{

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected