From 5fa955f50742de512d90340cdece49ba4795e459 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 5 May 2024 03:25:08 +0800 Subject: [PATCH] fix typo, enforce alignment on the RawPage structure I think i recall somewhere that an alignment of 16 is required for certain structures in Rust for the RV32 target; since anything could be put in there, let's enforce that. --- loader/src/swap.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/src/swap.rs b/loader/src/swap.rs index 975b42b34..01ec4dee9 100644 --- a/loader/src/swap.rs +++ b/loader/src/swap.rs @@ -26,14 +26,14 @@ pub struct SwapDescriptor { #[repr(C)] pub struct SwapSourceHeader { pub version: u32, - pub parital_nonce: [u8; 8], + pub partial_nonce: [u8; 8], pub mac_offset: u32, pub aad_len: u32, // aad is limited to 64 bytes! pub aad: [u8; 64], } -#[repr(C)] +#[repr(C, align(16))] pub struct RawPage { pub data: [u8; 4096], }