setjmp.h 614 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) 2018 Google, Inc
  4. * Written by Simon Glass <sjg@chromium.org>
  5. */
  6. #ifndef _SETJMP_H_
  7. #define _SETJMP_H_
  8. struct jmp_buf_data {
  9. /*
  10. * We're not sure how long this should be:
  11. *
  12. * amd64: 200 bytes
  13. * arm64: 392 bytes
  14. * armhf: 392 bytes
  15. *
  16. * So allow space for all of those, plus some extra.
  17. * We don't need to worry about 16-byte alignment, since this does not
  18. * run on Windows.
  19. */
  20. ulong data[128];
  21. };
  22. typedef struct jmp_buf_data jmp_buf[1];
  23. int setjmp(jmp_buf jmp);
  24. __noreturn void longjmp(jmp_buf jmp, int ret);
  25. #endif /* _SETJMP_H_ */