]> 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>
Tue, 22 Feb 2022 17:28:46 +0000 (17:28 +0000)
commit9e7e5fda38471e00d1190479ea91d7b08ae3e304
tree7a811ee404068f85a8bc877c029daaa1f04c0793
parentfdc1ae67fef27eea1445bab4bdfe2f0fb3bc7aa1
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.
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.042228 seconds and 5 git commands to generate.