~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to sysdeps/unix/sysv/linux/sh/sysdep.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004,
2
 
   2005,2006,2009       Free Software Foundation, Inc.
 
1
/* Copyright (C) 1992,1993,1995-2000,2002-2006,2009,2011
 
2
        Free Software Foundation, Inc.
3
3
   This file is part of the GNU C Library.
4
4
   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
5
5
   Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
114
114
 
115
115
# elif defined _LIBC_REENTRANT
116
116
 
117
 
#  if USE___THREAD
118
 
#   ifndef NOT_IN_libc
119
 
#    define SYSCALL_ERROR_ERRNO __libc_errno
120
 
#   else
121
 
#    define SYSCALL_ERROR_ERRNO errno
122
 
#   endif
123
 
#   define SYSCALL_ERROR_HANDLER \
 
117
#  ifndef NOT_IN_libc
 
118
#   define SYSCALL_ERROR_ERRNO __libc_errno
 
119
#  else
 
120
#   define SYSCALL_ERROR_ERRNO errno
 
121
#  endif
 
122
#  define SYSCALL_ERROR_HANDLER \
124
123
        neg r0,r1; \
125
124
        mov r12,r2; \
126
125
        mov.l 0f,r12; \
137
136
        .align 2; \
138
137
     0: .long _GLOBAL_OFFSET_TABLE_; \
139
138
     1: .long SYSCALL_ERROR_ERRNO@GOTTPOFF
140
 
#  else
141
 
#   define SYSCALL_ERROR_HANDLER \
142
 
        neg r0,r1; \
143
 
        mov.l r14,@-r15; \
144
 
        cfi_adjust_cfa_offset (4); \
145
 
        cfi_rel_offset (r14, 0); \
146
 
        mov.l r12,@-r15; \
147
 
        cfi_adjust_cfa_offset (4); \
148
 
        cfi_rel_offset (r12, 0); \
149
 
        mov.l r1,@-r15; \
150
 
        cfi_adjust_cfa_offset (4); \
151
 
        cfi_rel_offset (r1, 0); \
152
 
        mov.l 0f,r12; \
153
 
        mova 0f,r0; \
154
 
        add r0,r12; \
155
 
        sts.l pr,@-r15; \
156
 
        cfi_adjust_cfa_offset (4); \
157
 
        cfi_rel_offset (pr, 0); \
158
 
        mov r15,r14; \
159
 
        cfi_def_cfa_register (r14); \
160
 
        mov.l 1f,r1; \
161
 
        bsrf r1; \
162
 
         nop; \
163
 
     2: mov r14,r15; \
164
 
        lds.l @r15+,pr; \
165
 
        mov.l @r15+,r1; \
166
 
        mov.l r1,@r0; \
167
 
        mov.l @r15+,r12; \
168
 
        mov.l @r15+,r14; \
169
 
        bra .Lpseudo_end; \
170
 
         mov _IMM1,r0; \
171
 
        .align 2; \
172
 
     0: .long _GLOBAL_OFFSET_TABLE_; \
173
 
     1: .long PLTJMP(C_SYMBOL_NAME(__errno_location))-(2b-.)
174
 
/* A quick note: it is assumed that the call to `__errno_location' does
175
 
   not modify the stack!  */
176
 
#  endif
177
139
# else
178
140
/* Store (-r0) into errno through the GOT.  */
179
141
#  define SYSCALL_ERROR_HANDLER                                               \
324
286
    unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args);             \
325
287
    if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0))         \
326
288
      {                                                                       \
327
 
        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
328
 
        resultvar = 0xffffffff;                                               \
 
289
        __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, ));                   \
 
290
        resultvar = 0xffffffff;                                               \
329
291
      }                                                                       \
330
292
    (int) resultvar; })
331
293
 
347
309
#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \
348
310
  ({                                                                          \
349
311
    unsigned long int resultvar;                                              \
350
 
    register long int r3 asm ("%r3") = (name);                                \
 
312
    register long int r3 asm ("%r3") = (name);                                \
351
313
    SUBSTITUTE_ARGS_##nr(args);                                               \
352
314
                                                                              \
353
315
    asm volatile (SYSCALL_INST_STR##nr SYSCALL_INST_PAD                       \