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

sim: Rename `SimFlashMap` to `SimMultiFlash`

The name `SimFlashMap` is a bit misleading, as the Map part is more of
an implementation detail when the type really just represents multiple
flash devices.

This is just a rename, but the names `SimFlashMap` and the value
`flashmap` occur in a lot of places in the image module.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent ca23469e
Loading
Loading
Loading
Loading
+4 −4
Changes for sim/mcuboot-sys/src/c.rs: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
/// Interface wrappers to C API entering to the bootloader

use crate::area::AreaDesc;
use simflash::SimFlashMap;
use simflash::SimMultiFlash;
use lazy_static::lazy_static;
use libc;
use crate::api;
@@ -14,12 +14,12 @@ lazy_static! {
}

/// Invoke the bootloader on this flash device.
pub fn boot_go(flashmap: &mut SimFlashMap, areadesc: &AreaDesc,
pub fn boot_go(multiflash: &mut SimMultiFlash, areadesc: &AreaDesc,
               counter: Option<&mut i32>, catch_asserts: bool) -> (i32, u8) {
    let _lock = BOOT_LOCK.lock().unwrap();

    unsafe {
        for (&dev_id, flash) in flashmap.iter_mut() {
        for (&dev_id, flash) in multiflash.iter_mut() {
            api::set_flash(dev_id, flash);
        }
        raw::c_catch_asserts = if catch_asserts { 1 } else { 0 };
@@ -33,7 +33,7 @@ pub fn boot_go(flashmap: &mut SimFlashMap, areadesc: &AreaDesc,
    let asserts = unsafe { raw::c_asserts };
    unsafe {
        counter.map(|c| *c = raw::flash_counter as i32);
        for (&dev_id, _) in flashmap {
        for (&dev_id, _) in multiflash {
            api::clear_flash(dev_id);
        }
    };
+1 −1
Changes for sim/simflash/src/lib.rs: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ impl SimFlash {

}

pub type SimFlashMap = HashMap<u8, SimFlash>;
pub type SimMultiFlash = HashMap<u8, SimFlash>;

impl Flash for SimFlash {
    /// The flash drivers tend to erase beyond the bounds of the given range.  Instead, we'll be
+168 −168

File changed.

Preview size limit exceeded, changes collapsed.