| 59 | } |
| 60 | |
| 61 | int 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 | |
| 77 | void MemoryManager::releasePhysicalPages(enum AddressPoolType type, const int paddr, const int count) |
| 78 | { |