summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRui Miguel Silva <[email protected]>2023-06-12 09:09:15 +0100
committerTom Rini <[email protected]>2023-06-19 14:34:16 -0400
commit2974e2cd287003a21d73b04ea6d11ede423db464 (patch)
tree631a22db2a0eab2ea214df85be5ad69bfa5f3bbc /include
parentacfd0ff3cf23506e7de4c4fca1c3b4b713281317 (diff)
fwu_metadata: make sure structures are packed
The fwu metadata in the metadata partitions should/are packed to guarantee that the info is correct in all platforms. Also the size of them are used to calculate the crc32 and that is important to get it right. Signed-off-by: Rui Miguel Silva <[email protected]> Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/fwu_mdata.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/fwu_mdata.h b/include/fwu_mdata.h
index 8fda4f4ac22..56189e2f40a 100644
--- a/include/fwu_mdata.h
+++ b/include/fwu_mdata.h
@@ -6,6 +6,7 @@
#if !defined _FWU_MDATA_H_
#define _FWU_MDATA_H_
+#include <linux/compiler_attributes.h>
#include <efi.h>
/**
@@ -22,7 +23,7 @@ struct fwu_image_bank_info {
efi_guid_t image_uuid;
uint32_t accepted;
uint32_t reserved;
-};
+} __packed;
/**
* struct fwu_image_entry - information for a particular type of image
@@ -38,7 +39,7 @@ struct fwu_image_entry {
efi_guid_t image_type_uuid;
efi_guid_t location_uuid;
struct fwu_image_bank_info img_bank_info[CONFIG_FWU_NUM_BANKS];
-};
+} __packed;
/**
* struct fwu_mdata - FWU metadata structure for multi-bank updates
@@ -62,6 +63,6 @@ struct fwu_mdata {
uint32_t previous_active_index;
struct fwu_image_entry img_entry[CONFIG_FWU_NUM_IMAGES_PER_BANK];
-};
+} __packed;
#endif /* _FWU_MDATA_H_ */