summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h b/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
index 0b682c75ef..97a84726a1 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2018 Free Software Foundation, Inc.
+/* Copyright (C) 1998-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
@@ -13,9 +13,21 @@
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/>. */
+ <https://www.gnu.org/licenses/>. */
+
+#ifndef _SIGCONTEXTINFO_H
+#define _SIGCONTEXTINFO_H
#include <signal.h>
-#define SIGCONTEXT struct sigcontext *
-#define GET_PC(ctx) ((void *)((ctx)->regs->nip))
+static inline uintptr_t
+sigcontext_get_pc (const ucontext_t *ctx)
+{
+#ifdef __powerpc64__
+ return ctx->uc_mcontext.gp_regs[PT_NIP];
+#else
+ return ctx->uc_mcontext.uc_regs->gregs[PT_NIP];
+#endif
+}
+
+#endif