Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread/arch/sparc64 Fix ucontext conversion macros. ...
details: https://anonhg.NetBSD.org/src/rev/b24634c6d3df
branches: trunk
changeset: 555205:b24634c6d3df
user: martin <martin%NetBSD.org@localhost>
date: Tue Nov 11 16:21:05 2003 +0000
description:
Fix ucontext conversion macros. From Christian Limpach.
diffstat:
lib/libpthread/arch/sparc64/pthread_md.h | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diffs (52 lines):
diff -r f14e3a523edc -r b24634c6d3df lib/libpthread/arch/sparc64/pthread_md.h
--- a/lib/libpthread/arch/sparc64/pthread_md.h Tue Nov 11 15:01:05 2003 +0000
+++ b/lib/libpthread/arch/sparc64/pthread_md.h Tue Nov 11 16:21:05 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_md.h,v 1.2 2003/01/18 10:34:22 thorpej Exp $ */
+/* $NetBSD: pthread_md.h,v 1.3 2003/11/11 16:21:05 martin Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -61,21 +61,35 @@
*/
#define PTHREAD_UCONTEXT_TO_REG(reg, uc) do { \
- memcpy(&(reg)->r_tstate, &(uc)->uc_mcontext.__gregs, sizeof(__gregset_t));\
+ memcpy(&(reg)->r_tstate, &(uc)->uc_mcontext.__gregs, \
+ _REG_Y * sizeof(__greg_t)); \
+ (reg)->r_y = (uc)->uc_mcontext.__gregs[_REG_Y]; \
+ memcpy(&(reg)->r_global[1], &(uc)->uc_mcontext.__gregs[_REG_G1],\
+ (_REG_O7 - _REG_G1 + 1) * sizeof(__greg_t)); \
+ (reg)->r_global[0] = 0; \
} while (/*CONSTCOND*/0)
#define PTHREAD_REG_TO_UCONTEXT(uc, reg) do { \
- memcpy(&(uc)->uc_mcontext.__gregs, &(reg)->r_tstate, sizeof(__gregset_t));\
+ memcpy(&(uc)->uc_mcontext.__gregs, &(reg)->r_tstate, \
+ _REG_Y * sizeof(__greg_t)); \
+ (uc)->uc_mcontext.__gregs[_REG_Y] = (reg)->r_y; \
+ memcpy(&(uc)->uc_mcontext.__gregs[_REG_G1], &(reg)->r_global[1],\
+ (_REG_O7 - _REG_G1 + 1) * sizeof(__greg_t)); \
(uc)->uc_flags = ((uc)->uc_flags | _UC_CPU) & ~_UC_USER; \
} while (/*CONSTCOND*/0)
-#define PTHREAD_UCONTEXT_TO_FPREG(freg, uc) \
- memcpy((freg), &(uc)->uc_mcontext.__fpregs, \
- sizeof(struct fpreg)) \
+#define PTHREAD_UCONTEXT_TO_FPREG(freg, uc) do { \
+ memcpy((freg)->fr_regs, \
+ &(uc)->uc_mcontext.__fpregs.__fpu_fr.__fpu_dregs, \
+ 32*sizeof(double)); \
+ (freg)->fr_fsr = (uc)->uc_mcontext.__fpregs.__fpu_fsr; \
+ } while (/*CONSTCOND*/0)
#define PTHREAD_FPREG_TO_UCONTEXT(uc, freg) do { \
- memcpy(&(uc)->uc_mcontext.__fpregs, (freg), \
- sizeof(struct fpreg)); \
+ memcpy(&(uc)->uc_mcontext.__fpregs.__fpu_fr.__fpu_dregs, \
+ (freg)->fr_regs, \
+ 32*sizeof(double)); \
+ (uc)->uc_mcontext.__fpregs.__fpu_fsr = (freg)->fr_fsr; \
(uc)->uc_flags = ((uc)->uc_flags | _UC_FPU) & ~_UC_USER; \
} while (/*CONSTCOND*/0)
Home |
Main Index |
Thread Index |
Old Index