From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Tomsich Date: Tue, 07 Nov 2017 15:18:47 +0100 Subject: [U-Boot] [U-Boot, v5, 13/18] arm: provide a PCS-compliant setjmp implementation In-Reply-To: <1507645279-25188-14-git-send-email-philipp.tomsich@theobroma-systems.com> References: <1507645279-25188-14-git-send-email-philipp.tomsich@theobroma-systems.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > The previous setjmp-implementation (as a static inline function that > contained an 'asm volatile' sequence) was extremely fragile: (some > versions of) GCC optimised the set of registers. One critical example > was the removal of 'r9' from the clobber list, if -ffixed-reg9 was > supplied. > > To increase robustness and ensure PCS-compliant behaviour, the setjmp > and longjmp implementation are now in assembly and closely match what > one would expect to find in a libc implementation. > > Signed-off-by: Philipp Tomsich > Tested-by: Andy Yan > --- > > Changes in v5: None > Changes in v4: None > Changes in v3: > - converted setjmp/longjmp from inline-assembly to separate .S files > to improve predicatability if emitted code > > Changes in v2: None > > arch/arm/include/asm/setjmp.h | 94 ++++++------------------------------------- > arch/arm/lib/Makefile | 6 +++ > arch/arm/lib/setjmp.S | 37 +++++++++++++++++ > arch/arm/lib/setjmp_aarch64.S | 42 +++++++++++++++++++ > 4 files changed, 98 insertions(+), 81 deletions(-) > create mode 100644 arch/arm/lib/setjmp.S > create mode 100644 arch/arm/lib/setjmp_aarch64.S > Applied to u-boot-rockchip/next, thanks!