setjump.inc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by the Free Pascal development team.
  5. SetJmp and LongJmp implementation for exception handling
  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. function setjmp(var S : jmp_buf) : longint;assembler;
  13. label FPC_SETJMP;
  14. asm
  15. // the usual entry code would mix up things here
  16. .globl FPC_SETJMP
  17. FPC_SETJMP:
  18. stmia r0,{v1-v6, sl, fp, sp, lr}
  19. mov r0,#0
  20. mov pc,lr
  21. end;
  22. procedure longjmp(var S : jmp_buf;value : longint);assembler;[Public, alias : 'FPC_LONGJMP'];
  23. asm
  24. mov ip, r0
  25. movs r0, r1
  26. moveq r0, #1
  27. ldmia ip,{v1-v6, sl, fp, sp, pc}
  28. end;
  29. {
  30. $Log$
  31. Revision 1.4 2004-03-23 19:13:09 florian
  32. * setjmp fixed
  33. Revision 1.3 2004/01/20 21:01:57 florian
  34. * fixed setjump
  35. * fixed syscalls
  36. Revision 1.2 2003/09/03 14:09:37 florian
  37. * arm fixes to the common rtl code
  38. * some generic math code fixed
  39. * ...
  40. Revision 1.1 2003/08/21 16:41:54 florian
  41. * empty dummy files
  42. + [long|set]jmp implemented
  43. }