summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/sh
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-05-20 19:02:51 +0000
committerEric Andersen <andersen@codepoet.org>2005-05-20 19:02:51 +0000
commit124af9f4b2b77b1510d88cfc8092c788d7e513c7 (patch)
treeccce720bef4c1c604417e2082cf9997a8d6dd7ab /libpthread/nptl/sysdeps/sh
parent8028f35dbe29c5ace3883005e08ac91d873553b2 (diff)
Back out nptl changes, which for now will be done in branches/uClibc-nptl
Diffstat (limited to 'libpthread/nptl/sysdeps/sh')
-rw-r--r--libpthread/nptl/sysdeps/sh/Makefile3
-rw-r--r--libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h31
-rw-r--r--libpthread/nptl/sysdeps/sh/pthread_spin_init.c20
-rw-r--r--libpthread/nptl/sysdeps/sh/pthread_spin_lock.c35
-rw-r--r--libpthread/nptl/sysdeps/sh/pthread_spin_trylock.S32
-rw-r--r--libpthread/nptl/sysdeps/sh/pthread_spin_unlock.S30
-rw-r--r--libpthread/nptl/sysdeps/sh/pthreaddef.h49
-rw-r--r--libpthread/nptl/sysdeps/sh/tcb-offsets.sym11
-rw-r--r--libpthread/nptl/sysdeps/sh/tls.h145
9 files changed, 0 insertions, 356 deletions
diff --git a/libpthread/nptl/sysdeps/sh/Makefile b/libpthread/nptl/sysdeps/sh/Makefile
deleted file mode 100644
index 81bddf688..000000000
--- a/libpthread/nptl/sysdeps/sh/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-ifeq ($(subdir),csu)
-gen-as-const-headers += tcb-offsets.sym
-endif
diff --git a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
deleted file mode 100644
index cf6d25f04..000000000
--- a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
-
- 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. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(jmpbuf, address, adj) \
- ((uintptr_t) (address) - (adj) < (uintptr_t) (jmpbuf)[0].__regs[7] - (adj))
-
-/* We use the normal lobngjmp for unwinding. */
-#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/libpthread/nptl/sysdeps/sh/pthread_spin_init.c b/libpthread/nptl/sysdeps/sh/pthread_spin_init.c
deleted file mode 100644
index 0a47981aa..000000000
--- a/libpthread/nptl/sysdeps/sh/pthread_spin_init.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
-
- 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. */
-
-/* Not needed. pthread_spin_init is an alias for pthread_spin_unlock. */
diff --git a/libpthread/nptl/sysdeps/sh/pthread_spin_lock.c b/libpthread/nptl/sysdeps/sh/pthread_spin_lock.c
deleted file mode 100644
index e73264108..000000000
--- a/libpthread/nptl/sysdeps/sh/pthread_spin_lock.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2003 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. */
-
-#include "pthreadP.h"
-
-int
-pthread_spin_lock (lock)
- pthread_spinlock_t *lock;
-{
- unsigned int val;
-
- do
- asm volatile ("tas.b @%1; movt %0"
- : "=&r" (val)
- : "r" (lock)
- : "memory");
- while (val == 0);
-
- return 0;
-}
diff --git a/libpthread/nptl/sysdeps/sh/pthread_spin_trylock.S b/libpthread/nptl/sysdeps/sh/pthread_spin_trylock.S
deleted file mode 100644
index 18112ba23..000000000
--- a/libpthread/nptl/sysdeps/sh/pthread_spin_trylock.S
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2003 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. */
-
-#include <pthread-errnos.h>
-
- .globl pthread_spin_trylock
- .type pthread_spin_trylock,@function
- .align 5
-pthread_spin_trylock:
- tas.b @r4
- bf/s 1f
- mov #EBUSY, r0
- mov #0, r0
-1:
- rts
- nop
- .size pthread_spin_trylock,.-pthread_spin_trylock
diff --git a/libpthread/nptl/sysdeps/sh/pthread_spin_unlock.S b/libpthread/nptl/sysdeps/sh/pthread_spin_unlock.S
deleted file mode 100644
index c77acaffe..000000000
--- a/libpthread/nptl/sysdeps/sh/pthread_spin_unlock.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright (C) 2003 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. */
-
- .globl pthread_spin_unlock
- .type pthread_spin_unlock,@function
- .align 5
-pthread_spin_unlock:
- mov #0,r0
- rts
- mov.l r0,@r4
- .size pthread_spin_unlock,.-pthread_spin_unlock
-
- /* The implementation of pthread_spin_init is identical. */
- .globl pthread_spin_init
-pthread_spin_init = pthread_spin_unlock
diff --git a/libpthread/nptl/sysdeps/sh/pthreaddef.h b/libpthread/nptl/sysdeps/sh/pthreaddef.h
deleted file mode 100644
index 70c6a850b..000000000
--- a/libpthread/nptl/sysdeps/sh/pthreaddef.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 2003 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. */
-
-#include <sysdep.h>
-
-/* Default stack size. */
-#define ARCH_STACK_DEFAULT_SIZE (2 * 1024 * 1024)
-
-/* Required stack pointer alignment at beginning. */
-#define STACK_ALIGN 8
-
-/* Minimal stack size after allocating thread descriptor and guard size. */
-#define MINIMAL_REST_STACK 2048
-
-/* Alignment requirement for TCB. */
-#define TCB_ALIGNMENT 8
-
-
-/* Location of current stack frame. */
-#define CURRENT_STACK_FRAME __builtin_frame_address (0)
-
-
-/* XXX Until we have a better place keep the definitions here. */
-
-/* While there is no such syscall. */
-#define __exit_thread_inline(val) \
- while (1) { \
- if (__builtin_constant_p (val) && (val) == 0) \
- asm volatile ("mov #0,r4; mov %0,r3; trapa #0x11\n\t" SYSCALL_INST_PAD \
- :: "i" (__NR_exit)); \
- else \
- asm volatile ("mov %1,r4; mov %0,r3; trapa #0x11\n\t" SYSCALL_INST_PAD \
- :: "i" (__NR_exit), "r" (val)); \
- }
diff --git a/libpthread/nptl/sysdeps/sh/tcb-offsets.sym b/libpthread/nptl/sysdeps/sh/tcb-offsets.sym
deleted file mode 100644
index 539789a81..000000000
--- a/libpthread/nptl/sysdeps/sh/tcb-offsets.sym
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <sysdep.h>
-#include <tls.h>
-
-RESULT offsetof (struct pthread, result)
-TID offsetof (struct pthread, tid)
-PID offsetof (struct pthread, pid)
-CANCELHANDLING offsetof (struct pthread, cancelhandling)
-CLEANUP_JMP_BUF offsetof (struct pthread, cleanup_jmp_buf)
-MULTIPLE_THREADS_OFFSET offsetof (struct pthread, header.multiple_threads)
-TLS_PRE_TCB_SIZE sizeof (struct pthread)
-MUTEX_FUTEX offsetof (pthread_mutex_t, __data.__lock)
diff --git a/libpthread/nptl/sysdeps/sh/tls.h b/libpthread/nptl/sysdeps/sh/tls.h
deleted file mode 100644
index e883bae99..000000000
--- a/libpthread/nptl/sysdeps/sh/tls.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Definition for thread-local data handling. NPTL/SH version.
- Copyright (C) 2003, 2005 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 _TLS_H
-#define _TLS_H
-
-# include <dl-sysdep.h>
-
-#ifndef __ASSEMBLER__
-# include <stdbool.h>
-# include <stddef.h>
-# include <stdint.h>
-
-/* Type for the dtv. */
-typedef union dtv
-{
- size_t counter;
- struct
- {
- void *val;
- bool is_static;
- } pointer;
-} dtv_t;
-
-typedef struct
-{
- dtv_t *dtv;
- void *private;
-} tcbhead_t;
-
-# define TLS_MULTIPLE_THREADS_IN_TCB 1
-
-#else /* __ASSEMBLER__ */
-# include <tcb-offsets.h>
-#endif /* __ASSEMBLER__ */
-
-
-/* We require TLS support in the tools. */
-#ifndef HAVE_TLS_SUPPORT
-# error "TLS support is required."
-#endif
-
-/* Signal that TLS support is available. */
-# define USE_TLS 1
-
-#ifndef __ASSEMBLER__
-
-/* Get system call information. */
-# include <sysdep.h>
-
-/* This is the size of the initial TCB. */
-# define TLS_INIT_TCB_SIZE sizeof (tcbhead_t)
-
-/* Alignment requirements for the initial TCB. */
-# define TLS_INIT_TCB_ALIGN __alignof__ (tcbhead_t)
-
-/* This is the size of the TCB. */
-# define TLS_TCB_SIZE sizeof (tcbhead_t)
-
-/* This is the size we need before TCB. */
-# define TLS_PRE_TCB_SIZE sizeof (struct pthread)
-
-/* Alignment requirements for the TCB. */
-# define TLS_TCB_ALIGN __alignof__ (struct pthread)
-
-/* The TLS blocks start right after the TCB. */
-# define TLS_DTV_AT_TP 1
-
-/* Get the thread descriptor definition. */
-# include <nptl/descr.h>
-
-/* Install the dtv pointer. The pointer passed is to the element with
- index -1 which contain the length. */
-# define INSTALL_DTV(tcbp, dtvp) \
- ((tcbhead_t *) (tcbp))->dtv = (dtvp) + 1
-
-/* Install new dtv for current thread. */
-# define INSTALL_NEW_DTV(dtv) \
- ({ tcbhead_t *__tcbp; \
- __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \
- __tcbp->dtv = (dtv);})
-
-/* Return dtv of given thread descriptor. */
-# define GET_DTV(tcbp) \
- (((tcbhead_t *) (tcbp))->dtv)
-
-/* Code to initially initialize the thread pointer. This might need
- special attention since 'errno' is not yet available and if the
- operation can cause a failure 'errno' must not be touched. */
-# define TLS_INIT_TP(tcbp, secondcall) \
- ({ __asm __volatile ("ldc %0,gbr" : : "r" (tcbp)); 0; })
-
-/* Return the address of the dtv for the current thread. */
-# define THREAD_DTV() \
- ({ tcbhead_t *__tcbp; \
- __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \
- __tcbp->dtv;})
-
-/* Return the thread descriptor for the current thread.
- The contained asm must *not* be marked volatile since otherwise
- assignments like
- struct pthread *self = thread_self();
- do not get optimized away. */
-# define THREAD_SELF \
- ({ struct pthread *__self; \
- __asm ("stc gbr,%0" : "=r" (__self)); \
- __self - 1;})
-
-/* Magic for libthread_db to know how to do THREAD_SELF. */
-# define DB_THREAD_SELF \
- REGISTER (32, 32, REG_GBR * 4, -sizeof (struct pthread))
-
-/* Read member of the thread descriptor directly. */
-# define THREAD_GETMEM(descr, member) (descr->member)
-
-/* Same as THREAD_GETMEM, but the member offset can be non-constant. */
-# define THREAD_GETMEM_NC(descr, member, idx) (descr->member[idx])
-
-/* Set member of the thread descriptor directly. */
-# define THREAD_SETMEM(descr, member, value) \
- descr->member = (value)
-
-/* Same as THREAD_SETMEM, but the member offset can be non-constant. */
-# define THREAD_SETMEM_NC(descr, member, idx, value) \
- descr->member[idx] = (value)
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* tls.h */