diff --git a/kernel/lib/mman.c b/kernel/lib/mman.c index 9445c33..8f0ed5d 100644 --- a/kernel/lib/mman.c +++ b/kernel/lib/mman.c @@ -47,10 +47,11 @@ void _pull(int idx, size_t sz) { if (LCH->state == PAGE_FREE && RCH->state == PAGE_FREE) { if (CUR->state != PAGE_FREE) { - LOG("node merged"); + LOG("free page merged"); DEBUG_MEM((uint64_t)idx); } CUR->state = PAGE_FREE; + CUR->size = sz; } if (LCH->state != PAGE_FREE || RCH->state != PAGE_FREE) CUR->state = PAGE_DIVIDED; @@ -124,6 +125,9 @@ uint64_t _allocate_page(size_t req, int idx, uint64_t l, uint64_t r) CUR->size = 0; return l; } + LOG("page divided"); + LOG(l); + DEBUG(r); LCH->state = RCH->state = PAGE_FREE; LCH->size = m - l; RCH->size = r - m; @@ -239,6 +243,8 @@ void _reserve_page(uint64_t ql, uint64_t qr, int idx, uint64_t l, uint64_t r) uint64_t m = l + ((msb64(sz) == sz) ? (sz >> 1) : msb64(sz)); if (CUR->state == PAGE_FREE) { + LOG("page divided"); LOG(l); DEBUG_MEM(r); + CUR->state = PAGE_DIVIDED; LCH->state = RCH->state = PAGE_FREE; LCH->size = m - l; RCH->size = r - m; diff --git a/kernel/lib/timer.c b/kernel/lib/timer.c index a3daeab..3728312 100644 --- a/kernel/lib/timer.c +++ b/kernel/lib/timer.c @@ -95,11 +95,9 @@ void timer_irq_handler(void) { _enable_timer_irq(false); - LOG("timer irq"); - uint64_t cntpct_el0; R_SYSREG(cntpct_el0, cntpct_el0); - DEBUG_EXCEP(cntpct_el0); + LOG("timer irq"); DEBUG_EXCEP(cntpct_el0); if (global_timer) { add_interrupt_task(20, global_timer->data.func, global_timer->data.param);