2000-07-15 19:02:47 +00:00
|
|
|
/* Machine-dependent pthreads configuration and inline functions.
|
|
|
|
IA-64 version.
|
Update.
2003-01-11 Jim Meyering <jim@meyering.net>
* io/ftw.c [HAVE_CONFIG_H]: Include <config.h>.
[HAVE_SYS_PARAM_H || _LIBC]: Guard inclusion of <sys/param.h>.
Include <sys/stat.h>, not <include/sys/stat.h>, if !_LIBC.
[!_LIBC] (__chdir, __closedir, __fchdir, __getcwd, __opendir): Define.
[!_LIBC] (__readdir64, __tdestroy, __tfind, __tsearch): Define.
[!_LIBC] (internal_function, dirent64, MAX): Define.
(__set_errno): Define if not already defined.
(open_dir_stream): When FTW_CHDIR is enabled, invoke opendir on
the basename, not the entire file name.
(process_entry): When FTW_CHDIR is enabled, invoke XSTAT or LXSTAT on
the basename, not the entire file name.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* string/tester.c (test_strcpy): Disable last added strcpy until
it is fixed.
2003-01-11 Philip Blundell <philb@gnu.org>
* sysdeps/unix/sysv/linux/arm/socket.S: Add cancellation support.
2003-01-11 Andreas Schwab <schwab@suse.de>
* Makerules: Add vpath for %.dynsym and %.so so that the
implicit rule chaining for check-abi works.
2003-01-11 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sysdeps/unix/sysv/linux/sh/sysdep.h (SYSCALL_ERROR_HANDLER):
Add non-PIC case.
2003-01-11 Jakub Jelinek <jakub@redhat.com>
* elf/tls-macros.h [__ia64__] (__TLS_CALL_CLOBBERS): Define.
[__ia64__] (TLS_LE, TLS_IE): Fix typos. Add ;; at start of asm if
gp is used early.
[__ia64__] (TLS_LD, TLS_GD): Likewise. Use __TLS_CALL_CLOBBERS.
* elf/Makefile ($(objpfx)tst-tlsmod5.so, $(objpfx)tst-tlsmod6.so):
Ensure libc.so in DT_NEEDED.
* sysdeps/alpha/dl-machine.h (elf_machine_rela): Move
CHECK_STATIC_TLS before l_tls_offset use.
* sysdeps/i386/dl-machine.h (elf_machine_rel, elf_machine_rela):
Likewise.
* sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/generic/dl-tls.c (_dl_allocate_tls_storage) [TLS_DTV_AT_TP]:
Allocate TLS_PRE_TCB_SIZE bytes below result.
(_dl_deallocate_tls) [TLS_DTV_AT_TP]: Adjust before freeing.
* sysdeps/generic/libc-tls.c (__libc_setup_tls): If
TLS_INIT_TP_EXPENSIVE is not defined, allocate even if no PT_TLS
segment has been found. If TLS_DTV_AT_TP, allocate TLS_PRE_TCB_SIZE
bytes below result and add tcb_offset to memsz.
* sysdeps/ia64/dl-tls.h (__tls_get_addr): New prototype.
* sysdeps/ia64/dl-machine.h: Include tls.h.
(elf_machine_type_class): Return ELF_RTYPE_CLASS_PLT for TLS relocs
too.
(elf_machine_rela): Assume if sym_map != NULL sym is non-NULL too.
Handle R_IA64_DTPMOD*, R_IA64_DTPREL* and R_IA64_TPREL* relocations.
* sysdeps/ia64/libc-tls.c: New file.
2003-01-10 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_RET): Add branch hit.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h (STAT_VER_LINUX):
Fix type. Move definition out of #if.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ftruncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Add cancellation
support.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Remove
ftruncate64, pread64, pwrite64, truncate64 entries.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h
(INLINE_SYSCALL): New version that supports function call like
syscalls. Add __builtin_expect.
(LOADARGS_n): Add argument size safety checks.
(INTERNAL_SYSCALL): New Macro.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/truncate64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/sys/procfs.h [__PPC_ELF_H]: Avoid
redefinition of elf_fpreg_t and elf_fpregset_t.
2003-01-12 Ulrich Drepper <drepper@redhat.com>
* elf/dl-close.c (_dl_close): Add several asserts. Correct and
simplify test for unloading. If loader of a DSO is unloaded do not
use its scope anymore. Fall back to own scope and adjust opencounts.
Fix several comments.
* elf/dl-deps.c (_dl_map_object_deps): Always allocate memory for
the l_searchlist, not only for l_initfini.
* elf/dl-lookup.c (add_dependencies): Avoid creating relocation
dependencies if objects cannot be removed. Remove object with the
definition as not unloadable if necessary.
* elf/reldep6.c: Create relocation dependency before closing the first
module.
2003-01-10 Guido Günther <agx@sigxcpu.org>
* elf/Makefile: Add rules to build and run reldep9 test.
* elf/reldep9.c: New file.
* elf/reldep9mod1.c: New file.
* elf/reldep9mod2.c: New file.
* elf/reldep9mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
* elf/Makefile: Add rules to build and run nodelete2 test.
* elf/nodelete2.c: New file.
* elf/nodel2mod1.c: New file.
* elf/nodel2mod2.c: New file.
* elf/nodel2mod3.c: New file.
2003-01-09 Jakub Jelinek <jakub@redhat.com>
2003-01-12 10:11:16 +00:00
|
|
|
Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
2000-07-15 19:02:47 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2002-08-26 22:40:48 +00:00
|
|
|
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
|
2000-07-15 19:02:47 +00:00
|
|
|
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
|
2002-08-26 22:40:48 +00:00
|
|
|
Lesser General Public License for more details.
|
2000-07-15 19:02:47 +00:00
|
|
|
|
2002-08-26 22:40:48 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2000-07-15 19:02:47 +00:00
|
|
|
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. */
|
|
|
|
|
2002-04-06 04:05:41 +00:00
|
|
|
#ifndef _PT_MACHINE_H
|
|
|
|
#define _PT_MACHINE_H 1
|
|
|
|
|
2002-05-24 08:49:00 +00:00
|
|
|
#include <ia64intrin.h>
|
|
|
|
|
2000-07-15 19:02:47 +00:00
|
|
|
#ifndef PT_EI
|
|
|
|
# define PT_EI extern inline
|
|
|
|
#endif
|
|
|
|
|
2002-03-17 12:10:08 +00:00
|
|
|
extern long int testandset (int *spinlock);
|
|
|
|
extern int __compare_and_swap (long int *p, long int oldval, long int newval);
|
|
|
|
|
2000-07-15 19:02:47 +00:00
|
|
|
/* 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. */
|
|
|
|
#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
|
|
|
|
|
|
|
|
#ifndef ELF_MACHINE_NAME
|
|
|
|
|
|
|
|
#define NEED_SEPARATE_REGISTER_STACK
|
|
|
|
|
2001-07-22 23:41:12 +00:00
|
|
|
/* We want the OS to assign stack addresses. */
|
|
|
|
#define FLOATING_STACKS 1
|
|
|
|
|
|
|
|
/* Maximum size of the stack if the rlimit is unlimited. */
|
|
|
|
#define ARCH_STACK_MAX_SIZE 32*1024*1024
|
|
|
|
|
2000-07-15 19:02:47 +00:00
|
|
|
/* Get some notion of the current stack. Need not be exactly the top
|
|
|
|
of the stack, just something somewhere in the current frame.
|
|
|
|
r12 (sp) is the stack pointer. */
|
|
|
|
#define CURRENT_STACK_FRAME stack_pointer
|
|
|
|
register char *stack_pointer __asm__ ("sp");
|
|
|
|
|
|
|
|
|
|
|
|
/* Register r13 (tp) is reserved by the ABI as "thread pointer". */
|
|
|
|
struct _pthread_descr_struct;
|
|
|
|
register struct _pthread_descr_struct *__thread_self __asm__("r13");
|
|
|
|
|
|
|
|
/* Return the thread descriptor for the current thread. */
|
|
|
|
#define THREAD_SELF __thread_self
|
|
|
|
|
|
|
|
/* Initialize the thread-unique value. */
|
|
|
|
#define INIT_THREAD_SELF(descr, nr) (__thread_self = (descr))
|
|
|
|
|
|
|
|
|
|
|
|
/* Access to data in the thread descriptor is easy. */
|
2003-01-30 21:03:40 +00:00
|
|
|
#define THREAD_GETMEM(descr, member) \
|
|
|
|
((void) sizeof (descr), THREAD_SELF->member)
|
|
|
|
#define THREAD_GETMEM_NC(descr, member) \
|
|
|
|
((void) sizeof (descr), THREAD_SELF->member)
|
Update.
2003-01-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/alpha/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Avoid warnings about unused self
variable.
* sysdeps/ia64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/s390/s390-32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/s390/s390-64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sh/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sparc/sparc32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sparc/sparc64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2003-01-30 18:04:01 +00:00
|
|
|
#define THREAD_SETMEM(descr, member, value) \
|
2003-01-30 21:03:40 +00:00
|
|
|
((void) sizeof (descr), THREAD_SELF->member = (value))
|
Update.
2003-01-30 Jakub Jelinek <jakub@redhat.com>
* sysdeps/alpha/tls.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Avoid warnings about unused self
variable.
* sysdeps/ia64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/s390/s390-32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/s390/s390-64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sh/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sparc/sparc32/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
* sysdeps/sparc/sparc64/pt-machine.h (THREAD_GETMEM, THREAD_GETMEM_NC,
THREAD_SETMEM, THREAD_SETMEM_NC): Likewise.
2003-01-30 18:04:01 +00:00
|
|
|
#define THREAD_SETMEM_NC(descr, member, value) \
|
2003-01-30 21:03:40 +00:00
|
|
|
((void) sizeof (descr), THREAD_SELF->member = (value))
|
2000-07-15 19:02:47 +00:00
|
|
|
|
|
|
|
|
2002-04-02 22:28:27 +00:00
|
|
|
/* Memory barrier */
|
2002-06-07 20:12:02 +00:00
|
|
|
#define MEMORY_BARRIER() __sync_synchronize ()
|
2002-04-02 22:28:27 +00:00
|
|
|
|
|
|
|
|
2000-07-15 19:02:47 +00:00
|
|
|
#define HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS
|
|
|
|
|
2000-12-18 22:36:28 +00:00
|
|
|
PT_EI int
|
2000-07-15 19:02:47 +00:00
|
|
|
__compare_and_swap (long int *p, long int oldval, long int newval)
|
|
|
|
{
|
|
|
|
long int readval;
|
|
|
|
|
|
|
|
__asm__ __volatile__
|
|
|
|
("mov ar.ccv=%4;;\n\t"
|
|
|
|
"cmpxchg8.acq %0=%1,%2,ar.ccv"
|
|
|
|
: "=r" (readval), "=m" (__atomic_fool_gcc (p))
|
|
|
|
: "r"(newval), "1" (__atomic_fool_gcc (p)), "r" (oldval)
|
|
|
|
: "memory");
|
|
|
|
return readval == oldval;
|
|
|
|
}
|
|
|
|
|
2000-12-18 22:36:28 +00:00
|
|
|
PT_EI int
|
2000-07-15 19:02:47 +00:00
|
|
|
__compare_and_swap_with_release_semantics (long int *p,
|
|
|
|
long int oldval,
|
|
|
|
long int newval)
|
|
|
|
{
|
|
|
|
long int readval;
|
|
|
|
|
|
|
|
__asm__ __volatile__
|
|
|
|
("mov ar.ccv=%4;;\n\t"
|
|
|
|
"cmpxchg8.rel %0=%1,%2,ar.ccv"
|
|
|
|
: "=r" (readval), "=m" (__atomic_fool_gcc (p))
|
|
|
|
: "r"(newval), "1" (__atomic_fool_gcc (p)), "r" (oldval)
|
|
|
|
: "memory");
|
|
|
|
return readval == oldval;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* ELF_MACHINE_NAME */
|
|
|
|
|
|
|
|
/* Spinlock implementation; required. */
|
|
|
|
PT_EI long int
|
|
|
|
testandset (int *spinlock)
|
|
|
|
{
|
|
|
|
long int ret;
|
|
|
|
|
|
|
|
__asm__ __volatile__(
|
|
|
|
"xchg4 %0=%1,%2"
|
|
|
|
: "=r"(ret), "=m"(__atomic_fool_gcc (spinlock))
|
|
|
|
: "r"(1), "1"(__atomic_fool_gcc (spinlock))
|
|
|
|
: "memory");
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2002-04-06 04:05:41 +00:00
|
|
|
|
|
|
|
#endif /* pt-machine.h */
|