jmpbuf-offsets.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (C) 2006-2016 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public License as
  5. published by the Free Software Foundation; either version 2.1 of the
  6. License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library. If not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #define JB_X19 0
  15. #define JB_X20 1
  16. #define JB_X21 2
  17. #define JB_X22 3
  18. #define JB_X23 4
  19. #define JB_X24 5
  20. #define JB_X25 6
  21. #define JB_X26 7
  22. #define JB_X27 8
  23. #define JB_X28 9
  24. #define JB_X29 10
  25. #define JB_LR 11
  26. #define JB_SP 13
  27. #define JB_D8 14
  28. #define JB_D9 15
  29. #define JB_D10 16
  30. #define JB_D11 17
  31. #define JB_D12 18
  32. #define JB_D13 19
  33. #define JB_D14 20
  34. #define JB_D15 21
  35. #ifndef __ASSEMBLER__
  36. #include <setjmp.h>
  37. #include <stdint.h>
  38. #include <sysdep.h>
  39. static inline uintptr_t __attribute__ ((unused))
  40. _jmpbuf_sp (__jmp_buf jmpbuf)
  41. {
  42. uintptr_t sp = jmpbuf[JB_SP];
  43. return sp;
  44. }
  45. #endif
  46. /* Helper for generic ____longjmp_chk(). */
  47. #define JB_FRAME_ADDRESS(buf) \
  48. ((void *) _jmpbuf_sp (buf))