thumb.inc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. {$ifndef FPUNONE}
  16. softfloat_exception_mask:=[float_flag_underflow,float_flag_inexact,float_flag_denormal];
  17. softfloat_exception_flags:=[];
  18. {$endif FPUNONE}
  19. end;
  20. procedure fpc_cpucodeinit;
  21. begin
  22. end;
  23. {$define FPC_SYSTEM_HAS_SYSRESETFPU}
  24. Procedure SysResetFPU;{$ifdef SYSTEMINLINE}inline;{$endif}
  25. begin
  26. {$ifndef FPUNONE}
  27. softfloat_exception_flags:=[];
  28. {$endif FPUNONE}
  29. end;
  30. {$IFNDEF INTERNAL_BACKTRACE}
  31. {$define FPC_SYSTEM_HAS_GET_FRAME}
  32. function get_frame:pointer;assembler;nostackframe;
  33. asm
  34. end;
  35. {$ENDIF not INTERNAL_BACKTRACE}
  36. {$define FPC_SYSTEM_HAS_GET_CALLER_ADDR}
  37. function get_caller_addr(framebp:pointer;addr:pointer=nil):pointer;assembler;
  38. asm
  39. end;
  40. {$define FPC_SYSTEM_HAS_GET_CALLER_FRAME}
  41. function get_caller_frame(framebp:pointer;addr:pointer=nil):pointer;assembler;
  42. asm
  43. end;
  44. {$define FPC_SYSTEM_HAS_SPTR}
  45. Function Sptr : pointer;assembler;
  46. asm
  47. end;
  48. {$ifdef VER3_2}
  49. function InterLockedDecrement (var Target: longint) : longint;
  50. begin
  51. dec(Target);
  52. Result:=Target;
  53. end;
  54. function InterLockedIncrement (var Target: longint) : longint;
  55. begin
  56. inc(Target);
  57. Result:=Target;
  58. end;
  59. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  60. begin
  61. Result:=Target;
  62. Target:=Source;
  63. end;
  64. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  65. begin
  66. Result:=Target;
  67. inc(Target,Source);
  68. end;
  69. {$endif VER3_2}
  70. {$ifdef VER3_2}
  71. function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
  72. {$else VER3_2}
  73. {$define FPC_SYSTEM_HAS_ATOMIC_CMP_XCHG_32}
  74. function fpc_atomic_cmp_xchg_32(var Target: longint; NewValue: longint; Comparand: longint): longint; [public,alias:'FPC_ATOMIC_CMP_XCHG_32'];
  75. {$endif VER3_2}
  76. begin
  77. Result:=Target;
  78. if Target={$ifdef VER3_2}Comperand{$else}Comparand{$endif} then
  79. Target:=NewValue;
  80. end;