diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/s390')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h | 38 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h | 26 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h | 38 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/sigcontextinfo.h | 16 |
5 files changed, 52 insertions, 92 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h b/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h deleted file mode 100644 index 47ab8f3..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-32/profil-counter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Low-level statistical profiling support function. Linux/s390 version. - Copyright (C) 2000-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> -#include <sigcontextinfo.h> - -static void -__profil_counter (int signo, SIGCONTEXT scp) -{ - profil_count((void *) ((unsigned long) GET_PC (scp) & 0x7fffffffUL)); -} diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h b/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h index bd69e8d..0ad389d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/register-dump.h @@ -45,7 +45,7 @@ hexvalue (unsigned long int value, char *buf, size_t len) } static void -register_dump (int fd, struct sigcontext *ctx) +register_dump (int fd, struct ucontext_t *ctx) { char regs[19][8]; struct iovec iov[40]; @@ -61,24 +61,24 @@ register_dump (int fd, struct sigcontext *ctx) ++nr /* Generate strings of register contents. */ - hexvalue (ctx->sregs->regs.gprs[0], regs[0], 8); - hexvalue (ctx->sregs->regs.gprs[1], regs[1], 8); - hexvalue (ctx->sregs->regs.gprs[2], regs[2], 8); - hexvalue (ctx->sregs->regs.gprs[3], regs[3], 8); - hexvalue (ctx->sregs->regs.gprs[4], regs[4], 8); - hexvalue (ctx->sregs->regs.gprs[5], regs[5], 8); - hexvalue (ctx->sregs->regs.gprs[6], regs[6], 8); - hexvalue (ctx->sregs->regs.gprs[7], regs[7], 8); - hexvalue (ctx->sregs->regs.gprs[8], regs[8], 8); - hexvalue (ctx->sregs->regs.gprs[9], regs[9], 8); - hexvalue (ctx->sregs->regs.gprs[10], regs[10], 8); - hexvalue (ctx->sregs->regs.gprs[11], regs[11], 8); - hexvalue (ctx->sregs->regs.gprs[12], regs[12], 8); - hexvalue (ctx->sregs->regs.gprs[13], regs[13], 8); - hexvalue (ctx->sregs->regs.gprs[14], regs[14], 8); - hexvalue (ctx->sregs->regs.gprs[15], regs[15], 8); - hexvalue (ctx->sregs->regs.psw.mask, regs[16], 8); - hexvalue (ctx->sregs->regs.psw.addr, regs[17], 8); + hexvalue (ctx->uc_mcontext.gregs[0], regs[0], 8); + hexvalue (ctx->uc_mcontext.gregs[1], regs[1], 8); + hexvalue (ctx->uc_mcontext.gregs[2], regs[2], 8); + hexvalue (ctx->uc_mcontext.gregs[3], regs[3], 8); + hexvalue (ctx->uc_mcontext.gregs[4], regs[4], 8); + hexvalue (ctx->uc_mcontext.gregs[5], regs[5], 8); + hexvalue (ctx->uc_mcontext.gregs[6], regs[6], 8); + hexvalue (ctx->uc_mcontext.gregs[7], regs[7], 8); + hexvalue (ctx->uc_mcontext.gregs[8], regs[8], 8); + hexvalue (ctx->uc_mcontext.gregs[9], regs[9], 8); + hexvalue (ctx->uc_mcontext.gregs[10], regs[10], 8); + hexvalue (ctx->uc_mcontext.gregs[11], regs[11], 8); + hexvalue (ctx->uc_mcontext.gregs[12], regs[12], 8); + hexvalue (ctx->uc_mcontext.gregs[13], regs[13], 8); + hexvalue (ctx->uc_mcontext.gregs[14], regs[14], 8); + hexvalue (ctx->uc_mcontext.gregs[15], regs[15], 8); + hexvalue (ctx->uc_mcontext.psw.mask, regs[16], 8); + hexvalue (ctx->uc_mcontext.psw.addr, regs[17], 8); /* Generate the output. */ ADD_STRING ("Register dump:\n\n GPR0: "); diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h b/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h deleted file mode 100644 index 41301af..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/profil-counter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Low-level statistical profiling support function. Linux/s390 version. - Copyright (C) 2000-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <signal.h> -#include <sigcontextinfo.h> - -static void -__profil_counter (int signo, SIGCONTEXT scp) -{ - profil_count ((void *) GET_PC (scp)); -} diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h b/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h index f3af16b..a005167 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/register-dump.h @@ -48,7 +48,7 @@ hexvalue (unsigned long int value, char *buf, size_t len) } static void -register_dump (int fd, struct sigcontext *ctx) +register_dump (int fd, struct ucontext_t *ctx) { char regs[19][16]; struct iovec iov[40]; @@ -64,24 +64,24 @@ register_dump (int fd, struct sigcontext *ctx) ++nr /* Generate strings of register contents. */ - hexvalue (ctx->sregs->regs.gprs[0], regs[0], 16); - hexvalue (ctx->sregs->regs.gprs[1], regs[1], 16); - hexvalue (ctx->sregs->regs.gprs[2], regs[2], 16); - hexvalue (ctx->sregs->regs.gprs[3], regs[3], 16); - hexvalue (ctx->sregs->regs.gprs[4], regs[4], 16); - hexvalue (ctx->sregs->regs.gprs[5], regs[5], 16); - hexvalue (ctx->sregs->regs.gprs[6], regs[6], 16); - hexvalue (ctx->sregs->regs.gprs[7], regs[7], 16); - hexvalue (ctx->sregs->regs.gprs[8], regs[8], 16); - hexvalue (ctx->sregs->regs.gprs[9], regs[9], 16); - hexvalue (ctx->sregs->regs.gprs[10], regs[10], 16); - hexvalue (ctx->sregs->regs.gprs[11], regs[11], 16); - hexvalue (ctx->sregs->regs.gprs[12], regs[12], 16); - hexvalue (ctx->sregs->regs.gprs[13], regs[13], 16); - hexvalue (ctx->sregs->regs.gprs[14], regs[14], 16); - hexvalue (ctx->sregs->regs.gprs[15], regs[15], 16); - hexvalue (ctx->sregs->regs.psw.mask, regs[16], 16); - hexvalue (ctx->sregs->regs.psw.addr, regs[17], 16); + hexvalue (ctx->uc_mcontext.gregs[0], regs[0], 16); + hexvalue (ctx->uc_mcontext.gregs[1], regs[1], 16); + hexvalue (ctx->uc_mcontext.gregs[2], regs[2], 16); + hexvalue (ctx->uc_mcontext.gregs[3], regs[3], 16); + hexvalue (ctx->uc_mcontext.gregs[4], regs[4], 16); + hexvalue (ctx->uc_mcontext.gregs[5], regs[5], 16); + hexvalue (ctx->uc_mcontext.gregs[6], regs[6], 16); + hexvalue (ctx->uc_mcontext.gregs[7], regs[7], 16); + hexvalue (ctx->uc_mcontext.gregs[8], regs[8], 16); + hexvalue (ctx->uc_mcontext.gregs[9], regs[9], 16); + hexvalue (ctx->uc_mcontext.gregs[10], regs[10], 16); + hexvalue (ctx->uc_mcontext.gregs[11], regs[11], 16); + hexvalue (ctx->uc_mcontext.gregs[12], regs[12], 16); + hexvalue (ctx->uc_mcontext.gregs[13], regs[13], 16); + hexvalue (ctx->uc_mcontext.gregs[14], regs[14], 16); + hexvalue (ctx->uc_mcontext.gregs[15], regs[15], 16); + hexvalue (ctx->uc_mcontext.psw.mask, regs[16], 16); + hexvalue (ctx->uc_mcontext.psw.addr, regs[17], 16); /* Generate the output. */ ADD_STRING ("Register dump:\n\n GPR0: "); diff --git a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h index 6f911fe..576dc61 100644 --- a/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h +++ b/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h @@ -16,7 +16,19 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef _SIGCONTEXTINFO_H +#define _SIGCONTEXTINFO_H + #include <signal.h> -#define SIGCONTEXT struct sigcontext * -#define GET_PC(ctx) ((void *)((ctx)->sregs->regs.psw.addr)) +static inline uintptr_t +sigcontext_get_pc (const ucontext_t *ctx) +{ +#ifdef __s390x__ + return ctx->uc_mcontext.psw.addr; +#else + return ctx->uc_mcontext.psw.addr & 0x7FFFFFFF; +#endif +} + +#endif |