Boot: Save SW component's boot satus info

Bootloader must provide certain attributes of the
authenticated SW components to the runtime SW.
These informations are included to the initial
attestation token.

Change-Id: I35f9cd4321e1f8ca776303bcb1e32d11cb5dabe6
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/bl2/include/boot_record.h b/bl2/include/boot_record.h
index f7a6308..217a206 100644
--- a/bl2/include/boot_record.h
+++ b/bl2/include/boot_record.h
@@ -11,6 +11,8 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <limits.h>
+#include "../ext/mcuboot/bootutil/include/bootutil/image.h"
+#include "../ext/mcuboot/include/flash_map/flash_map.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -31,6 +33,16 @@
 };
 
 /*!
+ * \enum boot_status_err_t
+ *
+ * \brief Return values for saving boot status information to shared memory are
+ */
+enum boot_status_err_t {
+    BOOT_STATUS_OK,
+    BOOT_STATUS_ERROR,
+};
+
+/*!
  * \brief Add a data item to the shared data area between bootloader and
  *        runtime SW
  *
@@ -47,6 +59,21 @@
                              size_t         size,
                              const uint8_t *data);
 
+/*!
+ * \brief Add an image's all boot status information to the shared data area
+ *        between bootloader and runtime SW
+ *
+ * \param[in]  sw_module  Identifier of the SW component
+ * \param[in]  hdr        Pointer to the image header stored in RAM
+ * \param[in]  fap        Pointer to the flash area where image is stored
+ *
+ * \return Returns error code as specified in \ref boot_status_err_t
+ */
+enum boot_status_err_t
+boot_save_boot_status(uint8_t sw_module,
+                      const struct image_header *hdr,
+                      const struct flash_area *fap);
+
 #ifdef __cplusplus
 }
 #endif