Skip to content

Commit b965746

Browse files
committed
rseq/selftests: Add support for arm64
Hook up arm64 support to the rseq selftests. Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 09ffcb0 commit b965746

3 files changed

Lines changed: 616 additions & 0 deletions

File tree

‎tools/testing/selftests/rseq/param_test.c‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ unsigned int yield_mod_cnt, nr_abort;
114114
"bne 222b\n\t" \
115115
"333:\n\t"
116116

117+
#elif defined(__AARCH64EL__)
118+
119+
#define RSEQ_INJECT_INPUT \
120+
, [loop_cnt_1] "Qo" (loop_cnt[1]) \
121+
, [loop_cnt_2] "Qo" (loop_cnt[2]) \
122+
, [loop_cnt_3] "Qo" (loop_cnt[3]) \
123+
, [loop_cnt_4] "Qo" (loop_cnt[4]) \
124+
, [loop_cnt_5] "Qo" (loop_cnt[5]) \
125+
, [loop_cnt_6] "Qo" (loop_cnt[6])
126+
127+
#define INJECT_ASM_REG RSEQ_ASM_TMP_REG32
128+
129+
#define RSEQ_INJECT_ASM(n) \
130+
" ldr " INJECT_ASM_REG ", %[loop_cnt_" #n "]\n" \
131+
" cbz " INJECT_ASM_REG ", 333f\n" \
132+
"222:\n" \
133+
" sub " INJECT_ASM_REG ", " INJECT_ASM_REG ", #1\n" \
134+
" cbnz " INJECT_ASM_REG ", 222b\n" \
135+
"333:\n"
136+
117137
#elif __PPC__
118138

119139
#define RSEQ_INJECT_INPUT \

0 commit comments

Comments
 (0)