sim: get status area size from bootutil
Add new bootutil function that returns the size of the status area.
The simulator was updated to remove the custom calculation and get
the size directly from bootutil, avoiding breakages the happen when
both are not in sync.
Signed-off-by: Fabio Utzig <utzig@apache.org>
diff --git a/sim/mcuboot-sys/src/c.rs b/sim/mcuboot-sys/src/c.rs
index f3de302..6df89e4 100644
--- a/sim/mcuboot-sys/src/c.rs
+++ b/sim/mcuboot-sys/src/c.rs
@@ -36,10 +36,14 @@
(result, asserts)
}
-pub fn boot_trailer_sz(align: u8) -> u32 {
+pub fn boot_trailer_sz(align: u32) -> u32 {
unsafe { raw::boot_trailer_sz(align) }
}
+pub fn boot_status_sz(align: u32) -> u32 {
+ unsafe { raw::boot_status_sz(align) }
+}
+
pub fn boot_magic_sz() -> usize {
unsafe { raw::boot_magic_sz() as usize }
}
@@ -81,7 +85,8 @@
// for information and tracking.
pub fn invoke_boot_go(sim_ctx: *mut CSimContext, areadesc: *const CAreaDesc) -> libc::c_int;
- pub fn boot_trailer_sz(min_write_sz: u8) -> u32;
+ pub fn boot_trailer_sz(min_write_sz: u32) -> u32;
+ pub fn boot_status_sz(min_write_sz: u32) -> u32;
pub fn boot_magic_sz() -> u32;
pub fn boot_max_align() -> u32;