arch/arm64: generate error if context size is not aligned to 16bytes

Make sure the registers context size is aligned to 16bytes as required by armv8-a.
This issue has been reported earlier, thus make sense to make sure it won't happen in future.

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu
2025-02-05 11:01:38 +08:00
committed by archer
parent f9d8cdcca2
commit ca92c208c1
+4
View File
@@ -228,6 +228,10 @@
#define XCPTCONTEXT_REGS (ARM64_CONTEXT_REGS + FPU_CONTEXT_REGS)
#define XCPTCONTEXT_SIZE (8 * XCPTCONTEXT_REGS)
#if XCPTCONTEXT_SIZE % 16 != 0
# error "ARM64_CONTEXT_REGS and FPU_CONTEXT_REGS must be an even number to ensure the stack is aligned to 16 bytes"
#endif
/* Friendly register names */
#define REG_FP REG_X29