diff options
author | sergey ignatov <sergign60@mail.ru> | 2017-06-08 00:34:40 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-06-08 00:34:40 +0300 |
commit | 83e4241f94407bf76d21c63c2e1cb908cd2409e3 (patch) | |
tree | 0021274416b5de89f3108e727996128437e04351 /src/Native/Runtime/arm | |
parent | b26d0b33143a07caa93421ce2c0cfb8be77f9066 (diff) |
[armel tizen] Provided some stubs for unimplemented asm functions (#3826)
Diffstat (limited to 'src/Native/Runtime/arm')
-rw-r--r-- | src/Native/Runtime/arm/CallDescrWorker.S | 25 | ||||
-rw-r--r-- | src/Native/Runtime/arm/ExceptionHandling.S | 139 | ||||
-rw-r--r-- | src/Native/Runtime/arm/StubDispatch.S | 75 | ||||
-rw-r--r-- | src/Native/Runtime/arm/UniversalTransition.S | 80 | ||||
-rw-r--r-- | src/Native/Runtime/arm/WriteBarriers.S | 34 |
5 files changed, 353 insertions, 0 deletions
diff --git a/src/Native/Runtime/arm/CallDescrWorker.S b/src/Native/Runtime/arm/CallDescrWorker.S index de818954b..77017f4f8 100644 --- a/src/Native/Runtime/arm/CallDescrWorker.S +++ b/src/Native/Runtime/arm/CallDescrWorker.S @@ -4,4 +4,29 @@ #include <unixasmmacros.inc> +.syntax unified +.thumb + // TODO: Implement Arm support + +NESTED_ENTRY RhCallDescrWorker, _TEXT, NoHandler +LOCAL_LABEL(ReturnFromCallDescrThunk): + + // UNIXTODO: Implement this function + // int 3 +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif +NESTED_END RhCallDescrWorker, _TEXT + +//.text +//.align 8 +//C_FUNC(PointerToReturnFromCallDescrThunk): +//.quad LOCAL_LABEL(ReturnFromCallDescrThunk) +//.global C_FUNC(PointerToReturnFromCallDescrThunk) + +LEAF_ENTRY PointerToReturnFromCallDescrThunk, _TEXT +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif +LEAF_END PointerToReturnFromCallDescrThunk, _TEXT diff --git a/src/Native/Runtime/arm/ExceptionHandling.S b/src/Native/Runtime/arm/ExceptionHandling.S index de818954b..e5eaf6372 100644 --- a/src/Native/Runtime/arm/ExceptionHandling.S +++ b/src/Native/Runtime/arm/ExceptionHandling.S @@ -4,4 +4,143 @@ #include <unixasmmacros.inc> +.syntax unified +.thumb + // TODO: Implement Arm support + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// RhpThrowHwEx +// +// INPUT: RDI: exception code of fault +// RSI: faulting RIP +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpThrowHwEx, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpThrowHwEx2 + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpThrowHwEx + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// RhpThrowEx +// +// INPUT: RDI: exception object +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpThrowEx, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpThrowEx2 + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpThrowEx, _TEXT + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// void FASTCALL RhpRethrow() +// +// SUMMARY: Similar to RhpThrowEx, except that it passes along the currently active ExInfo +// +// INPUT: +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpRethrow, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpRethrow2 + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpRethrow, _TEXT + +// +// Prologue of all funclet calling helpers (RhpCallXXXXFunclet) +// + +// +// Epilogue of all funclet calling helpers (RhpCallXXXXFunclet) +// + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// void* FASTCALL RhpCallCatchFunclet(RtuObjectRef exceptionObj, void* pHandlerIP, REGDISPLAY* pRegDisplay, +// ExInfo* pExInfo) +// +// INPUT: RDI: exception object +// RSI: handler funclet address +// RDX: REGDISPLAY* +// RCX: ExInfo* +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpCallCatchFunclet, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpCallCatchFunclet2 + + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpCallCatchFunclet, _TEXT + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// void FASTCALL RhpCallFinallyFunclet(void* pHandlerIP, REGDISPLAY* pRegDisplay) +// +// INPUT: RDI: handler funclet address +// RSI: REGDISPLAY* +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpCallFinallyFunclet, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpCallFinallyFunclet2 + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpCallFinallyFunclet, _TEXT + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// void* FASTCALL RhpCallFilterFunclet(RtuObjectRef exceptionObj, void* pFilterIP, REGDISPLAY* pRegDisplay) +// +// INPUT: RDI: exception object +// RSI: filter funclet address +// RDX: REGDISPLAY* +// +// OUTPUT: +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +NESTED_ENTRY RhpCallFilterFunclet, _TEXT, NoHandler + +ALTERNATE_ENTRY RhpCallFilterFunclet2 + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpCallFilterFunclet, _TEXT diff --git a/src/Native/Runtime/arm/StubDispatch.S b/src/Native/Runtime/arm/StubDispatch.S index de818954b..7c79a11b8 100644 --- a/src/Native/Runtime/arm/StubDispatch.S +++ b/src/Native/Runtime/arm/StubDispatch.S @@ -4,4 +4,79 @@ #include <unixasmmacros.inc> +.syntax unified +.thumb + // TODO: Implement Arm support + +LEAF_ENTRY RhpCastableObjectDispatch_CommonStub, _TEXT + // UNIXTODO: Implement this function + //int 3 +LEAF_END RhpCastableObjectDispatch_CommonStub, _TEXT + +LEAF_ENTRY RhpTailCallTLSDispatchCell, _TEXT + // UNIXTODO: Implement this function + // int 3 +LEAF_END RhpTailCallTLSDispatchCell, _TEXT + +LEAF_ENTRY RhpCastableObjectDispatchHelper_TailCalled, _TEXT + // UNIXTODO: Implement this function + // int 3 +LEAF_END RhpCastableObjectDispatchHelper_TailCalled, _TEXT + +LEAF_ENTRY RhpCastableObjectDispatchHelper, _TEXT + // UNIXTODO: Implement this function + // int 3 +LEAF_END RhpCastableObjectDispatchHelper, _TEXT + + +// Stub dispatch routine for dispatch to a vtable slot +LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT + // UNIXTODO: Implement this function + // int 3 +LEAF_END RhpVTableOffsetDispatch, _TEXT + +// Initial dispatch on an interface when we don't have a cache yet. +LEAF_ENTRY RhpInitialInterfaceDispatch, _TEXT +ALTERNATE_ENTRY RhpInitialDynamicInterfaceDispatch + + // Just tail call to the cache miss helper. + // jmp C_FUNC(RhpInterfaceDispatchSlow) + +LEAF_END RhpInitialInterfaceDispatch, _TEXT + +// Cache miss case, call the runtime to resolve the target and update the cache. +// Use universal transition helper to allow an exception to flow out of resolution +LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT + // jmp C_FUNC(RhpUniversalTransition_DebugStepTailCall) + +LEAF_END RhpInterfaceDispatchSlow, _TEXT + + +LEAF_ENTRY RhpInterfaceDispatch1, _TEXT + +LEAF_END RhpInterfaceDispatch1, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch2, _TEXT + +LEAF_END RhpInterfaceDispatch2, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch4, _TEXT + +LEAF_END RhpInterfaceDispatch4, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch8, _TEXT + +LEAF_END RhpInterfaceDispatch8, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch16, _TEXT + +LEAF_END RhpInterfaceDispatch16, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch32, _TEXT + +LEAF_END RhpInterfaceDispatch32, _TEXT + +LEAF_ENTRY RhpInterfaceDispatch64, _TEXT + +LEAF_END RhpInterfaceDispatch64, _TEXT diff --git a/src/Native/Runtime/arm/UniversalTransition.S b/src/Native/Runtime/arm/UniversalTransition.S index de818954b..feaace2eb 100644 --- a/src/Native/Runtime/arm/UniversalTransition.S +++ b/src/Native/Runtime/arm/UniversalTransition.S @@ -4,4 +4,84 @@ #include <unixasmmacros.inc> +.syntax unified +.thumb + // TODO: Implement Arm support + +////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// RhpUniversalTransition +// +// At input to this function, r0-3, d0-7 and the stack may contain any number of arguments. +// +// In addition, there are 2 extra arguments passed in the RED ZONE (8 byte negative space +// off of sp). +// sp-4 will contain the managed function that is to be called by this transition function +// sp-8 will contain the pointer sized extra argument to the managed function +// +// When invoking the callee: +// +// r0 shall contain a pointer to the TransitionBlock +// r1 shall contain the value that was in sp-8 at entry to this function +// +// Frame layout is: +// +// {StackPassedArgs} ChildSP+078 CallerSP+000 +// {IntArgRegs (r0-r3) (0x10 bytes)} ChildSP+068 CallerSP-010 +// {ReturnBlock (0x20 bytes)} ChildSP+048 CallerSP-030 +// -- The base address of the Return block is the TransitionBlock pointer, the floating point args are +// in the neg space of the TransitionBlock pointer. Note that the callee has knowledge of the exact +// layout of all pieces of the frame that lie at or above the pushed floating point registers. +// {FpArgRegs (d0-d7) (0x40 bytes)} ChildSP+008 CallerSP-070 +// {PushedLR} ChildSP+004 CallerSP-074 +// {PushedR11} ChildSP+000 CallerSP-078 +// +// NOTE: If the frame layout ever changes, the C++ UniversalTransitionStackFrame structure +// must be updated as well. +// +// NOTE: The callee receives a pointer to the base of the ReturnBlock, and the callee has +// knowledge of the exact layout of all pieces of the frame that lie at or above the pushed +// FpArgRegs. +// +// NOTE: The stack walker guarantees that conservative GC reporting will be applied to +// everything between the base of the ReturnBlock and the top of the StackPassedArgs. +// +////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +NESTED_ENTRY RhpUniversalTransition, _TEXT, NoHandler + +LOCAL_LABEL(ReturnFromUniversalTransition): + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpUniversalTransition + +NESTED_ENTRY PointerToReturnFromUniversalTransition, _TEXT, NoHandler + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END PointerToReturnFromUniversalTransition + + +NESTED_ENTRY RhpUniversalTransition_DebugStepTailCall, _TEXT, NoHandler + +LOCAL_LABEL(ReturnFromUniversalTransition_DebugStepTailCall): + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END RhpUniversalTransition_DebugStepTailCall + +NESTED_ENTRY PointerToReturnFromUniversalTransition_DebugStepTailCall, _TEXT, NoHandler + +#ifdef _DEBUG + bl C_FUNC(NYI_Assert) +#endif + +NESTED_END PointerToReturnFromUniversalTransition_DebugStepTailCall diff --git a/src/Native/Runtime/arm/WriteBarriers.S b/src/Native/Runtime/arm/WriteBarriers.S index 316770987..c34af7e09 100644 --- a/src/Native/Runtime/arm/WriteBarriers.S +++ b/src/Native/Runtime/arm/WriteBarriers.S @@ -5,12 +5,27 @@ // TODO: Implement Unix write barriers #include <unixasmmacros.inc> +.syntax unified +.thumb + LEAF_ENTRY RhpAssignRef, _TEXT +ALTERNATE_ENTRY RhpAssignRefAVLocation str r1, [r0] bx lr LEAF_END RhpAssignRef, _TEXT +// Define a helper with a name of the form RhpCheckedAssignRefEAX etc. (along with suitable calling standard +// decoration). The location to be updated is always in RDI. The object reference that will be assigned into +// that location is in one of the other general registers determined by the value of REFREG. + +// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular: +// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen on the first instruction +// - Function "UnwindWriteBarrierToCaller" assumes the stack contains just the pushed return address LEAF_ENTRY RhpCheckedAssignRef, _TEXT + +// ALTERNATE_ENTRY RhpCheckedAssignRef +ALTERNATE_ENTRY RhpCheckedAssignRefAVLocation + str r1, [r0] bx lr LEAF_END RhpCheckedAssignRef, _TEXT @@ -32,3 +47,22 @@ LEAF_ENTRY RhpByRefAssignRef, _TEXT str r3, [r0], #4 bx lr LEAF_END RhpByRefAssignRef, _TEXT + + +// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular: +// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpCheckedLockCmpXchgAVLocation +// - Function "UnwindWriteBarrierToCaller" assumes the stack contains just the pushed return address +LEAF_ENTRY RhpCheckedLockCmpXchg, _TEXT +ALTERNATE_ENTRY RhpCheckedLockCmpXchgAVLocation +LEAF_END RhpCheckedLockCmpXchg, _TEXT + + +// WARNING: Code in EHHelpers.cpp makes assumptions about write barrier code, in particular: +// - Function "InWriteBarrierHelper" assumes an AV due to passed in null pointer will happen at RhpCheckedXchgAVLocation +// - Function "UnwindWriteBarrierToCaller" assumes the stack contains just the pushed return address +LEAF_ENTRY RhpCheckedXchg, _TEXT + +// Setup rax with the new object for the exchange, that way it will automatically hold the correct result +// afterwards and we can leave rdx unaltered ready for the GC write barrier below. +ALTERNATE_ENTRY RhpCheckedXchgAVLocation +LEAF_END RhpCheckedXchg, _TEXT |