|
82 | 82 |
|
83 | 83 | #endif /* MCUBOOT_BOOT_GO_HOOKS */
|
84 | 84 |
|
| 85 | +#ifdef MCUBOOT_FIND_NEXT_SLOT_HOOKS |
| 86 | + |
| 87 | +#define BOOT_HOOK_FIND_SLOT_CALL(f, ret_default, ...) \ |
| 88 | + DO_HOOK_CALL(f, ret_default, __VA_ARGS__) |
| 89 | + |
| 90 | +#else |
| 91 | + |
| 92 | +#define BOOT_HOOK_FIND_SLOT_CALL(f, ret_default, ...) \ |
| 93 | + HOOK_CALL_NOP(f, ret_default, __VA_ARGS__) |
| 94 | + |
| 95 | +#endif /* MCUBOOT_FIND_NEXT_SLOT_HOOKS */ |
| 96 | + |
85 | 97 | #ifdef MCUBOOT_FLASH_AREA_HOOKS
|
86 | 98 |
|
87 | 99 | #define BOOT_HOOK_FLASH_AREA_CALL(f, ret_default, ...) \
|
@@ -260,4 +272,16 @@ int flash_area_get_device_id_hook(const struct flash_area *fa,
|
260 | 272 | #define BOOT_RESET_REQUEST_HOOK_CHECK_FAILED 3
|
261 | 273 | #define BOOT_RESET_REQUEST_HOOK_INTERNAL_ERROR 4
|
262 | 274 |
|
| 275 | +/** |
| 276 | + * Finds the preferred slot containing the image. |
| 277 | + * |
| 278 | + * @param[in] state Boot loader status information. |
| 279 | + * @param[in] image Image, for which the slot should be found. |
| 280 | + * @param[out] active_slot Number of the preferred slot. |
| 281 | + * |
| 282 | + * @return 0 if a slot was requested; |
| 283 | + * BOOT_HOOK_REGULAR follow the normal execution path. |
| 284 | + */ |
| 285 | +int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, uint32_t *active_slot); |
| 286 | + |
263 | 287 | #endif /*H_BOOTUTIL_HOOKS*/
|
0 commit comments