@@ -700,19 +700,16 @@ pub fn build_capdl_spec(
700700 ) ) ;
701701
702702 // Step 3-5 Create fault Endpoint cap to parent/monitor
703- let pd_fault_ep_cap = if pd. parent . is_none ( ) {
704- let badge: u64 = mon_pd_idx as u64 + 1 ;
705- capdl_util_make_endpoint_cap ( mon_fault_ep_obj_id, true , true , true , badge)
706- } else {
703+ let pd_fault_ep_cap = if let Some ( parent) = pd. parent {
707704 // @kwinter: Should we enforce domain boundaries here?
708- assert ! ( pd_global_idx > pd . parent. unwrap ( ) ) ;
705+ assert ! ( pd_global_idx > parent) ;
709706 let badge: u64 = FAULT_BADGE | pd. id . unwrap ( ) ;
710- let parent_ep_obj_id = & pd_id_to_ep_id[ & pd . parent . unwrap ( ) ] ;
707+ let parent_ep_obj_id = & pd_id_to_ep_id[ & parent] ;
711708 let fault_ep_cap =
712709 capdl_util_make_endpoint_cap ( * parent_ep_obj_id, true , true , true , badge) ;
713710
714711 // Allow the parent PD to access the child's TCB:
715- let parent_cspace_obj_id = & pd_id_to_cspace_id[ & pd . parent . unwrap ( ) ] ;
712+ let parent_cspace_obj_id = & pd_id_to_cspace_id[ & parent] ;
716713 capdl_util_insert_cap_into_cspace (
717714 & mut spec_container,
718715 * parent_cspace_obj_id,
@@ -721,7 +718,11 @@ pub fn build_capdl_spec(
721718 ) ;
722719
723720 fault_ep_cap
721+ } else {
722+ let badge: u64 = mon_pd_idx as u64 + 1 ;
723+ capdl_util_make_endpoint_cap ( mon_fault_ep_obj_id, true , true , true , badge)
724724 } ;
725+
725726 caps_to_insert_to_pd_cspace. push ( capdl_util_make_cte (
726727 PD_FAULT_EP_CAP_IDX as u32 ,
727728 pd_fault_ep_cap. clone ( ) ,
@@ -1125,38 +1126,28 @@ pub fn build_capdl_spec(
11251126 // Step 5. Parse domain schedule
11261127 // *********************************
11271128
1128- if system. domain_schedule . is_some ( ) {
1129+ if let Some ( sys_domain_schedule ) = & system. domain_schedule {
11291130 let mut domain_schedule: Vec < DomainSchedEntry > = Vec :: new ( ) ;
11301131 // We want to convert from the microseconds that the user defines in the
11311132 // sdf to the kernel scheduler ticks. If we are on x86, we won't necessarily
11321133 // have a static definition of the timer frequency. We will express the
11331134 // domain timeslices in ticks.
1134- let ticks_in_ms = if kernel_config. timer_freq . is_some ( ) {
1135- kernel_config . timer_freq . unwrap ( ) / US_IN_S
1135+ let ticks_in_ms = if let Some ( timer_freq ) = kernel_config. timer_freq {
1136+ timer_freq / US_IN_S
11361137 } else {
11371138 1
11381139 } ;
11391140
1140- for sched_entry in system . domain_schedule . as_ref ( ) . unwrap ( ) . schedule . iter ( ) {
1141+ for sched_entry in sys_domain_schedule . schedule . iter ( ) {
11411142 domain_schedule. push ( DomainSchedEntry {
11421143 id : sched_entry. id ,
11431144 time : sched_entry. length * ticks_in_ms,
11441145 } ) ;
11451146 }
11461147
11471148 spec_container. spec . domain_schedule = Some ( domain_schedule) ;
1148- spec_container. spec . domain_set_start = system
1149- . domain_schedule
1150- . as_ref ( )
1151- . unwrap ( )
1152- . domain_start_idx
1153- . map ( Word ) ;
1154- spec_container. spec . domain_idx_shift = system
1155- . domain_schedule
1156- . as_ref ( )
1157- . unwrap ( )
1158- . domain_idx_shift
1159- . map ( Word ) ;
1149+ spec_container. spec . domain_set_start = sys_domain_schedule. domain_start_idx . map ( Word ) ;
1150+ spec_container. spec . domain_idx_shift = sys_domain_schedule. domain_idx_shift . map ( Word ) ;
11601151 }
11611152
11621153 // *********************************
0 commit comments