Back to index

glibc  2.9
sysdep.h
Go to the documentation of this file.
00001 /* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004
00002    Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Brendan Kehoe (brendan@zen.org).
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #include <sgidefs.h>
00022 #include <sysdeps/unix/sysdep.h>
00023 
00024 #ifdef __ASSEMBLER__
00025 
00026 #include <regdef.h>
00027 
00028 #define ENTRY(name) \
00029   .globl name;                                                              \
00030   .align 2;                                                          \
00031   .ent name,0;                                                              \
00032   name##:
00033 
00034 #undef END
00035 #define       END(function)                                   \
00036               .end   function;                    \
00037               .size  function,.-function
00038 
00039 #define ret   j ra ; nop
00040 
00041 #undef PSEUDO_END
00042 #define PSEUDO_END(sym) .end sym; .size sym,.-sym
00043 
00044 #define PSEUDO_NOERRNO(name, syscall_name, args) \
00045   .align 2;                                      \
00046   ENTRY(name)                                    \
00047   .set noreorder;                                \
00048   li v0, SYS_ify(syscall_name);                         \
00049   syscall
00050 
00051 #undef PSEUDO_END_NOERRNO
00052 #define PSEUDO_END_NOERRNO(sym) .end sym; .size sym,.-sym
00053 
00054 #define ret_NOERRNO ret
00055 
00056 #define PSEUDO_ERRVAL(name, syscall_name, args)  \
00057   .align 2;                                      \
00058   ENTRY(name)                                    \
00059   .set noreorder;                                \
00060   li v0, SYS_ify(syscall_name);                         \
00061   syscall
00062 
00063 #undef PSEUDO_END_ERRVAL
00064 #define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym
00065 
00066 #define ret_ERRVAL ret
00067 
00068 #define r0    v0
00069 #define r1    v1
00070 /* The mips move insn is d,s.  */
00071 #define MOVE(x,y)    move y , x
00072 
00073 #if _MIPS_SIM == _ABIO32
00074 # define L(label) $L ## label
00075 #else
00076 # define L(label) .L ## label
00077 #endif
00078 
00079 #endif