Explorar o código

* implement interface thunk for RISC V 32- and 64-bit

git-svn-id: trunk@44071 -
svenbarth %!s(int64=5) %!d(string=hai) anos
pai
achega
7bcdc2b37f
Modificáronse 1 ficheiros con 40 adicións e 0 borrados
  1. 40 0
      packages/rtl-objpas/src/inc/rtti.pp

+ 40 - 0
packages/rtl-objpas/src/inc/rtti.pp

@@ -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)}