rseq.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Restartable Sequences Linux aarch64 architecture header.
  2. Copyright (C) 2021-2026 Free Software Foundation, Inc.
  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
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the 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. <https://www.gnu.org/licenses/>. */
  14. #ifndef _SYS_RSEQ_H
  15. # error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
  16. #endif
  17. /* RSEQ_SIG is a signature required before each abort handler code.
  18. It is a 32-bit value that maps to actual architecture code compiled
  19. into applications and libraries. It needs to be defined for each
  20. architecture. When choosing this value, it needs to be taken into
  21. account that generating invalid instructions may have ill effects on
  22. tools like objdump, and may also have impact on the CPU speculative
  23. execution efficiency in some cases.
  24. aarch64 -mbig-endian generates mixed endianness code vs data:
  25. little-endian code and big-endian data. Ensure the RSEQ_SIG signature
  26. matches code endianness. */
  27. #define RSEQ_SIG_CODE 0xd428bc00 /* BRK #0x45E0. */
  28. #ifdef __AARCH64EB__
  29. # define RSEQ_SIG_DATA 0x00bc28d4 /* BRK #0x45E0. */
  30. #else
  31. # define RSEQ_SIG_DATA RSEQ_SIG_CODE
  32. #endif
  33. #define RSEQ_SIG RSEQ_SIG_DATA