]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/unix/mips/sysdep.h
Use __syscall_error.
[thirdparty/glibc.git] / sysdeps / unix / mips / sysdep.h
1 /* Copyright (C) 1992, 1995, 1997, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Brendan Kehoe (brendan@zen.org).
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
19
20 #include <sysdeps/unix/sysdep.h>
21
22 #ifdef __ASSEMBLER__
23
24 #include <regdef.h>
25
26 #define ENTRY(name) \
27 .globl name; \
28 .align 2; \
29 .ent name,0; \
30 name##:
31
32 /* Note that while it's better structurally, going back to call __syscall_error
33 can make things confusing if you're debugging---it looks like it's jumping
34 backwards into the previous fn. */
35 #ifdef PIC
36 #define PSEUDO(name, syscall_name, args) \
37 .align 2; \
38 99: la t9,__syscall_error; \
39 jr t9; \
40 ENTRY(name) \
41 .set noreorder; \
42 .cpload t9; \
43 li v0, SYS_##syscall_name; \
44 syscall; \
45 .set reorder; \
46 bne a3, zero, 99b; \
47 syse1:
48 #else
49 #define PSEUDO(name, syscall_name, args) \
50 .set noreorder; \
51 .align 2; \
52 99: j __syscall_error; \
53 ENTRY(name) \
54 .set noreorder; \
55 li v0, SYS_##syscall_name; \
56 syscall; \
57 .set reorder; \
58 bne a3, zero, 99b; \
59 syse1:
60 #endif
61
62 #undef PSEUDO_END
63 #define PSEUDO_END(sym) .end sym
64
65 #define ret j ra ; nop
66
67 #undef END
68 #define END(sym) .end sym
69
70 #define r0 v0
71 #define r1 v1
72 /* The mips move insn is d,s. */
73 #define MOVE(x,y) move y , x
74
75 #endif