Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootutil: Move flash_area_id_to_image under ifdef #1783

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions boot/bootutil/src/bootutil_public.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,20 @@ boot_swap_type_multi(int image_index)
return BOOT_SWAP_TYPE_NONE;
}

int
boot_write_copy_done(const struct flash_area *fap)
{
uint32_t off;

off = boot_copy_done_off(fap);
BOOT_LOG_DBG("writing copy_done; fa_id=%d off=0x%lx (0x%lx)",
flash_area_get_id(fap), (unsigned long)off,
(unsigned long)(flash_area_get_off(fap) + off));
return boot_write_trailer_flag(fap, off, BOOT_FLAG_SET);
}

#ifndef MCUBOOT_BOOTUTIL_LIB_FOR_DIRECT_XIP

static int flash_area_id_to_image(int id)
{
#if BOOT_IMAGE_NUMBER > 1
Expand All @@ -476,20 +490,6 @@ static int flash_area_id_to_image(int id)
return 0;
}

int
boot_write_copy_done(const struct flash_area *fap)
{
uint32_t off;

off = boot_copy_done_off(fap);
BOOT_LOG_DBG("writing copy_done; fa_id=%d off=0x%lx (0x%lx)",
flash_area_get_id(fap), (unsigned long)off,
(unsigned long)(flash_area_get_off(fap) + off));
return boot_write_trailer_flag(fap, off, BOOT_FLAG_SET);
}


#ifndef MCUBOOT_BOOTUTIL_LIB_FOR_DIRECT_XIP
int
boot_set_next(const struct flash_area *fa, bool active, bool confirm)
{
Expand Down
Loading