2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sparc / sysdep.h
blob24225d9622ef7a8defa612f9a11296eed0e3aa56
1 /* Copyright (C) 1993, 1994, 1995, 1997, 2003 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #include <sysdeps/unix/sysdep.h>
21 #ifdef __ASSEMBLER__
23 #ifdef NO_UNDERSCORES
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)
28 #endif
30 #ifdef HAVE_ELF
31 #define ENTRY(name) \
32 .global C_SYMBOL_NAME(name); \
33 .type name,@function; \
34 .align 4; \
35 C_LABEL(name)
37 #else
38 #define ENTRY(name) \
39 .global C_SYMBOL_NAME(name); \
40 .align 4; \
41 C_LABEL(name)
43 #endif /* HAVE_ELF */
45 #define PSEUDO(name, syscall_name, args) \
46 .global syscall_error; \
47 ENTRY (name) \
48 mov SYS_ify(syscall_name), %g1; \
49 ta 0; \
50 bcc 1f; \
51 sethi %hi(syscall_error), %g1; \
52 jmp %g1 + %lo(syscall_error); nop; \
55 #define PSEUDO_NOERRNO(name, syscall_name, args) \
56 .global syscall_error; \
57 ENTRY (name) \
58 mov SYS_ify(syscall_name), %g1; \
59 ta 0
61 #define PSEUDO_ERRVAL(name, syscall_name, args) \
62 .global syscall_error; \
63 ENTRY (name) \
64 mov SYS_ify(syscall_name), %g1; \
65 ta 0
67 #define ret retl; nop
68 #define ret_NOERRNO retl; nop
69 #define ret_ERRVAL retl; nop
70 #define r0 %o0
71 #define r1 %o1
72 #define MOVE(x,y) mov x, y
74 #endif /* __ASSEMBLER__ */