[U-Boot] [U-Boot, v5, 13/18] arm: provide a PCS-compliant setjmp implementation
Philipp Tomsich
philipp.tomsich at theobroma-systems.com
Tue Nov 7 14:18:47 UTC 2017
> 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 <philipp.tomsich at theobroma-systems.com>
> Tested-by: Andy Yan <andy.yan at rock-chips.com>
> ---
>
> 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!
More information about the U-Boot
mailing list