Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsel4simple-default: include schedcontrol range #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libsel4simple-default/src/libsel4simple-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ int simple_default_cap_count(void *data)
+ (bi->userImageFrames.end - bi->userImageFrames.start)
+ (bi->userImagePaging.end - bi->userImagePaging.start)
+ (bi->untyped.end - bi->untyped.start)
#ifdef CONFIG_KERNEL_MCS
+ (bi->schedcontrol.end - bi->schedcontrol.start)
#endif
+ SIMPLE_NUM_INIT_CAPS; //Include all the init caps
}

Expand All @@ -83,6 +86,9 @@ seL4_CPtr simple_default_nth_cap(void *data, int n)
size_t user_img_frame_range = bi->userImageFrames.end - bi->userImageFrames.start + shared_frame_range;
size_t user_img_paging_range = bi->userImagePaging.end - bi->userImagePaging.start + user_img_frame_range;
size_t untyped_range = bi->untyped.end - bi->untyped.start + user_img_paging_range;
#ifdef CONFIG_KERNEL_MCS
size_t sched_ctrl_range = bi->schedcontrol.end - bi->schedcontrol.start + untyped_range;
#endif

seL4_CPtr true_return = seL4_CapNull;

Expand Down Expand Up @@ -128,6 +134,10 @@ seL4_CPtr simple_default_nth_cap(void *data, int n)
return bi->userImagePaging.start + (n - user_img_frame_range);
} else if (n < untyped_range) {
return bi->untyped.start + (n - user_img_paging_range);
#ifdef CONFIG_KERNEL_MCS
} else if (n < sched_ctrl_range) {
return bi->schedcontrol.start + (n - untyped_range);
#endif
}

return true_return;
Expand Down