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
00002        Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Alexandre Oliva <aoliva@redhat.com>.
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 <sysdeps/unix/mips/sysdep.h>
00022 
00023 #ifdef __ASSEMBLER__
00024 
00025 /* Note that while it's better structurally, going back to call __syscall_error
00026    can make things confusing if you're debugging---it looks like it's jumping
00027    backwards into the previous fn.  */
00028 #ifdef __PIC__
00029 #define PSEUDO(name, syscall_name, args) \
00030   .align 2;                                                          \
00031   99:;                                                               \
00032   .set noat;                                                         \
00033   .cpsetup t9, $1, name;                                             \
00034   .set at;                                                           \
00035   la t9,__syscall_error;                                             \
00036   .cpreturn;                                                         \
00037   jr t9;                                                             \
00038   ENTRY(name)                                                        \
00039   li v0, SYS_ify(syscall_name);                                             \
00040   syscall;                                                           \
00041   bne a3, zero, 99b;                                                 \
00042 L(syse1):
00043 #else
00044 #define PSEUDO(name, syscall_name, args) \
00045   .set noreorder;                                                    \
00046   .align 2;                                                          \
00047   99: j __syscall_error;                                             \
00048   ENTRY(name)                                                        \
00049   .set noreorder;                                                    \
00050   li v0, SYS_ify(syscall_name);                                             \
00051   syscall;                                                           \
00052   .set reorder;                                                             \
00053   bne a3, zero, 99b;                                                 \
00054 L(syse1):
00055 #endif
00056 
00057 #endif