diff mbox series

[RFC,04/14] efi_loader: correct a definition of struct efi_capsule_header

Message ID 20200317021247.5849-5-takahiro.akashi@linaro.org
State Accepted, archived
Commit 74b44875357378c83e4bd150c0b759ca6ae6563a
Headers show
Series efi_loader: add capsule update support | expand

Commit Message

Takahiro Akashi March 17, 2020, 2:12 a.m. UTC
See UEFI specification, section 8.5.3.
In addition, the structure, efi_capsule_header, should be "packed"
as it is a serialized binary format in a capsule file.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 include/efi_api.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Heinrich Schuchardt March 17, 2020, 7:25 a.m. UTC | #1
On 3/17/20 3:12 AM, AKASHI Takahiro wrote:
> See UEFI specification, section 8.5.3.
> In addition, the structure, efi_capsule_header, should be "packed"
> as it is a serialized binary format in a capsule file.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Fixes: 0c2307431e6e ("efi_loader: add missing runtime services stubs")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>   include/efi_api.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/efi_api.h b/include/efi_api.h
> index a99cc7acc475..4040c44855fa 100644
> --- a/include/efi_api.h
> +++ b/include/efi_api.h
> @@ -218,11 +218,11 @@ enum efi_reset_type {
>   #define CAPSULE_FLAGS_INITIATE_RESET		0x00040000
>
>   struct efi_capsule_header {
> -	efi_guid_t *capsule_guid;
> +	efi_guid_t capsule_guid;
>   	u32 header_size;
>   	u32 flags;
>   	u32 capsule_image_size;
> -};
> +} __packed;
>
>   #define EFI_RT_SUPPORTED_GET_TIME			0x0001
>   #define EFI_RT_SUPPORTED_SET_TIME			0x0002
>
Heinrich Schuchardt March 18, 2020, 6:03 p.m. UTC | #2
On 3/17/20 3:12 AM, AKASHI Takahiro wrote:
> See UEFI specification, section 8.5.3.
> In addition, the structure, efi_capsule_header, should be "packed"
> as it is a serialized binary format in a capsule file.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Merged into U-Boot master.

Best regards

Heinrich
diff mbox series

Patch

diff --git a/include/efi_api.h b/include/efi_api.h
index a99cc7acc475..4040c44855fa 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -218,11 +218,11 @@  enum efi_reset_type {
 #define CAPSULE_FLAGS_INITIATE_RESET		0x00040000
 
 struct efi_capsule_header {
-	efi_guid_t *capsule_guid;
+	efi_guid_t capsule_guid;
 	u32 header_size;
 	u32 flags;
 	u32 capsule_image_size;
-};
+} __packed;
 
 #define EFI_RT_SUPPORTED_GET_TIME			0x0001
 #define EFI_RT_SUPPORTED_SET_TIME			0x0002