diff options
Diffstat (limited to 'src/pal/src/include/pal/context.h')
-rw-r--r-- | src/pal/src/include/pal/context.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h index 5e378942fb..6857c130ee 100644 --- a/src/pal/src/include/pal/context.h +++ b/src/pal/src/include/pal/context.h @@ -139,6 +139,8 @@ typedef ucontext_t native_context_t; ///////////////////// // Extended state +#ifdef XSTATE_SUPPORTED + inline _fpx_sw_bytes *FPREG_FpxSwBytes(const ucontext_t *uc) { // Bytes 464..511 in the FXSAVE format are available for software to use for any purpose. In this case, they are used to @@ -185,6 +187,8 @@ inline void *FPREG_Xstate_Ymmh(const ucontext_t *uc) return reinterpret_cast<_xstate *>(FPREG_Fpstate(uc))->ymmh.ymmh_space; } +#endif // XSTATE_SUPPORTED + ///////////////////// #else // BIT64 @@ -450,6 +454,8 @@ inline static DWORD64 CONTEXTGetPC(LPCONTEXT pContext) { #if defined(_AMD64_) return pContext->Rip; +#elif defined(_X86_) + return pContext->Eip; #elif defined(_ARM64_) || defined(_ARM_) return pContext->Pc; #else @@ -461,6 +467,8 @@ inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc) { #if defined(_AMD64_) pContext->Rip = pc; +#elif defined(_X86_) + pContext->Eip = pc; #elif defined(_ARM64_) || defined(_ARM_) pContext->Pc = pc; #else @@ -468,6 +476,21 @@ inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc) #endif } +inline static DWORD64 CONTEXTGetFP(LPCONTEXT pContext) +{ +#if defined(_AMD64_) + return pContext->Rbp; +#elif defined(_X86_) + return pContext->Ebp; +#elif defined(_ARM_) + return pContext->R7; +#elif defined(_ARM64_) + return pContext->Fp; +#else +#error don't know how to get the frame pointer for this architecture +#endif +} + /*++ Function : CONTEXT_CaptureContext @@ -481,6 +504,7 @@ Parameters : --*/ void +PALAPI CONTEXT_CaptureContext( LPCONTEXT lpContext ); |