Commit 11ffa0a5 authored by David Brown's avatar David Brown Committed by David Brown
Browse files

sim: Support direct-xip configuration



Add simulator support for building the direct-xip configuration.
Although this builds, there are no tests that test any of the
functionality, so all current tests trivially pass.

Signed-off-by: default avatarDavid Brown <david.brown@linaro.org>
parent 812a84b0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ enc-aes256-x25519 = ["mcuboot-sys/enc-aes256-x25519"]
bootstrap = ["mcuboot-sys/bootstrap"]
multiimage = ["mcuboot-sys/multiimage"]
ram-load = ["mcuboot-sys/ram-load"]
direct-xip = ["mcuboot-sys/direct-xip"]
large-write = []
downgrade-prevention = ["mcuboot-sys/downgrade-prevention"]

+5 −0
Original line number Diff line number Diff line
@@ -72,6 +72,11 @@ multiimage = []
# image is copied to RAM before loading it.
ram-load = []

# Support simulation of direct XIP.  No swaps are performed, the image
# is directly executed out of whichever partition contains the most
# appropriate image.
direct-xip = []

# Check (in software) against version downgrades.
downgrade-prevention = []

+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ fn main() {
    let multiimage = env::var("CARGO_FEATURE_MULTIIMAGE").is_ok();
    let downgrade_prevention = env::var("CARGO_FEATURE_DOWNGRADE_PREVENTION").is_ok();
    let ram_load = env::var("CARGO_FEATURE_RAM_LOAD").is_ok();
    let direct_xip = env::var("CARGO_FEATURE_DIRECT_XIP").is_ok();

    let mut conf = cc::Build::new();
    conf.define("__BOOTSIM__", None);
@@ -64,6 +65,10 @@ fn main() {
        conf.define("IMAGE_EXECUTABLE_RAM_SIZE", "0x10000");
    }

    if direct_xip {
        conf.define("MCUBOOT_DIRECT_XIP", None);
    }

    // Currently no more than one sig type can be used simultaneously.
    if vec![sig_rsa, sig_rsa3072, sig_ecdsa, sig_ed25519].iter()
        .fold(0, |sum, &v| sum + v as i32) > 1 {