Skip to content

Commit

Permalink
libsel4simple-default: include schedcontrol range
Browse files Browse the repository at this point in the history
Allows libsel4allocman:bootstrap_new_simple to work on the MCS kernel.

Signed-off-by: Arya Stevinson <[email protected]>
  • Loading branch information
astevins committed Aug 26, 2024
1 parent fcabdef commit 9022420
Showing 1 changed file with 10 additions and 0 deletions.
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

0 comments on commit 9022420

Please sign in to comment.