-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Reported by Andrew Boie:
We need a good method for defining stack memory regions. Right now the typical way to do it is with __stack __noinit. We may need something more generic so that we can have fine, architecture-specific control on how the stacks are declared.
For example, on x86 all the stacks are going to need to be aligned to 4096 byte boundaries, AND any given stack area should be immediately preceded by some memory which cannot be written to by the current thread. So I think we will need to position all the stacks in between rodata (which can't be written to) and the data section.
Other arches have much less in the way of constraints on the alignment/size of stacks, but the general requirement is that if the thread attempts to write RAM immediately before the stack (i.e. it overflows) we get an exception.
(Imported from Jira ZEP-2185)