(INTERNAL_SYSCALL): Update internal_syscall##nr invocation.
(INTERNAL_SYSCALL_NCS): New.
(internal_syscall0, internal_syscall1, internal_syscall2,
internal_syscall3, internal_syscall4, internal_syscall5,
internal_syscall6): Take ncs_init, cs_init, and input arguments.
Use them. Correct types for registers.
* sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
(INTERNAL_SYSCALL): Update internal_syscall##nr invocation.
(INTERNAL_SYSCALL_NCS): New.
(internal_syscall0, internal_syscall1, internal_syscall2,
internal_syscall3, internal_syscall4, internal_syscall5,
internal_syscall6): Take ncs_init, cs_init, and input arguments.
Use them.
* sysdeps/unix/sysv/linux/mips/mips64/syscalls.list: Remove
recvfrom and sendto. Mark lseek, msgrcv, and msgsnd as cancellation
points.
* sysdeps/mips/dl-machine.h (elf_machine_rel): Remove unused "value".
Use Elf(Addr) for TLS relocation targets.
* sysdeps/unix/sysv/linux/mips/mips64/Makefile: New file.
* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h (lll_futex_wait,
lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): Cast
futexp to long for n64.
* sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h: New file.
+2006-03-02 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+ (INTERNAL_SYSCALL): Update internal_syscall##nr invocation.
+ (INTERNAL_SYSCALL_NCS): New.
+ (internal_syscall0, internal_syscall1, internal_syscall2,
+ internal_syscall3, internal_syscall4, internal_syscall5,
+ internal_syscall6): Take ncs_init, cs_init, and input arguments.
+ Use them. Correct types for registers.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+ (INTERNAL_SYSCALL): Update internal_syscall##nr invocation.
+ (INTERNAL_SYSCALL_NCS): New.
+ (internal_syscall0, internal_syscall1, internal_syscall2,
+ internal_syscall3, internal_syscall4, internal_syscall5,
+ internal_syscall6): Take ncs_init, cs_init, and input arguments.
+ Use them.
+ * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list: Remove
+ recvfrom and sendto. Mark lseek, msgrcv, and msgsnd as cancellation
+ points.
+ * sysdeps/mips/dl-machine.h (elf_machine_rel): Remove unused "value".
+ Use Elf(Addr) for TLS relocation targets.
+ * sysdeps/unix/sysv/linux/mips/mips64/Makefile: New file.
+ * sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h (lll_futex_wait,
+ lll_futex_timed_wait, lll_futex_wake, lll_futex_requeue): Cast
+ futexp to long for n64.
+ * sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h: New file.
+
2006-02-20 Roland McGrath <roland@redhat.com>
* sysdeps/mips/shlib-versions: New file.
/* Machine-dependent ELF dynamic relocation inline functions. MIPS version.
- Copyright (C) 1996-2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1996-2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>.
# endif
{
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
- Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
-
- if (sym)
- value += sym->st_value;
switch (r_type)
{
case R_MIPS_TLS_DTPMOD64:
case R_MIPS_TLS_DTPMOD32:
if (sym_map)
- *(ElfW(Word) *)reloc_addr = sym_map->l_tls_modid;
+ *(ElfW(Addr) *)reloc_addr = sym_map->l_tls_modid;
break;
case R_MIPS_TLS_DTPREL64:
case R_MIPS_TLS_DTPREL32:
- *(ElfW(Word) *)reloc_addr += TLS_DTPREL_VALUE (sym);
+ *(ElfW(Addr) *)reloc_addr += TLS_DTPREL_VALUE (sym);
break;
case R_MIPS_TLS_TPREL32:
case R_MIPS_TLS_TPREL64:
CHECK_STATIC_TLS (map, sym_map);
- *(ElfW(Word) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
+ *(ElfW(Addr) *)reloc_addr += TLS_TPREL_VALUE (sym_map, sym);
break;
}
--- /dev/null
+ifeq ($(subdir),socket)
+CFLAGS-recv.c += -fexceptions
+CFLAGS-send.c += -fexceptions
+endif
+
+ifeq ($(subdir),nptl)
+CFLAGS-recv.c += -fexceptions
+CFLAGS-send.c += -fexceptions
+endif
-/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 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
#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
+ "i" (SYS_ify (name)), err, args)
-#define internal_syscall0(name, err, dummy...) \
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (= number, , "r" (__v0), err, args)
+
+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
- register long __a3 asm("$7"); \
+ register long long __v0 asm("$2") ncs_init; \
+ register long long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %2\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
- : "i" (SYS_ify(name)) \
+ : input \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall1(name, err, arg1) \
+#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %3\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "i" (SYS_ify(name)) \
+ : input, "r" (__a0) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall2(name, err, arg1, arg2) \
+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a1 asm("$5") = (long long) arg2; \
register long long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %4\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall3(name, err, arg1, arg2, arg3) \
+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a1 asm("$5") = (long long) arg2; \
register long long __a2 asm("$6") = (long long) arg3; \
register long long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a1 asm("$5") = (long long) arg2; \
register long long __a2 asm("$6") = (long long) arg3; \
register long long __a3 asm("$7") = (long long) arg4; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a1 asm("$5") = (long long) arg2; \
register long long __a2 asm("$6") = (long long) arg3; \
register long long __a4 asm("$8") = (long long) arg5; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long _sys_result; \
\
{ \
- register long long __v0 asm("$2"); \
+ register long long __v0 asm("$2") ncs_init; \
register long long __a0 asm("$4") = (long long) arg1; \
register long long __a1 asm("$5") = (long long) arg2; \
register long long __a2 asm("$6") = (long long) arg3; \
register long long __a5 asm("$9") = (long long) arg6; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4), "r" (__a5) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
+ "r" (__a5) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
-/* Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2005, 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
#define INTERNAL_SYSCALL_ERRNO(val, err) (val)
#undef INTERNAL_SYSCALL
-#define INTERNAL_SYSCALL(name, err, nr, args...) internal_syscall##nr(name, err, args)
+#define INTERNAL_SYSCALL(name, err, nr, args...) \
+ internal_syscall##nr (, "li\t$2, %2\t\t\t# " #name "\n\t", \
+ "i" (SYS_ify (name)), err, args)
-#define internal_syscall0(name, err, dummy...) \
+#undef INTERNAL_SYSCALL_NCS
+#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \
+ internal_syscall##nr (= number, , "r" (__v0), err, args)
+
+#define internal_syscall0(ncs_init, cs_init, input, err, dummy...) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
- register long __a3 asm("$7"); \
+ register long __v0 asm("$2") ncs_init; \
+ register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %2\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
- : "i" (SYS_ify(name)) \
+ : input \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall1(name, err, arg1) \
+#define internal_syscall1(ncs_init, cs_init, input, err, arg1) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %3\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set reorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "i" (SYS_ify(name)) \
+ : input, "r" (__a0) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall2(name, err, arg1, arg2) \
+#define internal_syscall2(ncs_init, cs_init, input, err, arg1, arg2) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a1 asm("$5") = (long) arg2; \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %4\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "r" (__a1), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall3(name, err, arg1, arg2, arg3) \
+#define internal_syscall3(ncs_init, cs_init, input, err, arg1, arg2, arg3) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a1 asm("$5") = (long) arg2; \
register long __a2 asm("$6") = (long) arg3; \
register long __a3 asm("$7"); \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "=r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall4(name, err, arg1, arg2, arg3, arg4) \
+#define internal_syscall4(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a1 asm("$5") = (long) arg2; \
register long __a2 asm("$6") = (long) arg3; \
register long __a3 asm("$7") = (long) arg4; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall5(name, err, arg1, arg2, arg3, arg4, arg5) \
+#define internal_syscall5(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a1 asm("$5") = (long) arg2; \
register long __a2 asm("$6") = (long) arg3; \
register long __a4 asm("$8") = (long) arg5; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
_sys_result; \
})
-#define internal_syscall6(name, err, arg1, arg2, arg3, arg4, arg5, arg6)\
+#define internal_syscall6(ncs_init, cs_init, input, err, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long _sys_result; \
\
{ \
- register long __v0 asm("$2"); \
+ register long __v0 asm("$2") ncs_init; \
register long __a0 asm("$4") = (long) arg1; \
register long __a1 asm("$5") = (long) arg2; \
register long __a2 asm("$6") = (long) arg3; \
register long __a5 asm("$9") = (long) arg6; \
__asm__ volatile ( \
".set\tnoreorder\n\t" \
- "li\t$2, %5\t\t\t# " #name "\n\t" \
+ cs_init \
"syscall\n\t" \
".set\treorder" \
: "=r" (__v0), "+r" (__a3) \
- : "r" (__a0), "r" (__a1), "r" (__a2), "i" (SYS_ify(name)), \
- "r" (__a4), "r" (__a5) \
+ : input, "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), \
+ "r" (__a5) \
: __SYSCALL_CLOBBERS); \
err = __a3; \
_sys_result = __v0; \
--- /dev/null
+/* Copyright (C) 2003, 2004, 2005, 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. */
+
+#include <sysdep.h>
+#include <sysdeps/generic/sysdep.h>
+#include <tls.h>
+#ifndef __ASSEMBLER__
+# include <nptl/pthreadP.h>
+#endif
+#include <sys/asm.h>
+
+/* Gas will put the initial save of $gp into the CIE, because it appears to
+ happen before any instructions. So we use cfi_same_value instead of
+ cfi_restore. */
+
+#ifdef HAVE_ASM_CFI_DIRECTIVES
+# define cfi_same_value .cfi_same_value
+#else
+# define cfi_same_value
+#endif
+
+#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
+
+#ifdef __PIC__
+# undef PSEUDO
+# define PSEUDO(name, syscall_name, args) \
+ .align 2; \
+ L(pseudo_start): \
+ cfi_startproc; \
+ cfi_adjust_cfa_offset (STKSPACE); \
+ cfi_rel_offset (gp, STKOFF_GP); \
+ 99: PTR_LA t9,__syscall_error; \
+ /* manual cpreturn */ \
+ REG_L gp, STKOFF_GP(sp); \
+ cfi_same_value (gp); \
+ RESTORESTK; \
+ jr t9; \
+ .type __##syscall_name##_nocancel, @function; \
+ .globl __##syscall_name##_nocancel; \
+ __##syscall_name##_nocancel: \
+ SAVESTK; \
+ .cpsetup t9, STKOFF_GP, name; \
+ cfi_rel_offset (gp, STKOFF_GP); \
+ li v0, SYS_ify(syscall_name); \
+ syscall; \
+ bne a3, zero, SYSCALL_ERROR_LABEL; \
+ /* manual cpreturn */ \
+ REG_L gp, STKOFF_GP(sp); \
+ cfi_same_value (gp); \
+ RESTORESTK; \
+ ret; \
+ .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
+ ENTRY (name) \
+ SAVESTK; \
+ .cpsetup t9, STKOFF_GP, name; \
+ cfi_rel_offset (gp, STKOFF_GP); \
+ SINGLE_THREAD_P(v1); \
+ bne zero, v1, L(pseudo_cancel); \
+ .set noreorder; \
+ li v0, SYS_ify(syscall_name); \
+ syscall; \
+ .set reorder; \
+ bne a3, zero, SYSCALL_ERROR_LABEL; \
+ /* manual cpreturn */ \
+ REG_L gp, STKOFF_GP(sp); \
+ cfi_same_value (gp); \
+ RESTORESTK; \
+ ret; \
+ L(pseudo_cancel): \
+ cfi_adjust_cfa_offset (STKSPACE); \
+ cfi_rel_offset (gp, STKOFF_GP); \
+ REG_S ra, STKOFF_RA(sp); \
+ cfi_rel_offset (ra, STKOFF_RA); \
+ PUSHARGS_##args; /* save syscall args */ \
+ CENABLE; \
+ REG_S v0, STKOFF_SVMSK(sp); /* save mask */ \
+ POPARGS_##args; /* restore syscall args */ \
+ .set noreorder; \
+ li v0, SYS_ify (syscall_name); \
+ syscall; \
+ .set reorder; \
+ REG_S v0, STKOFF_SC_V0(sp); /* save syscall result */ \
+ REG_S a3, STKOFF_SC_ERR(sp); /* save syscall error flag */ \
+ REG_L a0, STKOFF_SVMSK(sp); /* pass mask as arg1 */ \
+ CDISABLE; \
+ REG_L a3, STKOFF_SC_ERR(sp); /* restore syscall error flag */ \
+ REG_L ra, STKOFF_RA(sp); /* restore return address */ \
+ REG_L v0, STKOFF_SC_V0(sp); /* restore syscall result */ \
+ bne a3, zero, SYSCALL_ERROR_LABEL; \
+ /* manual cpreturn */ \
+ REG_L gp, STKOFF_GP(sp); \
+ cfi_same_value (gp); \
+ RESTORESTK; \
+ L(pseudo_end):
+
+
+# undef PSEUDO_END
+# define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
+
+#endif
+
+# define PUSHARGS_0 /* nothing to do */
+# define PUSHARGS_1 PUSHARGS_0 REG_S a0, STKOFF_A0(sp); cfi_rel_offset (a0, STKOFF_A0);
+# define PUSHARGS_2 PUSHARGS_1 REG_S a1, STKOFF_A1(sp); cfi_rel_offset (a1, STKOFF_A1);
+# define PUSHARGS_3 PUSHARGS_2 REG_S a2, STKOFF_A2(sp); cfi_rel_offset (a2, STKOFF_A2);
+# define PUSHARGS_4 PUSHARGS_3 REG_S a3, STKOFF_A3(sp); cfi_rel_offset (a3, STKOFF_A3);
+# define PUSHARGS_5 PUSHARGS_4 REG_S a4, STKOFF_A4(sp); cfi_rel_offset (a3, STKOFF_A4);
+# define PUSHARGS_6 PUSHARGS_5 REG_S a5, STKOFF_A5(sp); cfi_rel_offset (a3, STKOFF_A5);
+
+# define POPARGS_0 /* nothing to do */
+# define POPARGS_1 POPARGS_0 REG_L a0, STKOFF_A0(sp);
+# define POPARGS_2 POPARGS_1 REG_L a1, STKOFF_A1(sp);
+# define POPARGS_3 POPARGS_2 REG_L a2, STKOFF_A2(sp);
+# define POPARGS_4 POPARGS_3 REG_L a3, STKOFF_A3(sp);
+# define POPARGS_5 POPARGS_4 REG_L a4, STKOFF_A4(sp);
+# define POPARGS_6 POPARGS_5 REG_L a5, STKOFF_A5(sp);
+
+/* Save an even number of slots. Should be 0 if an even number of slots
+ are used below, or SZREG if an odd number are used. */
+# define STK_PAD SZREG
+
+/* Place values that we are more likely to use later in this sequence, i.e.
+ closer to the SP at function entry. If you do that, the are more
+ likely to already be in your d-cache. */
+# define STKOFF_A5 (STK_PAD)
+# define STKOFF_A4 (STKOFF_A5 + SZREG)
+# define STKOFF_A3 (STKOFF_A4 + SZREG)
+# define STKOFF_A2 (STKOFF_A3 + SZREG) /* MT and more args. */
+# define STKOFF_A1 (STKOFF_A2 + SZREG) /* MT and 2 args. */
+# define STKOFF_A0 (STKOFF_A1 + SZREG) /* MT and 1 arg. */
+# define STKOFF_RA (STKOFF_A0 + SZREG) /* Used if MT. */
+# define STKOFF_SC_V0 (STKOFF_RA + SZREG) /* Used if MT. */
+# define STKOFF_SC_ERR (STKOFF_SC_V0 + SZREG) /* Used if MT. */
+# define STKOFF_SVMSK (STKOFF_SC_ERR + SZREG) /* Used if MT. */
+# define STKOFF_GP (STKOFF_SVMSK + SZREG) /* Always used. */
+
+# define STKSPACE (STKOFF_GP + SZREG)
+# define SAVESTK PTR_SUBU sp, STKSPACE; cfi_adjust_cfa_offset(STKSPACE)
+# define RESTORESTK PTR_ADDU sp, STKSPACE; cfi_adjust_cfa_offset(-STKSPACE)
+
+# ifdef IS_IN_libpthread
+# define CENABLE PTR_LA t9, __pthread_enable_asynccancel; jalr t9
+# define CDISABLE PTR_LA t9, __pthread_disable_asynccancel; jalr t9
+# elif defined IS_IN_librt
+# define CENABLE PTR_LA t9, __librt_enable_asynccancel; jalr t9
+# define CDISABLE PTR_LA t9, __librt_disable_asynccancel; jalr t9
+# else
+# define CENABLE PTR_LA t9, __libc_enable_asynccancel; jalr t9
+# define CDISABLE PTR_LA t9, __libc_disable_asynccancel; jalr t9
+# endif
+
+# ifndef __ASSEMBLER__
+# define SINGLE_THREAD_P \
+ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
+ header.multiple_threads) \
+ == 0, 1)
+# else
+# define SINGLE_THREAD_P(reg) \
+ READ_THREAD_POINTER(reg); \
+ lw reg, MULTIPLE_THREADS_OFFSET(reg)
+#endif
+
+#elif !defined __ASSEMBLER__
+
+# define SINGLE_THREAD_P 1
+# define NO_CANCELLATION 1
+
+#endif
# File name Caller Syscall name Args Strong name Weak names
-lseek - lseek i:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
-
-# proper socket implementations:
-recvfrom - recvfrom i:ibniBN __libc_recvfrom __recvfrom recvfrom
-sendto - sendto i:ibnibn __libc_sendto __sendto sendto
+lseek - lseek Ci:iii __libc_lseek __lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
# semaphore and shm system calls
msgctl - msgctl i:iip __msgctl msgctl
msgget - msgget i:ii __msgget msgget
-msgrcv - msgrcv i:ibnii __msgrcv msgrcv
-msgsnd - msgsnd i:ibni __msgsnd msgsnd
+msgrcv - msgrcv Ci:ibnii __msgrcv msgrcv
+msgsnd - msgsnd Ci:ibni __msgsnd msgsnd
shmat - shmat i:ipi __shmat shmat
shmctl - shmctl i:iip __shmctl shmctl
shmdt - shmdt i:s __shmdt shmdt
-/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2005, 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
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), 0); \
+ (long) (futexp), FUTEX_WAIT, (val), 0); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
})
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAIT, (val), (timespec)); \
+ (long) (futexp), FUTEX_WAIT, (val), (timespec));\
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
})
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 4, \
- (futexp), FUTEX_WAKE, (nr), 0); \
+ (long) (futexp), FUTEX_WAKE, (nr), 0); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret; \
})
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
__ret = INTERNAL_SYSCALL (futex, __err, 6, \
- (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
+ (long) (futexp), FUTEX_CMP_REQUEUE, (nr_wake), \
(nr_move), (mutex), (val)); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})