@@ -75,6 +75,7 @@ fn loc_string(xml_sdf: &XmlSystemDescription, pos: roxmltree::TextPos) -> String
7575pub struct PlatformDescription {
7676 /// Note that we have the invariant that page sizes are be ordered by size
7777 page_sizes : [ u64 ; 2 ] ,
78+ domain_scheduler : bool ,
7879}
7980
8081impl PlatformDescription {
@@ -83,7 +84,10 @@ impl PlatformDescription {
8384 Arch :: Aarch64 => [ 0x1000 , 0x200_000 ] ,
8485 } ;
8586
86- PlatformDescription { page_sizes }
87+ PlatformDescription {
88+ page_sizes,
89+ domain_scheduler : kernel_config. domain_scheduler ,
90+ }
8791 }
8892}
8993
@@ -291,6 +295,7 @@ impl ProtectionDomain {
291295 node : & roxmltree:: Node ,
292296 is_child : bool ,
293297 domain_schedule : & Option < DomainSchedule > ,
298+ plat_desc : & PlatformDescription ,
294299 ) -> Result < ProtectionDomain , String > {
295300 let mut attrs = vec ! [
296301 "name" , "priority" , "pp" , "budget" , "period" , "passive" , "domain" ,
@@ -375,7 +380,7 @@ impl ProtectionDomain {
375380 return Err ( format ! ( "System specifies a domain schedule but protection domain {} does not specify a domain" , name) )
376381 }
377382 ( _, Ok ( domain) ) => {
378- if cfg ! ( feature = "experimental-domain-support" ) {
383+ if plat_desc . domain_scheduler {
379384 return Err ( format ! ( "Protection domain {} specifies a domain {} but system does not specify a domain schedule" , name, domain) ) ;
380385 } else {
381386 return Err ( format ! ( "Assigning PDs to domains is only supported if SDK is built with --experimental-domain-support" ) ) ;
@@ -498,6 +503,7 @@ impl ProtectionDomain {
498503 & child,
499504 true ,
500505 & domain_schedule,
506+ & plat_desc,
501507 ) ?) ,
502508 "virtual_machine" => {
503509 if virtual_machine. is_some ( ) {
@@ -1050,7 +1056,7 @@ pub fn parse(
10501056 // then parse the channels.
10511057 let mut channel_nodes = Vec :: new ( ) ;
10521058
1053- if cfg ! ( feature = "experimental-domain-support" ) {
1059+ if plat_desc . domain_scheduler {
10541060 if let Some ( domain_schedule_node) = system
10551061 . children ( )
10561062 . filter ( |& child| child. is_element ( ) )
@@ -1072,11 +1078,12 @@ pub fn parse(
10721078 & child,
10731079 false ,
10741080 & domain_schedule,
1081+ & plat_desc,
10751082 ) ?) ,
10761083 "channel" => channel_nodes. push ( child) ,
10771084 "memory_region" => mrs. push ( SysMemoryRegion :: from_xml ( & xml_sdf, & child, plat_desc) ?) ,
10781085 "domain_schedule" => {
1079- if !cfg ! ( feature = "experimental-domain-support" ) {
1086+ if !plat_desc . domain_scheduler {
10801087 let pos = xml_sdf. doc . text_pos_at ( child. range ( ) . start ) ;
10811088 return Err ( format ! ( "Domain schedule is only supported if SDK is built with --experimental-domain-support: {}" , loc_string( & xml_sdf, pos) ) ) ;
10821089 }
0 commit comments