aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-03-20 03:56:35 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-03-20 03:56:35 +0000
commite59329323b7ed941a9d10bb8df976a7320ba98ae (patch)
treea9541dc5e436bcbef78546e88ecb49c2e9eb7e77
parentae82a802374b63e3b0bc22c99104c3c120ede797 (diff)
parent9009e0c22e578bbf0ed974a6d7924a2ece8bf635 (diff)
downloadu-boot-nougat-iot-release.tar.gz
Change-Id: Ia5edf5be6dd7f1f78c20ff9ad9f63d7fd4672799
-rw-r--r--common/android_ab.c2
-rw-r--r--include/android_ab.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/common/android_ab.c b/common/android_ab.c
index cfbf5301a5..4a690c8db3 100644
--- a/common/android_ab.c
+++ b/common/android_ab.c
@@ -39,7 +39,7 @@ void android_boot_control_default(struct android_bootloader_control *abc)
memcpy(abc->slot_suffix, "a\0\0\0", 4);
abc->magic = ANDROID_BOOT_CTRL_MAGIC;
abc->version = ANDROID_BOOT_CTRL_VERSION;
- abc->nb_slot = ARRAY_SIZE(abc->slot_info);
+ abc->nb_slot = ANDROID_NUM_SLOTS;
memset(abc->reserved0, 0, sizeof(abc->reserved0));
for (i = 0; i < abc->nb_slot; ++i) {
abc->slot_info[i] = metadata;
diff --git a/include/android_ab.h b/include/android_ab.h
index c264e9b948..e590f8fa33 100644
--- a/include/android_ab.h
+++ b/include/android_ab.h
@@ -12,6 +12,9 @@
/* Android standard boot slot names are 'a', 'b', 'c', ... */
#define ANDROID_BOOT_SLOT_NAME(slot_num) ('a' + (slot_num))
+/* Number of slots */
+#define ANDROID_NUM_SLOTS 2
+
/** android_ab_select - Select the slot where to boot from.
* On Android devices with more than one boot slot (multiple copies of the
* kernel and system images) selects which slot should be used to boot from and