076f82
commit 4b527650e0d559a5f693275c598667e06cd6455c
076f82
Author: Florian Weimer <fweimer@redhat.com>
076f82
Date:   Thu Jun 2 16:29:55 2022 +0200
076f82
076f82
    Linux: Adjust struct rseq definition to current kernel version
076f82
    
076f82
    This definition is only used as a fallback with old kernel headers.
076f82
    The change follows kernel commit bfdf4e6208051ed7165b2e92035b4bf11
076f82
    ("rseq: Remove broken uapi field layout on 32-bit little endian").
076f82
    
076f82
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
076f82
076f82
diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux/sys/rseq.h
076f82
index 791ed83176b61fe4..56550329db962cc8 100644
076f82
--- a/sysdeps/unix/sysv/linux/sys/rseq.h
076f82
+++ b/sysdeps/unix/sysv/linux/sys/rseq.h
076f82
@@ -24,7 +24,6 @@
076f82
 #include <stddef.h>
076f82
 #include <stdint.h>
076f82
 #include <sys/cdefs.h>
076f82
-#include <bits/endian.h>
076f82
 
076f82
 #ifdef __has_include
076f82
 # if __has_include ("linux/rseq.h")
076f82
@@ -129,28 +128,13 @@ struct rseq
076f82
        targeted by the rseq_cs.  Also needs to be set to NULL by user-space
076f82
        before reclaiming memory that contains the targeted struct rseq_cs.
076f82
 
076f82
-       Read and set by the kernel.  Set by user-space with single-copy
076f82
-       atomicity semantics.  This field should only be updated by the
076f82
-       thread which registered this data structure.  Aligned on 64-bit.  */
076f82
-    union
076f82
-      {
076f82
-        uint64_t ptr64;
076f82
-# ifdef __LP64__
076f82
-        uint64_t ptr;
076f82
-# else /* __LP64__ */
076f82
-        struct
076f82
-          {
076f82
-#if __BYTE_ORDER == __BIG_ENDIAN
076f82
-            uint32_t padding; /* Initialized to zero.  */
076f82
-            uint32_t ptr32;
076f82
-#  else /* LITTLE */
076f82
-            uint32_t ptr32;
076f82
-            uint32_t padding; /* Initialized to zero.  */
076f82
-#  endif /* ENDIAN */
076f82
-          } ptr;
076f82
-# endif /* __LP64__ */
076f82
-      } rseq_cs;
076f82
+       Read and set by the kernel. Set by user-space with single-copy
076f82
+       atomicity semantics. This field should only be updated by the
076f82
+       thread which registered this data structure. Aligned on 64-bit.
076f82
 
076f82
+       32-bit architectures should update the low order bits of the
076f82
+       rseq_cs field, leaving the high order bits initialized to 0.  */
076f82
+    uint64_t rseq_cs;
076f82
     /* Restartable sequences flags field.
076f82
 
076f82
        This field should only be updated by the thread which