diff --git a/tool/microkit/src/main.rs b/tool/microkit/src/main.rs index 67923a54..0b492ea8 100644 --- a/tool/microkit/src/main.rs +++ b/tool/microkit/src/main.rs @@ -2339,6 +2339,14 @@ fn build_system( })); } + for (pd_idx, pd) in system.protection_domains.iter().enumerate() { + system_invocations.push(Invocation::new(InvocationArgs::DomainSetSet { + domain_set: DOMAIN_CAP_ADDRESS, + domain: pd.domain as u8, + tcb: pd_tcb_objs[pd_idx].cap_addr, + })); + } + // Set VSpace and CSpace let num_set_space_invocations = system.protection_domains.len() + virtual_machines.len(); let mut set_space_invocation = Invocation::new(InvocationArgs::TcbSetSpace { diff --git a/tool/microkit/src/sysxml.rs b/tool/microkit/src/sysxml.rs index 0c441b27..13e3dd99 100644 --- a/tool/microkit/src/sysxml.rs +++ b/tool/microkit/src/sysxml.rs @@ -168,6 +168,7 @@ pub struct ProtectionDomain { pub parent: Option, /// Location in the parsed SDF file text_pos: roxmltree::TextPos, + pub domain: u64, } #[derive(Debug, PartialEq, Eq, Hash)] @@ -277,7 +278,9 @@ impl ProtectionDomain { node: &roxmltree::Node, is_child: bool, ) -> Result { - let mut attrs = vec!["name", "priority", "pp", "budget", "period", "passive"]; + let mut attrs = vec![ + "name", "priority", "pp", "budget", "period", "passive", "domain", + ]; if is_child { attrs.push("id"); } @@ -346,6 +349,12 @@ impl ProtectionDomain { false }; + let domain = if let Some(xml_domain) = node.attribute("domain") { + sdf_parse_number(xml_domain, node)? + } else { + 0 + }; + let mut maps = Vec::new(); let mut irqs = Vec::new(); let mut setvars = Vec::new(); @@ -508,6 +517,7 @@ impl ProtectionDomain { has_children, parent: None, text_pos: xml_sdf.doc.text_pos_at(node.range().start), + domain, }) } }