This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[glibc] nptl: Add default pthread-offsets.h


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7ddac7f265d3db6888c68b04b86e265d15859ce5

commit 7ddac7f265d3db6888c68b04b86e265d15859ce5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Tue Nov 14 19:10:38 2017 -0200

    nptl: Add default pthread-offsets.h
    
    This patch adds a default pthread-offsets.h based on default
    thread definitions from struct_mutex.h and struct_rwlock.h.
    The idea is to simplify new ports inclusion.
    
    Checked with a build on affected abis.
    
    Change-Id: I7785a9581e651feb80d1413b9e03b5ac0452668a

Diff:
---
 sysdeps/aarch64/nptl/pthread-offsets.h    |  3 ---
 sysdeps/alpha/nptl/pthread-offsets.h      |  3 ---
 sysdeps/arm/nptl/pthread-offsets.h        |  7 -------
 sysdeps/csky/nptl/pthread-offsets.h       |  3 ---
 sysdeps/ia64/nptl/pthread-offsets.h       |  3 ---
 sysdeps/m68k/nptl/pthread-offsets.h       |  3 ---
 sysdeps/microblaze/nptl/pthread-offsets.h |  7 -------
 sysdeps/nios2/nptl/pthread-offsets.h      |  3 ---
 sysdeps/nptl/pthread-offsets.h            | 26 ++++++++++++++++++++++++++
 sysdeps/riscv/nptl/pthread-offsets.h      | 22 ----------------------
 sysdeps/sh/nptl/pthread-offsets.h         |  7 -------
 sysdeps/sparc/nptl/pthread-offsets.h      | 13 -------------
 12 files changed, 26 insertions(+), 74 deletions(-)

diff --git a/sysdeps/aarch64/nptl/pthread-offsets.h b/sysdeps/aarch64/nptl/pthread-offsets.h
deleted file mode 100644
index 7fe06e0..0000000
--- a/sysdeps/aarch64/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     16
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   48
diff --git a/sysdeps/alpha/nptl/pthread-offsets.h b/sysdeps/alpha/nptl/pthread-offsets.h
deleted file mode 100644
index 7fe06e0..0000000
--- a/sysdeps/alpha/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     16
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   48
diff --git a/sysdeps/arm/nptl/pthread-offsets.h b/sysdeps/arm/nptl/pthread-offsets.h
deleted file mode 100644
index e9accba..0000000
--- a/sysdeps/arm/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  27
-#else
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  24
-#endif
diff --git a/sysdeps/csky/nptl/pthread-offsets.h b/sysdeps/csky/nptl/pthread-offsets.h
deleted file mode 100644
index 7940d1f..0000000
--- a/sysdeps/csky/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   24
diff --git a/sysdeps/ia64/nptl/pthread-offsets.h b/sysdeps/ia64/nptl/pthread-offsets.h
deleted file mode 100644
index 7fe06e0..0000000
--- a/sysdeps/ia64/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     16
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   48
diff --git a/sysdeps/m68k/nptl/pthread-offsets.h b/sysdeps/m68k/nptl/pthread-offsets.h
deleted file mode 100644
index 4d6696a..0000000
--- a/sysdeps/m68k/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   27
diff --git a/sysdeps/microblaze/nptl/pthread-offsets.h b/sysdeps/microblaze/nptl/pthread-offsets.h
deleted file mode 100644
index e9accba..0000000
--- a/sysdeps/microblaze/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  27
-#else
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  24
-#endif
diff --git a/sysdeps/nios2/nptl/pthread-offsets.h b/sysdeps/nios2/nptl/pthread-offsets.h
deleted file mode 100644
index 7940d1f..0000000
--- a/sysdeps/nios2/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   24
diff --git a/sysdeps/nptl/pthread-offsets.h b/sysdeps/nptl/pthread-offsets.h
new file mode 100644
index 0000000..a399608
--- /dev/null
+++ b/sysdeps/nptl/pthread-offsets.h
@@ -0,0 +1,26 @@
+#include <bits/wordsize.h>
+
+/* These values are based on internal generic types from
+   mutex-internal.h and rwlock-internal.h.  */
+
+#if __WORDSIZE == 64
+# define __PTHREAD_MUTEX_NUSERS_OFFSET          12
+# define __PTHREAD_MUTEX_KIND_OFFSET            16
+# define __PTHREAD_MUTEX_SPINS_OFFSET           20
+# define __PTHREAD_MUTEX_LIST_OFFSET            24
+#else
+# define __PTHREAD_MUTEX_NUSERS_OFFSET          16
+# define __PTHREAD_MUTEX_KIND_OFFSET            12
+# define __PTHREAD_MUTEX_SPINS_OFFSET           20
+# define __PTHREAD_MUTEX_LIST_OFFSET            20
+#endif
+
+#if __WORDSIZE == 64
+# define __PTHREAD_RWLOCK_FLAGS_OFFSET          48
+#else
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         27
+# else
+#  define __PTHREAD_RWLOCK_FLAGS_OFFSET         24
+# endif
+#endif
diff --git a/sysdeps/riscv/nptl/pthread-offsets.h b/sysdeps/riscv/nptl/pthread-offsets.h
deleted file mode 100644
index 4f14276..0000000
--- a/sysdeps/riscv/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* RISC-V pthread offsets
-   Copyright (C) 2017-2019 Free Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <https://www.gnu.org/licenses/>.  */
-
-#define __PTHREAD_MUTEX_KIND_OFFSET     16
-
-#define __PTHREAD_RWLOCK_FLAGS_OFFSET   48
diff --git a/sysdeps/sh/nptl/pthread-offsets.h b/sysdeps/sh/nptl/pthread-offsets.h
deleted file mode 100644
index e9accba..0000000
--- a/sysdeps/sh/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#define __PTHREAD_MUTEX_KIND_OFFSET     12
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  27
-#else
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET  24
-#endif
diff --git a/sysdeps/sparc/nptl/pthread-offsets.h b/sysdeps/sparc/nptl/pthread-offsets.h
deleted file mode 100644
index 9e21121..0000000
--- a/sysdeps/sparc/nptl/pthread-offsets.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <bits/wordsize.h>
-
-#if __WORDSIZE == 64
-# define __PTHREAD_MUTEX_KIND_OFFSET     16
-#else
-# define __PTHREAD_MUTEX_KIND_OFFSET     12
-#endif
-
-#if __WORDSIZE == 64
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET   48
-#else
-# define __PTHREAD_RWLOCK_FLAGS_OFFSET   27
-#endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]