Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvraj1803 committed Nov 3, 2023
1 parent 90d37fa commit 6035eea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/paging.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ uint64_t ipa_to_phys(struct vm* vm, uint64_t ipa){ // returns physical page bas
uint64_t ipa_page_offset = ipa & (PAGE_SIZE - 1);
uint64_t ipa_page = ipa &~(PAGE_SIZE - 1);

uint64_t lv1_table = vm->virtual_address_space->lv1_table; // 512 GB block
uint64_t lv1_table = (uint64_t)vm->virtual_address_space->lv1_table; // 512 GB block

uint64_t lv2_table = ((uint64_t*)lv1_table)[0] & ~(PAGE_SIZE - 1); // 1 GB block
uint64_t lv2_index = (ipa_page >> LV2_SHIFT) & (TABLE_ENTRIES - 1);
Expand Down

0 comments on commit 6035eea

Please sign in to comment.