home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / pippy-0.6beta-src.tar.gz / pippy-0.6beta-src.tar / pippy-0.6beta-src / src / Palm / libc / setjmp.S < prev    next >
Text File  |  2000-12-21  |  2KB  |  91 lines

  1. /* These are predefined by new versions of GNU cpp.  */
  2. #include "libc_segments.h"
  3. AS_SEG_LIBC
  4.     
  5. #ifndef __USER_LABEL_PREFIX__
  6. #define __USER_LABEL_PREFIX__ _
  7. #endif
  8.  
  9. #ifndef __REGISTER_PREFIX__
  10. #define __REGISTER_PREFIX__
  11. #endif
  12.  
  13. /* ANSI concatenation macros.  */
  14.  
  15. #define CONCAT1(a, b) CONCAT2(a, b)
  16. #define CONCAT2(a, b) a ## b
  17.  
  18. /* Use the right prefix for global labels.  */
  19.  
  20. #define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
  21.  
  22. /* Use the right prefix for registers.  */
  23.  
  24. #define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
  25.  
  26. #define d0 REG (d0)
  27. #define d1 REG (d1)
  28. #define d2 REG (d2)
  29. #define d3 REG (d3)
  30. #define d4 REG (d4)
  31. #define d5 REG (d5)
  32. #define d6 REG (d6)
  33. #define d7 REG (d7)
  34. #define a0 REG (a0)
  35. #define a1 REG (a1)
  36. #define a2 REG (a2)
  37. #define a3 REG (a3)
  38. #define a4 REG (a4)
  39. #define a5 REG (a5)
  40. #define a6 REG (a6)
  41. #define fp REG (fp)
  42. #define sp REG (sp)
  43.  
  44. .global SYM (setjmp)
  45. .global SYM (longjmp)
  46.  
  47. SYM (setjmp):
  48.     moveal sp@(4),a0
  49.     movel sp@(0),a0@(12)
  50.     movel sp,a0@(8)
  51.     moveml d2-d7/a2-a6,a0@(20)
  52.     clrl d0
  53.     rts
  54.  
  55. SYM (longjmp):
  56.     moveal sp@(4),a0
  57.     movel sp@(8),d0
  58.     bne 1f
  59.     movel #1,d0
  60. 1:
  61.     moveml a0@(20),d2-d7/a2-a6
  62.     moveal a0@(8),sp
  63.     movel a0@(12),sp@
  64.     rts
  65.  
  66. #ifdef M68881
  67. .global SYM (setjmp_68881)
  68. .global SYM (longjmp_68881)
  69.  
  70. SYM (setjmp_68881):
  71.     moveal sp@(4),a0
  72.     movel sp@(0),a0@(12)
  73.     movel sp,a0@(8)
  74.     moveml d2-d7/a2-a6,a0@(20)
  75.     fmovemx fp2-fp7,a0@(64)
  76.     clrl d0
  77.     rts
  78.  
  79. SYM (longjmp_68881):
  80.     moveal sp@(4),a0
  81.     fmovemx a0@(64),fp2-fp7
  82.     movel sp@(8),d0
  83.     bne 1f
  84.     movel #1,d0
  85. 1:
  86.     moveml a0@(20),d2-d7/a2-a6
  87.     moveal a0@(8),sp
  88.     movel a0@(12),sp@
  89.     rts
  90. #endif
  91.