diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-11-04 02:48:45 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-11-04 02:48:45 +0300 |
commit | 31f4955afb95dbe35eda20c590eb3bf8d251866d (patch) | |
tree | 97736cf1dcfe907c30d4f796cd0fc6b7f15cef80 /src/Hardware/ExceptionHandlers.cpp | |
parent | 528e83698c1fb8be252423b4b69b0888d3318cfc (diff) |
Added GetStackPointer function to CoreN2G
Diffstat (limited to 'src/Hardware/ExceptionHandlers.cpp')
-rw-r--r-- | src/Hardware/ExceptionHandlers.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Hardware/ExceptionHandlers.cpp b/src/Hardware/ExceptionHandlers.cpp index 5bb9fdb3..38be6c22 100644 --- a/src/Hardware/ExceptionHandlers.cpp +++ b/src/Hardware/ExceptionHandlers.cpp @@ -89,8 +89,7 @@ [[noreturn]] void OutOfMemoryHandler() noexcept { - register const uint32_t * stack_ptr asm ("sp"); - SoftwareReset(SoftwareResetReason::outOfMemory, stack_ptr); + SoftwareReset(SoftwareResetReason::outOfMemory, GetStackPointer()); } // Exception handlers @@ -284,8 +283,7 @@ namespace std // The default terminate handler pulls in sprintf and lots of other functions, which makes the binary too large. So we replace it. [[noreturn]] void Terminate() noexcept { - register const uint32_t * stack_ptr asm ("sp"); - SoftwareReset(SoftwareResetReason::terminateCalled, stack_ptr); + SoftwareReset(SoftwareResetReason::terminateCalled, GetStackPointer()); } namespace __cxxabiv1 @@ -295,14 +293,12 @@ namespace __cxxabiv1 extern "C" [[noreturn]] void __cxa_pure_virtual() noexcept { - register const uint32_t * stack_ptr asm ("sp"); - SoftwareReset(SoftwareResetReason::pureOrDeletedVirtual, stack_ptr); + SoftwareReset(SoftwareResetReason::pureOrDeletedVirtual, GetStackPointer()); } extern "C" [[noreturn]] void __cxa_deleted_virtual() noexcept { - register const uint32_t * stack_ptr asm ("sp"); - SoftwareReset(SoftwareResetReason::pureOrDeletedVirtual, stack_ptr); + SoftwareReset(SoftwareResetReason::pureOrDeletedVirtual, GetStackPointer()); } // End |