boot: Add capability for ram loading

The MCUBOOT_RAM_LOAD feature supports configurations where code is
loaded from flash into RAM before execution.  As such, it is not
necessary for upgrades to move data around in flash.

Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/caps.rs b/sim/src/caps.rs
index 4af8bd0..932b5ab 100644
--- a/sim/src/caps.rs
+++ b/sim/src/caps.rs
@@ -26,6 +26,7 @@
     EncX25519            = (1 << 13),
     Bootstrap            = (1 << 14),
     Aes256               = (1 << 15),
+    RamLoad              = (1 << 16),
 }
 
 impl Caps {
@@ -39,6 +40,12 @@
     pub fn get_num_images() -> usize {
         (unsafe { bootutil_get_num_images() }) as usize
     }
+
+    /// Query if this configuration performs some kind of upgrade by writing to flash.
+    pub fn modifies_flash() -> bool {
+        // All other configurations perform upgrades by writing to flash.
+        !Self::RamLoad.present()
+    }
 }
 
 extern "C" {