Lines Matching refs:bs

81                            struct image_header *out_hdr, struct boot_status *bs)  argument
96 if (bs == NULL) {
104 if (!boot_status_is_reset(bs)) {
121 if (bs->swap_type == BOOT_SWAP_TYPE_REVERT ||
124 if (((bs->idx - BOOT_STATUS_IDX_0) > last_idx ||
125 ((bs->idx - BOOT_STATUS_IDX_0) == last_idx &&
126 bs->state == BOOT_STATUS_STATE_1))) {
134 if ((bs->idx - BOOT_STATUS_IDX_0) > last_idx ||
135 ((bs->idx - BOOT_STATUS_IDX_0) == last_idx &&
136 bs->state == BOOT_STATUS_STATE_2)) {
146 if ((bs->idx > BOOT_STATUS_IDX_0 ||
147 (bs->idx == BOOT_STATUS_IDX_0 && bs->state == BOOT_STATUS_STATE_1)) &&
148 bs->idx <= last_idx) {
156 if (bs->idx > BOOT_STATUS_IDX_0) {
170 if (bs->swap_type == BOOT_SWAP_TYPE_REVERT ||
208 if (out_hdr->ih_magic == IMAGE_MAGIC && (bs != NULL || state->bootstrap_secondary_offset_set[
213 if (out_hdr->ih_magic == IMAGE_MAGIC && bs != NULL && slot == BOOT_SECONDARY_SLOT) {
219 if (bs != NULL && out_hdr->ih_magic != IMAGE_MAGIC) {
232 struct boot_status *bs) argument
293 bs->op = BOOT_STATUS_OP_SWAP;
294 bs->idx = (found_idx / BOOT_STATUS_SWAP_STATE_COUNT) + BOOT_STATUS_IDX_0;
295 bs->state = (found_idx % BOOT_STATUS_SWAP_STATE_COUNT) + BOOT_STATUS_STATE_0;
301 uint32_t boot_status_internal_off(const struct boot_status *bs, int elem_sz) argument
307 off = (bs->idx - BOOT_STATUS_IDX_0) * idx_sz +
308 (bs->state - BOOT_STATUS_STATE_0) * elem_sz;
456 struct boot_status *bs, const struct flash_area *fap_pri, argument
469 if (bs->state == BOOT_STATUS_STATE_0) {
484 rc = boot_write_status(state, bs);
485 bs->state = BOOT_STATUS_STATE_1;
489 if (bs->state == BOOT_STATUS_STATE_1) {
506 rc = boot_write_status(state, bs);
507 bs->idx++;
508 bs->state = BOOT_STATUS_STATE_0;
514 struct boot_status *bs, const struct flash_area *fap_pri, argument
530 if (bs->state == BOOT_STATUS_STATE_0) {
545 rc = boot_write_status(state, bs);
546 bs->state = BOOT_STATUS_STATE_1;
550 if (bs->state == BOOT_STATUS_STATE_1) {
567 rc = boot_write_status(state, bs);
568 bs->idx++;
569 bs->state = BOOT_STATUS_STATE_0;
584 void fixup_revert(const struct boot_loader_state *state, struct boot_status *bs, argument
595 if (bs->swap_type != BOOT_SWAP_TYPE_REVERT ||
596 bs->idx != BOOT_STATUS_IDX_0) {
612 rc = swap_status_init(state, fap_sec, bs);
617 void swap_run(struct boot_loader_state *state, struct boot_status *bs, argument
639 if (boot_status_is_reset(bs)) {
657 bs->swap_type = BOOT_SWAP_TYPE_NONE;
670 fixup_revert(state, bs, fap_sec);
673 if (bs->idx == BOOT_STATUS_IDX_0) {
676 if (bs->source != BOOT_STATUS_SOURCE_PRIMARY_SLOT) {
680 rc = swap_status_init(state, fap_pri, bs);
688 bs->op = BOOT_STATUS_OP_SWAP;
699 if (bs->swap_type == BOOT_SWAP_TYPE_REVERT ||
702 if (idx >= (bs->idx - BOOT_STATUS_IDX_0)) {
705 boot_swap_sectors_revert(mirror_idx, sector_sz, state, bs, fap_pri, fap_sec,
725 if (idx >= (bs->idx - BOOT_STATUS_IDX_0)) {
726 boot_swap_sectors(idx, sector_sz, state, bs, fap_pri, fap_sec,