sysutilp.inc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Florian Klaempfl
  5. member of the Free Pascal development team
  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. { ---------------------------------------------------------------------
  13. This include contains cpu-specific routines
  14. ---------------------------------------------------------------------}
  15. { the ARM doesn't know multiprocessor system which would require locking }
  16. function InterLockedDecrement (var Target: longint) : longint;
  17. begin
  18. dec(Target);
  19. result:=target;
  20. end;
  21. function InterLockedIncrement (var Target: longint) : longint;
  22. begin
  23. inc(Target);
  24. result:=target;
  25. end;
  26. function InterLockedExchange (var Target: longint;Source : longint) : longint;
  27. begin
  28. Result:=Target;
  29. Target:=Source;
  30. end;
  31. function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint;
  32. begin
  33. Result:=Target;
  34. inc(Target,Source);
  35. end;
  36. {
  37. $Log$
  38. Revision 1.2 2004-03-05 12:17:50 marco
  39. * interlocked* changed to longints, including winapi. (which was a bug)
  40. Revision 1.1 2003/11/30 19:48:20 florian
  41. * fixed some arm stuff
  42. }