summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps/mips
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/nptl/sysdeps/mips')
-rw-r--r--libpthread/nptl/sysdeps/mips/Makefile.arch2
-rw-r--r--libpthread/nptl/sysdeps/mips/sysdep.h31
2 files changed, 32 insertions, 1 deletions
diff --git a/libpthread/nptl/sysdeps/mips/Makefile.arch b/libpthread/nptl/sysdeps/mips/Makefile.arch
index fa22a5454..2613afd32 100644
--- a/libpthread/nptl/sysdeps/mips/Makefile.arch
+++ b/libpthread/nptl/sysdeps/mips/Makefile.arch
@@ -31,7 +31,7 @@ libpthread-nomulti-y += $(PTHREAD_ARCH_OBJ)
LIBC_ARCH_OBJ := $(patsubst %.c,$(PTHREAD_ARCH_OUT)/%.o,$(libc_a_CSRC))
-libc-a-y += $(LIBC_ARCH_OBJ)
+libc-static-y += $(LIBC_ARCH_OBJ)
libc-nomulti-y += $(LIBC_ARCH_OBJ)
diff --git a/libpthread/nptl/sysdeps/mips/sysdep.h b/libpthread/nptl/sysdeps/mips/sysdep.h
index 9483d8b39..69cecae70 100644
--- a/libpthread/nptl/sysdeps/mips/sysdep.h
+++ b/libpthread/nptl/sysdeps/mips/sysdep.h
@@ -76,4 +76,35 @@
# define L(label) .L ## label
#endif
+/* Note that while it's better structurally, going back to call __syscall_error
+ can make things confusing if you're debugging---it looks like it's jumping
+ backwards into the previous fn. */
+#ifdef __PIC__
+#define PSEUDO(name, syscall_name, args) \
+ .align 2; \
+ 99: la t9,__syscall_error; \
+ jr t9; \
+ ENTRY(name) \
+ .set noreorder; \
+ .cpload t9; \
+ li v0, SYS_ify(syscall_name); \
+ syscall; \
+ .set reorder; \
+ bne a3, zero, 99b; \
+L(syse1):
+#else
+#define PSEUDO(name, syscall_name, args) \
+ .set noreorder; \
+ .align 2; \
+ 99: j __syscall_error; \
+ nop; \
+ ENTRY(name) \
+ .set noreorder; \
+ li v0, SYS_ify(syscall_name); \
+ syscall; \
+ .set reorder; \
+ bne a3, zero, 99b; \
+L(syse1):
+#endif
+
#endif