On Sat, Apr 2, 2016 at 5:19 AM, Patrick Wildt <patr...@blueri.se> wrote: > the Procedure Call Standard used in EABI requires the stack pointer to > be 8-byte aligned by > > * exception handlers, before calling AAPCS-conforming code. > * the OS, before giving control to an application. > > This diff makes sure our kernel interfaces adhere to that requirement. > > Can someone make sure this doesn't break armish/zaurus?
The changes to cpu_switchto(), savectx(), and switchframe seem odd; those are leaf functions, no? When would their frame layouts result in misaligned stacks for EABI-expecting code? The placement of if_pad is suspect: you're adjusting right before pushing sp, so shouldn't it be between if_sp and if_pc? If that's off then the CLKF_PC() macro will access the padding instead of the pushed pc, which would break profiling. Philip Guenther