Skip to content

Commit

Permalink
fix the cnode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiyuanSue committed Dec 12, 2024
1 parent 51e6f01 commit 184c9c0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion kernel/src/interfaces_impl/cspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ pub fn finaliseCap(capability: &cap, _final: bool, _exposed: bool) -> finaliseCa
fc_ret.cleanupInfo = cap_null_cap::new().unsplay();
return fc_ret;
}
cap_tag::cap_reply_cap | cap_tag::cap_null_cap | cap_tag::cap_domain_cap => {
cap_tag::cap_reply_cap => {
// TODO: MCS
}
cap_tag::cap_null_cap | cap_tag::cap_domain_cap => {
fc_ret.remainder = cap_null_cap::new().unsplay();
fc_ret.cleanupInfo = cap_null_cap::new().unsplay();
return fc_ret;
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/syscall/invocation/invoke_tcb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub fn installTCBCap(
newCap: &cap,
srcSlot: &mut cte_t,
) -> exception_t {
let mut rootSlot = target.get_cspace_mut_ref(tcbBuffer);
let mut rootSlot = target.get_cspace_mut_ref(index);
let e = rootSlot.delete_all(true);
if e != exception_t::EXCEPTION_NONE {
return e;
Expand Down
8 changes: 7 additions & 1 deletion sel4_task/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,12 @@ fn chooseThread() {
}
};
assert_ne!(thread, 0);
assert!(convert_to_mut_type_ref::<tcb_t>(thread).is_schedulable());
#[cfg(feature="KERNEL_MCS")]
{
assert!(convert_to_mut_type_ref::<sched_context_t>(convert_to_mut_type_ref::<tcb_t>(thread).tcbSchedContext).refill_sufficient(0));
assert!(convert_to_mut_type_ref::<sched_context_t>(convert_to_mut_type_ref::<tcb_t>(thread).tcbSchedContext).refill_ready());
}
convert_to_mut_type_ref::<tcb_t>(thread).switch_to_this();
} else {
#[cfg(target_arch = "aarch64")]
Expand Down Expand Up @@ -669,7 +675,7 @@ pub fn commitTime() {
assert!(current_sched_context.refill_sufficient(ksConsumed));
assert!(current_sched_context.refill_ready());

if (current_sched_context.is_round_robin()) {
if current_sched_context.is_round_robin() {
assert!(current_sched_context.refill_size() == MIN_REFILLS);
(*current_sched_context.refill_head()).rAmount -= ksConsumed;
(*current_sched_context.refill_tail()).rAmount += ksConsumed;
Expand Down

0 comments on commit 184c9c0

Please sign in to comment.