mirror of
https://github.com/zeldaret/oot
synced 2026-08-02 00:24:08 -04:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user