switch_alpha_unix.h 689 B

123456789101112131415161718192021222324252627282930
  1. #define STACK_REFPLUS 1
  2. #ifdef SLP_EVAL
  3. #define STACK_MAGIC 0
  4. #define REGS_TO_SAVE "$9", "$10", "$11", "$12", "$13", "$14", "$15", \
  5. "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8", "$f9"
  6. static int
  7. slp_switch(void)
  8. {
  9. register int ret;
  10. register long *stackref, stsizediff;
  11. __asm__ volatile ("" : : : REGS_TO_SAVE);
  12. __asm__ volatile ("mov $30, %0" : "=r" (stackref) : );
  13. {
  14. SLP_SAVE_STATE(stackref, stsizediff);
  15. __asm__ volatile (
  16. "addq $30, %0, $30\n\t"
  17. : /* no outputs */
  18. : "r" (stsizediff)
  19. );
  20. SLP_RESTORE_STATE();
  21. }
  22. __asm__ volatile ("" : : : REGS_TO_SAVE);
  23. __asm__ volatile ("mov $31, %0" : "=r" (ret) : );
  24. return ret;
  25. }
  26. #endif