mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-18 01:04:56 +08:00
The SSE part of the interrupt prologue saves the unit state with fxsave, which faults with a general protection exception unless its operand is 16 byte aligned. FRM_SIZ is a multiple of 16, so subtracting it keeps the alignment of the interrupted stack pointer without establishing it, and the stack pointer of an interrupted context is not necessarily aligned. The stack is aligned further down for the C calls, which is after the fxsave. Align the frame right after it is allocated. The original stack pointer is already in eax at that point and is stored to ESP_OFF as before, so the epilogue is unchanged. This affects the BSP variants built with SSE. Without it psxfenv01 terminates with an exception on pc586-sse as soon as it raises a floating point exception. Update #5696. Assisted-by: Claude:claude-opus-5 claude-code Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>