diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/sparc/sysdep.h | 50 | ||||
-rw-r--r-- | sysdeps/unix/sparc/brk.S | 50 | ||||
-rw-r--r-- | sysdeps/unix/sparc/dl-brk.S | 1 | ||||
-rw-r--r-- | sysdeps/unix/sparc/pipe.S | 29 | ||||
-rw-r--r-- | sysdeps/unix/sparc/sysdep.S | 41 | ||||
-rw-r--r-- | sysdeps/unix/sparc/sysdep.h | 95 | ||||
-rw-r--r-- | sysdeps/unix/sparc/vfork.S | 34 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h | 28 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h | 25 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sysdep.h | 19 |
10 files changed, 73 insertions, 299 deletions
diff --git a/sysdeps/sparc/sysdep.h b/sysdeps/sparc/sysdep.h index 8a7546bec9..2702620be6 100644 --- a/sysdeps/sparc/sysdep.h +++ b/sysdeps/sparc/sysdep.h @@ -42,3 +42,53 @@ #define HWCAP_SPARC_IMA 0x00400000 #define HWCAP_SPARC_ASI_CACHE_SPARING \ 0x00800000 + +#ifdef __ASSEMBLER__ + +#define SPARC_PIC_THUNK(reg) \ + .ifndef __sparc_get_pc_thunk.reg; \ + .section .text.__sparc_get_pc_thunk.reg,"axG",@progbits,__sparc_get_pc_thunk.reg,comdat; \ + .align 32; \ + .weak __sparc_get_pc_thunk.reg; \ + .hidden __sparc_get_pc_thunk.reg; \ + .type __sparc_get_pc_thunk.reg, #function; \ +__sparc_get_pc_thunk.reg: \ + jmp %o7 + 8; \ + add %o7, %reg, %##reg; \ + .previous; \ + .endif; + +/* Even when v9 we use a call sequence instead of using "rd %pc" because + RDPC is extremely expensive and incurs a full pipeline flush. */ + +#define SETUP_PIC_REG(reg) \ + SPARC_PIC_THUNK(reg) \ + sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \ + call __sparc_get_pc_thunk.reg; \ + or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; + +#define SETUP_PIC_REG_LEAF(reg, tmp) \ + SPARC_PIC_THUNK(reg) \ + sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \ + mov %o7, %##tmp; \ + call __sparc_get_pc_thunk.reg; \ + or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; \ + mov %##tmp, %o7; + +#undef ENTRY +#define ENTRY(name) \ + .align 4; \ + .global C_SYMBOL_NAME(name); \ + .type name, @function; \ +C_LABEL(name) \ + cfi_startproc; + +#undef END +#define END(name) \ + cfi_endproc; \ + .size name, . - name + +#undef LOC +#define LOC(name) .L##name + +#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sparc/brk.S b/sysdeps/unix/sparc/brk.S deleted file mode 100644 index 6b5d147242..0000000000 --- a/sysdeps/unix/sparc/brk.S +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright (C) 1993, 1995, 1997, 2005 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, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - -#ifndef SYS_brk -#define SYS_brk 17 -#endif - -#ifndef C_SYMBOL_NAME -#define C_SYMBOL_NAME(name) _##name -#endif - -.data -.global C_SYMBOL_NAME(__curbrk) -C_LABEL(__curbrk) - .long C_SYMBOL_NAME(_end) - -.text -ENTRY (__brk) - add %o0, 7, %o0 - andn %o0, 7, %o0 - mov SYS_brk, %g1 - mov %o0, %o1 /* Save rounded value. */ - ta %g0 - bcs error - sethi %hi(C_SYMBOL_NAME(__curbrk)), %g1 - st %o1, [%g1 + %lo(C_SYMBOL_NAME(__curbrk))] - ret -error: sethi %hi(C_SYMBOL_NAME(errno)), %g1 - st %o0, [%g1 + %lo(C_SYMBOL_NAME(errno))] - sub %g0, 1, %o0 - retl - nop /* Fill the delay slot. */ - -weak_alias (__brk, brk) diff --git a/sysdeps/unix/sparc/dl-brk.S b/sysdeps/unix/sparc/dl-brk.S deleted file mode 100644 index eeb96544e3..0000000000 --- a/sysdeps/unix/sparc/dl-brk.S +++ /dev/null @@ -1 +0,0 @@ -#include <brk.S> diff --git a/sysdeps/unix/sparc/pipe.S b/sysdeps/unix/sparc/pipe.S deleted file mode 100644 index 2513641774..0000000000 --- a/sysdeps/unix/sparc/pipe.S +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1991, 1992, 1995, 1997, 2002 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, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - -ENTRY (__pipe) - mov %o0, %o2 /* Save PIPEDES. */ -PSEUDO (__Spipe, pipe, 1) - st %o0, [%o2] /* PIPEDES[0] = %o0; */ - st %o1, [%o2 + 4] /* PIPEDES[1] = %o1; */ - retl /* return 0; */ - clr %o0 - -libc_hidden_def (__pipe) -weak_alias (__pipe, pipe) diff --git a/sysdeps/unix/sparc/sysdep.S b/sysdeps/unix/sparc/sysdep.S deleted file mode 100644 index 706a276a85..0000000000 --- a/sysdeps/unix/sparc/sysdep.S +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 1994, 1997, 2012 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, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> -#define _ERRNO_H -#include <bits/errno.h> - -.global C_SYMBOL_NAME(errno) -.global syscall_error - -.text -.align 2 -__syscall_error: -#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN - /* We translate the system's EWOULDBLOCK error into EAGAIN. - The GNU C library always defines EWOULDBLOCK==EAGAIN. - EWOULDBLOCK_sys is the original number. */ - cmp %o0, EWOULDBLOCK_sys - be,a notblock - mov EAGAIN, %o0 -#endif -notblock: /* Store the error code in `errno'. */ - sethi %hi(C_SYMBOL_NAME(errno)), %g1 - st %o0, [%g1 + %lo(C_SYMBOL_NAME(errno))] - /* And return -1. */ - retl - mov -1, %o0 diff --git a/sysdeps/unix/sparc/sysdep.h b/sysdeps/unix/sparc/sysdep.h deleted file mode 100644 index 1a095cc6c2..0000000000 --- a/sysdeps/unix/sparc/sysdep.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (C) 1993, 1994, 1995, 1997, 2003, 2011, 2012 - 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, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdeps/unix/sysdep.h> -#include <sysdeps/sparc/sysdep.h> - -#ifdef __ASSEMBLER__ - -/* Since C identifiers are not normally prefixed with an underscore - on this system, the asm identifier `syscall_error' intrudes on the - C name space. Make sure we use an innocuous name. */ -#define syscall_error C_SYMBOL_NAME(__syscall_error) - -#define SPARC_PIC_THUNK(reg) \ - .ifndef __sparc_get_pc_thunk.reg; \ - .section .text.__sparc_get_pc_thunk.reg,"axG",@progbits,__sparc_get_pc_thunk.reg,comdat; \ - .align 32; \ - .weak __sparc_get_pc_thunk.reg; \ - .hidden __sparc_get_pc_thunk.reg; \ - .type __sparc_get_pc_thunk.reg, #function; \ -__sparc_get_pc_thunk.reg: \ - jmp %o7 + 8; \ - add %o7, %reg, %##reg; \ - .previous; \ - .endif; - -/* Even when v9 we use a call sequence instead of using "rd %pc" because - RDPC is extremely expensive and incurs a full pipeline flush. */ - -#define SETUP_PIC_REG(reg) \ - SPARC_PIC_THUNK(reg) \ - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \ - call __sparc_get_pc_thunk.reg; \ - or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; - -#define SETUP_PIC_REG_LEAF(reg, tmp) \ - SPARC_PIC_THUNK(reg) \ - sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \ - mov %o7, %##tmp; \ - call __sparc_get_pc_thunk.reg; \ - or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; \ - mov %##tmp, %o7; - -#define ENTRY(name) \ - .global C_SYMBOL_NAME(name); \ - .type name,@function; \ - .align 4; \ - C_LABEL(name) - - -#define PSEUDO(name, syscall_name, args) \ - .global syscall_error; \ - ENTRY (name) \ - mov SYS_ify(syscall_name), %g1; \ - ta 0; \ - bcc 1f; \ - sethi %hi(syscall_error), %g1; \ - jmp %g1 + %lo(syscall_error); nop; \ -1: - -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - .global syscall_error; \ - ENTRY (name) \ - mov SYS_ify(syscall_name), %g1; \ - ta 0 - -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - .global syscall_error; \ - ENTRY (name) \ - mov SYS_ify(syscall_name), %g1; \ - ta 0 - -#define ret retl; nop -#define ret_NOERRNO retl; nop -#define ret_ERRVAL retl; nop -#define r0 %o0 -#define r1 %o1 -#define MOVE(x,y) mov x, y - -#endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sparc/vfork.S b/sysdeps/unix/sparc/vfork.S deleted file mode 100644 index c8c2d51df4..0000000000 --- a/sysdeps/unix/sparc/vfork.S +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 97, 99, 2002 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, see - <http://www.gnu.org/licenses/>. */ - -#include <sysdep.h> - -#ifndef SYS_vfork -#define SYS_vfork 66 -#endif - -SYSCALL__ (vfork, 0) - /* %o1 is now 0 for the parent and 1 for the child. Decrement it to - make it -1 (all bits set) for the parent, and 0 (no bits set) - for the child. Then AND it with %o0, so the parent gets - %o0&-1==pid, and the child gets %o0&0==0. */ - sub %o1, 1, %o1 - retl - and %o0, %o1, %o0 -libc_hidden_def (__vfork) - -weak_alias (__vfork, vfork) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index 3424598566..3a1b35909c 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -20,7 +20,7 @@ #ifndef _LINUX_SPARC32_SYSDEP_H #define _LINUX_SPARC32_SYSDEP_H 1 -#include <sysdeps/unix/sparc/sysdep.h> +#include <sysdeps/unix/sysv/linux/sparc/sysdep.h> #ifdef IS_IN_rtld # include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ @@ -34,28 +34,7 @@ #define LOADSYSCALL(x) mov __NR_##x, %g1 -/* Linux/SPARC uses a different trap number */ #undef PSEUDO -#undef PSEUDO_NOERRNO -#undef PSEUDO_ERRVAL -#undef PSEUDO_END -#undef ENTRY -#undef END -#undef LOC - -#define ENTRY(name) \ - .align 4; \ - .global C_SYMBOL_NAME(name); \ - .type name, @function; \ -C_LABEL(name) \ - cfi_startproc; - -#define END(name) \ - cfi_endproc; \ - .size name, . - name - -#define LOC(name) .L##name - #define PSEUDO(name, syscall_name, args) \ .text; \ ENTRY(name); \ @@ -66,18 +45,21 @@ ENTRY(name); \ SYSCALL_ERROR_HANDLER \ 1: +#undef PSEUDO_NOERRNO #define PSEUDO_NOERRNO(name, syscall_name, args)\ .text; \ ENTRY(name); \ LOADSYSCALL(syscall_name); \ ta 0x10; +#undef PSEUDO_ERRVAL #define PSEUDO_ERRVAL(name, syscall_name, args) \ .text; \ ENTRY(name); \ LOADSYSCALL(syscall_name); \ ta 0x10; +#undef PSEUDO_END #define PSEUDO_END(name) \ END(name) @@ -141,8 +123,6 @@ ENTRY(name); \ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ "cc", "memory" -#include <sysdeps/unix/sysv/linux/sparc/sysdep.h> - #endif /* __ASSEMBLER__ */ /* Pointer mangling support. */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index 1bf75973fc..214ab5b257 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -20,7 +20,7 @@ #ifndef _LINUX_SPARC64_SYSDEP_H #define _LINUX_SPARC64_SYSDEP_H 1 -#include <sysdeps/unix/sparc/sysdep.h> +#include <sysdeps/unix/sysv/linux/sparc/sysdep.h> #ifdef IS_IN_rtld # include <dl-sysdep.h> /* Defines RTLD_PRIVATE_ERRNO. */ @@ -44,25 +44,7 @@ #define LOADSYSCALL(x) mov __NR_##x, %g1 -/* Linux/SPARC uses a different trap number */ #undef PSEUDO -#undef PSEUDO_NOERRNO -#undef PSEUDO_ERRVAL -#undef PSEUDO_END -#undef ENTRY -#undef END - -#define ENTRY(name) \ - .align 4; \ - .global C_SYMBOL_NAME(name); \ - .type name, @function; \ -C_LABEL(name) \ - cfi_startproc; - -#define END(name) \ - cfi_endproc; \ - .size name, . - name - #define PSEUDO(name, syscall_name, args) \ .text; \ ENTRY(name); \ @@ -73,18 +55,21 @@ ENTRY(name); \ SYSCALL_ERROR_HANDLER \ 1: +#undef PSEUDO_NOERRNO #define PSEUDO_NOERRNO(name, syscall_name, args)\ .text; \ ENTRY(name); \ LOADSYSCALL(syscall_name); \ ta 0x6d; +#undef PSEUDO_ERRVAL #define PSEUDO_ERRVAL(name, syscall_name, args) \ .text; \ ENTRY(name); \ LOADSYSCALL(syscall_name); \ ta 0x6d; +#undef PSEUDO_END #define PSEUDO_END(name) \ END(name) @@ -149,8 +134,6 @@ ENTRY(name); \ "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ "cc", "memory" -#include <sysdeps/unix/sysv/linux/sparc/sysdep.h> - #endif /* __ASSEMBLER__ */ /* This is the offset from the %sp to the backing store above the diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h index fc955c236c..a8cd82a70b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -19,6 +19,20 @@ #ifndef _LINUX_SPARC_SYSDEP_H #define _LINUX_SPARC_SYSDEP_H 1 +#include <sysdeps/unix/sysdep.h> +#include <sysdeps/sparc/sysdep.h> + +#ifdef __ASSEMBLER__ + +#define ret retl; nop +#define ret_NOERRNO retl; nop +#define ret_ERRVAL retl; nop +#define r0 %o0 +#define r1 %o1 +#define MOVE(x,y) mov x, y + +#else /* __ASSEMBLER__ */ + #undef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) \ ({ INTERNAL_SYSCALL_DECL(err); \ @@ -165,9 +179,6 @@ __o0; \ }) - -#ifdef __ASSEMBLER__ -# define JUMPTARGET(sym) sym -#endif +#endif /* __ASSEMBLER__ */ #endif /* _LINUX_SPARC_SYSDEP_H */ |