13 auto& cpu_sched = GetCurrentCpuSched();
15 auto* current = GetCurrentTask();
16 assert(current !=
nullptr &&
"Block: No current task to block");
18 "Block: current task status must be kRunning");
24 auto& list = cpu_sched.blocked_tasks[resource_id];
27 "Block: blocked_tasks list full for resource, cannot block task {}",
34 current->fsm.Receive(
MsgBlock{resource_id});
36 current->aux->blocked_on = resource_id;
37 list.push_back(current);
39 klog::Debug(
"Block: pid={} blocked on resource={}, data={:#x}",
40 current->pid, resource_id.GetTypeName(),
41 static_cast<uint64_t
>(resource_id.GetData()));