Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-04-02 20:05:32 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-04-23 22:57:11 +0300
commit383ff5fc47123ab2914cffc9517df1071eb1dc6a (patch)
treed16139747cf00ce89352cf4e30e9edb70c644729 /winsup
parent50adb19f030d7721e2dec9dfb022b1c1aac64ca4 (diff)
Try to make sure struct _mcontext is 16-byte aligned
On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state. fxsave requires that the destination address is 16-byte aligned, or it will fault. CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with struct _mcontext. Rearrange ucontext_t so that it's struct _mcontext element is also correctly aligned. * include/cygwin/signal.h (struct __mcontext): 16-byte align. * include/sys/ucontext.h (ucontext_t): Ditto. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/include/cygwin/signal.h2
-rw-r--r--winsup/cygwin/include/sys/ucontext.h4
3 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 72dfa6658..bcc7df874 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-02 Jon TURNEY <jon.turney@dronecode.org.uk>
+
+ * include/cygwin/signal.h (struct __mcontext): 16-byte align.
+ * include/sys/ucontext.h (ucontext_t): Ditto.
+
2015-04-01 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h.
diff --git a/winsup/cygwin/include/cygwin/signal.h b/winsup/cygwin/include/cygwin/signal.h
index 04e65aa34..ef29baf7b 100644
--- a/winsup/cygwin/include/cygwin/signal.h
+++ b/winsup/cygwin/include/cygwin/signal.h
@@ -49,7 +49,7 @@ struct _fpstate
__uint32_t padding[24];
};
-struct __mcontext
+struct __attribute__ ((aligned (16))) __mcontext
{
__uint64_t p1home;
__uint64_t p2home;
diff --git a/winsup/cygwin/include/sys/ucontext.h b/winsup/cygwin/include/sys/ucontext.h
index 9362d90cd..65485fbad 100644
--- a/winsup/cygwin/include/sys/ucontext.h
+++ b/winsup/cygwin/include/sys/ucontext.h
@@ -15,11 +15,11 @@ details. */
typedef struct __mcontext mcontext_t;
-typedef struct __ucontext {
+typedef __attribute__ ((aligned (16))) struct __ucontext {
+ mcontext_t uc_mcontext;
struct __ucontext *uc_link;
sigset_t uc_sigmask;
stack_t uc_stack;
- mcontext_t uc_mcontext;
unsigned long int uc_flags;
} ucontext_t;