longjmp.h 401 B

1234567891011121314151617181920212223
  1. #ifndef __UML_LONGJMP_H
  2. #define __UML_LONGJMP_H
  3. #include "sysdep/archsetjmp.h"
  4. #include "os.h"
  5. extern int setjmp(jmp_buf);
  6. extern void longjmp(jmp_buf, int);
  7. #define UML_LONGJMP(buf, val) do { \
  8. longjmp(*buf, val); \
  9. } while(0)
  10. #define UML_SETJMP(buf) ({ \
  11. int n; \
  12. volatile int enable; \
  13. enable = get_signals(); \
  14. n = setjmp(*buf); \
  15. if(n != 0) \
  16. set_signals(enable); \
  17. n; })
  18. #endif