mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 20:30:40 +02:00
* implement RawThunk for ARM
git-svn-id: trunk@42755 -
This commit is contained in:
parent
5978d9924f
commit
7b4cf161aa
@ -891,6 +891,34 @@ asm
|
||||
RawThunkEnd:
|
||||
end;
|
||||
{$endif}
|
||||
{$elseif defined(cpuarm)}
|
||||
const
|
||||
RawThunkPlaceholderProc = $87658765;
|
||||
RawThunkPlaceholderContext = $43214321;
|
||||
|
||||
type
|
||||
TRawThunkProc = PtrUInt;
|
||||
TRawThunkContext = PtrUInt;
|
||||
|
||||
procedure RawThunk; assembler; nostackframe;
|
||||
asm
|
||||
(* To be compatible with Thumb we first load the function pointer into R0,
|
||||
then move that to R12 which is volatile and then we load the new Self into
|
||||
R0 *)
|
||||
ldr r0, .LProc
|
||||
mov r12, r0
|
||||
ldr r0, .LContext
|
||||
{$ifdef CPUARM_HAS_BX}
|
||||
bx r12
|
||||
{$else}
|
||||
mov pc, r12
|
||||
{$endif}
|
||||
.LProc:
|
||||
.long RawThunkPlaceholderProc
|
||||
.LContext:
|
||||
.long RawThunkPlaceholderContext
|
||||
RawThunkEnd:
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{$if declared(RawThunk)}
|
||||
|
Loading…
Reference in New Issue
Block a user