Replace FSF snail mail address with URLs.
[glibc.git] / sysdeps / unix / sparc / sysdep.h
blobfe8b75a0e77192d86d2493750391b626bfdd9394
1 /* Copyright (C) 1993, 1994, 1995, 1997, 2003, 2011, 2012
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <sysdeps/unix/sysdep.h>
20 #include <sysdeps/sparc/sysdep.h>
22 #ifdef __ASSEMBLER__
24 /* Since C identifiers are not normally prefixed with an underscore
25 on this system, the asm identifier `syscall_error' intrudes on the
26 C name space. Make sure we use an innocuous name. */
27 #define syscall_error C_SYMBOL_NAME(__syscall_error)
29 #ifdef PIC
30 #define SETUP_PIC_REG(reg, tmp) \
31 .ifndef __sparc_get_pc_thunk.reg; \
32 .section .text.__sparc_get_pc_thunk.reg,"axG",@progbits,__sparc_get_pc_thunk.reg,comdat; \
33 .align 32; \
34 .weak __sparc_get_pc_thunk.reg; \
35 .hidden __sparc_get_pc_thunk.reg; \
36 .type __sparc_get_pc_thunk.reg, #function; \
37 __sparc_get_pc_thunk.reg: \
38 jmp %o7 + 8; \
39 add %o7, %reg, %##reg; \
40 .previous; \
41 .endif; \
42 sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \
43 mov %o7, %##tmp; \
44 call __sparc_get_pc_thunk.reg; \
45 or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; \
46 mov %##tmp, %o7;
47 #endif
49 #define ENTRY(name) \
50 .global C_SYMBOL_NAME(name); \
51 .type name,@function; \
52 .align 4; \
53 C_LABEL(name)
56 #define PSEUDO(name, syscall_name, args) \
57 .global syscall_error; \
58 ENTRY (name) \
59 mov SYS_ify(syscall_name), %g1; \
60 ta 0; \
61 bcc 1f; \
62 sethi %hi(syscall_error), %g1; \
63 jmp %g1 + %lo(syscall_error); nop; \
66 #define PSEUDO_NOERRNO(name, syscall_name, args) \
67 .global syscall_error; \
68 ENTRY (name) \
69 mov SYS_ify(syscall_name), %g1; \
70 ta 0
72 #define PSEUDO_ERRVAL(name, syscall_name, args) \
73 .global syscall_error; \
74 ENTRY (name) \
75 mov SYS_ify(syscall_name), %g1; \
76 ta 0
78 #define ret retl; nop
79 #define ret_NOERRNO retl; nop
80 #define ret_ERRVAL retl; nop
81 #define r0 %o0
82 #define r1 %o1
83 #define MOVE(x,y) mov x, y
85 #endif /* __ASSEMBLER__ */