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

« back to all changes in this revision

Viewing changes to sysdeps/unix/sysv/linux/sparc/sparc32/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) 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.
57
57
 
58
58
#define LOC(name)  .L##name
59
59
 
60
 
        /* If the offset to __syscall_error fits into a signed 22-bit
61
 
         * immediate branch offset, the linker will relax the call into
62
 
         * a normal branch.
63
 
         */
64
60
#define PSEUDO(name, syscall_name, args)        \
65
61
        .text;                                  \
66
 
        .globl          __syscall_error;        \
67
62
ENTRY(name);                                    \
68
63
        LOADSYSCALL(syscall_name);              \
69
64
        ta              0x10;                   \
70
65
        bcc             1f;                     \
71
 
         mov            %o7, %g1;               \
72
 
        call            __syscall_error;        \
73
 
         mov            %g1, %o7;               \
 
66
         nop;                                   \
 
67
        SYSCALL_ERROR_HANDLER                   \
74
68
1:
75
69
 
76
70
#define PSEUDO_NOERRNO(name, syscall_name, args)\
88
82
#define PSEUDO_END(name)                        \
89
83
        END(name)
90
84
 
 
85
#ifndef PIC
 
86
# define SYSCALL_ERROR_HANDLER                  \
 
87
        mov     %o7, %g1;                       \
 
88
        call    __syscall_error;                \
 
89
         mov    %g1, %o7;
 
90
#else
 
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;               \
 
97
        st      %o0, [%g1];                     \
 
98
        jmp     %o7 + 8;                        \
 
99
         mov    -1, %o0;
 
100
# elif defined _LIBC_REENTRANT
 
101
 
 
102
#  ifndef NOT_IN_libc
 
103
#   define SYSCALL_ERROR_ERRNO __libc_errno
 
104
#  else
 
105
#   define SYSCALL_ERROR_ERRNO errno
 
106
#  endif
 
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];                               \
 
113
        jmp     %o7 + 8;                                        \
 
114
         mov    -1, %o0;
 
115
# else
 
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;       \
 
121
        st      %o0, [%g1];             \
 
122
        jmp     %o7 + 8;                \
 
123
         mov    -1, %o0;
 
124
# endif /* _LIBC_REENTRANT */
 
125
#endif  /* PIC */
 
126
 
 
127
 
91
128
#else  /* __ASSEMBLER__ */
92
129
 
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;"
96
 
#else
97
 
# define CALL_ERRNO_LOCATION "call   __errno_location;"
98
 
#endif
99
 
 
100
130
#define __SYSCALL_STRING                                                \
101
131
        "ta     0x10;"                                                  \
102
 
        "bcs    2f;"                                                    \
103
 
        " nop;"                                                         \
104
 
        "1:"                                                            \
105
 
        ".subsection 2;"                                                \
106
 
        "2:"                                                            \
107
 
        "save   %%sp, -192, %%sp;"                                      \
108
 
        CALL_ERRNO_LOCATION                                             \
109
 
        " nop;"                                                         \
110
 
        "st     %%i0,[%%o0];"                                           \
111
 
        "ba     1b;"                                                    \
112
 
        " restore %%g0, -1, %%o0;"                                      \
113
 
        ".previous;"
114
 
 
115
 
#define __CLONE_SYSCALL_STRING                                          \
116
 
        "ta     0x10;"                                                  \
117
 
        "bcs    2f;"                                                    \
118
 
        " sub   %%o1, 1, %%o1;"                                         \
119
 
        "and    %%o0, %%o1, %%o0;"                                      \
120
 
        "1:"                                                            \
121
 
        ".subsection 2;"                                                \
122
 
        "2:"                                                            \
123
 
        "save   %%sp, -192, %%sp;"                                      \
124
 
        CALL_ERRNO_LOCATION                                             \
125
 
        " nop;"                                                         \
126
 
        "st     %%i0, [%%o0];"                                          \
127
 
        "ba     1b;"                                                    \
128
 
        " restore %%g0, -1, %%o0;"                                      \
129
 
        ".previous;"
130
 
 
131
 
#define __INTERNAL_SYSCALL_STRING                                       \
132
 
        "ta     0x10;"                                                  \
133
 
        "bcs,a  1f;"                                                    \
134
 
        " sub   %%g0, %%o0, %%o0;"                                      \
 
132
        "bcc    1f;"                                                    \
 
133
        " mov   0, %%g1;"                                               \
 
134
        "sub    %%g0, %%o0, %%o0;"                                      \
 
135
        "mov    1, %%g1;"                                               \
135
136
        "1:"
136
137
 
137
138
#define __SYSCALL_CLOBBERS                                              \