rseq-bits-template.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * rseq-bits-template.h
  4. *
  5. * (C) Copyright 2016-2022 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  6. */
  7. #ifdef RSEQ_TEMPLATE_CPU_ID
  8. # define RSEQ_TEMPLATE_CPU_ID_OFFSET RSEQ_CPU_ID_OFFSET
  9. # define RSEQ_TEMPLATE_CPU_ID_FIELD cpu_id
  10. # ifdef RSEQ_TEMPLATE_MO_RELEASE
  11. # define RSEQ_TEMPLATE_SUFFIX _release_cpu_id
  12. # elif defined (RSEQ_TEMPLATE_MO_RELAXED)
  13. # define RSEQ_TEMPLATE_SUFFIX _relaxed_cpu_id
  14. # else
  15. # error "Never use <rseq-bits-template.h> directly; include <rseq.h> instead."
  16. # endif
  17. #elif defined(RSEQ_TEMPLATE_MM_CID)
  18. # define RSEQ_TEMPLATE_CPU_ID_OFFSET RSEQ_MM_CID_OFFSET
  19. # define RSEQ_TEMPLATE_CPU_ID_FIELD mm_cid
  20. # ifdef RSEQ_TEMPLATE_MO_RELEASE
  21. # define RSEQ_TEMPLATE_SUFFIX _release_mm_cid
  22. # elif defined (RSEQ_TEMPLATE_MO_RELAXED)
  23. # define RSEQ_TEMPLATE_SUFFIX _relaxed_mm_cid
  24. # else
  25. # error "Never use <rseq-bits-template.h> directly; include <rseq.h> instead."
  26. # endif
  27. #elif defined (RSEQ_TEMPLATE_CPU_ID_NONE)
  28. # ifdef RSEQ_TEMPLATE_MO_RELEASE
  29. # define RSEQ_TEMPLATE_SUFFIX _release
  30. # elif defined (RSEQ_TEMPLATE_MO_RELAXED)
  31. # define RSEQ_TEMPLATE_SUFFIX _relaxed
  32. # else
  33. # error "Never use <rseq-bits-template.h> directly; include <rseq.h> instead."
  34. # endif
  35. #else
  36. # error "Never use <rseq-bits-template.h> directly; include <rseq.h> instead."
  37. #endif
  38. #define RSEQ_TEMPLATE_IDENTIFIER(x) RSEQ_COMBINE_TOKENS(x, RSEQ_TEMPLATE_SUFFIX)