newlib/winsup/cygwin/include/sys/ucontext.h
Jon TURNEY 383ff5fc47 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>
2015-04-23 21:57:11 +02:00

27 lines
561 B
C

/* ucontext.h
Copyright 2015 Red Hat, Inc.
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#ifndef _SYS_UCONTEXT_H_
#define _SYS_UCONTEXT_H_
#include <signal.h>
typedef struct __mcontext mcontext_t;
typedef __attribute__ ((aligned (16))) struct __ucontext {
mcontext_t uc_mcontext;
struct __ucontext *uc_link;
sigset_t uc_sigmask;
stack_t uc_stack;
unsigned long int uc_flags;
} ucontext_t;
#endif /* !_SYS_UCONTEXT_H_ */