Skip to content

Commit 43a49a3

Browse files
committed
bootutil: Add better mode selection checks
Improves the mode selection checks to prevent selecting multiple conflicting modes as has been seen in TFM Signed-off-by: Jamie McCrae <[email protected]>
1 parent 6376b4c commit 43a49a3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

boot/bootutil/src/bootutil_priv.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,16 @@ struct flash_area;
5858
defined(MCUBOOT_SWAP_USING_MOVE) + \
5959
defined(MCUBOOT_DIRECT_XIP) + \
6060
defined(MCUBOOT_RAM_LOAD) + \
61-
defined(MCUBOOT_FIRMWARE_LOADER)) > 1
61+
defined(MCUBOOT_FIRMWARE_LOADER) + \
62+
defined(MCUBOOT_SWAP_USING_SCRATCH)) > 1
6263
#error "Please enable only one of MCUBOOT_OVERWRITE_ONLY, MCUBOOT_SWAP_USING_MOVE, MCUBOOT_DIRECT_XIP, MCUBOOT_RAM_LOAD or MCUBOOT_FIRMWARE_LOADER"
6364
#endif
6465

66+
#if !defined(MCUBOOT_DIRECT_XIP) && \
67+
defined(MCUBOOT_DIRECT_XIP_REVERT)
68+
#error "MCUBOOT_DIRECT_XIP_REVERT cannot be enabled unless MCUBOOT_DIRECT_XIP is used"
69+
#endif
70+
6571
#if !defined(MCUBOOT_OVERWRITE_ONLY) && \
6672
!defined(MCUBOOT_SWAP_USING_MOVE) && \
6773
!defined(MCUBOOT_DIRECT_XIP) && \

0 commit comments

Comments
 (0)