Fix: interrupt preemption

This commit is contained in:
2025-04-15 17:22:45 +08:00
parent 89ff8a018d
commit c4a44542ef
8 changed files with 93 additions and 51 deletions

View File

@@ -118,16 +118,12 @@ uint64_t _allocate_page(size_t req, int idx, uint64_t l, uint64_t r)
switch (CUR->state) {
case PAGE_FREE:
if (req == sz) {
LOG("page allocated");
LOG(l);
DEBUG_MEM(r);
LOG("page allocated"); LOG(l); DEBUG_MEM(r);
CUR->state = PAGE_ALLOCATED;
CUR->size = 0;
return l;
}
LOG("page divided");
LOG(l);
DEBUG(r);
LOG("page divided"); LOG(l); DEBUG_MEM(r);
LCH->state = RCH->state = PAGE_FREE;
LCH->size = m - l;
RCH->size = r - m;