@@ -863,10 +863,13 @@ split_image_check(struct image_header *app_hdr,
863
863
* within the flash area we are in.
864
864
*/
865
865
static bool
866
- boot_is_header_valid (const struct image_header * hdr , const struct flash_area * fap )
866
+ boot_is_header_valid (const struct image_header * hdr , const struct flash_area * fap ,
867
+ struct boot_loader_state * state )
867
868
{
868
869
uint32_t size ;
869
870
871
+ (void )state ;
872
+
870
873
if (hdr -> ih_magic != IMAGE_MAGIC ) {
871
874
return false;
872
875
}
@@ -1033,7 +1036,7 @@ boot_validate_slot(struct boot_loader_state *state, int slot,
1033
1036
{
1034
1037
FIH_CALL (boot_image_check , fih_rc , state , hdr , fap , bs );
1035
1038
}
1036
- if (!boot_is_header_valid (hdr , fap ) || FIH_NOT_EQ (fih_rc , FIH_SUCCESS )) {
1039
+ if (!boot_is_header_valid (hdr , fap , state ) || FIH_NOT_EQ (fih_rc , FIH_SUCCESS )) {
1037
1040
if ((slot != BOOT_PRIMARY_SLOT ) || ARE_SLOTS_EQUIVALENT ()) {
1038
1041
flash_area_erase (fap , 0 , flash_area_get_size (fap ));
1039
1042
/* Image is invalid, erase it to prevent further unnecessary
@@ -2556,7 +2559,7 @@ boot_get_slot_usage(struct boot_loader_state *state)
2556
2559
for (slot = 0 ; slot < BOOT_NUM_SLOTS ; slot ++ ) {
2557
2560
hdr = boot_img_hdr (state , slot );
2558
2561
2559
- if (boot_is_header_valid (hdr , BOOT_IMG_AREA (state , slot ))) {
2562
+ if (boot_is_header_valid (hdr , BOOT_IMG_AREA (state , slot ), state )) {
2560
2563
state -> slot_usage [BOOT_CURR_IMG (state )].slot_available [slot ] = true;
2561
2564
BOOT_LOG_IMAGE_INFO (slot , hdr );
2562
2565
} else {
0 commit comments