diff options
Diffstat (limited to 'libpthread/sysdeps/ia32')
-rw-r--r-- | libpthread/sysdeps/ia32/bits/atomic.h | 66 | ||||
-rw-r--r-- | libpthread/sysdeps/ia32/bits/memory.h | 40 | ||||
-rw-r--r-- | libpthread/sysdeps/ia32/bits/spin-lock-inline.h | 98 | ||||
-rw-r--r-- | libpthread/sysdeps/ia32/bits/spin-lock.h | 39 | ||||
-rw-r--r-- | libpthread/sysdeps/ia32/machine-sp.h | 30 | ||||
-rw-r--r-- | libpthread/sysdeps/ia32/pt-machdep.h | 29 |
6 files changed, 0 insertions, 302 deletions
diff --git a/libpthread/sysdeps/ia32/bits/atomic.h b/libpthread/sysdeps/ia32/bits/atomic.h deleted file mode 100644 index 0dfc1f60..00000000 --- a/libpthread/sysdeps/ia32/bits/atomic.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Atomic operations. i386 version. - Copyright (C) 2000 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 Library General Public License as - published by the Free Software Foundation; either version 2 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. - - You should have received a copy of the GNU Library 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 _BITS_ATOMIC_H -#define _BITS_ATOMIC_H 1 - -typedef __volatile int __atomic_t; - -static inline void -__atomic_inc (__atomic_t *__var) -{ - __asm__ __volatile ("lock; incl %0" : "=m" (*__var) : "m" (*__var)); -} - -static inline void -__atomic_dec (__atomic_t *__var) -{ - __asm__ __volatile ("lock; decl %0" : "=m" (*__var) : "m" (*__var)); -} - -static inline int -__atomic_dec_and_test (__atomic_t *__var) -{ - unsigned char __ret; - - __asm__ __volatile ("lock; decl %0; sete %1" - : "=m" (*__var), "=qm" (__ret) : "m" (*__var)); - return __ret != 0; -} - -/* We assume that an __atomicptr_t is only used for pointers to - word-aligned objects, and use the lowest bit for a simple lock. */ -typedef __volatile int * __atomicptr_t; - -/* Actually we don't implement that yet, and assume that we run on - something that has the i486 instruction set. */ -static inline int -__atomicptr_compare_and_swap (__atomicptr_t *__ptr, void *__oldval, - void * __newval) -{ - char __ret; - int __dummy; - - __asm__ __volatile ("lock; cmpxchgl %3, %1; sete %0" - : "=q" (__ret), "=m" (*__ptr), "=a" (__dummy) - : "r" (__newval), "m" (*__ptr), "a" (__oldval)); - return __ret; -} - -#endif diff --git a/libpthread/sysdeps/ia32/bits/memory.h b/libpthread/sysdeps/ia32/bits/memory.h deleted file mode 100644 index 932c4086..00000000 --- a/libpthread/sysdeps/ia32/bits/memory.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Memory barrier operations. i386 version. - Copyright (C) 2002, 2008 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 Library General Public License as - published by the Free Software Foundation; either version 2 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. - - You should have received a copy of the GNU Library 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 _BITS_MEMORY_H -#define _BITS_MEMORY_H 1 - -/* Prevent read and write reordering across this function. */ -static inline void -__memory_barrier (void) -{ - int i; - - /* Any lock'ed instruction will do. We just do a simple - increment. */ - __asm__ __volatile ("lock; incl %0" : "=m" (i) : "m" (i) : "memory"); -} - -/* Prevent read reordering across this function. */ -#define __memory_read_barrier __memory_barrier - -/* Prevent write reordering across this function. */ -#define __memory_write_barrier __memory_barrier - -#endif diff --git a/libpthread/sysdeps/ia32/bits/spin-lock-inline.h b/libpthread/sysdeps/ia32/bits/spin-lock-inline.h deleted file mode 100644 index e5ed3def..00000000 --- a/libpthread/sysdeps/ia32/bits/spin-lock-inline.h +++ /dev/null @@ -1,98 +0,0 @@ -/* Machine-specific definitions for spin locks. i386 version. - Copyright (C) 2000, 2005, 2008, 2009 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 Library General Public License as - published by the Free Software Foundation; either version 2 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. - - You should have received a copy of the GNU Library 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. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_SPIN_LOCK_INLINE_H -#define _BITS_SPIN_LOCK_INLINE_H 1 - -#include <features.h> -#include <bits/spin-lock.h> - -__BEGIN_DECLS - -#if defined __USE_EXTERN_INLINES || defined _FORCE_INLINES - -# ifndef __EBUSY -# include <errno.h> -# define __EBUSY EBUSY -# endif - -# ifndef __PT_SPIN_INLINE -# define __PT_SPIN_INLINE __extern_inline -# endif - -__PT_SPIN_INLINE int __pthread_spin_destroy (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_destroy (__pthread_spinlock_t *__lock) -{ - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_init (__pthread_spinlock_t *__lock, - int __pshared); - -__PT_SPIN_INLINE int -__pthread_spin_init (__pthread_spinlock_t *__lock, int __pshared) -{ - *__lock = __PTHREAD_SPIN_LOCK_INITIALIZER; - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_trylock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_trylock (__pthread_spinlock_t *__lock) -{ - int __locked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__locked), "=m" (*__lock) : "0" (1) : "memory"); - return __locked ? __EBUSY : 0; -} - -__extern_inline int __pthread_spin_lock (__pthread_spinlock_t *__lock); -extern int _pthread_spin_lock (__pthread_spinlock_t *__lock); - -__extern_inline int -__pthread_spin_lock (__pthread_spinlock_t *__lock) -{ - if (__pthread_spin_trylock (__lock)) - return _pthread_spin_lock (__lock); - return 0; -} - -__PT_SPIN_INLINE int __pthread_spin_unlock (__pthread_spinlock_t *__lock); - -__PT_SPIN_INLINE int -__pthread_spin_unlock (__pthread_spinlock_t *__lock) -{ - int __unlocked; - __asm__ __volatile ("xchgl %0, %1" - : "=&r" (__unlocked), "=m" (*__lock) : "0" (0) : "memory"); - return 0; -} - -#endif /* Use extern inlines or force inlines. */ - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/ia32/bits/spin-lock.h b/libpthread/sysdeps/ia32/bits/spin-lock.h deleted file mode 100644 index 5ae81e18..00000000 --- a/libpthread/sysdeps/ia32/bits/spin-lock.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Machine-specific definitions for spin locks. i386 version. - Copyright (C) 2000, 2005, 2008, 2009 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 Library General Public License as - published by the Free Software Foundation; either version 2 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. - - You should have received a copy of the GNU Library 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. */ - -/* - * Never include this file directly; use <pthread.h> or <cthreads.h> instead. - */ - -#ifndef _BITS_SPIN_LOCK_H -#define _BITS_SPIN_LOCK_H 1 - -#include <features.h> - -__BEGIN_DECLS - -/* The type of a spin lock object. */ -typedef __volatile int __pthread_spinlock_t; - -/* Initializer for a spin lock object. */ -# define __PTHREAD_SPIN_LOCK_INITIALIZER ((__pthread_spinlock_t) 0) - -__END_DECLS - -#endif /* bits/spin-lock.h */ diff --git a/libpthread/sysdeps/ia32/machine-sp.h b/libpthread/sysdeps/ia32/machine-sp.h deleted file mode 100644 index cef6ab72..00000000 --- a/libpthread/sysdeps/ia32/machine-sp.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Machine-specific function to return the stack pointer. i386 version. - Copyright (C) 1994, 1997, 2001, 2006 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _MACHINE_SP_H -#define _MACHINE_SP_H - -/* Return the current stack pointer. */ - -#define __thread_stack_pointer() ({ \ - register void *__sp__ asm("esp"); \ - __sp__; \ -}) - -#endif /* machine-sp.h */ diff --git a/libpthread/sysdeps/ia32/pt-machdep.h b/libpthread/sysdeps/ia32/pt-machdep.h deleted file mode 100644 index 6d456367..00000000 --- a/libpthread/sysdeps/ia32/pt-machdep.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Machine dependent pthreads internal defenitions. i386 version. - Copyright (C) 2000 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 Library General Public License as - published by the Free Software Foundation; either version 2 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. - - You should have received a copy of the GNU Library 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_MACHDEP_H -#define _PT_MACHDEP_H 1 - -struct pthread_mcontext -{ - void *pc; - void *sp; -}; - -#endif /* pt-machdep.h */ |