Module Name:    src
Committed By:   christos
Date:           Sun Feb 18 15:29:29 UTC 2018

Modified Files:
        src/sys/arch/sparc/include: mcontext.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc/include/mcontext.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/include/mcontext.h
diff -u src/sys/arch/sparc/include/mcontext.h:1.15 src/sys/arch/sparc/include/mcontext.h:1.16
--- src/sys/arch/sparc/include/mcontext.h:1.15	Sat Feb 17 10:22:22 2018
+++ src/sys/arch/sparc/include/mcontext.h	Sun Feb 18 10:29:29 2018
@@ -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 @@ typedef struct {
 
 #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);			\

Reply via email to