aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps/unix/sysv/linux/ia64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /linuxthreads/sysdeps/unix/sysv/linux/ia64
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'linuxthreads/sysdeps/unix/sysv/linux/ia64')
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/Makefile3
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/Versions6
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h92
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h49
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h25
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c140
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c33
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h144
-rw-r--r--linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S54
9 files changed, 546 insertions, 0 deletions
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/Makefile b/linuxthreads/sysdeps/unix/sysv/linux/ia64/Makefile
new file mode 100644
index 0000000000..e03aee99fc
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),linuxthreads)
+libpthread-routines += ptw-sysdep ptw-sigblock ptw-sigprocmask
+endif
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/Versions b/linuxthreads/sysdeps/unix/sysv/linux/ia64/Versions
new file mode 100644
index 0000000000..d102772482
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/Versions
@@ -0,0 +1,6 @@
+libpthread {
+ GLIBC_2.3.3 {
+ # Changed PTHREAD_STACK_MIN.
+ pthread_attr_setstack; pthread_attr_setstacksize;
+ }
+}
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h b/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
new file mode 100644
index 0000000000..629b1f89c1
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/bits/local_lim.h
@@ -0,0 +1,92 @@
+/* Minimum guaranteed maximum values for system limits. Linux/Alpha version.
+ Copyright (C) 1993-1998,2000,2002,2003,2004 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; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol
+ and defines LINK_MAX although filesystems have different maxima. A
+ similar thing is true for OPEN_MAX: the limit can be changed at
+ runtime and therefore the macro must not be defined. Remove this
+ after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+#ifndef LINK_MAX
+# define __undef_LINK_MAX
+#endif
+#ifndef OPEN_MAX
+# define __undef_OPEN_MAX
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+/* Have to remove LINK_MAX? */
+#ifdef __undef_LINK_MAX
+# undef LINK_MAX
+# undef __undef_LINK_MAX
+#endif
+/* Have to remove OPEN_MAX? */
+#ifdef __undef_OPEN_MAX
+# undef OPEN_MAX
+# undef __undef_OPEN_MAX
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* This is the value this implementation supports. */
+#define PTHREAD_THREADS_MAX 16384
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 196608
+
+/* Maximum number of POSIX timers available. */
+#define TIMER_MAX 256
+
+/* Maximum number of timer expiration overruns. */
+#define DELAYTIMER_MAX 2147483647
+
+/* Maximum tty name length. */
+#define TTY_NAME_MAX 32
+
+/* Maximum login name length. This is arbitrary. */
+#define LOGIN_NAME_MAX 256
+
+/* Maximum host name length. */
+#define HOST_NAME_MAX 64
+
+/* Maximum message queue priority level. */
+#define MQ_PRIO_MAX 32768
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h b/linuxthreads/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
new file mode 100644
index 0000000000..27d5fdfbf5
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/dl-sysdep.h
@@ -0,0 +1,49 @@
+/* System-specific settings for dynamic linker code. IA-64 version.
+ Copyright (C) 2003, 2004 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 _DL_SYSDEP_H
+#define _DL_SYSDEP_H 1
+
+#define NEED_DL_SYSINFO 1
+#undef USE_DL_SYSINFO
+
+#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__
+/* Don't declare this as a function---we want it's entry-point, not
+ it's function descriptor... */
+extern int _dl_sysinfo_break attribute_hidden;
+# define DL_SYSINFO_DEFAULT ((uintptr_t) &_dl_sysinfo_break)
+# define DL_SYSINFO_IMPLEMENTATION \
+ asm (".text\n\t" \
+ ".hidden _dl_sysinfo_break\n\t" \
+ ".proc _dl_sysinfo_break\n\t" \
+ "_dl_sysinfo_break:\n\t" \
+ ".prologue\n\t" \
+ ".altrp b6\n\t" \
+ ".body\n\t" \
+ "break 0x100000;\n\t" \
+ "br.ret.sptk.many b6;\n\t" \
+ ".endp _dl_sysinfo_break" \
+ ".previous");
+#endif
+
+/* _dl_argv cannot be attribute_relro, because _dl_start_user
+ might write into it after _dl_start returns. */
+#define DL_ARGV_NOT_RELRO 1
+
+#endif /* dl-sysdep.h */
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h b/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h
new file mode 100644
index 0000000000..30a0cc1918
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/fork.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@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. */
+
+#include <signal.h>
+#include <sysdep.h>
+
+#define ARCH_FORK() INLINE_SYSCALL (clone, 2, SIGCHLD, 0)
+
+#include_next <fork.h>
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c b/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c
new file mode 100644
index 0000000000..85fd33f4a8
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-initfini.c
@@ -0,0 +1,140 @@
+/* Special .init and .fini section support for ia64. LinuxThreads version.
+ Copyright (C) 2000, 2001, 2002, 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The Lesser General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ 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; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This file is compiled into assembly code which is then munged by a sed
+ script into two files: crti.s and crtn.s.
+
+ * crti.s puts a function prologue at the beginning of the
+ .init and .fini sections and defines global symbols for
+ those addresses, so they can be called as functions.
+
+ * crtn.s puts the corresponding function epilogues
+ in the .init and .fini sections. */
+
+#include <stddef.h>
+
+#ifdef HAVE_INITFINI_ARRAY
+
+# define INIT_NEW_WAY \
+ ".xdata8 \".init_array\", @fptr(__pthread_initialize_minimal)\n"
+# define INIT_OLD_WAY ""
+#else
+# define INIT_NEW_WAY ""
+# define INIT_OLD_WAY \
+ "\n\
+ st8 [r12] = gp, -16\n\
+ br.call.sptk.many b0 = __pthread_initialize_minimal# ;;\n\
+ ;;\n\
+ adds r12 = 16, r12\n\
+ ;;\n\
+ ld8 gp = [r12]\n\
+ ;;\n"
+#endif
+
+__asm__ ("\n\
+\n\
+#include \"defs.h\"\n\
+\n\
+/*@HEADER_ENDS*/\n\
+\n\
+/*@_init_PROLOG_BEGINS*/\n"
+ INIT_NEW_WAY
+ ".section .init\n\
+ .align 16\n\
+ .global _init#\n\
+ .proc _init#\n\
+_init:\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
+ alloc r34 = ar.pfs, 0, 3, 0, 0\n\
+ .vframe r32\n\
+ mov r32 = r12\n\
+ .save rp, r33\n\
+ mov r33 = b0\n\
+ .body\n\
+ adds r12 = -16, r12\n\
+ ;;\n"
+ INIT_OLD_WAY
+ ".endp _init#\n\
+\n\
+/*@_init_PROLOG_ENDS*/\n\
+\n\
+/*@_init_EPILOG_BEGINS*/\n\
+ .section .init\n\
+ .proc _init#\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
+ .vframe r32\n\
+ .save rp, r33\n\
+ .body\n\
+ mov r12 = r32\n\
+ mov ar.pfs = r34\n\
+ mov b0 = r33\n\
+ br.ret.sptk.many b0\n\
+ .endp _init#\n\
+/*@_init_EPILOG_ENDS*/\n\
+\n\
+/*@_fini_PROLOG_BEGINS*/\n\
+ .section .fini\n\
+ .align 16\n\
+ .global _fini#\n\
+ .proc _fini#\n\
+_fini:\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
+ alloc r34 = ar.pfs, 0, 3, 0, 0\n\
+ .vframe r32\n\
+ mov r32 = r12\n\
+ .save rp, r33\n\
+ mov r33 = b0\n\
+ .body\n\
+ adds r12 = -16, r12\n\
+ ;;\n\
+ .endp _fini#\n\
+\n\
+/*@_fini_PROLOG_ENDS*/\n\
+\n\
+/*@_fini_EPILOG_BEGINS*/\n\
+ .section .fini\n\
+ .proc _fini#\n\
+ .prologue\n\
+ .save ar.pfs, r34\n\
+ .vframe r32\n\
+ .save rp, r33\n\
+ .body\n\
+ mov r12 = r32\n\
+ mov ar.pfs = r34\n\
+ mov b0 = r33\n\
+ br.ret.sptk.many b0\n\
+ .endp _fini#\n\
+\n\
+/*@_fini_EPILOG_ENDS*/\n\
+\n\
+/*@TRAILER_BEGINS*/\n\
+ .weak __gmon_start__#\n\
+");
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c b/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c
new file mode 100644
index 0000000000..0b96e3d5bd
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/pt-sigsuspend.c
@@ -0,0 +1,33 @@
+/* Internal sigsuspend system call for LinuxThreads. IA64 version.
+ 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 <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <linuxthreads/internals.h>
+
+void
+__pthread_sigsuspend (const sigset_t *set)
+{
+ INTERNAL_SYSCALL_DECL (err);
+ INTERNAL_SYSCALL (rt_sigsuspend, err, 2, set, _NSIG / 8);
+}
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h b/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
new file mode 100644
index 0000000000..dd9637d2b5
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
@@ -0,0 +1,144 @@
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@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. */
+
+#include <sysdep.h>
+#include <tls.h>
+#ifndef __ASSEMBLER__
+# include <linuxthreads/internals.h>
+#endif
+
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+
+# ifdef IS_IN_librt
+# define PSEUDO_NLOCAL 6
+# define PSEUDO_SAVE_GP mov loc5 = gp
+# define PSEUDO_RESTORE_GP mov gp = loc5
+# define PSEUDO_SAVE_GP_1
+# define PSEUDO_RESTORE_GP_1 mov gp = loc5
+# else
+# define PSEUDO_NLOCAL 5
+# define PSEUDO_SAVE_GP
+# define PSEUDO_RESTORE_GP
+# define PSEUDO_SAVE_GP_1 mov loc4 = gp;;
+# define PSEUDO_RESTORE_GP_1 mov gp = loc4
+# endif
+
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args) \
+.text; \
+ENTRY (name) \
+ adds r14 = MULTIPLE_THREADS_OFFSET, r13;; \
+ ld4 r14 = [r14]; \
+ mov r15 = SYS_ify(syscall_name);; \
+ cmp4.ne p6, p7 = 0, r14; \
+(p6) br.cond.spnt .Lpseudo_cancel;; \
+ break __BREAK_SYSCALL;; \
+ cmp.eq p6,p0=-1,r10; \
+(p6) br.cond.spnt.few __syscall_error; \
+ ret;; \
+ .endp name; \
+ .proc __GC_##name; \
+ .globl __GC_##name; \
+ .hidden __GC_##name; \
+__GC_##name: \
+.Lpseudo_cancel: \
+ .prologue; \
+ .regstk args, PSEUDO_NLOCAL, args, 0; \
+ .save ar.pfs, loc0; \
+ alloc loc0 = ar.pfs, args, PSEUDO_NLOCAL, args, 0; \
+ .save rp, loc1; \
+ mov loc1 = rp; \
+ PSEUDO_SAVE_GP;; \
+ .body; \
+ CENABLE;; \
+ PSEUDO_RESTORE_GP; \
+ mov loc2 = r8; \
+ COPY_ARGS_##args \
+ mov r15 = SYS_ify(syscall_name); \
+ break __BREAK_SYSCALL;; \
+ mov loc3 = r8; \
+ mov loc4 = r10; \
+ mov out0 = loc2; \
+ CDISABLE;; \
+ PSEUDO_RESTORE_GP; \
+ cmp.eq p6,p0=-1,loc4; \
+(p6) br.cond.spnt.few __syscall_error_##args; \
+ mov r8 = loc3; \
+ mov rp = loc1; \
+ mov ar.pfs = loc0; \
+.Lpseudo_end: \
+ ret; \
+ .endp __GC_##name; \
+.section .gnu.linkonce.t.__syscall_error_##args, "ax"; \
+ .align 32; \
+ .proc __syscall_error_##args; \
+ .global __syscall_error_##args; \
+ .hidden __syscall_error_##args; \
+ .size __syscall_error_##args, 64; \
+__syscall_error_##args: \
+ .prologue; \
+ .regstk args, PSEUDO_NLOCAL, args, 0; \
+ .save ar.pfs, loc0; \
+ .save rp, loc1; \
+ .body; \
+ PSEUDO_SAVE_GP_1; \
+ br.call.sptk.many b0 = __errno_location;; \
+ st4 [r8] = loc3; \
+ PSEUDO_RESTORE_GP_1; \
+ mov rp = loc1; \
+ mov r8 = -1; \
+ mov ar.pfs = loc0
+
+#undef PSEUDO_END
+#define PSEUDO_END(name) .endp
+
+# ifdef IS_IN_libpthread
+# define CENABLE br.call.sptk.many b0 = __pthread_enable_asynccancel
+# define CDISABLE br.call.sptk.many b0 = __pthread_disable_asynccancel
+# elif !defined NOT_IN_libc
+# define CENABLE br.call.sptk.many b0 = __libc_enable_asynccancel
+# define CDISABLE br.call.sptk.many b0 = __libc_disable_asynccancel
+# else
+# define CENABLE br.call.sptk.many b0 = __librt_enable_asynccancel
+# define CDISABLE br.call.sptk.many b0 = __librt_disable_asynccancel
+# endif
+
+#define COPY_ARGS_0 /* Nothing */
+#define COPY_ARGS_1 COPY_ARGS_0 mov out0 = in0;
+#define COPY_ARGS_2 COPY_ARGS_1 mov out1 = in1;
+#define COPY_ARGS_3 COPY_ARGS_2 mov out2 = in2;
+#define COPY_ARGS_4 COPY_ARGS_3 mov out3 = in3;
+#define COPY_ARGS_5 COPY_ARGS_4 mov out4 = in4;
+#define COPY_ARGS_6 COPY_ARGS_5 mov out5 = in5;
+#define COPY_ARGS_7 COPY_ARGS_6 mov out6 = in6;
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, p_multiple_threads) == 0, 1)
+# else
+# define SINGLE_THREAD_P \
+ adds r14 = MULTIPLE_THREADS_OFFSET, r13 ;; ld4 r14 = [r14] ;; cmp4.ne p6, p7 = 0, r14
+# endif
+
+#elif !defined __ASSEMBLER__
+
+/* This code should never be used but we define it anyhow. */
+# define SINGLE_THREAD_P (1)
+
+#endif
diff --git a/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S b/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S
new file mode 100644
index 0000000000..54acedad4c
--- /dev/null
+++ b/linuxthreads/sysdeps/unix/sysv/linux/ia64/vfork.S
@@ -0,0 +1,54 @@
+/* Copyright (C) 2000, 2002, 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-cancel.h>
+#define _SIGNAL_H
+#include <bits/signum.h>
+
+/* The following are defined in linux/sched.h, which unfortunately */
+/* is not safe for inclusion in an assembly file. */
+#define CLONE_VM 0x00000100 /* set if VM shared between processes */
+#define CLONE_VFORK 0x00004000 /* set if the parent wants the child to wake it up on mm_release */
+
+/* pid_t vfork(void); */
+/* Implemented as __clone_syscall(CLONE_VFORK | CLONE_VM | SIGCHLD, 0) */
+
+ENTRY(__vfork)
+#ifdef SHARED
+ addl r14 = @gprel(__libc_pthread_functions#), gp;;
+#else
+ .weak pthread_create
+ addl r14 = @ltoff(@fptr(pthread_create#)), gp;;
+#endif
+ ld8 r14 = [r14];;
+ cmp.ne p6, p7 = 0, r14
+(p6) br.cond.spnt.few HIDDEN_JUMPTARGET (__fork);;
+ alloc r2=ar.pfs,0,0,2,0
+ mov out0=CLONE_VM+CLONE_VFORK+SIGCHLD
+ mov out1=0 /* Standard sp value. */
+ ;;
+ DO_CALL (SYS_ify (clone))
+ cmp.eq p6,p0=-1,r10
+ ;;
+(p6) br.cond.spnt.few __syscall_error
+ ret
+PSEUDO_END(__vfork)
+libc_hidden_def (__vfork)
+
+weak_alias (__vfork, vfork)