sysutilp.inc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Florian Klaempfl
  4. member of the Free Pascal development team
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. { ---------------------------------------------------------------------
  12. This include contains cpu-specific routines
  13. ---------------------------------------------------------------------}
  14. { the ARM doesn't know multiprocessor system which would require locking }
  15. function InterLockedDecrement (var Target: longint) : longint;
  16. begin
  17. dec(Target);
  18. result:=target;
  19. end;
  20. function InterLockedIncrement (var Target: longint) : longint;
  21. begin
  22. inc(Target);
  23. result:=target;
  24. end;
  25. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  26. begin
  27. Result:=Target;
  28. Target:=Source;
  29. end;
  30. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  31. begin
  32. Result:=Target;
  33. inc(Target,Source);
  34. end;