Skip to content

Commit 5484ebe

Browse files
committed
rseq/selftests: Add support for OpenRISC
Add support for OpenRISC in the rseq selftests. OpenRISC is 32-bit only. Tested this with: Compiler: gcc version 14.2.0 (GCC) Binutils: GNU assembler version 2.43.1 (or1k-smh-linux-gnu) using BFD version (GNU Binutils) 2.43.1.20241207 Linux: Linux buildroot 6.13.0-rc2-00005-g1fa73dd6c2d3-dirty torvalds#213 SMP Sat Dec 28 22:18:39 GMT 2024 openrisc GNU/Linux Glibc: 2024-12-13 e4e49583d9 Stafford Horne or1k: Update libm-test-ulps Signed-off-by: Stafford Horne <[email protected]> Reviewed-by: Mathieu Desnoyers <[email protected]>
1 parent 25dafd9 commit 5484ebe

File tree

6 files changed

+634
-0
lines changed

6 files changed

+634
-0
lines changed

tools/testing/selftests/rseq/param_test.c

+24
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,32 @@ unsigned int yield_mod_cnt, nr_abort;
226226
"addi " INJECT_ASM_REG "," INJECT_ASM_REG ", -1\n\t" \
227227
"bnez " INJECT_ASM_REG ", 222b\n\t" \
228228
"333:\n\t"
229+
#elif defined(__or1k__)
229230

231+
#define RSEQ_INJECT_INPUT \
232+
, [loop_cnt_1]"m"(loop_cnt[1]) \
233+
, [loop_cnt_2]"m"(loop_cnt[2]) \
234+
, [loop_cnt_3]"m"(loop_cnt[3]) \
235+
, [loop_cnt_4]"m"(loop_cnt[4]) \
236+
, [loop_cnt_5]"m"(loop_cnt[5]) \
237+
, [loop_cnt_6]"m"(loop_cnt[6])
230238

239+
#define INJECT_ASM_REG "r31"
240+
241+
#define RSEQ_INJECT_CLOBBER \
242+
, INJECT_ASM_REG
243+
244+
#define RSEQ_INJECT_ASM(n) \
245+
"l.lwz " INJECT_ASM_REG ", %[loop_cnt_" #n "]\n\t" \
246+
"l.sfeqi " INJECT_ASM_REG ", 0\n\t" \
247+
"l.bf 333f\n\t" \
248+
" l.nop\n\t" \
249+
"222:\n\t" \
250+
"l.addi " INJECT_ASM_REG "," INJECT_ASM_REG ", -1\n\t" \
251+
"l.sfeqi " INJECT_ASM_REG ", 0\n\t" \
252+
"l.bf 222f\n\t" \
253+
" l.nop\n\t" \
254+
"333:\n\t"
231255
#else
232256
#error unsupported target
233257
#endif

0 commit comments

Comments
 (0)