Skip to content

Commit

Permalink
Mcs support 2 (#23)
Browse files Browse the repository at this point in the history
* start add some of the mcs features

* add lot's of mcs todo codes and add the new pbf of aarch64

* add the no mcs case framework

* pass the rel4_complier

* put in all the symbols

* update the fastpath_reply_recv

* try to add the riscv pbf support

* fill in the real riscv pbf

* adjust the archtecture of the timer

* add the time functions for the qemu-arm-virt and spike

* add some timer functions

* add the framework of the sched_context

* update some of the mcs functions

* continue add the sched_context part

* fix previous bugs

* try to add some code but have bugs

* fill in some of the code again

* add some boot code,but have some panics

* add the alloc root task sched context part

* update the schedule and fix the previous bug

* finish the boot part code, start debug

* update the syscall num

* add some necessery mcs codes

* continue add mcs code

* add some thing about the interrupt entry

* fix one assert

* use is_schedulable to replace the is_runable

* try to fix the handle_fault on mcs and no mcs

* fix sysgetclock bug

* successfully go into the tests

* add the framework of handle syscall

* complete the handlesyscall

* add the reply

* finish the functions of reply

* add the do reply part

* update the ci

* add the some functions

* finish fill in sched control code

* add some of the mcs feature in the handlesyscall

* pass the tcb set space function

* finish the TCBSetTimeoutEndpoint part

* update the decode sched context invocation

* try to add the decodeSchedContext_Bind code

* fix bugs

* update the rece code

* add restart part

* add the handle yield

* fix some bugs

* fix the cnode bug

* try to fix more bugs of convert

* fix bugs

* fix some bugs

* fix another bug

* add the invoke sc unbind and pass all bind tests

* fix some bugs

* add something but seems cannot fix the bugsd

* fix the bug of cancelallipc

* try to fix version

* try to fix bugs

* fix the no mcs feature bugs

* try to fix

* change dir

* Adapt dependencies

* fix a bug that might fail in riscv of cancel all ipc

* add some of the code but still cannot fix the bug

* fix the ksconsumed counting bug

* try to fix bug but fail

* try to fix more

* update

* try to fix bugs

* fix the call stack new parameter order bug

* fix another bug

* fix another bug

* try to fix bugs

* continue fix bugs

* fix the bug of sc control judge and add mcs code of cancel badged sends

* update the sc yieldto codes

* add the timeout fault data structure and code

* fix previous bug

* add complete signal mcs code, but cannot fix bugs

* update the tcb enqueue, add the mcs ep append and handle unknown syscall

* fix the do_fault_reply_transfer position bug

* seems fix the bugs

* update the ci timeout time

---------

Co-authored-by: jackhu <[email protected]>
  • Loading branch information
ZhiyuanSue and Huzhiwen1208 committed Dec 24, 2024
1 parent 9350038 commit 56e891a
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
6 changes: 6 additions & 0 deletions src/arch/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ impl cap_arch_func for cap {
// cap_tag::CapPageGlobalDirectoryCap => self.get_pgd_base_ptr(),
cap_tag::cap_asid_control_cap => 0,
cap_tag::cap_asid_pool_cap => cap::cap_asid_pool_cap(self).get_capASIDPool() as usize,
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_reply_cap => cap::cap_reply_cap(self).get_capReplyPtr() as usize,
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_sched_context_cap => {
cap::cap_sched_context_cap(self).get_capSCPtr() as usize
}
_ => 0,
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/arch/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ impl cap_arch_func for cap {
cap::cap_page_table_cap(self).get_capPTBasePtr() as usize
}
cap_tag::cap_asid_pool_cap => cap::cap_asid_pool_cap(self).get_capASIDPool() as usize,
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_reply_cap => cap::cap_reply_cap(self).get_capReplyPtr() as usize,
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_sched_context_cap => {
cap::cap_sched_context_cap(self).get_capSCPtr() as usize
}
_ => 0,
}
}
Expand Down
73 changes: 61 additions & 12 deletions src/capability/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,47 @@ impl cap_func for cap {
cap_tag::cap_reply_cap => seL4_ReplyBits,
#[cfg(not(feature = "KERNEL_MCS"))]
cap_tag::cap_reply_cap => 0,
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_sched_context_cap => {
cap::cap_sched_context_cap(self).get_capSCSizeBits() as usize
}
_ => 0,
}
}

fn get_cap_is_physical(&self) -> bool {
matches!(
self.get_tag(),
cap_tag::cap_untyped_cap
| cap_tag::cap_endpoint_cap
| cap_tag::cap_notification_cap
| cap_tag::cap_cnode_cap
| cap_tag::cap_frame_cap
| cap_tag::cap_asid_pool_cap
| cap_tag::cap_page_table_cap
| cap_tag::cap_zombie_cap
| cap_tag::cap_thread_cap
)
#[cfg(not(feature = "KERNEL_MCS"))]
{
matches!(
self.get_tag(),
cap_tag::cap_untyped_cap
| cap_tag::cap_endpoint_cap
| cap_tag::cap_notification_cap
| cap_tag::cap_cnode_cap
| cap_tag::cap_frame_cap
| cap_tag::cap_asid_pool_cap
| cap_tag::cap_page_table_cap
| cap_tag::cap_zombie_cap
| cap_tag::cap_thread_cap
)
}
#[cfg(feature = "KERNEL_MCS")]
{
matches!(
self.get_tag(),
cap_tag::cap_untyped_cap
| cap_tag::cap_endpoint_cap
| cap_tag::cap_notification_cap
| cap_tag::cap_cnode_cap
| cap_tag::cap_frame_cap
| cap_tag::cap_asid_pool_cap
| cap_tag::cap_page_table_cap
| cap_tag::cap_zombie_cap
| cap_tag::cap_thread_cap
| cap_tag::cap_sched_context_cap
| cap_tag::cap_reply_cap
)
}
}

fn isArchCap(&self) -> bool {
Expand Down Expand Up @@ -186,6 +210,31 @@ pub fn same_region_as(cap1: &cap, cap2: &cap) -> bool {
}
false
}
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_sched_context_cap => {
if cap2.get_tag() == cap_tag::cap_sched_context_cap {
return (cap::cap_sched_context_cap(cap1).get_capSCPtr()
== cap::cap_sched_context_cap(cap2).get_capSCPtr())
&& (cap::cap_sched_context_cap(cap1).get_capSCSizeBits()
== cap::cap_sched_context_cap(cap2).get_capSCSizeBits());
}
false
}
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_sched_control_cap => {
if cap2.get_tag() == cap_tag::cap_sched_control_cap {
return true;
}
false
}
#[cfg(feature = "KERNEL_MCS")]
cap_tag::cap_reply_cap => {
if cap2.get_tag() == cap_tag::cap_reply_cap {
return cap::cap_reply_cap(cap1).get_capReplyPtr()
== cap::cap_reply_cap(cap2).get_capReplyPtr();
}
false
}
_ => false,
}
}
Expand Down

0 comments on commit 56e891a

Please sign in to comment.