[PATCH] score/aarch64: Align context validation frame
Gedare Bloom
gedare at rtems.org
Mon Apr 12 18:51:09 UTC 2021
On Fri, Apr 9, 2021 at 4:34 PM Kinsey Moore <kinsey.moore at oarcorp.com> wrote:
>
> Ensure the stack remains aligned when validating the context frame to
> avoid stack alignment exceptions.
> ---
the commit message is a little vague,
> .../cpu/aarch64/aarch64-context-validate.S | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/cpukit/score/cpu/aarch64/aarch64-context-validate.S b/cpukit/score/cpu/aarch64/aarch64-context-validate.S
> index 57f634934b..fb4fbd6379 100644
> --- a/cpukit/score/cpu/aarch64/aarch64-context-validate.S
> +++ b/cpukit/score/cpu/aarch64/aarch64-context-validate.S
> @@ -54,18 +54,18 @@
> #define FRAME_OFFSET_LR 0x40
>
> #ifdef AARCH64_MULTILIB_VFP
> - #define FRAME_OFFSET_V8 0x48
> - #define FRAME_OFFSET_V9 0x58
> - #define FRAME_OFFSET_V10 0x68
> - #define FRAME_OFFSET_V11 0x78
> - #define FRAME_OFFSET_V12 0x88
> - #define FRAME_OFFSET_V13 0x98
> - #define FRAME_OFFSET_V14 0xA8
> - #define FRAME_OFFSET_V15 0xB8
> + #define FRAME_OFFSET_V8 0x50
if this has an adjustment because of alignment, then a comment should
be included. If someone changes something earlier in the structure
(unlikely, but still) that would make a problem here if the alignment
padding changes from 2B to something else.
> + #define FRAME_OFFSET_V9 0x60
> + #define FRAME_OFFSET_V10 0x70
> + #define FRAME_OFFSET_V11 0x80
> + #define FRAME_OFFSET_V12 0x90
> + #define FRAME_OFFSET_V13 0xA0
> + #define FRAME_OFFSET_V14 0xB0
> + #define FRAME_OFFSET_V15 0xC0
>
> #define FRAME_SIZE (FRAME_OFFSET_V15 + 0x10)
> #else
> - #define FRAME_SIZE (FRAME_OFFSET_LR + 0x08)
> + #define FRAME_SIZE (FRAME_OFFSET_LR + 0x10)
> #endif
>
> .section .text
> --
> 2.20.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list