summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/nios
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/nios')
-rw-r--r--libc/sysdeps/linux/nios/__longjmp.S9
-rw-r--r--libc/sysdeps/linux/nios/bits/uClibc_arch_features.h42
-rw-r--r--libc/sysdeps/linux/nios/brk.c8
-rw-r--r--libc/sysdeps/linux/nios/clone.S13
-rw-r--r--libc/sysdeps/linux/nios/setjmp.S1
-rw-r--r--libc/sysdeps/linux/nios/vfork.S38
6 files changed, 73 insertions, 38 deletions
diff --git a/libc/sysdeps/linux/nios/__longjmp.S b/libc/sysdeps/linux/nios/__longjmp.S
index c2b1979cc..d7d1cdd86 100644
--- a/libc/sysdeps/linux/nios/__longjmp.S
+++ b/libc/sysdeps/linux/nios/__longjmp.S
@@ -16,6 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <features.h>
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
@@ -99,10 +100,4 @@ __longjmp_done:
jmp %o7 ; and kinda return there.
mov %o0,%g1 ; (delay slot) return value
-
-
-
-
-
-
-
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h b/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
new file mode 100644
index 000000000..ff0e20fad
--- /dev/null
+++ b/libc/sysdeps/linux/nios/bits/uClibc_arch_features.h
@@ -0,0 +1,42 @@
+/*
+ * Track misc arch-specific features that aren't config options
+ */
+
+#ifndef _BITS_UCLIBC_ARCH_FEATURES_H
+#define _BITS_UCLIBC_ARCH_FEATURES_H
+
+/* instruction used when calling abort() to kill yourself */
+/*#define __UCLIBC_ABORT_INSTRUCTION__ "asm instruction"*/
+#undef __UCLIBC_ABORT_INSTRUCTION__
+
+/* can your target use syscall6() for mmap ? */
+#undef __UCLIBC_MMAP_HAS_6_ARGS__
+
+/* does your target use syscall4() for truncate64 ? (32bit arches only) */
+#undef __UCLIBC_TRUNCATE64_HAS_4_ARGS__
+
+/* does your target have a broken create_module() ? */
+#undef __UCLIBC_BROKEN_CREATE_MODULE__
+
+/* does your target prefix all symbols with an _ ? */
+#define __UCLIBC_NO_UNDERSCORES__
+
+/* does your target have an asm .set ? */
+#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
+
+/* define if target doesn't like .global */
+#undef __UCLIBC_ASM_GLOBAL_DIRECTIVE__
+
+/* define if target supports .weak */
+#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__
+
+/* define if target supports .weakext */
+#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__
+
+/* needed probably only for ppc64 */
+#undef __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__
+
+/* define if target supports IEEE signed zero floats */
+#define __UCLIBC_HAVE_SIGNED_ZERO__
+
+#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/libc/sysdeps/linux/nios/brk.c b/libc/sysdeps/linux/nios/brk.c
index 2e785b734..69f60d336 100644
--- a/libc/sysdeps/linux/nios/brk.c
+++ b/libc/sysdeps/linux/nios/brk.c
@@ -21,11 +21,15 @@
#include <sys/syscall.h>
#include <errno.h>
+libc_hidden_proto(brk)
/* This must be initialized data because commons can't have aliases. */
+extern void *__curbrk;
+libc_hidden_proto(__curbrk)
void *__curbrk = 0;
+libc_hidden_data_def(__curbrk)
-int attribute_hidden __brk (void *addr)
+int brk (void *addr)
{
void *newbrk;
register int g1 asm("%g1") = __NR_brk;
@@ -42,4 +46,4 @@ int attribute_hidden __brk (void *addr)
return 0;
}
-strong_alias(__brk,brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/nios/clone.S b/libc/sysdeps/linux/nios/clone.S
index a3098f5f8..39eb54035 100644
--- a/libc/sysdeps/linux/nios/clone.S
+++ b/libc/sysdeps/linux/nios/clone.S
@@ -21,17 +21,17 @@
and invokes a function in the right context after its all over. */
#include <asm/errno.h>
-#include <asm/unistd.h>
+#include <sys/syscall.h>
#include "NM_Macros.S"
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
.text
.align 2
- .globl __clone
- .type __clone,@function
+ .globl clone
+ .type clone,@function
-__clone:
+clone:
save %sp,-16
MOVIP %l0, -EINVAL
@@ -74,7 +74,7 @@ CLONE_ERROR_LABEL:
ret
restore
- .size __clone, .-__clone
+ .size clone, .-clone
.type __thread_start,@function
@@ -86,6 +86,3 @@ __thread_start:
nop
.size __thread_start, .-__thread_start
-
-.globl clone;
- clone = __clone
diff --git a/libc/sysdeps/linux/nios/setjmp.S b/libc/sysdeps/linux/nios/setjmp.S
index 70bd75c5d..c2851461c 100644
--- a/libc/sysdeps/linux/nios/setjmp.S
+++ b/libc/sysdeps/linux/nios/setjmp.S
@@ -16,6 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <features.h>
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
diff --git a/libc/sysdeps/linux/nios/vfork.S b/libc/sysdeps/linux/nios/vfork.S
index 22b3c30cd..f8a6d031c 100644
--- a/libc/sysdeps/linux/nios/vfork.S
+++ b/libc/sysdeps/linux/nios/vfork.S
@@ -9,7 +9,11 @@
*
* Written by Wentao Xu <wentao@microtronix.com>
*/
-#include <asm/unistd.h>
+
+#include <features.h>
+
+#include <bits/errno.h>
+#include <sys/syscall.h>
#include "NM_Macros.S"
#ifndef __NR_vfork
@@ -18,15 +22,10 @@
.text
.align 2
- .globl errno
- .globl vfork
- .globl __libc_vfork
-#if defined __HAVE_ELF__
- .type vfork,@function
- .type __libc_vfork,@function
-#endif
-vfork:
-__libc_vfork:
+ .globl __vfork
+ .hidden __vfork
+ .type __vfork,@function
+__vfork:
MOVIP %g1, __NR_vfork
trap 63
@@ -34,25 +33,22 @@ __libc_vfork:
not %g1 /* (unsigned long) -4096 */
cmp %o0, %g1
skps cc_hi
- jmp %o7
- nop
-
+ jmp %o7
+ nop
+
fix_errno:
neg %o0
save %sp, -16
MOVIA %g1, __errno_location@h
call %g1
- nop
+ nop
st [%o0], %i0 /* store errno */
xor %i0, %i0
subi %i0, 1 /* retval=-1 */
ret
- restore
-
-
-
-
-
-
+ restore
+.size __vfork,.-__vfork
+weak_alias(__vfork,vfork)
+libc_hidden_weak(vfork)