kern: implement enough of KPageTable to initialize a thread

This commit is contained in:
Michael Scire 2020-02-13 17:38:56 -08:00
parent c6d1579265
commit 8c93eb5712
31 changed files with 1475 additions and 270 deletions

View file

@ -104,7 +104,7 @@ namespace ams::kern {
MESOSPHERE_ASSERT(big_index >= 0);
/* Free space before the big blocks. */
for (s32 i = big_index; i >= 0; i--) {
for (s32 i = big_index - 1; i >= 0; i--) {
const size_t block_size = this->blocks[i].GetSize();
while (before_start + block_size <= before_end) {
before_end -= block_size;
@ -113,11 +113,11 @@ namespace ams::kern {
}
/* Free space after the big blocks. */
for (s32 i = big_index; i >= 0; i--) {
for (s32 i = big_index - 1; i >= 0; i--) {
const size_t block_size = this->blocks[i].GetSize();
while (after_start + block_size <= after_end) {
after_start += block_size;
this->FreeBlock(after_start, i);
after_start += block_size;
}
}
}