Skip to content

Commit

Permalink
fix: Align an element inside a packed struct
Browse files Browse the repository at this point in the history
The compiler issues errors when trying to get the reference of elements of
packed structs since it might result in unaligned pointer values.
As such we forced the elements in question to be aligned inside the struct.

Signed-off-by: Miguel Silva <miguelafsilva5@gmail.com>
  • Loading branch information
miguelafsilva5 authored and DavidMCerdeira committed May 23, 2024
1 parent 8883953 commit d2d208f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/armv8/inc/arch/psci.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct psci_off_state {
uint64_t vttbr_el2;
uint64_t wakeup_reason;
paddr_t flat_map;
struct gicc_state gicc_state;
struct gicc_state gicc_state __attribute__((aligned(8)));
} __attribute__((packed, aligned(8)));

enum wakeup_reason {
Expand Down

0 comments on commit d2d208f

Please sign in to comment.