Lines Matching +full:1 +full:- +full:4

1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
5 * (C) Copyright 2016-2022 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 #include "rseq-bits-template.h"
19 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
20 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) in RSEQ_TEMPLATE_IDENTIFIER()
22 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
23 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2]) in RSEQ_TEMPLATE_IDENTIFIER()
26 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
27 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
29 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
30 "bne $4, %[expect], %l[cmpfail]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
31 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
34 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
35 "bne $4, %[expect], %l[error2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
42 RSEQ_ASM_DEFINE_ABORT(3, 4, "", abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
46 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
47 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
52 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
62 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
64 return 1; in RSEQ_TEMPLATE_IDENTIFIER()
80 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
81 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) in RSEQ_TEMPLATE_IDENTIFIER()
83 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
84 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2]) in RSEQ_TEMPLATE_IDENTIFIER()
87 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
88 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
90 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
91 "beq $4, %[expectnot], %l[cmpfail]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
92 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
95 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
96 "beq $4, %[expectnot], %l[error2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
98 LONG_S " $4, %[load]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
99 LONG_ADDI " $4, %[voffp]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
100 LONG_L " $4, 0($4)\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
102 LONG_S " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
106 RSEQ_ASM_DEFINE_ABORT(3, 4, "", abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
110 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
111 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
118 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
128 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
130 return 1; in RSEQ_TEMPLATE_IDENTIFIER()
145 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
147 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
150 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
151 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
156 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
157 LONG_ADDI " $4, %[count]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
159 LONG_S " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
161 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
163 RSEQ_ASM_DEFINE_ABORT(3, 4, "", abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
167 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
168 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
172 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
182 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
197 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
198 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) in RSEQ_TEMPLATE_IDENTIFIER()
200 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
201 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2]) in RSEQ_TEMPLATE_IDENTIFIER()
202 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error3]) in RSEQ_TEMPLATE_IDENTIFIER()
205 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
206 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
208 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
209 "bne $4, %[expect], %l[cmpfail]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
210 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
211 LONG_L " $4, %[v2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
212 "bne $4, %[expect2], %l[cmpfail]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
216 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
217 "bne $4, %[expect], %l[error2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
218 LONG_L " $4, %[v2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
219 "bne $4, %[expect2], %l[error3]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
226 RSEQ_ASM_DEFINE_ABORT(3, 4, "", abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
230 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
231 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
240 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
250 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
252 return 1; in RSEQ_TEMPLATE_IDENTIFIER()
257 rseq_bug("1st expected value comparison failed"); in RSEQ_TEMPLATE_IDENTIFIER()
277 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
278 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) in RSEQ_TEMPLATE_IDENTIFIER()
280 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
281 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2]) in RSEQ_TEMPLATE_IDENTIFIER()
284 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
285 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
287 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
288 "bne $4, %[expect], %l[cmpfail]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
289 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
292 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
293 "bne $4, %[expect], %l[error2]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
299 "sync\n\t" /* full sync provides store-release */ in RSEQ_TEMPLATE_IDENTIFIER()
306 RSEQ_ASM_DEFINE_ABORT(3, 4, "", abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
310 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
311 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
320 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
330 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
332 return 1; in RSEQ_TEMPLATE_IDENTIFIER()
351 RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */ in RSEQ_TEMPLATE_IDENTIFIER()
352 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail]) in RSEQ_TEMPLATE_IDENTIFIER()
354 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1]) in RSEQ_TEMPLATE_IDENTIFIER()
355 RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error2]) in RSEQ_TEMPLATE_IDENTIFIER()
361 RSEQ_ASM_STORE_RSEQ_CS(1, 3f, rseq_cs) in RSEQ_TEMPLATE_IDENTIFIER()
362 RSEQ_ASM_CMP_CPU_ID(cpu_id, current_cpu_id, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
364 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
365 "bne $4, %[expect], 5f\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
366 RSEQ_INJECT_ASM(4) in RSEQ_TEMPLATE_IDENTIFIER()
369 LONG_L " $4, %[v]\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
370 "bne $4, %[expect], 7f\n\t" in RSEQ_TEMPLATE_IDENTIFIER()
375 "lb $4, 0(%[src])\n\t" \ in RSEQ_TEMPLATE_IDENTIFIER()
376 "sb $4, 0(%[dst])\n\t" \ in RSEQ_TEMPLATE_IDENTIFIER()
377 LONG_ADDI " %[src], 1\n\t" \ in RSEQ_TEMPLATE_IDENTIFIER()
378 LONG_ADDI " %[dst], 1\n\t" \ in RSEQ_TEMPLATE_IDENTIFIER()
379 LONG_ADDI " %[len], -1\n\t" \ in RSEQ_TEMPLATE_IDENTIFIER()
384 "sync\n\t" /* full sync provides store-release */ in RSEQ_TEMPLATE_IDENTIFIER()
395 RSEQ_ASM_DEFINE_ABORT(3, 4, in RSEQ_TEMPLATE_IDENTIFIER()
400 abort, 1b, 2b, 4f) in RSEQ_TEMPLATE_IDENTIFIER()
424 [current_cpu_id] "m" (rseq_get_abi()->RSEQ_TEMPLATE_CPU_ID_FIELD), in RSEQ_TEMPLATE_IDENTIFIER()
425 [rseq_cs] "m" (rseq_get_abi()->rseq_cs.arch.ptr), in RSEQ_TEMPLATE_IDENTIFIER()
435 [rseq_scratch1] "m" (rseq_scratch[1]), in RSEQ_TEMPLATE_IDENTIFIER()
438 : "$4", "memory" in RSEQ_TEMPLATE_IDENTIFIER()
448 return -1; in RSEQ_TEMPLATE_IDENTIFIER()
450 return 1; in RSEQ_TEMPLATE_IDENTIFIER()
462 #include "rseq-bits-reset.h"