Skip to content

Commit

Permalink
Kernel/aarch64: Make REGISTER_STATE_SIZE a multiple of 16 bytes
Browse files Browse the repository at this point in the history
This ensure that the stack pointer also stays 16 byte aligned. This
fixes a baremetal issue when getting an exception.
  • Loading branch information
FireFox317 authored and ADKaster committed May 15, 2023
1 parent 65ed541 commit 55e8ffd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Kernel/Arch/aarch64/vector_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@

.section .text.vector_table

#define REGISTER_STATE_SIZE 264
// NOTE: This size must be a multiple of 16 bytes, to ensure that the stack pointer
// stays 16 byte aligned.
#define REGISTER_STATE_SIZE 272
#if REGISTER_STATE_SIZE % 16 != 0
# error "REGISTER_STATE_SIZE is not a multiple of 16 bytes!"
#endif

#define SPSR_EL1_SLOT (31 * 8)
#define ELR_EL1_SLOT (32 * 8)
#define SP_EL0_SLOT (33 * 8)
Expand Down

0 comments on commit 55e8ffd

Please sign in to comment.