thumb.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. function InterLockedDecrement (var Target: longint) : longint;
  49. begin
  50. dec(Target);
  51. Result:=Target;
  52. end;
  53. function InterLockedIncrement (var Target: longint) : longint;
  54. begin
  55. inc(Target);
  56. Result:=Target;
  57. end;
  58. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  59. begin
  60. Result:=Target;
  61. Target:=Source;
  62. end;
  63. function InterlockedCompareExchange(var Target: longint; NewValue: longint; Comperand: longint): longint;
  64. begin
  65. Result:=Target;
  66. if Target=Comperand then
  67. Target:=NewValue;
  68. end;
  69. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  70. begin
  71. Result:=Target;
  72. inc(Target,Source);
  73. end;