This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 1/2] Rename struct ucontext to struct mcontext
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-patches at cygwin dot com
- Cc: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- Date: Mon, 30 Mar 2015 18:32:36 +0100
- Subject: [PATCH 1/2] Rename struct ucontext to struct mcontext
- Authentication-results: sourceware.org; auth=none
- References: <20150330102129 dot GH29875 at calimero dot vinschen dot de> <1427736757-13884-1-git-send-email-jon dot turney at dronecode dot org dot uk>
* include/cygwin/signal.h : Rename struct ucontext to struct mcontext.
Remove unused member oldmask and simplify __COPY_CONTEXT_SIZE.
---
winsup/cygwin/ChangeLog | 5 +++++
winsup/cygwin/include/cygwin/signal.h | 16 +++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 505f4ce..cfc29a8 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-30 Jon TURNEY <jon.turney@dronecode.org.uk>
+
+ * include/cygwin/signal.h : Rename struct ucontext to struct mcontext.
+ Remove unused member oldmask and simplify __COPY_CONTEXT_SIZE.
+
2015-03-30 Corinna Vinschen <corinna@vinschen.de>
* cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT.
diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h
index 58bbff0..47093b9 100644
--- a/winsup/cygwin/include/cygwin/signal.h
+++ b/winsup/cygwin/include/cygwin/signal.h
@@ -18,6 +18,10 @@
extern "C" {
#endif
+/*
+ Define a struct mcontext, which should be identical to the Win32 API type
+ CONTEXT
+*/
#ifdef __x86_64__
struct _uc_fpxreg {
@@ -45,7 +49,7 @@ struct _fpstate
__uint32_t padding[24];
};
-struct ucontext
+struct mcontext
{
__uint64_t p1home;
__uint64_t p2home;
@@ -93,7 +97,6 @@ struct ucontext
__uint64_t etr;
__uint64_t efr;
__uint8_t _internal;
- __uint64_t oldmask;
};
#else /* !x86_64 */
@@ -117,7 +120,7 @@ struct _fpstate
__uint32_t nxst;
};
-struct ucontext
+struct mcontext
{
__uint32_t cr2;
__uint32_t dr0;
@@ -144,14 +147,13 @@ struct ucontext
__uint32_t esp;
__uint32_t ss;
__uint8_t _internal;
- __uint32_t oldmask;
};
#endif /* !x86_64 */
-/* Needed for GDB. It only compiles in the context copy code if this
- macro s defined. */
-#define __COPY_CONTEXT_SIZE ((size_t) (uintptr_t) &((struct ucontext *) 0)->_internal)
+/* Needed for GDB 7.9 and earlier. It only compiles in the context copy code if
+ this macro is defined. */
+#define __COPY_CONTEXT_SIZE (sizeof(struct mcontext))
typedef union sigval
{
--
2.1.4