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