summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads')
-rw-r--r--libpthread/linuxthreads/internals.h4
-rw-r--r--libpthread/linuxthreads/sysdeps/alpha/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/arm/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/avr32/pt-machine.h12
-rw-r--r--libpthread/linuxthreads/sysdeps/cris/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/hppa/pt-machine.h10
-rw-r--r--libpthread/linuxthreads/sysdeps/i386/pt-machine.h9
-rw-r--r--libpthread/linuxthreads/sysdeps/ia64/pt-machine.h10
-rw-r--r--libpthread/linuxthreads/sysdeps/m68k/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/mips/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/sh/pt-machine.h11
-rw-r--r--libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h11
12 files changed, 77 insertions, 45 deletions
diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h
index c8e4262d6..8e270e37a 100644
--- a/libpthread/linuxthreads/internals.h
+++ b/libpthread/linuxthreads/internals.h
@@ -531,9 +531,9 @@ weak_extern (__pthread_thread_self)
# define __manager_thread __pthread_manager_threadp
#endif
-extern __always_inline pthread_descr
+static __always_inline pthread_descr
check_thread_self (void);
-extern __always_inline pthread_descr
+static __always_inline pthread_descr
check_thread_self (void)
{
pthread_descr self = thread_self ();
diff --git a/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h b/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h
index 853ac6f04..26805c4e2 100644
--- a/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h
@@ -23,8 +23,14 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
+
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
#ifdef __linux__
@@ -33,9 +39,6 @@
# include <machine/pal.h>
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Get some notion of the current stack. Need not be exactly the top
of the stack, just something somewhere in the current frame. */
#define CURRENT_STACK_FRAME stack_pointer
diff --git a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h
index a4c2f314c..80d040f4c 100644
--- a/libpthread/linuxthreads/sysdeps/arm/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/arm/pt-machine.h
@@ -22,13 +22,16 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
+
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* This will not work on ARM1 or ARM2 because SWP is lacking on those
machines. Unfortunately we have no way to detect this at compile
time; let's hope nobody tries to use one. */
diff --git a/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h b/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h
index 9ff55586b..253bda528 100644
--- a/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h
@@ -11,6 +11,14 @@
#include <features.h>
+#ifndef PT_EI
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
+#endif
+
static inline int
_test_and_set (int *p, int v) __THROW
{
@@ -26,10 +34,6 @@ _test_and_set (int *p, int v) __THROW
return result;
}
-#ifndef PT_EI
-# define PT_EI extern inline
-#endif
-
extern long int testandset (int *spinlock);
extern int __compare_and_swap (long int *p, long int oldval, long int newval);
diff --git a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h
index 431da7101..d6e46f376 100644
--- a/libpthread/linuxthreads/sysdeps/cris/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/cris/pt-machine.h
@@ -21,13 +21,16 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
+
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
PT_EI long int
testandset (int *spinlock)
{
diff --git a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h b/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h
index abc25c4ca..e50a42e31 100644
--- a/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h
@@ -22,15 +22,17 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
#include <bits/initspin.h>
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Get some notion of the current stack. Need not be exactly the top
of the stack, just something somewhere in the current frame. */
#define CURRENT_STACK_FRAME stack_pointer
diff --git a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
index 8483d4ef6..ad004e90d 100644
--- a/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/i386/pt-machine.h
@@ -29,12 +29,17 @@
#ifndef __ASSEMBLER__
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
+/*
extern long int testandset (int *spinlock);
extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
+*/
/* Get some notion of the current stack. Need not be exactly the top
of the stack, just something somewhere in the current frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)
diff --git a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h
index be1d37986..2fc94ec46 100644
--- a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h
@@ -21,15 +21,17 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
#include <ia64intrin.h>
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Make sure gcc doesn't try to be clever and move things around on
us. We need to use _exactly_ the address the user gave us, not some
alias that contains the same information. */
diff --git a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
index ad524d6d2..3d1e87db1 100644
--- a/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h
@@ -22,13 +22,16 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
+
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Spinlock implementation; required. */
PT_EI long int
testandset (int *spinlock)
diff --git a/libpthread/linuxthreads/sysdeps/mips/pt-machine.h b/libpthread/linuxthreads/sysdeps/mips/pt-machine.h
index 96f7a7f8c..ce7028631 100644
--- a/libpthread/linuxthreads/sysdeps/mips/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/mips/pt-machine.h
@@ -24,17 +24,18 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
#include <sgidefs.h>
#include <sys/tas.h>
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
-
/* Spinlock implementation; required. */
PT_EI long int
diff --git a/libpthread/linuxthreads/sysdeps/sh/pt-machine.h b/libpthread/linuxthreads/sysdeps/sh/pt-machine.h
index 02545e6b4..d1e560d33 100644
--- a/libpthread/linuxthreads/sysdeps/sh/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/sh/pt-machine.h
@@ -22,14 +22,17 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+#include <features.h>
+
#ifndef __ASSEMBLER__
#ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
#endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Spinlock implementation; required. */
PT_EI long int
testandset (int *spinlock)
diff --git a/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h b/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h
index b30ab8518..66f9652fa 100644
--- a/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h
+++ b/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h
@@ -21,6 +21,8 @@
#ifndef _PT_MACHINE_H
#define _PT_MACHINE_H 1
+# include <features.h>
+
#ifndef __ASSEMBLER__
# include <stddef.h> /* For offsetof. */
# include <stdlib.h> /* For abort(). */
@@ -28,12 +30,13 @@
# ifndef PT_EI
-# define PT_EI extern inline __attribute__ ((always_inline))
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+# define PT_EI static inline __attribute__((always_inline))
+# else
+# define PT_EI extern inline __attribute__((always_inline))
+# endif
# endif
-extern long int testandset (int *spinlock);
-extern int __compare_and_swap (long int *p, long int oldval, long int newval);
-
/* Get some notion of the current stack. Need not be exactly the top
of the stack, just something somewhere in the current frame. */
# define CURRENT_STACK_FRAME stack_pointer