mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 16:59:12 +02:00
* implement interface thunk for RISC V 32- and 64-bit
git-svn-id: trunk@44071 -
This commit is contained in:
parent
f1eccca3a6
commit
7bcdc2b37f
@ -975,6 +975,46 @@ asm
|
|||||||
jmp (a0)
|
jmp (a0)
|
||||||
RawThunkEnd:
|
RawThunkEnd:
|
||||||
end;
|
end;
|
||||||
|
{$elseif defined(cpuriscv64)}
|
||||||
|
const
|
||||||
|
RawThunkPlaceholderProc = $8765876587658765;
|
||||||
|
RawThunkPlaceholderContext = $4321432143214321;
|
||||||
|
|
||||||
|
type
|
||||||
|
TRawThunkProc = PtrUInt;
|
||||||
|
TRawThunkContext = PtrUInt;
|
||||||
|
|
||||||
|
procedure RawThunk; assembler; nostackframe;
|
||||||
|
asm
|
||||||
|
ld x5, .LProc
|
||||||
|
ld x10, .LContext
|
||||||
|
jalr x0, x5, 0
|
||||||
|
.LProc:
|
||||||
|
.quad RawThunkPlaceholderProc
|
||||||
|
.LContext:
|
||||||
|
.quad RawThunkPlaceholderContext
|
||||||
|
RawThunkEnd:
|
||||||
|
end;
|
||||||
|
{$elseif defined(cpuriscv32)}
|
||||||
|
const
|
||||||
|
RawThunkPlaceholderProc = $87658765;
|
||||||
|
RawThunkPlaceholderContext = $43214321;
|
||||||
|
|
||||||
|
type
|
||||||
|
TRawThunkProc = PtrUInt;
|
||||||
|
TRawThunkContext = PtrUInt;
|
||||||
|
|
||||||
|
procedure RawThunk; assembler; nostackframe;
|
||||||
|
asm
|
||||||
|
lw x5, .LProc
|
||||||
|
lw x10, .LContext
|
||||||
|
jalr x0, x5, 0
|
||||||
|
.LProc:
|
||||||
|
.long RawThunkPlaceholderProc
|
||||||
|
.LContext:
|
||||||
|
.long RawThunkPlaceholderContext
|
||||||
|
RawThunkEnd:
|
||||||
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$if declared(RawThunk)}
|
{$if declared(RawThunk)}
|
||||||
|
Loading…
Reference in New Issue
Block a user