]> git.ipfire.org Git - thirdparty/glibc.git/blob - ports/sysdeps/unix/am33/sysdep.S
Add Changelog ...
[thirdparty/glibc.git] / ports / sysdeps / unix / am33 / sysdep.S
1 /* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Alexandre Oliva <aoliva@redhat.com>.
5 Based on ../i386/sysdep.S.
6
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library. If not, see
19 <http://www.gnu.org/licenses/>. */
20
21 #include <sysdep.h>
22 #define _ERRNO_H
23 #include <bits/errno.h>
24
25 .globl C_SYMBOL_NAME(errno)
26 .globl syscall_error
27
28 #undef syscall_error
29 #ifdef NO_UNDERSCORES
30 __syscall_error:
31 #else
32 syscall_error:
33 #endif
34 #if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
35 /* We translate the system's EWOULDBLOCK error into EAGAIN.
36 The GNU C library always defines EWOULDBLOCK==EAGAIN.
37 EWOULDBLOCK_sys is the original number. */
38 cmp EWOULDBLOCK_sys,d0 /* Is it the old EWOULDBLOCK? */
39 bne .Lnotb /* Branch if not. */
40 mov EAGAIN,d0 /* Yes; translate it to EAGAIN. */
41 .Lnotb:
42 #endif
43 #ifndef PIC
44 # ifndef _LIBC_REENTRANT
45 mov d0,(C_SYMBOL_NAME (errno))
46 # else
47 movm [d2],(sp)
48 add -12,sp
49 mov d0,d2
50 call __errno_location,[],0
51 mov d2,(a0)
52 add 12,sp
53 movm (sp),[d2]
54 # endif
55 #else
56 # error "This shouldn't be assembled for PIC"
57 #endif
58 mov -1,d0
59 mov d0,a0
60 ret
61
62 #undef __syscall_error
63 END (__syscall_error)