Fix: use long rather than int for offsets
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Jan 2022 20:47:12 +0000 (15:47 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 21 Jan 2022 20:47:12 +0000 (15:47 -0500)
Fixes build issue on x86-64 where the assembler expects a 64-bit
register as input. Use long type across all architectures.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9537acf1269e5d3c0ed156e5f93a422ad5608a1b

include/rseq/rseq-arm.h
include/rseq/rseq-arm64.h
include/rseq/rseq-mips.h
include/rseq/rseq-ppc.h
include/rseq/rseq-s390.h
include/rseq/rseq-skip.h
include/rseq/rseq-x86.h
tests/basic_percpu_ops_test.c
tests/param_test.c

index c6fa158acc885f1a57c869f847b2c2538eca70a3..01a48dfec795c1f6da305f46541c26dadb01b31f 100644 (file)
@@ -218,7 +218,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index b61b228481dcfa16de736ec7df71d9e5c19a5171..b0e60200fa938f3aba99eb40d98d8cc56792c34e 100644 (file)
@@ -265,7 +265,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index ca0c8e0fb7363cb688e6258725c94ae4be0a0c34..d93a6d0805b52bd5c4bea6471f4b422c486299bd 100644 (file)
@@ -218,7 +218,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 5a8d05d311018c8ea64c925c6ab4a13ea9ee1713..0a6d4f93f93a7a4364171eeb32d4e06127688f36 100644 (file)
@@ -279,7 +279,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index aa8ebab9f7724bb6c79158c8d49877f88f40f619..9e1b69a582d096216ef66c56e06dbd6d4a569841 100644 (file)
@@ -207,7 +207,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index c5592fbf3cea4b387d17eb8db0efe6078c1684cb..473131ad52a9818b3ab328684bf316426553cf95 100644 (file)
@@ -13,7 +13,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        return -1;
 }
@@ -65,7 +65,7 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
 }
 
 static inline __attribute__((always_inline))
-int rseq_deref_loadoffp(void *p, int voffp, intptr_t *load, int cpu)
+int rseq_deref_loadoffp(void *p, long voffp, intptr_t *load, int cpu)
 {
        return -1;
 }
index a7ed624c6e7add2b8058f04e89fe2f195fef9bb9..7e0417fa773805904bc46988b647b984615786c7 100644 (file)
@@ -178,7 +178,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -300,7 +300,7 @@ error1:
  *  *pval += inc;
  */
 static inline __attribute__((always_inline))
-int rseq_offset_deref_addv(intptr_t *ptr, int off, intptr_t inc, int cpu)
+int rseq_offset_deref_addv(intptr_t *ptr, long off, intptr_t inc, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -636,7 +636,7 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
  * into @load.
  */
 static inline __attribute__((always_inline))
-int rseq_deref_loadoffp(intptr_t *p, int voffp, intptr_t *load, int cpu)
+int rseq_deref_loadoffp(intptr_t *p, long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -844,7 +844,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              int voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -1421,7 +1421,7 @@ error2:
  * into @load.
  */
 static inline __attribute__((always_inline))
-int rseq_deref_loadoffp(intptr_t *p, int voffp, intptr_t *load, int cpu)
+int rseq_deref_loadoffp(intptr_t *p, long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 9aa0d4344b98e678bfb26e14883a9121df3c544d..23d733cd137d0cc041d8c9ba51332734dddef187 100644 (file)
@@ -179,7 +179,8 @@ static struct percpu_list_node *this_cpu_list_pop(struct percpu_list *list,
        for (;;) {
                struct percpu_list_node *head;
                intptr_t *targetptr, expectnot, *load;
-               int offset, ret, cpu;
+               long offset;
+               int ret, cpu;
 
                cpu = rseq_cpu_start();
                targetptr = (intptr_t *)&list->c[cpu].head;
index a2929729c76a2dabbd0346f7ea773bbc66b96df1..4a45b5ca9758ec9b4f736e0069b79ab5215a4da4 100644 (file)
@@ -562,7 +562,8 @@ static struct percpu_list_node *this_cpu_list_pop(struct percpu_list *list,
        for (;;) {
                struct percpu_list_node *head;
                intptr_t *targetptr, expectnot, *load;
-               int offset, ret;
+               long offset;
+               int ret;
 
                cpu = rseq_cpu_start();
                targetptr = (intptr_t *)&list->c[cpu].head;
This page took 0.033996 seconds and 4 git commands to generate.