From 35f427c8cc79d941e3249ed729b7ba63974ae588 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 10 Jan 2023 21:02:09 +0100 Subject: [PATCH] xtensa: use 8-byte alignment This is probably not necessary on Espressif chips, but let's strictly follow the ABI to be sure. --- src/runtime/arch_xtensa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/arch_xtensa.go b/src/runtime/arch_xtensa.go index 2bb58476..03ca8c65 100644 --- a/src/runtime/arch_xtensa.go +++ b/src/runtime/arch_xtensa.go @@ -9,9 +9,9 @@ const TargetBits = 32 const deferExtraRegs = 0 -// Align on a word boundary. +// The largest alignment according to the Xtensa ABI is 8 (long long, double). func align(ptr uintptr) uintptr { - return (ptr + 3) &^ 3 + return (ptr + 7) &^ 7 } func getCurrentStackPointer() uintptr {