public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/6] arm: provide a PCS-compliant setjmp implementation
Date: Sat, 23 Sep 2017 02:48:52 +0200	[thread overview]
Message-ID: <10f7c0bb-1e28-8f15-8bea-db207f3efbbd@suse.de> (raw)
In-Reply-To: <1505981969-49480-4-git-send-email-philipp.tomsich@theobroma-systems.com>



On 21.09.17 10:19, Philipp Tomsich wrote:
> 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.

I wouldn't call that fragile, but "works as intended". Gcc only saves 
the registers it really needs to save - and if r9 is fixed it can safely 
assume that between setjmp/longjmp it did not change.

Did you encounter other cases where it did something wrong?

> 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.

I'm personally quite indifferent on which version we take, but I 
personally found the inline asm version more readable. At least it was 
half-way self-documenting and struct offset independent ;).

But again, I really don't have strong feelings. I only wrote the inline 
asm version because we didn't have any implementation at all. If you opt 
to maintain yours, be my guest :).


Alex

  reply	other threads:[~2017-09-23  0:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21  8:19 [U-Boot] [PATCH v3 0/6] rockchip: back-to-bootrom: replace assembly-implementation with C-code Philipp Tomsich
2017-09-21  8:19 ` [U-Boot] [PATCH v3 1/6] arm: make save_boot_params_ret prototype visible for AArch64 Philipp Tomsich
2017-09-21  8:19 ` [U-Boot] [PATCH v3 2/6] arm: mark save_boot_params_ret as a function Philipp Tomsich
2017-09-21  8:19 ` [U-Boot] [PATCH v3 3/6] arm: provide a PCS-compliant setjmp implementation Philipp Tomsich
2017-09-23  0:48   ` Alexander Graf [this message]
2017-09-21  8:19 ` [U-Boot] [PATCH v3 4/6] rockchip: back-to-bootrom: replace assembly-implementation with C-code Philipp Tomsich
2017-09-21  8:19 ` [U-Boot] [PATCH v3 5/6] rockchip: back-to-bootrom: rk3188: chain from SPL via TPL to the BROM Philipp Tomsich
2017-09-21  8:19 ` [U-Boot] [PATCH v3 6/6] rockchip: back-to-bootrom: allow passing a cmd to the bootrom Philipp Tomsich
2017-09-21  9:09 ` [U-Boot] [PATCH v3 0/6] rockchip: back-to-bootrom: replace assembly-implementation with C-code Heiko Stuebner
2017-09-21  9:44   ` Heiko Stuebner
2017-09-21 10:25     ` Dr. Philipp Tomsich
2017-09-21 10:39       ` Dr. Philipp Tomsich
2017-09-21 10:44       ` Heiko Stübner
2017-09-25  8:46         ` Andy Yan
2017-09-25  8:49           ` Dr. Philipp Tomsich
2017-09-21 10:27   ` Dr. Philipp Tomsich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10f7c0bb-1e28-8f15-8bea-db207f3efbbd@suse.de \
    --to=agraf@suse.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox