X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Futils%2Fmono-sigcontext.h;h=daa82bbef3742d8ea07529776eefc31589ced3cf;hb=5df3fd4797d5529466d0507d18f1ae312c082b4f;hp=df76434d347fa777ee937980b4d40dc427607788;hpb=c251b192a55c255f278c9b9ad2ec949264a36526;p=mono.git diff --git a/mono/utils/mono-sigcontext.h b/mono/utils/mono-sigcontext.h index df76434d347..daa82bbef37 100644 --- a/mono/utils/mono-sigcontext.h +++ b/mono/utils/mono-sigcontext.h @@ -14,7 +14,7 @@ #include #endif -#if defined(__i386__) +#if defined(TARGET_X86) #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) #include @@ -34,7 +34,7 @@ #define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_edi) #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.mc_eip) #elif defined(__APPLE__) -# if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5 +# if defined (TARGET_IOS) || (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5) #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__eax) #define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__ebx) #define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__ecx) @@ -152,7 +152,7 @@ typedef struct ucontext { #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [REG_EIP]) #endif -#elif defined(__x86_64__) +#elif defined(TARGET_AMD64) #if defined(__FreeBSD__) #include @@ -301,7 +301,7 @@ typedef struct ucontext { #define UCONTEXT_REG_LNK(ctx) ((ctx)->uc_mcontext.mc_lr) #endif -#elif defined(__arm__) +#elif defined(TARGET_ARM) #if defined(__APPLE__) typedef ucontext_t arm_ucontext; @@ -322,6 +322,7 @@ typedef struct ucontext { #define UCONTEXT_REG_R11(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r[11]) #define UCONTEXT_REG_R12(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__r[12]) #define UCONTEXT_REG_CPSR(ctx) (((ucontext_t*)(ctx))->uc_mcontext->__ss.__cpsr) + #define UCONTEXT_REG_VFPREGS(ctx) (double*)(((ucontext_t*)(ctx))->uc_mcontext->__fs.__r) #elif defined(__linux__) typedef struct arm_ucontext { unsigned long uc_flags; @@ -354,6 +355,30 @@ typedef struct ucontext { #define UCONTEXT_REG_R12(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_ip) #define UCONTEXT_REG_CPSR(ctx) (((arm_ucontext*)(ctx))->sig_ctx.arm_cpsr) #endif + +#elif defined(TARGET_ARM64) + +#if defined(MONO_CROSS_COMPILE) + #define UCONTEXT_REG_PC(ctx) NULL + #define UCONTEXT_REG_SP(ctx) NULL + #define UCONTEXT_REG_R0(ctx) NULL + #define UCONTEXT_GREGS(ctx) NULL +#elif defined(__APPLE__) +#include +#include + /* mach/arm/_structs.h */ + #define UCONTEXT_REG_PC(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__pc) + #define UCONTEXT_REG_SP(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__sp) + #define UCONTEXT_REG_R0(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x [ARMREG_R0]) + #define UCONTEXT_GREGS(ctx) (&(((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x)) +#else +#include + #define UCONTEXT_REG_PC(ctx) (((ucontext_t*)(ctx))->uc_mcontext.pc) + #define UCONTEXT_REG_SP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.sp) + #define UCONTEXT_REG_R0(ctx) (((ucontext_t*)(ctx))->uc_mcontext.regs [ARMREG_R0]) + #define UCONTEXT_GREGS(ctx) (&(((ucontext_t*)(ctx))->uc_mcontext.regs)) +#endif + #elif defined(__mips__) # if HAVE_UCONTEXT_H