aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2024-03-01 19:44:59 -0500
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>2024-03-01 20:32:11 -0500
commit040147907ff31cdc279568ffcb74197650430e4b (patch)
tree548a1482e2f67aa8f425fa7c59f0db97bc1076dd
parent18f21b27f01b9147cd95c538ece07f95c37150a2 (diff)
downloadlibrseq-040147907ff31cdc279568ffcb74197650430e4b.tar.gz
rseq.h: Introduce rseq_load_cbne_load_add_store__ptr
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Change-Id: I5011d4115d5dc0064b0d3fc359c037dcda02508c
-rw-r--r--include/rseq/rseq.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/rseq/rseq.h b/include/rseq/rseq.h
index b672468..5379b89 100644
--- a/include/rseq/rseq.h
+++ b/include/rseq/rseq.h
@@ -240,6 +240,25 @@ int rseq_load_cbne_store__ptr(enum rseq_mo rseq_mo, enum rseq_percpu_mode percpu
}
}
+#ifdef rseq_arch_has_load_cbne_load_add_store
+static inline __attribute__((always_inline))
+int rseq_load_cbne_load_add_store__ptr(enum rseq_mo rseq_mo, enum rseq_percpu_mode percpu_mode,
+ intptr_t *v, intptr_t expect,
+ intptr_t *v2, intptr_t count, int cpu)
+{
+ if (rseq_mo != RSEQ_MO_RELAXED)
+ return -1;
+ switch (percpu_mode) {
+ case RSEQ_PERCPU_CPU_ID:
+ return rseq_load_cbne_load_add_store__ptr_relaxed_cpu_id(v, expect, v2, count, cpu);
+ case RSEQ_PERCPU_MM_CID:
+ return rseq_load_cbne_load_add_store__ptr_relaxed_mm_cid(v, expect, v2, count, cpu);
+ default:
+ return -1;
+ }
+}
+#endif
+
static inline __attribute__((always_inline))
int rseq_load_cbeq_store_add_load_store__ptr(enum rseq_mo rseq_mo, enum rseq_percpu_mode percpu_mode,
intptr_t *v, intptr_t expectnot, long voffp, intptr_t *load,