diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-06-22 21:00:20 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-06-22 21:00:20 +0300 |
commit | d8ba6a0def20c2ef44dbfa8a0f53eb0513043001 (patch) | |
tree | c9f66e680b0311765c4ff71db91511079d05416c /src/Native/Runtime/PalRedhawkCommon.h | |
parent | 0603b782dc0ab509b4f8c7fa3da1e8923fc24958 (diff) |
Implement Linux hardware and software exception handling (#1417)
This change implements code manager for Linux, context manipulation
and compiler changes necessary to enable exception handling.
All calls to libunwind are disabled for now on non-OSX though, since
our build system doesn't support specifying additional dynamic
libraries, which prevents us from using the libunwind.
Those pieces of code are under CAN_LINK_SHARED_LIBUNWIND ifdef so
that the ifdef can easily be located and removed after we add
the necessary support to the build system.
On OSX, the unwind functionality is part of the compiler support
libraries, so it works.
I have verified that everything works with the libunwind though
by manually invoking clang to link everything together and adding
the necessary libraries to its command line. The exception handling
test was passing with that.
Diffstat (limited to 'src/Native/Runtime/PalRedhawkCommon.h')
-rw-r--r-- | src/Native/Runtime/PalRedhawkCommon.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Native/Runtime/PalRedhawkCommon.h b/src/Native/Runtime/PalRedhawkCommon.h index 0b1eb9157..882d5a3f6 100644 --- a/src/Native/Runtime/PalRedhawkCommon.h +++ b/src/Native/Runtime/PalRedhawkCommon.h @@ -83,6 +83,8 @@ struct PAL_LIMITED_CONTEXT UIntNative GetIp() const { return IP; } UIntNative GetSp() const { return Rsp; } + void SetIp(UIntNative ip) { IP = ip; } + void SetSp(UIntNative sp) { Rsp = sp; } UIntNative GetFp() const { return Rbp; } #else // _TARGET_ARM_ UIntNative IP; @@ -118,4 +120,8 @@ struct PAL_LIMITED_CONTEXT void __stdcall RuntimeThreadShutdown(void* thread); +#ifdef PLATFORM_UNIX +typedef Int32 (*PHARDWARE_EXCEPTION_HANDLER)(UIntNative faultCode, UIntNative faultAddress, PAL_LIMITED_CONTEXT* palContext, UIntNative* arg0Reg, UIntNative* arg1Reg); +#endif + #endif // __PAL_REDHAWK_COMMON_INCLUDED |