Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nathanw_sa]: src/lib/libpthread/arch/powerpc sigcontext/ucontext glue.
details: https://anonhg.NetBSD.org/src/rev/b1def2b83ad5
branches: nathanw_sa
changeset: 506538:b1def2b83ad5
user: nathanw <nathanw%NetBSD.org@localhost>
date: Fri Dec 06 21:17:48 2002 +0000
description:
sigcontext/ucontext glue.
diffstat:
lib/libpthread/arch/powerpc/pthread_md.h | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r 84f03c12c3a0 -r b1def2b83ad5 lib/libpthread/arch/powerpc/pthread_md.h
--- a/lib/libpthread/arch/powerpc/pthread_md.h Fri Dec 06 20:59:26 2002 +0000
+++ b/lib/libpthread/arch/powerpc/pthread_md.h Fri Dec 06 21:17:48 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_md.h,v 1.1.2.6 2002/10/22 16:20:05 nathanw Exp $ */
+/* $NetBSD: pthread_md.h,v 1.1.2.7 2002/12/06 21:17:48 nathanw Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -103,5 +103,27 @@
(uc)->uc_flags = ((uc)->uc_flags | _UC_FPU) & ~_UC_USER; \
} while (/*CONSTCOND*/0)
+#define PTHREAD_UCONTEXT_TO_SIGCONTEXT(uc, sc) do { \
+ memcpy(&(sc)->sc_frame.fixreg, &(uc)->uc_mcontext.__gregs, \
+ 32 * 4); \
+ (sc)->sc_frame.lr = (uc)->uc_mcontext.__gregs[33]; \
+ (sc)->sc_frame.cr = (uc)->uc_mcontext.__gregs[32]; \
+ (sc)->sc_frame.xer = (uc)->uc_mcontext.__gregs[37]; \
+ (sc)->sc_frame.ctr = (uc)->uc_mcontext.__gregs[36]; \
+ (sc)->sc_frame.srr0 = (uc)->uc_mcontext.__gregs[34]; \
+ (sc)->sc_frame.srr1 = (uc)->uc_mcontext.__gregs[35]; \
+ } while (/*CONSTCOND*/0)
+
+#define PTHREAD_SIGCONTEXT_TO_UCONTEXT(uc, sc) do { \
+ memcpy(&(uc)->uc_mcontext.__gregs, &(sc)->sc_frame.fixreg, \
+ 32 * 4); \
+ (uc)->uc_mcontext.__gregs[33] = (sc)->sc_frame.lr; \
+ (uc)->uc_mcontext.__gregs[32] = (sc)->sc_frame.cr; \
+ (uc)->uc_mcontext.__gregs[37] = (sc)->sc_frame.xer; \
+ (uc)->uc_mcontext.__gregs[36] = (sc)->sc_frame.ctr; \
+ (uc)->uc_mcontext.__gregs[34] = (sc)->sc_frame.srr0; \
+ (uc)->uc_mcontext.__gregs[35] = (sc)->sc_frame.srr1; \
+ (uc)->uc_flags &= ~_UC_USER; \
+ } while (/*CONSTCOND*/0)
#endif /* _LIB_PTHREAD_POWERPC_MD_H */
Home |
Main Index |
Thread Index |
Old Index