1 /* SPDX-License-Identifier: BSD-2-Clause */
3 * Copyright (C) 2017 The Android Open Source Project
11 /* Android standard boot slot names are 'a', 'b', 'c', ... */
12 #define BOOT_SLOT_NAME(slot_num) ('a' + (slot_num))
18 * Select the slot where to boot from.
20 * On Android devices with more than one boot slot (multiple copies of the
21 * kernel and system images) selects which slot should be used to boot from and
22 * registers the boot attempt. This is used in by the new A/B update model where
23 * one slot is updated in the background while running from the other slot. If
24 * the selected slot did not successfully boot in the past, a boot attempt is
25 * registered before returning from this function so it isn't selected
28 * @param[in] dev_desc Place to store the device description pointer
29 * @param[in] part_info Place to store the partition information
30 * @return The slot number (>= 0) on success, or a negative on error
32 int ab_select_slot(struct blk_desc *dev_desc, disk_partition_t *part_info);
34 #endif /* __ANDROID_AB_H */