2012-01-08 01:30:26 +00:00
|
|
|
/* Copyright (C) 1993, 1994, 1995, 1997, 2003, 2011, 2012
|
|
|
|
Free Software Foundation, Inc.
|
1997-03-20 05:17:15 +00:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
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.
|
1997-03-20 05:17:15 +00:00
|
|
|
|
|
|
|
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
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1997-03-20 05:17:15 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
#include <sysdeps/unix/sysdep.h>
|
2011-09-01 20:41:27 +00:00
|
|
|
#include <sysdeps/sparc/sysdep.h>
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1998-05-29 10:21:16 +00:00
|
|
|
#ifdef __ASSEMBLER__
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
/* 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)
|
|
|
|
|
2012-02-19 06:31:42 +00:00
|
|
|
#define SPARC_PIC_THUNK(reg) \
|
2011-09-01 00:30:41 +00:00
|
|
|
.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; \
|
2012-02-19 06:31:42 +00:00
|
|
|
.endif;
|
|
|
|
|
2012-02-21 23:45:17 +00:00
|
|
|
/* Even when v9 we use a call sequence instead of using "rd %pc" because
|
|
|
|
RDPC is extremely expensive and incurs a full pipeline flush. */
|
|
|
|
|
2012-02-19 06:31:42 +00:00
|
|
|
#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) \
|
2011-09-01 00:30:41 +00:00
|
|
|
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;
|
|
|
|
|
1997-07-11 01:19:07 +00:00
|
|
|
#define ENTRY(name) \
|
|
|
|
.global C_SYMBOL_NAME(name); \
|
|
|
|
.type name,@function; \
|
|
|
|
.align 4; \
|
1995-02-18 01:27:10 +00:00
|
|
|
C_LABEL(name)
|
|
|
|
|
1997-07-11 01:19:07 +00:00
|
|
|
|
|
|
|
#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; \
|
1995-02-18 01:27:10 +00:00
|
|
|
1:
|
|
|
|
|
2003-03-23 19:44:31 +00:00
|
|
|
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
|
|
|
.global syscall_error; \
|
|
|
|
ENTRY (name) \
|
|
|
|
mov SYS_ify(syscall_name), %g1; \
|
|
|
|
ta 0
|
|
|
|
|
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
2003-08-17 00:37:19 +00:00
|
|
|
#define PSEUDO_ERRVAL(name, syscall_name, args) \
|
|
|
|
.global syscall_error; \
|
|
|
|
ENTRY (name) \
|
|
|
|
mov SYS_ify(syscall_name), %g1; \
|
|
|
|
ta 0
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
#define ret retl; nop
|
2003-03-23 19:44:31 +00:00
|
|
|
#define ret_NOERRNO retl; nop
|
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
2003-08-17 00:37:19 +00:00
|
|
|
#define ret_ERRVAL retl; nop
|
1995-02-18 01:27:10 +00:00
|
|
|
#define r0 %o0
|
|
|
|
#define r1 %o1
|
|
|
|
#define MOVE(x,y) mov x, y
|
|
|
|
|
1998-05-29 10:21:16 +00:00
|
|
|
#endif /* __ASSEMBLER__ */
|