diff options
author | sergey ignatov <sergign60@mail.ru> | 2017-07-30 20:15:37 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-07-30 20:15:37 +0300 |
commit | d83e3320807c171d7186c7a2e2a9fc297b24c672 (patch) | |
tree | 7a82bb4cafca8d27c92cccd82002282d1c458868 /src/Native/Runtime/arm | |
parent | ab57acf80871d3e45dea528f04d200c45a719c39 (diff) |
[armel tizen] Implemented InteropThunksHelpers.S stubs (#4243)
* [armel tizen] Implemented InteropThunksHelpers.S stubs
* Saved floating point arg register
Diffstat (limited to 'src/Native/Runtime/arm')
-rw-r--r-- | src/Native/Runtime/arm/InteropThunksHelpers.S | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/src/Native/Runtime/arm/InteropThunksHelpers.S b/src/Native/Runtime/arm/InteropThunksHelpers.S index 4fdcdddb9..69336f445 100644 --- a/src/Native/Runtime/arm/InteropThunksHelpers.S +++ b/src/Native/Runtime/arm/InteropThunksHelpers.S @@ -2,50 +2,57 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#include <unixasmmacros.inc> - .syntax unified .thumb -#ifdef _DEBUG -.rodata -AssertMsg: .asciz "__FILE__:%s: %s is not implemented\n" -FileName: .asciz "InteropThunksHelpers.S" -RhCommonStubName: .asciz "RhCommonStub" -RhGetCommonStubAddressName: .asciz "RhGetCommonStubAddress" -RhGetCurrentThunkContextName: .asciz "RhGetCurrentThunkContext" - -.text -.macro GEN_ASSERT_FUNC func - GEN_ASSERT AssertMsg, FileName, \func -.endm -#endif - -// TODO: Implement Arm support +#include <unixasmmacros.inc> +#include <AsmOffsets.inc> // generated by the build from AsmOffsets.cpp +#define POINTER_SIZE 4 // // RhCommonStub // NESTED_ENTRY RhCommonStub, _TEXT, NoHandler -#ifdef _DEBUG - GEN_ASSERT_FUNC RhCommonStubName -#endif + // Custom calling convention: + // red zone has pointer to the current thunk's data block (data contains 2 pointer values: context + target pointers) + // Copy red zone value into r12 so that the PROLOG_PUSH doesn't destroy it + ldr r12, [sp, #-4] + PROLOG_PUSH "{r0-r5}" + PROLOG_VPUSH {d0-d7} // Capture the floating point argument registers + + mov r4, r12 + + INLINE_GET_TLS_VAR tls_thunkData + + // r0 = base address of TLS data + // r4 = address of context cell in thunk's data + + ldr r12, [r4] + str r12, [r0] + + // Now load the target address and jump to it. + ldr r12, [r4, #POINTER_SIZE] + EPILOG_VPOP {d0-d7} + EPILOG_POP "{r0-r5}" + bx r12 + NESTED_END RhCommonStub, _TEXT // // IntPtr RhGetCommonStubAddress() // LEAF_ENTRY RhGetCommonStubAddress, _TEXT -#ifdef _DEBUG - GEN_ASSERT_FUNC RhGetCommonStubAddressName -#endif + ldr r0, =C_FUNC(RhCommonStub) + bx lr LEAF_END RhGetCommonStubAddress, _TEXT // // IntPtr RhGetCurrentThunkContext() // LEAF_ENTRY RhGetCurrentThunkContext, _TEXT -#ifdef _DEBUG - GEN_ASSERT_FUNC RhGetCurrentThunkContextName -#endif + + INLINE_GET_TLS_VAR tls_thunkData + + ldr r0, [r0] + bx lr LEAF_END RhGetCurrentThunkContext, _TEXT |