aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-03-30 18:05:51 +0100
committerCorinna Vinschen <corinna@vinschen.de>2015-04-23 21:57:10 +0200
commit9afde4dff449f9fac207de548fff34a44f5eb6ea (patch)
tree9029578c6444f411a3f53bb2747ee9de65867358 /winsup
parent9b42474f293d068dcaa65f2f20ca268c51c960ec (diff)
downloadnewlib-9afde4dff449f9fac207de548fff34a44f5eb6ea.zip
newlib-9afde4dff449f9fac207de548fff34a44f5eb6ea.tar.gz
newlib-9afde4dff449f9fac207de548fff34a44f5eb6ea.tar.bz2
Rename struct ucontext to struct __mcontext
* include/cygwin/signal.h : Rename struct ucontext to struct __mcontext. Fix layout differences from the Win32 API CONTEXT type. Remove unused member _internal. Rename member which corresponds to ContextFlags. Add cr2 member. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/include/cygwin/signal.h28
2 files changed, 26 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 58bfa23..3b86991 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-01 Jon TURNEY <jon.turney@dronecode.org.uk>
+
+ * include/cygwin/signal.h : Rename struct ucontext to struct
+ __mcontext. Fix layout differences from the Win32 API CONTEXT
+ type. Remove unused member _internal. Rename member which
+ corresponds to ContextFlags. Add cr2 member.
+
2015-04-01 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Handle negative domain index to avoid
diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h
index 58bbff0..04e65aa 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 in layout to the Win32
+ API type CONTEXT with the addition of oldmask and cr2 fields at the end.
+*/
#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;
@@ -53,7 +57,7 @@ struct ucontext
__uint64_t p4home;
__uint64_t p5home;
__uint64_t p6home;
- __uint32_t cr2;
+ __uint32_t ctxflags;
__uint32_t mxcsr;
__uint16_t cs;
__uint16_t ds;
@@ -86,14 +90,15 @@ struct ucontext
__uint64_t r15;
__uint64_t rip;
struct _fpstate fpregs;
+ __uint64_t vregs[52];
__uint64_t vcx;
__uint64_t dbc;
__uint64_t btr;
__uint64_t bfr;
__uint64_t etr;
__uint64_t efr;
- __uint8_t _internal;
__uint64_t oldmask;
+ __uint64_t cr2;
};
#else /* !x86_64 */
@@ -117,9 +122,9 @@ struct _fpstate
__uint32_t nxst;
};
-struct ucontext
+struct __mcontext
{
- __uint32_t cr2;
+ __uint32_t ctxflags;
__uint32_t dr0;
__uint32_t dr1;
__uint32_t dr2;
@@ -143,15 +148,20 @@ struct ucontext
__uint32_t eflags;
__uint32_t esp;
__uint32_t ss;
- __uint8_t _internal;
+ __uint32_t reserved[128];
__uint32_t oldmask;
+ __uint32_t cr2;
};
#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. It only compiles in the context copy code if this macro is
+ defined. This is not sizeof(CONTEXT) due to historical accidents. */
+#ifdef __x86_64__
+#define __COPY_CONTEXT_SIZE 816
+#else
+#define __COPY_CONTEXT_SIZE 204
+#endif
typedef union sigval
{