summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Campbell <leecam@google.com>2016-06-15 17:55:52 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-15 17:55:52 +0000
commit1401b19577472d51fdb29495d9a2aee55486773a (patch)
tree4464a7ea06d1f2d81ddaa4015ad17788bc6a76ef
parent2f9f1e276cf9bc178c8cd2ad2b97d3eac8d2dd74 (diff)
parent180fd6f2baf51cc437c8ba84b053b2b9ed2cca11 (diff)
downloadintel-1401b19577472d51fdb29495d9a2aee55486773a.tar.gz
Fix A/B slot_suffix location
am: 180fd6f2ba Change-Id: I2c26ef5e36db54bdb2e1a2b2153b0e5e2c73feef
-rw-r--r--peripheral/bootctrl/bootctrl.c6
-rw-r--r--peripheral/bootctrl/bootctrl.h12
-rw-r--r--peripheral/bootctrl/hal.mk1
3 files changed, 11 insertions, 8 deletions
diff --git a/peripheral/bootctrl/bootctrl.c b/peripheral/bootctrl/bootctrl.c
index 9e8626b..8d6feb9 100644
--- a/peripheral/bootctrl/bootctrl.c
+++ b/peripheral/bootctrl/bootctrl.c
@@ -207,7 +207,7 @@ int bootctrl_mark_boot_successful(boot_control_module_t *module __unused)
{
int ret, slot;
boot_ctrl_t metadata;
- slot_metadata_t *slotp;
+ slot_metadata_intel_t *slotp;
ret = bootctrl_read_metadata(&metadata);
if (ret < 0) {
@@ -233,7 +233,7 @@ int bootctrl_set_active_boot_slot(boot_control_module_t *module __unused,
{
int ret, slot2;
boot_ctrl_t metadata;
- slot_metadata_t *slotp;
+ slot_metadata_intel_t *slotp;
if (slot >= 2) {
fprintf(stderr, "Wrong Slot value %u\n", slot);
@@ -273,7 +273,7 @@ int bootctrl_set_slot_as_unbootable(boot_control_module_t *module __unused,
{
int ret;
boot_ctrl_t metadata;
- slot_metadata_t *slotp;
+ slot_metadata_intel_t *slotp;
if (slot >= 2) {
fprintf(stderr, "Wrong Slot value %u\n", slot);
diff --git a/peripheral/bootctrl/bootctrl.h b/peripheral/bootctrl/bootctrl.h
index 8febd4f..4e2fc11 100644
--- a/peripheral/bootctrl/bootctrl.h
+++ b/peripheral/bootctrl/bootctrl.h
@@ -21,9 +21,11 @@
#include <stdint.h>
+#include <bootloader.h>
+
/* struct boot_ctrl occupies the slot_suffix field of
- * struct bootloader_message */
-#define OFFSETOF_SLOT_SUFFIX 864
+ * struct bootloader_message_ab */
+#define OFFSETOF_SLOT_SUFFIX offsetof(struct bootloader_message_ab, slot_suffix)
#define BOOTCTRL_MAGIC 0x42424100
#define BOOTCTRL_SUFFIX_A "_a"
@@ -31,11 +33,11 @@
#define BOOT_CONTROL_VERSION 1
-typedef struct slot_metadata {
+typedef struct slot_metadata_intel {
uint8_t priority : 4;
uint8_t tries_remaining : 3;
uint8_t successful_boot : 1;
-} slot_metadata_t;
+} slot_metadata_intel_t;
typedef struct boot_ctrl {
/* Magic for identification - '\0ABB' (Boot Contrl Magic) */
@@ -45,7 +47,7 @@ typedef struct boot_ctrl {
uint8_t version;
/* Information about each slot. */
- slot_metadata_t slot_info[2];
+ slot_metadata_intel_t slot_info[2];
uint8_t recovery_tries_remaining;
} boot_ctrl_t;
diff --git a/peripheral/bootctrl/hal.mk b/peripheral/bootctrl/hal.mk
index cb18a78..ad7dd45 100644
--- a/peripheral/bootctrl/hal.mk
+++ b/peripheral/bootctrl/hal.mk
@@ -19,6 +19,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := bootctrl.$(TARGET_DEVICE)
LOCAL_MODULE_RELATIVE_PATH := hw
LOCAL_SRC_FILES := bootctrl.c
+LOCAL_C_INCLUDES += bootable/recovery/
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)