diff options
-rw-r--r-- | libc/sysdeps/linux/sh/__longjmp.S | 10 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/bsd-_setjmp.S | 10 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/bsd-setjmp.S | 10 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/clone.S | 24 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/setjmp.S | 14 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/sysdep.h | 86 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/vfork.S | 8 |
7 files changed, 48 insertions, 114 deletions
diff --git a/libc/sysdeps/linux/sh/__longjmp.S b/libc/sysdeps/linux/sh/__longjmp.S index 09f829ae3..9b785a300 100644 --- a/libc/sysdeps/linux/sh/__longjmp.S +++ b/libc/sysdeps/linux/sh/__longjmp.S @@ -17,14 +17,17 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <sysdep.h> #define _SETJMP_H #define _ASM #include <bits/setjmp.h> /* __longjmp(jmpbuf, val) */ -ENTRY (__longjmp) +.text +.align 5 +.type __longjmp,@function +.globl __longjmp; +__longjmp: mov.l @r4+, r8 mov.l @r4+, r9 mov.l @r4+, r10 @@ -41,4 +44,5 @@ ENTRY (__longjmp) 1: rts ldc.l @r4+, gbr -END (__longjmp) +.size __longjmp,.-__longjmp; + diff --git a/libc/sysdeps/linux/sh/bsd-_setjmp.S b/libc/sysdeps/linux/sh/bsd-_setjmp.S index 32b642558..8b5fc8a2d 100644 --- a/libc/sysdeps/linux/sh/bsd-_setjmp.S +++ b/libc/sysdeps/linux/sh/bsd-_setjmp.S @@ -21,13 +21,17 @@ We cannot do it in C because it must be a tail-call, so frame-unwinding in setjmp doesn't clobber the state restored by longjmp. */ -#include <sysdep.h> -ENTRY (_setjmp) +.text +.align 5 +.type _setjmp,@function +.globl _setjmp; +_setjmp: mov.l 1f, r1 jmp @r1 mov #0, r0 .align 2 1: .long __sigsetjmp -END (_setjmp) +.size _setjmp,.-_setjmp; + diff --git a/libc/sysdeps/linux/sh/bsd-setjmp.S b/libc/sysdeps/linux/sh/bsd-setjmp.S index ea47caa6c..72ab83a85 100644 --- a/libc/sysdeps/linux/sh/bsd-setjmp.S +++ b/libc/sysdeps/linux/sh/bsd-setjmp.S @@ -21,13 +21,17 @@ We cannot do it in C because it must be a tail-call, so frame-unwinding in setjmp doesn't clobber the state restored by longjmp. */ -#include <sysdep.h> -ENTRY (setjmp) +.text +.align 5 +.type setjmp,@function +.globl setjmp; +setjmp: mov.l 1f, r1 jmp @r1 mov #1, r0 .align 2 1: .long __sigsetjmp -END (setjmp) +.size setjmp,.-setjmp; + diff --git a/libc/sysdeps/linux/sh/clone.S b/libc/sysdeps/linux/sh/clone.S index ed0357cbc..bc31f48f8 100644 --- a/libc/sysdeps/linux/sh/clone.S +++ b/libc/sysdeps/linux/sh/clone.S @@ -19,11 +19,19 @@ /* clone() is even more special than fork() as it mucks with stacks and invokes a function in the right context after its all over. */ +#include <features.h> #include <asm/unistd.h> -#include <sysdep.h> #define _ERRNO_H 1 #include <bits/errno.h> + +#if defined __HAVE_ELF__ && defined __HAVE_SHARED__ +#define PLTJMP(_x) _x##@PLT +#else +#define PLTJMP(_x) _x +#endif + + /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ .text @@ -40,7 +48,7 @@ __clone: tst r5, r5 bf/s 1f mov.l .L1, r1 -#ifdef SHARED +#ifdef __HAVE_SHARED__ mov.l r12, @-r15 sts.l pr, @-r15 mov.l .LG, r12 @@ -59,7 +67,7 @@ __clone: #endif .align 2 .L1: - .long PLTJMP(C_SYMBOL_NAME(__syscall_error)) + .long PLTJMP(__syscall_error) 1: /* insert the args onto the new stack */ mov.l r7, @-r5 @@ -77,7 +85,7 @@ __clone: tst r1, r1 // i.e. error in linux bf 2f mov.l .L2, r1 -#ifdef SHARED +#ifdef __HAVE_SHARED__ mov r0, r4 mov.l r12, @-r15 sts.l pr, @-r15 @@ -97,7 +105,7 @@ __clone: #endif .align 2 .L2: - .long PLTJMP(C_SYMBOL_NAME(__syscall_error)) + .long PLTJMP(__syscall_error) 2: tst r0, r0 @@ -112,7 +120,7 @@ __clone: /* we are done, passing the return value through r0 */ mov.l .L3, r1 -#ifdef SHARED +#ifdef __HAVE_SHARED__ mov.l r12, @-r15 sts.l pr, @-r15 mov r0, r4 @@ -134,8 +142,8 @@ __clone: .LG: .long _GLOBAL_OFFSET_TABLE_ .L3: - .long PLTJMP(C_SYMBOL_NAME(_exit)) - END(__clone) + .long PLTJMP(_exit) +.size __clone,.-__clone; .globl clone; clone = __clone diff --git a/libc/sysdeps/linux/sh/setjmp.S b/libc/sysdeps/linux/sh/setjmp.S index c263dc918..771b488bd 100644 --- a/libc/sysdeps/linux/sh/setjmp.S +++ b/libc/sysdeps/linux/sh/setjmp.S @@ -17,18 +17,15 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <sysdep.h> - #define _SETJMP_H #define _ASM #include <bits/setjmp.h> -ENTRY (__sigsetjmp) -/* - .globl __sigsetjmp - .align 4 +.text +.align 5 +.type __sigsetjmp,@function +.globl __sigsetjmp; __sigsetjmp: -*/ /* Save registers */ add #(JB_SIZE-5*4), r4 /* this code doesn't do FP yet */ stc.l gbr, @-r4 @@ -49,4 +46,5 @@ __sigsetjmp: .align 2 .L1: .long __sigjmp_save -END (__sigsetjmp) +.size __sigsetjmp,.-__sigsetjmp; + diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h deleted file mode 100644 index 9cd6c6cfa..000000000 --- a/libc/sysdeps/linux/sh/sysdep.h +++ /dev/null @@ -1,86 +0,0 @@ -/* Assembler macros for SH. - Copyright (C) 1999, 2000 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 Library General Public License as - published by the Free Software Foundation; either version 2 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#define __need_uClibc_config_h 1 -#include <bits/uClibc_config.h> - -/* Define a macro we can use to construct the asm name for a C symbol. */ -#define C_LABEL(name) __C_SYMBOL_PREFIX__ name - -/* Mark the end of function named SYM. This is used on some platforms - to generate correct debugging information. */ -#ifndef END -#define END(sym) -#endif - -#ifndef ASM_GLOBAL_DIRECTIVE -#define ASM_GLOBAL_DIRECTIVE .global -#endif - -#ifndef C_SYMBOL_NAME -#define C_SYMBOL_NAME(name) name -#endif - -#ifdef __ASSEMBLER__ - -/* Syntactic details of assembler. */ - -#ifdef __HAVE_ELF__ - -#define ALIGNARG(log2) log2 -/* For ELF we need the `.type' directive to make shared libs work right. */ -#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,@##typearg; -#define ASM_SIZE_DIRECTIVE(name) .size name,.-name - -#ifdef SHARED -#define PLTJMP(_x) _x##@PLT -#else -#define PLTJMP(_x) _x -#endif - -#else - -#define ALIGNARG(log2) log2 -#define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */ -#define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */ -#define C_SYMBOL_NAME(name) name /* Nothing is specified. */ -#define PLTJMP(_x) _x - -#endif - -/* Define an entry point visible from C. */ -#define ENTRY(name) \ - ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \ - ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \ - .align ALIGNARG(5); \ - C_LABEL(name) \ - CALL_MCOUNT - -#undef END -#define END(name) \ - ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name)) - -/* If compiled for profiling, call `_mcount' at the start of each function. */ -#ifdef PROF -#define CALL_MCOUNT /* NOTYET */ -#else -#define CALL_MCOUNT /* Do nothing. */ -#endif - -#endif /* __ASSEMBLER__ */ diff --git a/libc/sysdeps/linux/sh/vfork.S b/libc/sysdeps/linux/sh/vfork.S index b3b8f3ce0..c9cc12da7 100644 --- a/libc/sysdeps/linux/sh/vfork.S +++ b/libc/sysdeps/linux/sh/vfork.S @@ -20,7 +20,6 @@ respective copyright holders. */ -#include <sysdep.h> #define _ERRNO_H 1 #include <bits/errno.h> @@ -31,8 +30,11 @@ .global errno -ENTRY (__vfork) - +.text +.align 5 +.type __vfork,@function +.globl __vfork; +__vfork: mov.l @r15+,r3 // pop value from the stack mov.l .L5,r1 mov.l r3,@r1 // save it in .sav_stack |