Skip to content

Commit 1b53457

Browse files
committed
Using C layout for RegisterBlock structs
Rust representation doesn't even guarantee keeping the order, I've found some registers in the wrong place and this fixed it.
1 parent d0a0c21 commit 1b53457

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/generate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ fn register_block(registers: &[Register], defs: &Defaults) -> Result<Tokens> {
309309

310310
Ok(quote! {
311311
/// Register block
312+
#[repr(C)]
312313
pub struct RegisterBlock {
313314
#(#fields)*
314315
}

0 commit comments

Comments
 (0)