1
/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008
1
/* Copyright (C) 1997, 2002, 2003, 2004, 2006, 2008, 2011
2
2
Free Software Foundation, Inc.
3
3
This file is part of the GNU C Library.
4
4
Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997.
58
58
#define LOC(name) .L##name
60
/* If the offset to __syscall_error fits into a signed 22-bit
61
* immediate branch offset, the linker will relax the call into
64
60
#define PSEUDO(name, syscall_name, args) \
66
.globl __syscall_error; \
68
63
LOADSYSCALL(syscall_name); \
72
call __syscall_error; \
67
SYSCALL_ERROR_HANDLER \
76
70
#define PSEUDO_NOERRNO(name, syscall_name, args)\
88
82
#define PSEUDO_END(name) \
86
# define SYSCALL_ERROR_HANDLER \
88
call __syscall_error; \
91
# if RTLD_PRIVATE_ERRNO
92
# define SYSCALL_ERROR_HANDLER \
93
0: SETUP_PIC_REG(o2,g1) \
94
sethi %hi(rtld_errno), %g1; \
95
or %g1, %lo(rtld_errno), %g1; \
96
ld [%o2 + %g1], %g1; \
100
# elif defined _LIBC_REENTRANT
103
# define SYSCALL_ERROR_ERRNO __libc_errno
105
# define SYSCALL_ERROR_ERRNO errno
107
# define SYSCALL_ERROR_HANDLER \
108
0: SETUP_PIC_REG(o2,g1) \
109
sethi %tie_hi22(SYSCALL_ERROR_ERRNO), %g1; \
110
add %g1, %tie_lo10(SYSCALL_ERROR_ERRNO), %g1; \
111
ld [%o2 + %g1], %g1, %tie_ld(SYSCALL_ERROR_ERRNO); \
112
st %o0, [%g7 + %g1]; \
116
# define SYSCALL_ERROR_HANDLER \
117
0: SETUP_PIC_REG(o2,g1) \
118
sethi %hi(errno), %g1; \
119
or %g1, %lo(errno), %g1; \
120
ld [%o2 + %g1], %g1; \
124
# endif /* _LIBC_REENTRANT */
91
128
#else /* __ASSEMBLER__ */
93
#if defined SHARED && defined DO_VERSIONING && defined PIC \
94
&& !defined NO_HIDDEN && !defined NOT_IN_libc
95
# define CALL_ERRNO_LOCATION "call __GI___errno_location;"
97
# define CALL_ERRNO_LOCATION "call __errno_location;"
100
130
#define __SYSCALL_STRING \
107
"save %%sp, -192, %%sp;" \
108
CALL_ERRNO_LOCATION \
112
" restore %%g0, -1, %%o0;" \
115
#define __CLONE_SYSCALL_STRING \
118
" sub %%o1, 1, %%o1;" \
119
"and %%o0, %%o1, %%o0;" \
123
"save %%sp, -192, %%sp;" \
124
CALL_ERRNO_LOCATION \
128
" restore %%g0, -1, %%o0;" \
131
#define __INTERNAL_SYSCALL_STRING \
134
" sub %%g0, %%o0, %%o0;" \
134
"sub %%g0, %%o0, %%o0;" \
137
138
#define __SYSCALL_CLOBBERS \