[uClibc-cvs] uClibc/libpthread/linuxthreads/sysdeps/i386/i686 pt-machine.h,1.1,1.2
Erik Andersen
andersen at codepoet.org
Thu Feb 27 18:13:24 UTC 2003
- Previous message: [uClibc-cvs] uClibc/libpthread/linuxthreads/sysdeps/cris stackinfo.h,NONE,1.1 pt-machine.h,1.1,1.2
- Next message: [uClibc-cvs] uClibc/libpthread/linuxthreads/sysdeps/i386 stackinfo.h,NONE,1.1 tls.h,NONE,1.1 pt-machine.h,1.1,1.2 sigcontextinfo.h,1.1,1.2 useldt.h,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/cvs/uClibc/libpthread/linuxthreads/sysdeps/i386/i686
In directory winder:/tmp/cvs-serv18985/libpthread/linuxthreads/sysdeps/i386/i686
Modified Files:
pt-machine.h
Log Message:
Major update for pthreads, based in large part on improvements
from glibc 2.3. This should make threads much more efficient.
-Erik
Index: pt-machine.h
===================================================================
RCS file: /var/cvs/uClibc/libpthread/linuxthreads/sysdeps/i386/i686/pt-machine.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pt-machine.h 20 Feb 2002 09:18:47 -0000 1.1
+++ pt-machine.h 27 Feb 2003 18:12:49 -0000 1.2
@@ -1,45 +1,51 @@
/* Machine-dependent pthreads configuration and inline functions.
i686 version.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson <rth at tamu.edu>.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
+ 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
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
+ You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
#ifndef PT_EI
# define PT_EI extern inline
#endif
+#include "kernel-features.h"
+#ifndef ASSEMBLER
+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
-register char * stack_pointer __asm__ ("%esp");
+#define CURRENT_STACK_FRAME __builtin_frame_address (0)
/* Spinlock implementation; required. */
-PT_EI int
+PT_EI long int
testandset (int *spinlock)
{
- int ret;
+ long int ret;
__asm__ __volatile__ (
"xchgl %0, %1"
- : "=r"(ret), "=m"(*spinlock)
- : "0"(1), "m"(*spinlock)
+ : "=r" (ret), "=m" (*spinlock)
+ : "0" (1), "m" (*spinlock)
: "memory");
return ret;
@@ -61,7 +67,13 @@
: "memory");
return ret;
}
+#endif
+#if __ASSUME_LDT_WORKS > 0
+#include "../useldt.h"
+#endif
-/* Use the LDT implementation only if the kernel is fixed. */
-//#include "../useldt.h"
+/* The P4 and above really want some help to prevent overheating. */
+#define BUSY_WAIT_NOP __asm__ ("rep; nop")
+
+#endif /* pt-machine.h */
- Previous message: [uClibc-cvs] uClibc/libpthread/linuxthreads/sysdeps/cris stackinfo.h,NONE,1.1 pt-machine.h,1.1,1.2
- Next message: [uClibc-cvs] uClibc/libpthread/linuxthreads/sysdeps/i386 stackinfo.h,NONE,1.1 tls.h,NONE,1.1 pt-machine.h,1.1,1.2 sigcontextinfo.h,1.1,1.2 useldt.h,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the uClibc-cvs
mailing list