Lines Matching refs:ab_data
172 AvbABData* ab_data, in load_metadata() argument
176 io_ret = ab_ops->read_ab_metadata(ab_ops, ab_data); in load_metadata()
181 *ab_data_orig = *ab_data; in load_metadata()
187 slot_normalize(&ab_data->slots[0]); in load_metadata()
188 slot_normalize(&ab_data->slots[1]); in load_metadata()
196 AvbABData* ab_data, in save_metadata_if_changed() argument
198 if (avb_safe_memcmp(ab_data, ab_data_orig, sizeof(AvbABData)) != 0) { in save_metadata_if_changed()
200 return ab_ops->write_ab_metadata(ab_ops, ab_data); in save_metadata_if_changed()
214 AvbABData ab_data, ab_data_orig; in avb_ab_flow() local
219 io_ret = load_metadata(ab_ops, &ab_data, &ab_data_orig); in avb_ab_flow()
230 if (slot_is_bootable(&ab_data.slots[n])) { in avb_ab_flow()
294 slot_set_unbootable(&ab_data.slots[n]); in avb_ab_flow()
299 if (slot_is_bootable(&ab_data.slots[0]) && in avb_ab_flow()
300 slot_is_bootable(&ab_data.slots[1])) { in avb_ab_flow()
301 if (ab_data.slots[1].priority > ab_data.slots[0].priority) { in avb_ab_flow()
306 } else if (slot_is_bootable(&ab_data.slots[0])) { in avb_ab_flow()
308 } else if (slot_is_bootable(&ab_data.slots[1])) { in avb_ab_flow()
373 if (!ab_data.slots[slot_index_to_boot].successful_boot && in avb_ab_flow()
374 ab_data.slots[slot_index_to_boot].tries_remaining > 0) { in avb_ab_flow()
375 ab_data.slots[slot_index_to_boot].tries_remaining -= 1; in avb_ab_flow()
379 io_ret = save_metadata_if_changed(ab_ops, &ab_data, &ab_data_orig); in avb_ab_flow()
411 AvbABData ab_data, ab_data_orig; in avb_ab_mark_slot_active() local
417 ret = load_metadata(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_active()
423 ab_data.slots[slot_number].priority = AVB_AB_MAX_PRIORITY; in avb_ab_mark_slot_active()
424 ab_data.slots[slot_number].tries_remaining = AVB_AB_MAX_TRIES_REMAINING; in avb_ab_mark_slot_active()
425 ab_data.slots[slot_number].successful_boot = 0; in avb_ab_mark_slot_active()
429 if (ab_data.slots[other_slot_number].priority == AVB_AB_MAX_PRIORITY) { in avb_ab_mark_slot_active()
430 ab_data.slots[other_slot_number].priority = AVB_AB_MAX_PRIORITY - 1; in avb_ab_mark_slot_active()
437 ret = save_metadata_if_changed(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_active()
444 AvbABData ab_data, ab_data_orig; in avb_ab_mark_slot_unbootable() local
449 ret = load_metadata(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_unbootable()
454 slot_set_unbootable(&ab_data.slots[slot_number]); in avb_ab_mark_slot_unbootable()
460 ret = save_metadata_if_changed(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_unbootable()
467 AvbABData ab_data, ab_data_orig; in avb_ab_mark_slot_successful() local
472 ret = load_metadata(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_successful()
477 if (!slot_is_bootable(&ab_data.slots[slot_number])) { in avb_ab_mark_slot_successful()
483 ab_data.slots[slot_number].tries_remaining = 0; in avb_ab_mark_slot_successful()
484 ab_data.slots[slot_number].successful_boot = 1; in avb_ab_mark_slot_successful()
490 ret = save_metadata_if_changed(ab_ops, &ab_data, &ab_data_orig); in avb_ab_mark_slot_successful()