From 12cecc8261e8da2703bbeb3f6bd1c933a475ca9c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 10 Jan 2006 02:06:25 +0000 Subject: more fixes by Thomas Chou in Bug 618 --- libc/sysdeps/linux/nios2/__longjmp.S | 3 ++- libc/sysdeps/linux/nios2/clone.S | 23 +++++++++++++++-------- libc/sysdeps/linux/nios2/crt1.S | 4 +++- libc/sysdeps/linux/nios2/setjmp.S | 4 ++-- libc/sysdeps/linux/nios2/vfork.S | 30 +++++++++++++++--------------- 5 files changed, 37 insertions(+), 27 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/nios2/__longjmp.S b/libc/sysdeps/linux/nios2/__longjmp.S index d15f040cd..96eeaadc0 100644 --- a/libc/sysdeps/linux/nios2/__longjmp.S +++ b/libc/sysdeps/linux/nios2/__longjmp.S @@ -11,6 +11,7 @@ * */ +#include #define _ASM #define _SETJMP_H #include @@ -45,4 +46,4 @@ __longjmp: /* return to saved RA */ ret - +.size __longjmp,.-__longjmp diff --git a/libc/sysdeps/linux/nios2/clone.S b/libc/sysdeps/linux/nios2/clone.S index 4dd8745cd..ba514c40b 100644 --- a/libc/sysdeps/linux/nios2/clone.S +++ b/libc/sysdeps/linux/nios2/clone.S @@ -9,18 +9,18 @@ * * Written by Wentao Xu */ -#include -#include +#define _ERRNO_H +#include +#include + +#ifdef __NR_clone /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ .text -.balign 4 -.type clone,@function -.globl clone; -clone: -.type __clone,@function -.globl __clone; +.global __clone +.type __clone,%function +.align 4 __clone: addi sp,sp,-8 mov r8,r4 @@ -64,3 +64,10 @@ CLONE_OK: ldw r16,0(sp) addi sp,sp,8 ret + +.size __clone,.-__clone + +.weak clone + clone = __clone + +#endif diff --git a/libc/sysdeps/linux/nios2/crt1.S b/libc/sysdeps/linux/nios2/crt1.S index 948eeb1ed..bcb8a26db 100644 --- a/libc/sysdeps/linux/nios2/crt1.S +++ b/libc/sysdeps/linux/nios2/crt1.S @@ -47,7 +47,9 @@ _start: movhi r7, %hi(_init) ori r7, r7, %lo(_init) - /* reuse the argc stack slot for the 5th arg */ + /* Allocate space on the stack for 6-7th arg, reuse 5th space */ + addi sp,sp,-8 + /* push 5-7th args on stack */ movhi r8, %hi(_fini) ori r8, r8, %lo(_fini) stw r8, 0(sp) diff --git a/libc/sysdeps/linux/nios2/setjmp.S b/libc/sysdeps/linux/nios2/setjmp.S index b2ff52162..8acd22044 100644 --- a/libc/sysdeps/linux/nios2/setjmp.S +++ b/libc/sysdeps/linux/nios2/setjmp.S @@ -11,6 +11,7 @@ * */ +#include #define _ASM #define _SETJMP_H #include @@ -47,5 +48,4 @@ __sigsetjmp: jmp r8 #endif - - +.size __sigsetjmp,.-__sigsetjmp diff --git a/libc/sysdeps/linux/nios2/vfork.S b/libc/sysdeps/linux/nios2/vfork.S index a19a90023..d75edcec9 100644 --- a/libc/sysdeps/linux/nios2/vfork.S +++ b/libc/sysdeps/linux/nios2/vfork.S @@ -9,23 +9,20 @@ * * Written by Wentao Xu */ -#include -#ifndef __NR_vfork -#define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */ -#endif +#include + +#define _ERRNO_H +#include +#include + +#ifdef __NR_fork +.text +.global __vfork +.hidden __vfork +.type __vfork,%function +.align 4 - .text - .balign 4 - .globl errno - .globl vfork - .globl __libc_vfork -#if defined __HAVE_ELF__ - .type vfork,@function - .type __libc_vfork,@function -#endif -vfork: -__libc_vfork: movui r2, TRAP_ID_SYSCALL movui r3, __NR_vfork trap @@ -51,3 +48,6 @@ fix_errno: addi sp, sp, 8 ret +.size __vfork,.-__vfork +strong_alias(__vfork,vfork) +#endif -- cgit v1.2.3