thumb.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2013 by the Free Pascal development team.
  4. Processor dependent implementation for the system unit for
  5. ARM Thumb
  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. {$define FPC_SYSTEM_HAS_SYSINITFPU}
  13. Procedure SysInitFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
  14. begin
  15. softfloat_exception_mask:=[float_flag_underflow,float_flag_inexact,float_flag_denormal];
  16. end;
  17. procedure fpc_cpuinit;
  18. begin
  19. SysInitFPU;
  20. end;
  21. procedure fpc_cpucodeinit;
  22. begin
  23. end;
  24. {$define FPC_SYSTEM_HAS_SYSRESETFPU}
  25. Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
  26. begin
  27. softfloat_exception_flags:=[];
  28. end;
  29. {$IFNDEF INTERNAL_BACKTRACE}
  30. {$define FPC_SYSTEM_HAS_GET_FRAME}
  31. function get_frame:pointer;assembler;nostackframe;
  32. asm
  33. end;
  34. {$ENDIF not INTERNAL_BACKTRACE}
  35. {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
  36. function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler;
  37. asm
  38. end;
  39. {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
  40. function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler;
  41. asm
  42. end;
  43. {$define FPC_SYSTEM_HAS_SPTR}
  44. Function Sptr : pointer;assembler;
  45. asm
  46. end;
  47. function InterLockedDecrement (var Target: longint) : longint;
  48. begin
  49. dec(Target);
  50. Result:=Target;
  51. end;
  52. function InterLockedIncrement (var Target: longint) : longint;
  53. begin
  54. inc(Target);
  55. Result:=Target;
  56. end;
  57. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  58. begin
  59. Result:=Target;
  60. Target:=Source;
  61. end;
  62. function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
  63. begin
  64. Result:=Target;
  65. if Target=Comperand then
  66. Target:=NewValue;
  67. end;
  68. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  69. begin
  70. Result:=Target;
  71. inc(Target,Source);
  72. end;