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

Method allocatePhysicalPages

lab7/src/4/src/kernel/memory.cpp:63–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected