Commit d5e632c4 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

Move Slotinfo values into Images struct

So that this can be stored in its own structure, make it own the slot
info (which is only two usize values).

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent decbd046
Loading
Loading
Loading
Loading
+8 −7
Changes for sim/src/lib.rs: 8 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -206,8 +206,8 @@ impl RunStatus {
        // upgraded to
        let mut bad_flash = flash.clone();
        let bad_slot1_image = Images {
            slot0: &slot0,
            slot1: &slot1,
            slot0: slot0.clone(),
            slot1: slot1.clone(),
            primary: install_image(&mut bad_flash, slot0_base, 32784, false),
            upgrade: install_image(&mut bad_flash, slot1_base, 41928, true),
        };
@@ -215,8 +215,8 @@ impl RunStatus {
        failed |= run_signfail_upgrade(&bad_flash, &areadesc, &bad_slot1_image);

        let images = Images {
            slot0: &slot0,
            slot1: &slot1,
            slot0: slot0.clone(),
            slot1: slot1.clone(),
            primary: install_image(&mut flash, slot0_base, 32784, false),
            upgrade: install_image(&mut flash, slot1_base, 41928, false),
        };
@@ -943,14 +943,15 @@ pub struct ImageVersion {
    build_num: u32,
}

#[derive(Clone)]
struct SlotInfo {
    base_off: usize,
    trailer_off: usize,
}

struct Images<'a> {
    slot0: &'a SlotInfo,
    slot1: &'a SlotInfo,
struct Images {
    slot0: SlotInfo,
    slot1: SlotInfo,
    primary: Vec<u8>,
    upgrade: Vec<u8>,
}