Correctly align program stacks (#1133)

* Properly align program stacks

* Enforce size being a multiple of 8 bytes

* Correct alignment calculation

* Use an ALIGN8 macro in the stack declaration macro
This commit is contained in:
Tharo
2022-02-06 18:00:01 +00:00
committed by GitHub
parent b41489c443
commit cf048f849a
8 changed files with 38 additions and 30 deletions
+8
View File
@@ -49,6 +49,14 @@
#define Z_PRIORITY_DMAMGR 16
#define Z_PRIORITY_IRQMGR 17
#define ALIGN8(val) (((val) + 7) & ~7)
#define STACK(stack, size) \
u64 stack[ALIGN8(size) / sizeof(u64)]
#define STACK_TOP(stack) \
((u8*)(stack) + sizeof(stack))
// NOTE: Once we start supporting other builds, this can be changed with an ifdef
#define REGION_NATIVE REGION_EU