Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 13 additions & 12 deletions tool/microkit/src/capdl/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,22 @@ pub fn simulate_capdl_object_alloc_algorithm(
}
}

if !phys_addrs_ok
&& matches!(
if !phys_addrs_ok {
if matches!(
error_reporting_level,
CapDLAllocEmulationErrorLevel::PrintStderr
)
{
eprintln!("Below are the valid ranges of memory to be allocated from:");
eprintln!("Valid ranges outside of main memory:");
for (_i, ut) in untypeds_by_paddr.iter().filter(|(_i, ut)| ut.is_device) {
eprintln!(" [0x{:0>12x}..0x{:0>12x})", ut.base(), ut.end());
}
eprintln!("Valid ranges within main memory:");
for (_i, ut) in untypeds_by_paddr.iter().filter(|(_i, ut)| !ut.is_device) {
eprintln!(" [0x{:0>12x}..0x{:0>12x})", ut.base(), ut.end());
) {
eprintln!("Below are the valid ranges of memory to be allocated from:");
eprintln!("Valid ranges outside of main memory:");
for (_i, ut) in untypeds_by_paddr.iter().filter(|(_i, ut)| ut.is_device) {
eprintln!(" [0x{:0>12x}..0x{:0>12x})", ut.base(), ut.end());
}
eprintln!("Valid ranges within main memory:");
for (_i, ut) in untypeds_by_paddr.iter().filter(|(_i, ut)| !ut.is_device) {
eprintln!(" [0x{:0>12x}..0x{:0>12x})", ut.base(), ut.end());
}
}

return false;
}

Expand Down
2 changes: 2 additions & 0 deletions tool/microkit/src/capdl/initialiser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub const INITIALISER_GRANULE_SIZE: PageSize = PageSize::Small;
const PT_SEL4_CAPDL_SPEC: u32 = 0x64c3_4003;
const PT_SEL4_CAPDL_FRAME_DATA: u32 = 0x64c3_4004;

#[derive(Clone)]
pub struct CapDLInitialiserSpecMetadata {
pub spec_size: u64,
}
Expand All @@ -35,6 +36,7 @@ pub enum LogLevel {
Trace = 5,
}

#[derive(Clone)]
pub struct CapDLInitialiser {
pub elf: ElfFile,
pub phys_base: Option<u64>,
Expand Down
3 changes: 2 additions & 1 deletion tool/microkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,15 @@ fn main() -> Result<(), String> {
// The monitor is just a special PD
system_elfs.push(monitor_elf);

let mut capdl_initialiser = CapDLInitialiser::new(capdl_initialiser_elf);
let capdl_initialiser_orig = CapDLInitialiser::new(capdl_initialiser_elf);

// Now build the capDL spec and final image. We may need to do this in >1 iterations on ARM and RISC-V
// if there are Memory Regions without a paddr but subject to setvar region_paddr.
let mut iteration = 0;
let mut spec_need_refinement = true;
let mut system_built = false;
while spec_need_refinement && iteration < MAX_BUILD_ITERATION {
let mut capdl_initialiser = capdl_initialiser_orig.clone();
spec_need_refinement = false;

// Patch all the required symbols in the Monitor and PDs according to the Microkit's requirements
Expand Down
Loading