OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [sys/] [linux/] [linuxthreads/] [machine/] [i386/] [i386-sysdep.S] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000 Free Software Foundation, Inc.
2
   This file has been modified from the GNU C Library.
3
 
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.
8
 
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.
13
 
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.  */
18
 
19
#include 
20
#define _ERRNO_H
21
#include 
22
#include 
23
#include 
24
 
25
.globl __syscall_error
26
 
27
__syscall_error:
28
#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
29
        /* We translate the system's EWOULDBLOCK error into EAGAIN.
30
           The GNU C library always defines EWOULDBLOCK==EAGAIN.
31
           EWOULDBLOCK_sys is the original number.  */
32
        cmpl $EWOULDBLOCK_sys, %eax /* Is it the old EWOULDBLOCK?  */
33
        jne notb                /* Branch if not.  */
34
        movl $EAGAIN, %eax      /* Yes; translate it to EAGAIN.  */
35
notb:
36
#endif
37
#ifndef PIC
38
        pushl %eax
39
        PUSH_ERRNO_LOCATION_RETURN
40
        call BP_SYM (__errno)
41
        POP_ERRNO_LOCATION_RETURN
42
        popl %ecx
43
        movl %ecx, (%eax)
44
#else
45
        /* The caller has pushed %ebx and then set it up to
46
           point to the GOT before calling us through the PLT.  */
47
        pushl %eax
48
        PUSH_ERRNO_LOCATION_RETURN
49
        call C_SYMBOL_NAME (BP_SYM (__errno)@PLT)
50
        POP_ERRNO_LOCATION_RETURN
51
        popl %ecx
52
        /* Pop %ebx value saved before jumping here.  */
53
        popl %ebx
54
        movl %ecx, (%eax)
55
#endif
56
        movl $-1, %eax
57
        ret
58
 
59
#undef  __syscall_error
60
END (__syscall_error)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.