From 7fbfac681afabfc9ab72d290de0d005579249fd9 Mon Sep 17 00:00:00 2001 From: ZhiyuanSue <2262387848@qq.com> Date: Thu, 19 Dec 2024 22:06:11 +0800 Subject: [PATCH] fix another bug --- .../invocation/decode/decode_sched_invocation.rs | 2 +- sel4_ipc/src/endpoint.rs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/kernel/src/syscall/invocation/decode/decode_sched_invocation.rs b/kernel/src/syscall/invocation/decode/decode_sched_invocation.rs index 5e50118..cafc4dc 100644 --- a/kernel/src/syscall/invocation/decode/decode_sched_invocation.rs +++ b/kernel/src/syscall/invocation/decode/decode_sched_invocation.rs @@ -41,7 +41,7 @@ pub fn decode_sched_context_invocation( capability: &cap_sched_context_cap, buffer: &seL4_IPCBuffer, ) -> exception_t { - // println!("go into decode sched context invocation"); + // sel4_common::println!("go into decode sched context invocation"); let sc = convert_to_mut_type_ref::(capability.get_capSCPtr() as usize); match inv_label { MessageLabel::SchedContextConsumed => { diff --git a/sel4_ipc/src/endpoint.rs b/sel4_ipc/src/endpoint.rs index fddbb3f..5d5a133 100644 --- a/sel4_ipc/src/endpoint.rs +++ b/sel4_ipc/src/endpoint.rs @@ -476,13 +476,15 @@ impl endpoint_func for endpoint { sender.do_ipc_transfer(thread, Some(self), badge, can_grant); let do_call = sender.tcbState.get_blockingIPCIsCall() != 0; // MCS - if convert_to_mut_type_ref::(sender.tcbSchedContext).sc_sporadic() + if let Some(sc) = + convert_to_option_mut_type_ref::(sender.tcbSchedContext) { - unsafe { - assert!(sender.tcbSchedContext != ksCurSC); - if sender.tcbSchedContext != ksCurSC { - convert_to_mut_type_ref::(sender.tcbSchedContext) - .refill_unblock_check(); + if sc.sc_sporadic() { + unsafe { + assert!(sender.tcbSchedContext != ksCurSC); + if sender.tcbSchedContext != ksCurSC { + sc.refill_unblock_check(); + } } } }