setjump.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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;[Public, alias : 'FPC_SETJMP'];nostackframe;
  13. label FPC_SETJMP;
  14. asm
  15. stmia r0,{v1-v6, sl, fp, sp, lr}
  16. mov r0,#0
  17. mov pc,lr
  18. end;
  19. procedure longjmp(var S : jmp_buf;value : longint);assembler;[Public, alias : 'FPC_LONGJMP'];
  20. asm
  21. mov ip, r0
  22. movs r0, r1
  23. moveq r0, #1
  24. ldmia ip,{v1-v6, sl, fp, sp, pc}
  25. end;
  26. {
  27. $Log$
  28. Revision 1.5 2005-01-04 16:22:05 florian
  29. + added nostackframe directive
  30. Revision 1.4 2004/03/23 19:13:09 florian
  31. * setjmp fixed
  32. Revision 1.3 2004/01/20 21:01:57 florian
  33. * fixed setjump
  34. * fixed syscalls
  35. Revision 1.2 2003/09/03 14:09:37 florian
  36. * arm fixes to the common rtl code
  37. * some generic math code fixed
  38. * ...
  39. Revision 1.1 2003/08/21 16:41:54 florian
  40. * empty dummy files
  41. + [long|set]jmp implemented
  42. }