core: (struct frame_zone).addr now represent address without the header

This commit is contained in:
2024-11-20 00:49:31 +01:00
parent 3315d85e0c
commit b7dd7761d5
2 changed files with 12 additions and 12 deletions

View File

@ -33,8 +33,7 @@ int free_frame(void *frame_ptr)
while (it && (frame_ptr < it->addr || frame_ptr >= it->addr + it->len))
it = it->next;
uint32_t index =
(frame_ptr + (it->len - it->size) - it->addr) / PAGE_SIZE;
uint32_t index = ((frame_ptr - it->addr) / PAGE_SIZE);
SET_FRAME(it->frame_table, index, 0);
if (it->first_free_frame > index)
it->first_free_frame = index;