Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/include Make _UC_MACHINE_FP() compile again a...



details:   https://anonhg.NetBSD.org/src/rev/bd5f9bf97213
branches:  trunk
changeset: 829941:bd5f9bf97213
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 18 15:29:29 2018 +0000

description:
Make _UC_MACHINE_FP() compile again and fix it so that it does not add
the offset twice.

diffstat:

 sys/arch/sparc/include/mcontext.h |  24 +++++-------------------
 1 files changed, 5 insertions(+), 19 deletions(-)

diffs (47 lines):

diff -r 23db64091ed3 -r bd5f9bf97213 sys/arch/sparc/include/mcontext.h
--- a/sys/arch/sparc/include/mcontext.h Sun Feb 18 14:32:31 2018 +0000
+++ b/sys/arch/sparc/include/mcontext.h Sun Feb 18 15:29:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.15 2018/02/17 15:22:22 kamil Exp $      */
+/*     $NetBSD: mcontext.h,v 1.16 2018/02/18 15:29:29 christos Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -145,33 +145,19 @@
 
 #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_MACHINE_FP(uc)      (_uc_machine_fp((uc), 2047))
+#define        _UC_MACHINE_SP(uc)      (((uc)->uc_mcontext.__gregs[_REG_O6]) + 0x7ff)
+#define        _UC_MACHINE_FP(uc)      (((__greg_t *)_UC_MACHINE_SP(uc))[15])
 #define _UC_MACHINE32_PAD      43      /* compat_netbsd32 variant */
 #define        _UC_MACHINE32_SP(uc)    ((uc)->uc_mcontext.__gregs[_REG_O6])
-#define        _UC_MACHINE32_FP(uc)    (_uc_machine_fp((uc), 0))
+#define        _UC_MACHINE32_FP(uc)    (((__greg_t *)_UC_MACHINE32_SP(uc))[15])
 #else
 #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)      (_uc_machine_fp((uc), 0))
+#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])
 
-static inline long
-_uc_machine_fp(ucontext_t *ucontext, long shift)
-{
-       long *sptr;
-       long *sp;
-       long fp;
-
-       sp = (long *)_UC_MACHINE_SP(ucontext);
-       sptr = (long *)(*sp + shift);
-       fp = sptr[15];
-
-       return fp;
-}
-
 #define        _UC_MACHINE_SET_PC(uc, pc)                                      \
 do {                                                                   \
        (uc)->uc_mcontext.__gregs[_REG_PC] = (pc);                      \



Home | Main Index | Thread Index | Old Index