Skip to content

Commit

Permalink
add complete signal mcs code, but cannot fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiyuanSue committed Dec 22, 2024
1 parent 3afd7a0 commit acbde6e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
3 changes: 0 additions & 3 deletions sel4_ipc/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ impl endpoint_func for endpoint {
can_grant_reply: bool,
canDonate: bool,
) {
use sel4_task::{ksCurSC, reply::reply_t, sched_context::sched_context_t};
// sel4_common::println!("send ipc {}",self.get_ep_state() as usize);
match self.get_ep_state() {
EPState::Idle | EPState::Send => {
Expand Down Expand Up @@ -451,7 +450,6 @@ impl endpoint_func for endpoint {
use core::intrinsics::unlikely;
use log::debug;
use sel4_common::structures_gen::{cap_tag::cap_reply_cap, notification_t, seL4_Fault_tag};
use sel4_task::{ksCurSC, sched_context::sched_context_t};

use crate::notification_func;

Expand Down Expand Up @@ -525,7 +523,6 @@ impl endpoint_func for endpoint {
convert_to_mut_type_ref::<reply_t>(replyptr)
.push(sender, thread, canDonate);
} else {
sel4_common::println!("receive ipc inactive");
set_thread_state(sender, ThreadState::ThreadStateInactive);
}
} else {
Expand Down
11 changes: 11 additions & 0 deletions sel4_ipc/src/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,17 @@ impl Transfer for tcb_t {
self.tcbArch
.set_register(ArchReg::Badge, ntfn.get_ntfnMsgIdentifier() as usize);
ntfn.set_state(NtfnState::Idle as u64);
#[cfg(feature="KERNEL_MCS")]
{
maybeDonateSchedContext(self, ntfn);
if let Some(tcbsc)=convert_to_option_mut_type_ref::<sched_context_t>(self.tcbSchedContext){
if tcbsc.sc_sporadic(){
if self.tcbSchedContext == ntfn.get_ntfnSchedContext() as usize && !tcbsc.is_current(){
tcbsc.refill_unblock_check();
}
}
}
}
return true;
}
}
Expand Down
13 changes: 12 additions & 1 deletion sel4_task/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,20 @@ fn nextDomain() {
if ksDomScheduleIdx >= ksDomScheduleLength {
ksDomScheduleIdx = 0;
}
#[cfg(feature = "KERNEL_MCS")]
{
ksReprogram = true;
}
ksWorkUnitsCompleted = 0;
ksCurDomain = ksDomSchedule[ksDomScheduleIdx].domain;
ksDomainTime = ksDomSchedule[ksDomScheduleIdx].length;
#[cfg(feature = "KERNEL_MCS")]
{
ksDomainTime = usToTicks(ksDomSchedule[ksDomScheduleIdx].length * US_IN_MS);
}
#[cfg(not(feature = "KERNEL_MCS"))]
{
ksDomainTime = ksDomSchedule[ksDomScheduleIdx].length;
}
//FIXME ksWorkUnits not used;
// ksWorkUnits
}
Expand Down

0 comments on commit acbde6e

Please sign in to comment.