]> git.ipfire.org Git - thirdparty/glibc.git/commit
s390: Set psw addr field in getcontext and friends.
authorStefan Liebler <stli@linux.ibm.com>
Fri, 15 Dec 2023 08:26:40 +0000 (09:26 +0100)
committerStefan Liebler <stli@linux.ibm.com>
Tue, 19 Dec 2023 10:00:19 +0000 (11:00 +0100)
commit664f565f9caa26bb128bad7d7050cf0f0b9c6322
treeb26446bc1d347bc0c858f28d17545b00df308cbf
parente957308723ac2e55dad360d602298632980bbd38
s390: Set psw addr field in getcontext and friends.

So far if the ucontext structure was obtained by getcontext and co,
the return address was stored in general purpose register 14 as
it is defined as return address in the ABI.

In contrast, the context passed to a signal handler contains the address
in psw.addr field.

If somebody e.g. wants to dump the address of the context, the origin
needs to be known.

Now this patch adjusts getcontext and friends and stores the return address
also in psw.addr field.

Note that setcontext isn't adjusted and it is not supported to pass a
ucontext structure from signal-handler to setcontext.  We are not able to
restore all registers and branching to psw.addr without clobbering one
register.
sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
sysdeps/unix/sysv/linux/s390/s390-32/makecontext.c
sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/makecontext.c
sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S