cpu-op: add add_release API
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Apr 2019 18:51:52 +0000 (14:51 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Apr 2019 18:51:52 +0000 (14:51 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/rseq/cpu-op.h
src/cpu-op.c

index 899900688cdc7ae1e6e88dd0657ae9497c94d8f1..f0d5da1296304b0d7f933d2d7cc64e999b0f11b2 100644 (file)
@@ -19,6 +19,7 @@ int cpu_op_available(void);
 int cpu_op_cmpxchg(void *v, void *expect, void *old, void *_new, size_t len,
                   int cpu);
 int cpu_op_add(void *v, int64_t count, size_t len, int cpu);
+int cpu_op_add_release(void *v, int64_t count, size_t len, int cpu);
 
 int cpu_op_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu);
 int cpu_op_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
index f85a3cb363654c90add096ff3fe340a0f79410e2..3e69ce635958699a2ac055a3cd35c3e5df08925d 100644 (file)
@@ -119,6 +119,23 @@ int cpu_op_add(void *v, int64_t count, size_t len, int cpu)
        return cpu_opv(opvec, ARRAY_SIZE(opvec), cpu, 0);
 }
 
+int cpu_op_add_release(void *v, int64_t count, size_t len, int cpu)
+{
+       struct cpu_op opvec[] = {
+               [0] = {
+                       .op = CPU_ADD_RELEASE_OP,
+                       .len = len,
+                       .u.arithmetic_op = {
+                               .p = (unsigned long)v,
+                               .count = count,
+                               .expect_fault_p = 0,
+                       },
+               },
+       };
+
+       return cpu_opv(opvec, ARRAY_SIZE(opvec), cpu, 0);
+}
+
 int cpu_op_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv,
                         int cpu)
 {
This page took 0.040712 seconds and 4 git commands to generate.