u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Rui Miguel Silva <rui.silva@linaro.org>
To: u-boot@lists.denx.de
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Rui Miguel Silva <rui.silva@linaro.org>
Subject: [PATCH 1/6] fwu_metadata: make sure structures are packed
Date: Tue,  2 May 2023 14:11:55 +0100	[thread overview]
Message-ID: <20230502131200.2551513-2-rui.silva@linaro.org> (raw)
In-Reply-To: <20230502131200.2551513-1-rui.silva@linaro.org>

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 <rui.silva@linaro.org>
---
 include/fwu_mdata.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/fwu_mdata.h b/include/fwu_mdata.h
index 8fda4f4ac225..c61221a91735 100644
--- a/include/fwu_mdata.h
+++ b/include/fwu_mdata.h
@@ -22,7 +22,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 +38,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 +62,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_ */
-- 
2.40.0


  reply	other threads:[~2023-05-02 13:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 13:11 [PATCH 0/6] corstone1000: fwu metadata and GPT Rui Miguel Silva
2023-05-02 13:11 ` Rui Miguel Silva [this message]
2023-05-03  8:06   ` [PATCH 1/6] fwu_metadata: make sure structures are packed Ilias Apalodimas
2023-05-29  8:48     ` Heinrich Schuchardt
2023-05-29 13:12       ` Rui Miguel Silva
2023-05-29 13:18         ` Ilias Apalodimas
2023-05-29 13:47           ` Rui Miguel Silva
2023-05-02 13:11 ` [PATCH 2/6] nvmxip: move header to include Rui Miguel Silva
2023-05-29  8:51   ` Heinrich Schuchardt
2023-05-29 13:13     ` Rui Miguel Silva
2023-05-02 13:11 ` [PATCH 3/6] corstone1000: add fwu-metadata store info Rui Miguel Silva
2023-05-02 13:11 ` [PATCH 4/6] corstone1000: add boot index Rui Miguel Silva
2023-05-02 13:11 ` [PATCH 5/6] corstone1000: set kernel_addr based on boot_idx Rui Miguel Silva
2023-05-02 13:12 ` [PATCH 6/6] corstone1000: add nvmxip, fwu-mdata and gpt options Rui Miguel Silva
2023-05-15 13:27 ` [PATCH 0/6] corstone1000: fwu metadata and GPT Rui Miguel Silva
2023-05-29  8:39   ` Rui Miguel Silva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230502131200.2551513-2-rui.silva@linaro.org \
    --to=rui.silva@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).