Lines Matching refs:idx

103         if (bs->op == BOOT_STATUS_OP_MOVE && slot == 0 && bs->idx > last_idx) {  in boot_read_image_header()
106 if (bs->idx > 1 && bs->idx <= last_idx) { in boot_read_image_header()
108 } else if (bs->idx == 1) { in boot_read_image_header()
209 bs->idx = (found_idx / BOOT_STATUS_MOVE_STATE_COUNT) + BOOT_STATUS_IDX_0; in swap_read_status_bytes()
213 bs->idx = ((found_idx - move_entries) / BOOT_STATUS_SWAP_STATE_COUNT) + BOOT_STATUS_IDX_0; in swap_read_status_bytes()
231 (bs->idx - BOOT_STATUS_IDX_0) * idx_sz + in boot_status_internal_off()
387 boot_move_sector_up(int idx, uint32_t sz, struct boot_loader_state *state, in boot_move_sector_up() argument
401 new_off = boot_img_sector_off(state, BOOT_PRIMARY_SLOT, idx); in boot_move_sector_up()
402 old_off = boot_img_sector_off(state, BOOT_PRIMARY_SLOT, idx - 1); in boot_move_sector_up()
404 if (bs->idx == BOOT_STATUS_IDX_0) { in boot_move_sector_up()
425 bs->idx++; in boot_move_sector_up()
430 boot_swap_sectors(int idx, uint32_t sz, struct boot_loader_state *state, in boot_swap_sectors() argument
439 pri_up_off = boot_img_sector_off(state, BOOT_PRIMARY_SLOT, idx); in boot_swap_sectors()
440 pri_off = boot_img_sector_off(state, BOOT_PRIMARY_SLOT, idx - 1); in boot_swap_sectors()
441 sec_off = boot_img_sector_off(state, BOOT_SECONDARY_SLOT, idx - 1); in boot_swap_sectors()
463 bs->idx++; in boot_swap_sectors()
493 bs->idx != BOOT_STATUS_IDX_0) { in fixup_revert()
523 uint32_t idx; in swap_run() local
574 idx = last_idx; in swap_run()
575 while (idx > 0) { in swap_run()
576 if (idx <= (last_idx - bs->idx + 1)) { in swap_run()
577 boot_move_sector_up(idx, sector_sz, state, bs, fap_pri, fap_sec); in swap_run()
579 idx--; in swap_run()
581 bs->idx = BOOT_STATUS_IDX_0; in swap_run()
586 idx = 1; in swap_run()
587 while (idx <= last_idx) { in swap_run()
588 if (idx >= bs->idx) { in swap_run()
589 boot_swap_sectors(idx, sector_sz, state, bs, fap_pri, fap_sec); in swap_run()
591 idx++; in swap_run()