Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src Pull up following revision(s) (requested by kamil in tick...



details:   https://anonhg.NetBSD.org/src/rev/7dd6c34ba88a
branches:  netbsd-8
changeset: 434654:7dd6c34ba88a
user:      snj <snj%NetBSD.org@localhost>
date:      Sun Feb 25 23:50:22 2018 +0000

description:
Pull up following revision(s) (requested by kamil in ticket #552):
        sys/arch/aarch64/include/mcontext.h: 1.2
        sys/arch/alpha/include/mcontext.h: 1.9
        sys/arch/amd64/include/mcontext.h: 1.19
        sys/arch/arm/include/mcontext.h: 1.19
        sys/arch/hppa/include/mcontext.h: 1.9
        sys/arch/i386/include/mcontext.h: 1.14
        sys/arch/ia64/include/mcontext.h: 1.6
        sys/arch/m68k/include/mcontext.h: 1.10
        sys/arch/mips/include/mcontext.h: 1.22
        sys/arch/or1k/include/mcontext.h: 1.2
        sys/arch/powerpc/include/mcontext.h: 1.18
        sys/arch/riscv/include/mcontext.h: 1.5
        sys/arch/sh3/include/mcontext.h: 1.11
        sys/arch/sparc/include/mcontext.h: 1.14-1.17
        sys/arch/sparc64/include/mcontext.h: 1.10
        sys/arch/vax/include/mcontext.h: 1.9
        tests/lib/libc/sys/Makefile: 1.50
        tests/lib/libc/sys/t_ucontext.c: 1.2
Introduce _UC_MACHINE_FP() as a macro
_UC_MACHINE_FP() is a helper macro to extract from mcontext a frame pointer.
Don't rely on this interface as a compiler might strip frame pointer or
optimize it making this interface unreliable.
For hppa assume a small frame context, for larger frames FP might be located
in a different register (4 instead of 3).
For ia64 there is no strict frame pointer, and registers might rotate.
Reuse 79 following:
  ./gcc/config/ia64/ia64.h:#define HARD_FRAME_POINTER_REGNUM  LOC_REG (79)
Once ia64 will mature, this should be revisited.
A macro can encapsulate a real function for extracting Frame Pointer on
more complex CPUs / ABIs.
For the remaining CPUs, reuse standard register as defined in appropriate ABI.
The direct users of this macro are LLVM and GCC with Sanitizers.
Proposed on tech-userlevel@.
Sponsored by <The NetBSD Foundation>
--
Improve _UC_MACHINE_FP() for SPARC/SPARC64
Introduce a static inline function _uc_machine_fp() that contains improved
caluclation of a frame pointer.
Algorithm:
  uptr *stk_ptr;
#  if defined (__arch64__)
  stk_ptr = (uptr *) (*sp + 2047);
#  else
  stk_ptr = (uptr *) *sp;
#  endif
  *bp = stk_ptr[15];
Noted by <mrg>
--
Make _UC_MACHINE_FP() compile again and fix it so that it does not add
the offset twice.
--
fix _UC_MACHINE32_FP() -- use 32 bit pointer value so that [15] is
the right offset.  do this by using __greg32_t, which is only in
the sparc64 version, and these are only useful there, so move them.
--
Add new tests in lib/libc/sys/t_ucontext
New tests:
 - ucontext_sp
 - ucontext_fp
 - ucontext_pc
 - ucontext_intrv
They test respectively:
 - _UC_MACHINE_SP
 - _UC_MACHINE_FP
 - _UC_MACHINE_PC
 - _UC_MACHINE_INTRV
These tests attempt to access and print the values from ucontext, without
interpreting the values.
This is a follow up of the _UC_MACHINE_FP() introduction.
These tests use PRIxREGISTER, and require to be built with -D_KERNTYPES.
Sponsored by <The NetBSD Foundation>

diffstat:

 sys/arch/aarch64/include/mcontext.h |   3 +-
 sys/arch/alpha/include/mcontext.h   |   3 +-
 sys/arch/amd64/include/mcontext.h   |   3 +-
 sys/arch/arm/include/mcontext.h     |   3 +-
 sys/arch/hppa/include/mcontext.h    |   3 +-
 sys/arch/i386/include/mcontext.h    |   3 +-
 sys/arch/ia64/include/mcontext.h    |   3 +-
 sys/arch/m68k/include/mcontext.h    |   3 +-
 sys/arch/mips/include/mcontext.h    |   3 +-
 sys/arch/or1k/include/mcontext.h    |   3 +-
 sys/arch/powerpc/include/mcontext.h |   3 +-
 sys/arch/riscv/include/mcontext.h   |   3 +-
 sys/arch/sh3/include/mcontext.h     |   3 +-
 sys/arch/sparc/include/mcontext.h   |  20 +++++-----
 sys/arch/sparc64/include/mcontext.h |  10 +++-
 sys/arch/vax/include/mcontext.h     |   3 +-
 tests/lib/libc/sys/Makefile         |   3 +-
 tests/lib/libc/sys/t_ucontext.c     |  68 +++++++++++++++++++++++++++++++++++-
 18 files changed, 113 insertions(+), 30 deletions(-)

diffs (truncated from 418 to 300 lines):

diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/aarch64/include/mcontext.h
--- a/sys/arch/aarch64/include/mcontext.h       Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/aarch64/include/mcontext.h       Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.1 2014/08/10 05:47:38 matt Exp $ */
+/* $NetBSD: mcontext.h,v 1.1.22.1 2018/02/25 23:50:22 snj Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -106,6 +106,7 @@
 #define        _UC_TLSBASE     0x00080000      /* see <sys/ucontext.h> */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_X29])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_X0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/alpha/include/mcontext.h
--- a/sys/arch/alpha/include/mcontext.h Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/alpha/include/mcontext.h Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.8 2012/09/12 02:00:54 manu Exp $        */
+/*     $NetBSD: mcontext.h,v 1.8.32.1 2018/02/25 23:50:22 snj Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -96,6 +96,7 @@
 #define _UC_TLSBASE    0x20    /* valid process-unique value in _REG_UNIQUE */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_S6])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_V0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/amd64/include/mcontext.h
--- a/sys/arch/amd64/include/mcontext.h Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/amd64/include/mcontext.h Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.18 2014/05/12 22:50:03 uebayasi Exp $   */
+/*     $NetBSD: mcontext.h,v 1.18.20.1 2018/02/25 23:50:22 snj Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -68,6 +68,7 @@
 
 /* AMD64 ABI 128-bytes "red zone". */
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_RSP] - 128)
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_RBP])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_RIP])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_RAX])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/arm/include/mcontext.h
--- a/sys/arch/arm/include/mcontext.h   Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/arm/include/mcontext.h   Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.18 2015/03/24 08:38:29 matt Exp $       */
+/*     $NetBSD: mcontext.h,v 1.18.10.1 2018/02/25 23:50:22 snj Exp $   */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -110,6 +110,7 @@
 #define _UC_MACHINE_PAD        1               /* Padding appended to ucontext_t */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_R11])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_R0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/hppa/include/mcontext.h
--- a/sys/arch/hppa/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/hppa/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.8 2014/02/19 13:01:51 skrll Exp $       */
+/*     $NetBSD: mcontext.h,v 1.8.22.1 2018/02/25 23:50:22 snj Exp $    */
 
 #ifndef _HPPA_MCONTEXT_H_
 #define        _HPPA_MCONTEXT_H_
@@ -50,6 +50,7 @@
 } mcontext_t;
 
 #define        _UC_MACHINE_SP(uc)      ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define        _UC_MACHINE_FP(uc)      ((uc)->uc_mcontext.__gregs[3])
 #define        _UC_MACHINE_PC(uc)      ((uc)->uc_mcontext.__gregs[_REG_PCOQH])
 #define        _UC_MACHINE_SET_PC(uc, pc)                                      \
 do {                                                                   \
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/i386/include/mcontext.h
--- a/sys/arch/i386/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/i386/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.12 2014/02/15 22:20:42 dsl Exp $        */
+/*     $NetBSD: mcontext.h,v 1.12.22.1 2018/02/25 23:50:22 snj Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -116,6 +116,7 @@
 #ifndef _UC_MACHINE_SP
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_UESP])
 #endif
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_EBP])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_EIP])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_EAX])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/ia64/include/mcontext.h
--- a/sys/arch/ia64/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/ia64/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.5 2016/08/05 17:01:13 scole Exp $       */
+/*     $NetBSD: mcontext.h,v 1.5.8.1 2018/02/25 23:50:23 snj Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -112,6 +112,7 @@
 } mcontext_t;
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.mc_special.sp)
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[79])
 /* XXX or assembly "mov Rn = ip" or ...? */
 #define        _UC_MACHINE_PC(uc)      ((uc)->uc_mcontext.mc_special.iip)
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/m68k/include/mcontext.h
--- a/sys/arch/m68k/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/m68k/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.9 2011/11/22 15:25:28 joerg Exp $       */
+/*     $NetBSD: mcontext.h,v 1.9.42.1 2018/02/25 23:50:23 snj Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -102,6 +102,7 @@
 #define        _UC_TLSBASE     0x00080000
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_A7])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_A6])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_D0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/mips/include/mcontext.h
--- a/sys/arch/mips/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/mips/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.21 2015/05/26 02:16:38 matt Exp $       */
+/*     $NetBSD: mcontext.h,v 1.21.10.1 2018/02/25 23:50:23 snj Exp $   */
 
 /*-
  * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -159,6 +159,7 @@
 #define        _UC_TLSBASE     0x00040000
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_S8])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_EPC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_V0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/or1k/include/mcontext.h
--- a/sys/arch/or1k/include/mcontext.h  Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/or1k/include/mcontext.h  Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */
+/* $NetBSD: mcontext.h,v 1.1.12.1 2018/02/25 23:50:23 snj Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -88,6 +88,7 @@
 #define        _UC_TLSBASE     0x00080000      /* see <sys/ucontext.h> */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_R2])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_RV])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/powerpc/include/mcontext.h
--- a/sys/arch/powerpc/include/mcontext.h       Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/powerpc/include/mcontext.h       Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.17 2014/08/12 20:27:10 joerg Exp $      */
+/*     $NetBSD: mcontext.h,v 1.17.12.1 2018/02/25 23:50:23 snj Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -133,6 +133,7 @@
 #define        _UC_TLSBASE     0x00080000      /* thread context valid in R2 */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_R1])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_R31])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_R3])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/riscv/include/mcontext.h
--- a/sys/arch/riscv/include/mcontext.h Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/riscv/include/mcontext.h Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.4 2015/04/01 21:55:33 matt Exp $ */
+/* $NetBSD: mcontext.h,v 1.4.10.1 2018/02/25 23:50:23 snj Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -118,6 +118,7 @@
 #define        _UC_TLSBASE     0x00080000      /* see <sys/ucontext.h> */
 
 #define _UC_MACHINE_SP(uc)     ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define _UC_MACHINE_FP(uc)     ((uc)->uc_mcontext.__gregs[_REG_S0])
 #define _UC_MACHINE_PC(uc)     ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define _UC_MACHINE_INTRV(uc)  ((uc)->uc_mcontext.__gregs[_REG_RV])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/sh3/include/mcontext.h
--- a/sys/arch/sh3/include/mcontext.h   Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/sh3/include/mcontext.h   Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.10 2012/09/12 02:00:54 manu Exp $       */
+/*     $NetBSD: mcontext.h,v 1.10.32.1 2018/02/25 23:50:23 snj Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -82,6 +82,7 @@
 } mcontext_t;
 
 #define        _UC_MACHINE_SP(uc)      ((uc)->uc_mcontext.__gregs[_REG_SP])
+#define        _UC_MACHINE_FP(uc)      ((uc)->uc_mcontext.__gregs[_REG_R14])
 #define        _UC_MACHINE_PC(uc)      ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define        _UC_MACHINE_INTRV(uc)   ((uc)->uc_mcontext.__gregs[_REG_R0])
 
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/sparc/include/mcontext.h
--- a/sys/arch/sparc/include/mcontext.h Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/sparc/include/mcontext.h Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.13 2012/09/12 02:00:54 manu Exp $       */
+/*     $NetBSD: mcontext.h,v 1.13.32.1 2018/02/25 23:50:23 snj Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,11 +30,11 @@
  */
 
 #ifndef _SPARC_MCONTEXT_H_
-#define _SPARC_MCONTEXT_H_
+#define        _SPARC_MCONTEXT_H_
 
-#define _UC_SETSTACK   0x00010000
-#define _UC_CLRSTACK   0x00020000
-#define _UC_TLSBASE    0x00080000
+#define        _UC_SETSTACK    0x00010000
+#define        _UC_CLRSTACK    0x00020000
+#define        _UC_TLSBASE     0x00080000
 
 /*
  * Layout of mcontext_t according the System V Application Binary Interface,
@@ -144,13 +144,13 @@
 } mcontext_t;
 
 #ifdef __arch64__
-#define _UC_MACHINE_PAD        8               /* Padding appended to ucontext_t */
-#define        _UC_MACHINE_SP(uc)      (((uc)->uc_mcontext.__gregs[_REG_O6])+0x7ff)
-#define _UC_MACHINE32_PAD      43      /* compat_netbsd32 variant */
-#define        _UC_MACHINE32_SP(uc)    ((uc)->uc_mcontext.__gregs[_REG_O6])
+#define        _UC_MACHINE_PAD 8               /* Padding appended to ucontext_t */
+#define        _UC_MACHINE_SP(uc)      (((uc)->uc_mcontext.__gregs[_REG_O6]) + 0x7ff)
+#define        _UC_MACHINE_FP(uc)      (((__greg_t *)_UC_MACHINE_SP(uc))[15])
 #else
-#define _UC_MACHINE_PAD        43              /* Padding appended to ucontext_t */
+#define        _UC_MACHINE_PAD 43              /* Padding appended to ucontext_t */
 #define        _UC_MACHINE_SP(uc)      ((uc)->uc_mcontext.__gregs[_REG_O6])
+#define        _UC_MACHINE_FP(uc)      (((__greg_t *)_UC_MACHINE_SP(uc))[15])
 #endif
 #define        _UC_MACHINE_PC(uc)      ((uc)->uc_mcontext.__gregs[_REG_PC])
 #define        _UC_MACHINE_INTRV(uc)   ((uc)->uc_mcontext.__gregs[_REG_O0])
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/sparc64/include/mcontext.h
--- a/sys/arch/sparc64/include/mcontext.h       Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/sparc64/include/mcontext.h       Sun Feb 25 23:50:22 2018 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: mcontext.h,v 1.9 2012/09/12 02:00:54 manu Exp $        */
+/*     $NetBSD: mcontext.h,v 1.9.32.1 2018/02/25 23:50:23 snj Exp $    */
 
 #ifndef _SPARC64_MCONTEXT_H_
-#define _SPARC64_MCONTEXT_H_
+#define        _SPARC64_MCONTEXT_H_
 
 #include <sparc/mcontext.h>
 
-#define _NGREG32       19      /* %psr, pc, npc, %g1-7, %o0-7 */
+#define        _NGREG32        19      /* %psr, pc, npc, %g1-7, %o0-7 */
 typedef        int     __greg32_t;
 typedef        __greg32_t      __gregset32_t[_NGREG32];
 
@@ -76,4 +76,8 @@
 #define        _UC_CLRSTACK    0x00020000
 #define        _UC_TLSBASE     0x00080000
 
+#define        _UC_MACHINE32_PAD       43      /* compat_netbsd32 variant */
+#define        _UC_MACHINE32_SP(uc)    ((uc)->uc_mcontext.__gregs[_REG_O6])
+#define        _UC_MACHINE32_FP(uc)    (((__greg32_t *)_UC_MACHINE32_SP(uc))[15])
+
 #endif /* _SPARC64_MCONTEXT_H_ */
diff -r f360d9024687 -r 7dd6c34ba88a sys/arch/vax/include/mcontext.h
--- a/sys/arch/vax/include/mcontext.h   Sun Feb 25 21:01:13 2018 +0000
+++ b/sys/arch/vax/include/mcontext.h   Sun Feb 25 23:50:22 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.8 2012/02/02 18:32:16 matt Exp $        */
+/*     $NetBSD: mcontext.h,v 1.8.40.1 2018/02/25 23:50:23 snj Exp $    */
 
 /*-



Home | Main Index | Thread Index | Old Index