| 111 | } |
| 112 | |
| 113 | int MemoryManager::getTotalMemory() |
| 114 | { |
| 115 | |
| 116 | if (!this->totalMemory) |
| 117 | { |
| 118 | int memory = *((int *)MEMORY_SIZE_ADDRESS); |
| 119 | // ax寄存器保存的内容 |
| 120 | int low = memory & 0xffff; |
| 121 | // bx寄存器保存的内容 |
| 122 | int high = (memory >> 16) & 0xffff; |
| 123 | |
| 124 | this->totalMemory = low * 1024 + high * 64 * 1024; |
| 125 | } |
| 126 | |
| 127 | return this->totalMemory; |
| 128 | } |
| 129 | |
| 130 | int MemoryManager::allocatePages(enum AddressPoolType type, const int count) |
| 131 | { |
nothing calls this directly
no outgoing calls
no test coverage detected