aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@codesourcery.com>2006-03-03 01:06:48 +0000
committerDaniel Jacobowitz <dan@codesourcery.com>2006-03-03 01:06:48 +0000
commit6428ce3cdad3d587fb77f2f1d0d7036f780fa9e0 (patch)
tree0b9ab606ed6e36b293b65483dfb10f331f59a0d3 /sysdeps
parent43b83c6fe172730ffe39b3fbcf54add3ce92b084 (diff)
downloadglibc-6428ce3cdad3d587fb77f2f1d0d7036f780fa9e0.tar.xz
glibc-6428ce3cdad3d587fb77f2f1d0d7036f780fa9e0.zip
* 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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mips/dl-machine.h12
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/Makefile9
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h72
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h72
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h183
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/syscalls.list10
-rw-r--r--sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h10
7 files changed, 282 insertions, 86 deletions
diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h
index c04609f9bc..b91218479d 100644
--- a/sysdeps/mips/dl-machine.h
+++ b/sysdeps/mips/dl-machine.h
@@ -1,5 +1,5 @@
/* 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>.
@@ -336,28 +336,24 @@ elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
# 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;
}
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/Makefile b/sysdeps/unix/sysv/linux/mips/mips64/Makefile
new file mode 100644
index 0000000000..0a37c5b9b4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/Makefile
@@ -0,0 +1,9 @@
+ifeq ($(subdir),socket)
+CFLAGS-recv.c += -fexceptions
+CFLAGS-send.c += -fexceptions
+endif
+
+ifeq ($(subdir),nptl)
+CFLAGS-recv.c += -fexceptions
+CFLAGS-send.c += -fexceptions
+endif
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
index e6013669a4..247d4ffbf4 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h
@@ -1,4 +1,5 @@
-/* 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
@@ -66,22 +67,28 @@
#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; \
@@ -89,21 +96,21 @@
_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; \
@@ -111,22 +118,22 @@
_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; \
@@ -134,23 +141,23 @@
_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; \
@@ -158,23 +165,23 @@
_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; \
@@ -182,12 +189,12 @@
_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; \
@@ -195,12 +202,11 @@
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; \
@@ -208,12 +214,12 @@
_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; \
@@ -222,12 +228,12 @@
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; \
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
index dc0a1a0edc..c238822b20 100644
--- a/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h
@@ -1,4 +1,5 @@
-/* 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
@@ -66,22 +67,28 @@
#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; \
@@ -89,21 +96,21 @@
_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; \
@@ -111,22 +118,22 @@
_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; \
@@ -134,23 +141,23 @@
_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; \
@@ -158,23 +165,23 @@
_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; \
@@ -182,12 +189,12 @@
_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; \
@@ -195,12 +202,11 @@
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; \
@@ -208,12 +214,12 @@
_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; \
@@ -222,12 +228,12 @@
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; \
diff --git a/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h b/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
new file mode 100644
index 0000000000..e184c91236
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/mips64/nptl/sysdep-cancel.h
@@ -0,0 +1,183 @@
+/* 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, STKO