Skip to content

Commit

Permalink
openfirmware/ppc: A few minor fixes and extra debugging
Browse files Browse the repository at this point in the history
* Show old page table location and provide more feedback
* 16 int32 * 0x10000000 > sizeof(int32), fix to uint32

Change-Id: Ib68c34f5d3c6bfa1da53241e6586c07e4e494750
  • Loading branch information
kallisti5 committed Mar 14, 2018
1 parent 36ea340 commit 3b60bc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ arch_mmu_init(void)

// can we just keep the page table?
size_t suggestedTableSize = suggested_page_table_size(total);
dprintf("current page table size = %" B_PRIuSIZE "\n", tableSize);
dprintf("suggested page table size = %" B_PRIuSIZE "\n",
suggestedTableSize);
if (tableSize < suggestedTableSize) {
Expand Down Expand Up @@ -788,13 +789,14 @@ arch_mmu_init(void)
table = (page_table_entry_group *)tableBase;
}

dprintf("new table at: %p\n", table);
dprintf("OpenFirmware gave us a new page table at: %p\n", table);
sPageTable = table;
tableSize = suggestedTableSize;
} else {
// ToDo: we could check if the page table is much too large
// and create a smaller one in this case (in order to save
// memory).
dprintf("using original OpenFirmware page table at: %p\n", table);
sPageTable = table;
}

Expand Down Expand Up @@ -885,7 +887,7 @@ arch_mmu_init(void)

// set up new page table and turn on translation again

for (int32 i = 0; i < 16; i++) {
for (uint32 i = 0; i < 16; i++) {
ppc_set_segment_register((void *)(i * 0x10000000), sSegments[i]);
// one segment describes 256 MB of memory
}
Expand Down

0 comments on commit 3b60bc6

Please sign in to comment.