]> sourceware.org Git - glibc.git/commit
hppa: Revise gettext trampoline design
authorJohn David Anglin <danglin@gcc.gnu.org>
Tue, 22 Feb 2022 17:28:46 +0000 (17:28 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Thu, 3 Mar 2022 21:18:22 +0000 (21:18 +0000)
commitd82d9cdff40492d46f75d5d12b3c9e2ac0c422fe
tree91056c05413dfcfb5e9819108093d4ba1d0a529d
parent2631d3b3a68108661deca311c3fc159a4ce62983
hppa: Revise gettext trampoline design

The current getcontext return trampoline is overly complex and it
unnecessarily clobbers several registers.  By saving the context
pointer (r26) in the context, __getcontext_ret can restore any
registers not restored by setcontext.  This allows getcontext to
save and restore the entire register context present when getcontext
is entered.  We use the unused oR0 context slot for the return
from __getcontext_ret.

While this is not directly useful in C, it can be exploited in
assembly code.  Registers r20, r23, r24 and r25 are not clobbered
in the call path to getcontext.  This allows a small simplification
of swapcontext.

It also allows saving and restoring the 6-bit SAR register in the
LSB of the oSAR context slot.  The getcontext flag value can be
stored in the MSB of the oSAR slot.

(cherry picked from commit 9e7e5fda38471e00d1190479ea91d7b08ae3e304)
sysdeps/unix/sysv/linux/hppa/getcontext.S
sysdeps/unix/sysv/linux/hppa/setcontext.S
sysdeps/unix/sysv/linux/hppa/swapcontext.c
This page took 0.043048 seconds and 5 git commands to generate.