aarch64: Introduce RSEQ_ASM_U64_PTR
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Feb 2024 14:20:07 +0000 (09:20 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 29 Feb 2024 14:20:07 +0000 (09:20 -0500)
This will allow moving __RSEQ_ASM_DEFINE_TABLE and
RSEQ_ASM_DEFINE_EXIT_POINT to a generic common header file.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ic5470bb851be1b79bbba387a4db2ce0911bbe23d

include/rseq/arch/aarch64.h

index 6d1dca4cf11e94ae4b67a4b8d8433e4225ea0434..9e75066b0bca0f93a43feb5de5456367aa644dda 100644 (file)
@@ -107,6 +107,8 @@ do {                                                                                \
        }                                                                       \
 } while (0)
 
+#define RSEQ_ASM_U64_PTR(x)    ".quad " x
+
 /* Temporary scratch registers. */
 #define RSEQ_ASM_TMP_REG32     "w15"
 #define RSEQ_ASM_TMP_REG       "x15"
@@ -119,12 +121,12 @@ do {                                                                              \
        "       .balign 32\n"                                                   \
        __rseq_str(label) ":\n"                                                 \
        "       .long   " __rseq_str(version) ", " __rseq_str(flags) "\n"       \
-       "       .quad   " __rseq_str(start_ip) ", "                             \
-                         __rseq_str(post_commit_offset) ", "                   \
-                         __rseq_str(abort_ip) "\n"                             \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(start_ip)) "\n"                   \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(post_commit_offset)) "\n"         \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(abort_ip)) "\n"                   \
        "       .popsection\n\t"                                                \
        "       .pushsection __rseq_cs_ptr_array, \"aw\"\n"                     \
-       "       .quad " __rseq_str(label) "b\n"                                 \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(label) "b") "\n"                  \
        "       .popsection\n"
 
 /*
@@ -166,7 +168,8 @@ do {                                                                                \
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                          \
        "       .pushsection __rseq_exit_point_array, \"aw\"\n"                 \
-       "       .quad " __rseq_str(start_ip) ", " __rseq_str(exit_ip) "\n"      \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(start_ip)) "\n"                   \
+       "       " RSEQ_ASM_U64_PTR(__rseq_str(exit_ip)) "\n"                    \
        "       .popsection\n"
 
 /*
This page took 0.029192 seconds and 4 git commands to generate.