ntdll: Add context definitions missing from the Android NDK.

This commit is contained in:
Alexandre Julliard 2013-07-30 14:11:42 +02:00
parent f7161ebe89
commit f8cdbecc25
2 changed files with 48 additions and 1 deletions

View File

@ -68,6 +68,18 @@ static pthread_key_t teb_key;
*/
#ifdef linux
#ifdef __ANDROID__
typedef struct ucontext
{
unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
sigset_t uc_sigmask;
unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
} ucontext_t;
#endif
typedef ucontext_t SIGCONTEXT;
/* All Registers access - only for local access */

View File

@ -100,7 +100,42 @@ typedef struct
* signal context platform-specific definitions
*/
#if defined (__linux__)
#ifdef __ANDROID__
typedef struct ucontext
{
unsigned long uc_flags;
struct ucontext *uc_link;
stack_t uc_stack;
struct sigcontext uc_mcontext;
sigset_t uc_sigmask;
} SIGCONTEXT;
#define EAX_sig(context) ((context)->uc_mcontext.eax)
#define EBX_sig(context) ((context)->uc_mcontext.ebx)
#define ECX_sig(context) ((context)->uc_mcontext.ecx)
#define EDX_sig(context) ((context)->uc_mcontext.edx)
#define ESI_sig(context) ((context)->uc_mcontext.esi)
#define EDI_sig(context) ((context)->uc_mcontext.edi)
#define EBP_sig(context) ((context)->uc_mcontext.ebp)
#define ESP_sig(context) ((context)->uc_mcontext.esp)
#define CS_sig(context) ((context)->uc_mcontext.cs)
#define DS_sig(context) ((context)->uc_mcontext.ds)
#define ES_sig(context) ((context)->uc_mcontext.es)
#define SS_sig(context) ((context)->uc_mcontext.ss)
#define FS_sig(context) ((context)->uc_mcontext.fs)
#define GS_sig(context) ((context)->uc_mcontext.gs)
#define EFL_sig(context) ((context)->uc_mcontext.eflags)
#define EIP_sig(context) ((context)->uc_mcontext.eip)
#define TRAP_sig(context) ((context)->uc_mcontext.trapno)
#define ERROR_sig(context) ((context)->uc_mcontext.err)
#define FPU_sig(context) ((FLOATING_SAVE_AREA*)((context)->uc_mcontext.fpstate))
#define FPUX_sig(context) (FPU_sig(context) && !((context)->uc_mcontext.fpstate->status >> 16) ? (XMM_SAVE_AREA32 *)(FPU_sig(context) + 1) : NULL)
#elif defined (__linux__)
typedef ucontext_t SIGCONTEXT;