Robustify Linux kernel headers configure checks
[glibc.git] / sysdeps / unix / mips / sysdep.h
blobd59fac0e8dd47fc426cadabdd6ad6f0e1631675c
1 /* Copyright (C) 1992-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Brendan Kehoe (brendan@zen.org).
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
19 #include <sgidefs.h>
20 #include <sysdeps/unix/sysdep.h>
22 #ifdef __ASSEMBLER__
24 #include <regdef.h>
26 #define ENTRY(name) \
27 .globl name; \
28 .align 2; \
29 .ent name,0; \
30 name##: \
31 cfi_startproc;
33 #undef END
34 #define END(function) \
35 cfi_endproc; \
36 .end function; \
37 .size function,.-function
39 #define ret j ra ; nop
41 #undef PSEUDO_END
42 #define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
44 #define PSEUDO_NOERRNO(name, syscall_name, args) \
45 .align 2; \
46 ENTRY(name) \
47 .set nomips16; \
48 .set noreorder; \
49 li v0, SYS_ify(syscall_name); \
50 syscall
52 #undef PSEUDO_END_NOERRNO
53 #define PSEUDO_END_NOERRNO(sym) cfi_endproc; .end sym; .size sym,.-sym
55 #define ret_NOERRNO ret
57 #define PSEUDO_ERRVAL(name, syscall_name, args) \
58 .align 2; \
59 ENTRY(name) \
60 .set nomips16; \
61 .set noreorder; \
62 li v0, SYS_ify(syscall_name); \
63 syscall
65 #undef PSEUDO_END_ERRVAL
66 #define PSEUDO_END_ERRVAL(sym) cfi_endproc; .end sym; .size sym,.-sym
68 #define ret_ERRVAL ret
70 #define r0 v0
71 #define r1 v1
72 /* The mips move insn is d,s. */
73 #define MOVE(x,y) move y , x
75 #if _MIPS_SIM == _ABIO32
76 # define L(label) $L ## label
77 #else
78 # define L(label) .L ## label
79 #endif
81 #endif