summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeoff Norton <kangaroo@clr.ninja>2015-10-26 22:23:31 +0000
committerGeoff Norton <kangaroo@clr.ninja>2015-10-27 17:28:27 +0000
commit8a6e646301b399de933e22ec88b5456db3c511a9 (patch)
treef894763ef4c83280509a21c31f099541e562492a /src
parent83a78f96b95fd67c7d89516256ccb9cb9c909452 (diff)
downloadcoreclr-8a6e646301b399de933e22ec88b5456db3c511a9.tar.gz
coreclr-8a6e646301b399de933e22ec88b5456db3c511a9.tar.bz2
coreclr-8a6e646301b399de933e22ec88b5456db3c511a9.zip
[arm] Clean up a few places where the arm build has bit rotted
Diffstat (limited to 'src')
-rw-r--r--src/jit/codegencommon.cpp2
-rw-r--r--src/pal/src/exception/seh-unwind.cpp30
-rw-r--r--src/pal/src/exception/signal.cpp4
-rw-r--r--src/pal/src/include/pal/context.h22
-rw-r--r--src/vm/comutilnative.h2
-rw-r--r--src/vm/threadsuspend.cpp2
6 files changed, 33 insertions, 29 deletions
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp
index ea3cce6cc8..8b0e05d637 100644
--- a/src/jit/codegencommon.cpp
+++ b/src/jit/codegencommon.cpp
@@ -11046,7 +11046,7 @@ var_types Compiler::GetHfaType(GenTreePtr tree)
unsigned Compiler::GetHfaSlots(GenTreePtr tree)
{
- return GetHfaSlots(GetHfaClassHandle(tree));
+ return GetHfaSlots(GetStructClassHandle(tree));
}
var_types Compiler::GetHfaType(CORINFO_CLASS_HANDLE hClass)
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index 322515ad5e..c69c3e1504 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -209,28 +209,6 @@ static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext,
#endif
}
-static DWORD64 GetPc(CONTEXT *context)
-{
-#if defined(_AMD64_)
- return context->Rip;
-#elif defined(_ARM64_) || defined(_ARM_)
- return context->Pc;
-#else
-#error don't know how to get the program counter for this architecture
-#endif
-}
-
-static void SetPc(CONTEXT *context, DWORD64 pc)
-{
-#if defined(_AMD64_)
- context->Rip = pc;
-#elif defined(_ARM64_) || defined(_ARM_)
- context->Pc = pc;
-#else
-#error don't know how to set the program counter for this architecture
-#endif
-}
-
BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextPointers)
{
int st;
@@ -250,7 +228,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// So we compensate it by incrementing the PC before passing it to the unwinder.
// Without it, the unwinder would not find unwind info if the hardware exception
// happened in the first instruction of a function.
- SetPc(context, GetPc(context) + 1);
+ SetProgramCounterOnCONTEXT(context, GetProgramCounterFromCONTEXT(context) + 1);
}
#if UNWIND_CONTEXT_IS_UCONTEXT_T
@@ -282,7 +260,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// The behaviour of libunwind from nongnu.org is to null the PC
// So we bank the original PC here, so we can compare it after
// the step
- curPc = GetPc(context);
+ curPc = GetProgramCounterFromCONTEXT(context);
#endif
st = unw_step(&cursor);
@@ -307,9 +285,9 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
//
UnwindContextToWinContext(&cursor, context);
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_ARM64_)
- if (st == 0 && GetPc(context) == curPc)
+ if (st == 0 && GetProgramCounterFromCONTEXT(context) == curPc)
{
- SetPc(context, 0);
+ SetProgramCounterOnCONTEXT(context, 0);
}
#endif
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index d11d5ffd2c..27fadc9b9d 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -101,6 +101,8 @@ int g_signalPipe[2] = { 0, 0 };
DWORD g_dwExternalSignalHandlerThreadId = 0;
+
+
/* public function definitions ************************************************/
/*++
@@ -594,7 +596,7 @@ static void inject_activation_handler(int code, siginfo_t *siginfo, void *contex
&winContext,
CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT);
- if (g_safeActivationCheckFunction(winContext.Rip))
+ if (g_safeActivationCheckFunction(GetProgramCounterFromCONTEXT(&winContext)))
{
g_activationFunction(&winContext);
}
diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h
index 51dcedfcd2..e94c1a0ac1 100644
--- a/src/pal/src/include/pal/context.h
+++ b/src/pal/src/include/pal/context.h
@@ -336,6 +336,28 @@ typedef ucontext_t native_context_t;
#endif // HAVE_BSD_REGS_T
+inline static DWORD64 GetProgramCounterFromCONTEXT(LPCONTEXT pContext)
+{
+#if defined(_AMD64_)
+ return pContext->Rip;
+#elif defined(_ARM64_) || defined(_ARM_)
+ return pContext->Pc;
+#else
+#error don't know how to get the program counter for this architecture
+#endif
+}
+
+inline static void SetProgramCounterOnCONTEXT(LPCONTEXT pContext, DWORD64 pc)
+{
+#if defined(_AMD64_)
+ pContext->Rip = pc;
+#elif defined(_ARM64_) || defined(_ARM_)
+ pContext->Pc = pc;
+#else
+#error don't know how to set the program counter for this architecture
+#endif
+}
+
/*++
Function :
CONTEXT_CaptureContext
diff --git a/src/vm/comutilnative.h b/src/vm/comutilnative.h
index d234d7c62d..3a9b35a365 100644
--- a/src/vm/comutilnative.h
+++ b/src/vm/comutilnative.h
@@ -34,7 +34,7 @@
#ifdef FEATURE_RANDOMIZED_STRING_HASHING
#pragma warning(push)
#pragma warning(disable:4324)
-#if !defined(CROSS_COMPILE) && defined(_TARGET_ARM_)
+#if !defined(CROSS_COMPILE) && defined(_TARGET_ARM_) && !defined(PLATFORM_UNIX)
#include "arm_neon.h"
#endif
#include "marvin32.h"
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp
index 5d414192c4..0d823ddda1 100644
--- a/src/vm/threadsuspend.cpp
+++ b/src/vm/threadsuspend.cpp
@@ -8415,8 +8415,10 @@ void PALAPI HandleGCSuspensionForInterruptedThread(CONTEXT *interruptedContext)
pThread->InitRegDisplay(&regDisplay, interruptedContext, true /* validContext */);
BOOL unused;
+#if defined(_TARGET_AMD64_)
if (IsIPInEpilog(interruptedContext, &codeInfo, &unused))
return;
+#endif
// Use StackWalkFramesEx to find the location of the return address. This will locate the
// return address by checking relative to the caller frame's SP, which is preferable to