riscv32.inc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2008 by the Free Pascal development team.
  4. Processor dependent implementation for the system unit for
  5. AVR
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. procedure fpc_cpuinit;{$ifdef SYSTEMINLINE}inline;{$endif}
  13. begin
  14. end;
  15. {$IFNDEF INTERNAL_BACKTRACE}
  16. {$define FPC_SYSTEM_HAS_GET_FRAME}
  17. function get_frame:pointer;assembler;nostackframe;
  18. asm
  19. end;
  20. {$ENDIF not INTERNAL_BACKTRACE}
  21. {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
  22. function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler;
  23. asm
  24. end;
  25. {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
  26. function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler;
  27. asm
  28. end;
  29. {$define FPC_SYSTEM_HAS_SPTR}
  30. Function Sptr : pointer;assembler;
  31. asm
  32. end;
  33. function InterLockedDecrement (var Target: longint) : longint;
  34. begin
  35. dec(Target);
  36. Result:=Target;
  37. end;
  38. function InterLockedIncrement (var Target: longint) : longint;
  39. begin
  40. inc(Target);
  41. Result:=Target;
  42. end;
  43. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  44. begin
  45. Result:=Target;
  46. Target:=Source;
  47. end;
  48. function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
  49. begin
  50. Result:=Target;
  51. if Target=Comperand then
  52. Target:=NewValue;
  53. end;
  54. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  55. begin
  56. Result:=Target;
  57. inc(Target,Source);
  58. end;