Module Name: src
Committed By: skrll
Date: Fri Aug 12 15:26:04 UTC 2016
Modified Files:
src/lib/libc/arch/mips: genassym.cf
src/lib/libc/arch/mips/sys: getcontext.S
Log Message:
Provide _OFFSETOF_UC_GREGS_GP and use _OFFSETOF_UC_GREGS_* in getcontext
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/mips/genassym.cf
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/mips/sys/getcontext.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/arch/mips/genassym.cf
diff -u src/lib/libc/arch/mips/genassym.cf:1.2 src/lib/libc/arch/mips/genassym.cf:1.3
--- src/lib/libc/arch/mips/genassym.cf:1.2 Mon Dec 14 01:07:41 2009
+++ src/lib/libc/arch/mips/genassym.cf Fri Aug 12 15:26:04 2016
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.2 2009/12/14 01:07:41 matt Exp $
+# $NetBSD: genassym.cf,v 1.3 2016/08/12 15:26:04 skrll Exp $
#
# Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,8 +36,8 @@ include <ucontext.h>
include <signal.h>
include <sys/siginfo.h>
-define _OFFSETOF_UC_GREGS offsetof(ucontext_t, uc_mcontext.__gregs[0])
define _OFFSETOF_UC_GREGS_V0 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_V0])
+define _OFFSETOF_UC_GREGS_GP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_GP])
define _OFFSETOF_UC_GREGS_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP])
define _OFFSETOF_UC_GREGS_EPC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_EPC])
define _OFFSETOF_UC_LINK offsetof(ucontext_t, uc_link)
Index: src/lib/libc/arch/mips/sys/getcontext.S
diff -u src/lib/libc/arch/mips/sys/getcontext.S:1.5 src/lib/libc/arch/mips/sys/getcontext.S:1.6
--- src/lib/libc/arch/mips/sys/getcontext.S:1.5 Wed Aug 10 16:45:24 2016
+++ src/lib/libc/arch/mips/sys/getcontext.S Fri Aug 12 15:26:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $ */
+/* $NetBSD: getcontext.S,v 1.6 2016/08/12 15:26:04 skrll Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
#include <machine/mcontext.h>
#if defined(SYSLIBC_SCCS) && !defined(lint)
- RCSID("$NetBSD: getcontext.S,v 1.5 2016/08/10 16:45:24 skrll Exp $")
+ RCSID("$NetBSD: getcontext.S,v 1.6 2016/08/12 15:26:04 skrll Exp $")
#endif /* SYSLIBC_SCCS && !lint */
#ifdef WEAK_ALIAS
@@ -47,12 +47,12 @@ LEAF(_getcontext)
SYSTRAP(getcontext)
bne a3, zero, 1f
REG_PROLOGUE
- REG_S zero, (_OFFSETOF_UC_GREGS + _REG_V0 * SZREG)(a0)
+ REG_S zero, _OFFSETOF_UC_GREGS_V0(a0)
#if !defined(__mips_o32)
/* PIC_PROLOGUE saved gp in t3 */
- REG_S t3, (_OFFSETOF_UC_GREGS + _REG_GP * SZREG)(a0)
+ REG_S t3, _OFFSETOF_UC_GREGS_GP(a0)
#endif
- REG_S ra, (_OFFSETOF_UC_GREGS + _REG_EPC * SZREG)(a0)
+ REG_S ra, _OFFSETOF_UC_GREGS_EPC(a0)
REG_EPILOGUE
PIC_RETURN()
1: