selftests/rseq: introduce own copy of rseq uapi header
[platform/kernel/linux-rpi.git] / tools / testing / selftests / rseq / rseq.c
index fb440df..bfe1b26 100644 (file)
@@ -30,8 +30,8 @@
 #include "../kselftest.h"
 #include "rseq.h"
 
-__thread volatile struct rseq __rseq_abi = {
-       .cpu_id = RSEQ_CPU_ID_UNINITIALIZED,
+__thread volatile struct rseq_abi __rseq_abi = {
+       .cpu_id = RSEQ_ABI_CPU_ID_UNINITIALIZED,
 };
 
 /*
@@ -66,7 +66,7 @@ static void signal_restore(sigset_t oldset)
                abort();
 }
 
-static int sys_rseq(volatile struct rseq *rseq_abi, uint32_t rseq_len,
+static int sys_rseq(volatile struct rseq_abi *rseq_abi, uint32_t rseq_len,
                    int flags, uint32_t sig)
 {
        return syscall(__NR_rseq, rseq_abi, rseq_len, flags, sig);
@@ -86,13 +86,13 @@ int rseq_register_current_thread(void)
        }
        if (__rseq_refcount++)
                goto end;
-       rc = sys_rseq(&__rseq_abi, sizeof(struct rseq), 0, RSEQ_SIG);
+       rc = sys_rseq(&__rseq_abi, sizeof(struct rseq_abi), 0, RSEQ_SIG);
        if (!rc) {
                assert(rseq_current_cpu_raw() >= 0);
                goto end;
        }
        if (errno != EBUSY)
-               __rseq_abi.cpu_id = RSEQ_CPU_ID_REGISTRATION_FAILED;
+               __rseq_abi.cpu_id = RSEQ_ABI_CPU_ID_REGISTRATION_FAILED;
        ret = -1;
        __rseq_refcount--;
 end:
@@ -114,8 +114,8 @@ int rseq_unregister_current_thread(void)
        }
        if (--__rseq_refcount)
                goto end;
-       rc = sys_rseq(&__rseq_abi, sizeof(struct rseq),
-                     RSEQ_FLAG_UNREGISTER, RSEQ_SIG);
+       rc = sys_rseq(&__rseq_abi, sizeof(struct rseq_abi),
+                     RSEQ_ABI_FLAG_UNREGISTER, RSEQ_SIG);
        if (!rc)
                goto end;
        __rseq_refcount = 1;